@kanunilabs/pivotgrid-core 1.7.2 → 1.9.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.cjs +14 -14
- package/dist/index.d.cts +525 -53
- package/dist/index.d.ts +525 -53
- package/dist/index.js +14 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,9 @@ interface PivotDictionary {
|
|
|
61
61
|
columnFilter: string;
|
|
62
62
|
percentOfColumnTotal: string;
|
|
63
63
|
percentOfRowTotal: string;
|
|
64
|
+
/** Display modes with the same names (share of the parent group on that axis). */
|
|
65
|
+
percentOfParentRowTotal: string;
|
|
66
|
+
percentOfParentColumnTotal: string;
|
|
64
67
|
percentDifference: string;
|
|
65
68
|
filterField: string;
|
|
66
69
|
removeFromArea: string;
|
|
@@ -96,18 +99,14 @@ interface PivotDictionary {
|
|
|
96
99
|
year: string;
|
|
97
100
|
quarter: string;
|
|
98
101
|
month: string;
|
|
102
|
+
/** The ISO week date grouping (`groupInterval: 'week'`). */
|
|
103
|
+
week: string;
|
|
99
104
|
day: string;
|
|
100
105
|
and: string;
|
|
101
106
|
or: string;
|
|
102
107
|
noConditionsAdded: string;
|
|
103
108
|
calculatedMeasureDesigner: string;
|
|
104
|
-
createFormulasWithoutCode: string;
|
|
105
|
-
measureName: string;
|
|
106
109
|
format: string;
|
|
107
|
-
numericStandard: string;
|
|
108
|
-
numericDecimal: string;
|
|
109
|
-
currencyTRY: string;
|
|
110
|
-
currencyUSD: string;
|
|
111
110
|
percent: string;
|
|
112
111
|
expand: string;
|
|
113
112
|
collapse: string;
|
|
@@ -147,6 +146,11 @@ interface PivotDictionary {
|
|
|
147
146
|
opEndsWith: string;
|
|
148
147
|
opIsBlank: string;
|
|
149
148
|
opIsNotBlank: string;
|
|
149
|
+
/** Value filter `between` / `notBetween` (G-PIV-03); `opBetween` is the DataGrid's own string. */
|
|
150
|
+
opBetween: string;
|
|
151
|
+
opNotBetween: string;
|
|
152
|
+
/** The field menu item and dialog title for value / label filters (G-PIV-03). */
|
|
153
|
+
conditionFilter: string;
|
|
150
154
|
/** Prefilter builder chrome (#210) — shared with DataGrid. */
|
|
151
155
|
builderCombine: string;
|
|
152
156
|
builderAddCondition: string;
|
|
@@ -155,24 +159,8 @@ interface PivotDictionary {
|
|
|
155
159
|
builderRemoveCondition: string;
|
|
156
160
|
builderEmpty: string;
|
|
157
161
|
builderValuePlaceholder: string;
|
|
158
|
-
/** Drill-down modal (#212); the pager/CSV five are shared with DataGrid. */
|
|
159
|
-
exportCsv: string;
|
|
160
|
-
pagerPage: string;
|
|
161
|
-
pagerOf: string;
|
|
162
|
-
pagerPrevious: string;
|
|
163
|
-
pagerNext: string;
|
|
164
|
-
drillDown: string;
|
|
165
|
-
/** `Label: {count}` — no plural engine, so no locale is ever ungrammatical. */
|
|
166
|
-
drillDownRecords: string;
|
|
167
162
|
/** PDF export header (#215). */
|
|
168
163
|
exportGeneratedOn: string;
|
|
169
|
-
/** Designer level tiles and live formula verdict (#220). */
|
|
170
|
-
calcRowLevelHint: string;
|
|
171
|
-
calcSummaryLevelHint: string;
|
|
172
|
-
formulaValid: string;
|
|
173
|
-
calcFieldsHint: string;
|
|
174
|
-
/** `Uses: {fields}` — the captions the formula references. */
|
|
175
|
-
formulaUses: string;
|
|
176
164
|
showFieldList: string;
|
|
177
165
|
/**
|
|
178
166
|
* License watermark reasons (1.3.0) — the badge shows the product name and
|
|
@@ -332,9 +320,55 @@ declare function percentAxisTicks(min: number): number[];
|
|
|
332
320
|
* nearer the axis.
|
|
333
321
|
*/
|
|
334
322
|
declare function stackSeries(series: ReadonlyArray<ArrayLike<number>>, mode: Exclude<ChartStacking, 'grouped'>, include?: (index: number) => boolean): Array<StackedSegment | null>;
|
|
323
|
+
/**
|
|
324
|
+
* `count` colours derived from `accent`, index-stable.
|
|
325
|
+
*
|
|
326
|
+
* Falls back to the packaged eight when the accent cannot be read — an unthemed
|
|
327
|
+
* grid, or a custom theme whose `--dg-primary` is something this cannot parse
|
|
328
|
+
* (a named colour, `color-mix()`, `oklch()`). Falling back is deliberate: a
|
|
329
|
+
* chart with the wrong-but-readable palette beats a chart of black shapes.
|
|
330
|
+
*
|
|
331
|
+
* A near-grey accent also falls back. Rotating the hue of something with almost
|
|
332
|
+
* no saturation produces eight indistinguishable greys, which is worse than an
|
|
333
|
+
* off-theme palette that can actually be told apart.
|
|
334
|
+
*/
|
|
335
|
+
declare function chartPalette(accent: string | null | undefined, count: number): string[];
|
|
336
|
+
/** The series palettes a chart offers by name. */
|
|
337
|
+
type ChartPaletteName = 'theme' | 'classic' | 'colorblind' | 'vivid' | 'monochrome';
|
|
338
|
+
declare const CHART_PALETTE_NAMES: readonly ChartPaletteName[];
|
|
339
|
+
/**
|
|
340
|
+
* The series colours for a chart, `count` long and index-stable.
|
|
341
|
+
*
|
|
342
|
+
* @param choice the chart format's `palette` and `colors` (both optional)
|
|
343
|
+
* @param accent the grid's accent, as read from its tokens (`theme` derives from it)
|
|
344
|
+
* @param surface the chart's background, as read from its tokens — the floor
|
|
345
|
+
* named palettes keep their contrast against; without it they
|
|
346
|
+
* are used as listed
|
|
347
|
+
*/
|
|
348
|
+
declare function resolveChartPalette(choice: {
|
|
349
|
+
palette?: ChartPaletteName;
|
|
350
|
+
colors?: readonly string[];
|
|
351
|
+
} | null | undefined, accent: string | null | undefined, surface: string | null | undefined, count: number): string[];
|
|
335
352
|
|
|
336
353
|
/** Where the legend sits around the plot, or `'none'` to hide it. */
|
|
337
354
|
type ChartLegendPosition = 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
355
|
+
/**
|
|
356
|
+
* The chart's text — tick labels, axis titles, data labels, the legend. Every
|
|
357
|
+
* field left out keeps what the theme draws (rival analysis §E.3 #46).
|
|
358
|
+
*/
|
|
359
|
+
interface ChartFont {
|
|
360
|
+
family?: string;
|
|
361
|
+
/** Tick-label size in px (6–32); titles draw one larger, data labels one smaller. */
|
|
362
|
+
size?: number;
|
|
363
|
+
/** Any CSS colour. */
|
|
364
|
+
color?: string;
|
|
365
|
+
bold?: boolean;
|
|
366
|
+
italic?: boolean;
|
|
367
|
+
}
|
|
368
|
+
/** Category-axis label angle: the chart's own rule, or a fixed one. */
|
|
369
|
+
type ChartLabelAngle = 'auto' | 0 | 45 | 90;
|
|
370
|
+
/** Grid lines behind the plot: one per value tick, plus one per category, or none. */
|
|
371
|
+
type ChartGridLines = 'value' | 'both' | 'none';
|
|
338
372
|
interface ChartFormat {
|
|
339
373
|
/** Shown above the chart, and written into an exported image. */
|
|
340
374
|
title?: string;
|
|
@@ -353,7 +387,45 @@ interface ChartFormat {
|
|
|
353
387
|
* left out. It does not apply to a stacked layout, whose segments add up.
|
|
354
388
|
*/
|
|
355
389
|
valueScale?: 'linear' | 'log';
|
|
390
|
+
/** Text styling (§E.3 #46). */
|
|
391
|
+
font?: ChartFont;
|
|
392
|
+
/** Category labels: `'auto'` (default — the chart's own slant) or 0, 45, 90 degrees (§E.3 #40). */
|
|
393
|
+
labelAngle?: ChartLabelAngle;
|
|
394
|
+
/** Default `'value'`. */
|
|
395
|
+
gridLines?: ChartGridLines;
|
|
396
|
+
/** Dashed grid lines (the default); `false` draws them solid. */
|
|
397
|
+
gridDashed?: boolean;
|
|
398
|
+
/** Series line width in px, 1–6 (default 2) — lines, area outlines, radar (§E.3 #41). */
|
|
399
|
+
lineWidth?: number;
|
|
400
|
+
/** Dashed series lines. Default `false`. */
|
|
401
|
+
lineDashed?: boolean;
|
|
402
|
+
/** Opacity of area, radar and bubble fills, 0.05–1. Default: the chart's own. */
|
|
403
|
+
fillOpacity?: number;
|
|
404
|
+
/**
|
|
405
|
+
* How a date axis grouped by calendar prints its categories (rival analysis,
|
|
406
|
+
* charts §E.1 #21): a preset, written in the reader's language by the
|
|
407
|
+
* browser. Absent: the grouping's own labels ("2026-03", "2026-Q1").
|
|
408
|
+
*/
|
|
409
|
+
dateFormat?: ChartDateFormat;
|
|
410
|
+
/**
|
|
411
|
+
* Series colours by name (rival analysis, charts §E.4 #54): `'theme'` (the
|
|
412
|
+
* default — derived from the grid's accent), `'classic'`, `'colorblind'`,
|
|
413
|
+
* `'vivid'` or `'monochrome'`. Named palettes keep 3:1 contrast against the
|
|
414
|
+
* chart background.
|
|
415
|
+
*/
|
|
416
|
+
palette?: ChartPaletteName;
|
|
417
|
+
/**
|
|
418
|
+
* The app's own series colours, as `#rgb` / `#rrggbb`, used in order and
|
|
419
|
+
* repeated — they win over `palette`. Set it through `defaultFormat` to give
|
|
420
|
+
* every chart a brand palette.
|
|
421
|
+
*/
|
|
422
|
+
colors?: string[];
|
|
356
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* The date presets an axis offers. Each is an `Intl.DateTimeFormat` shape, so
|
|
426
|
+
* month and day names come out in the chart's locale with nothing to translate.
|
|
427
|
+
*/
|
|
428
|
+
type ChartDateFormat = 'iso' | 'numeric' | 'dayMonth' | 'dayMonthYear' | 'long' | 'weekday' | 'month' | 'monthYear' | 'monthYearLong' | 'monthNumeric' | 'year';
|
|
357
429
|
/**
|
|
358
430
|
* Value-axis ticks for a log scale: every power of ten from just below `min`
|
|
359
431
|
* to just above `max` (both > 0). With fewer than two decades the 2 and 5
|
|
@@ -390,19 +462,6 @@ interface ChartImageRequest {
|
|
|
390
462
|
/** Background colour; `null` keeps transparency (not for JPEG). Default white. */
|
|
391
463
|
background?: string | null;
|
|
392
464
|
}
|
|
393
|
-
/**
|
|
394
|
-
* `count` colours derived from `accent`, index-stable.
|
|
395
|
-
*
|
|
396
|
-
* Falls back to the packaged eight when the accent cannot be read — an unthemed
|
|
397
|
-
* grid, or a custom theme whose `--dg-primary` is something this cannot parse
|
|
398
|
-
* (a named colour, `color-mix()`, `oklch()`). Falling back is deliberate: a
|
|
399
|
-
* chart with the wrong-but-readable palette beats a chart of black shapes.
|
|
400
|
-
*
|
|
401
|
-
* A near-grey accent also falls back. Rotating the hue of something with almost
|
|
402
|
-
* no saturation produces eight indistinguishable greys, which is worse than an
|
|
403
|
-
* off-theme palette that can actually be told apart.
|
|
404
|
-
*/
|
|
405
|
-
declare function chartPalette(accent: string | null | undefined, count: number): string[];
|
|
406
465
|
|
|
407
466
|
interface WaterfallStep {
|
|
408
467
|
/** Running total before and after this step. */
|
|
@@ -600,12 +659,177 @@ interface SunburstInput {
|
|
|
600
659
|
* what is that made". Zero, negative and missing leaves take no angle.
|
|
601
660
|
*/
|
|
602
661
|
declare function sunburstMarks(input: SunburstInput): ChartMark[];
|
|
662
|
+
/** One bar of a histogram: the values from `from` up to (not including) `to` — the last bar includes `to`. */
|
|
663
|
+
interface HistogramBin {
|
|
664
|
+
from: number;
|
|
665
|
+
to: number;
|
|
666
|
+
count: number;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* `values` counted into bins of one round width — 1, 2 or 5 × 10ⁿ, the width
|
|
670
|
+
* that gives about `binCount` bins — so the edges read as 0, 500, 1,000
|
|
671
|
+
* rather than 0, 473.2, 946.4. The bins start at the multiple of that width at
|
|
672
|
+
* or below the smallest value; the last one closes on the largest. Values
|
|
673
|
+
* that are not finite numbers (blanks) are left out. Every value equal: one bin.
|
|
674
|
+
*/
|
|
675
|
+
declare function histogramBins(values: ArrayLike<number>, binCount?: number): HistogramBin[];
|
|
676
|
+
/**
|
|
677
|
+
* The first series as a histogram — how many categories fall in each band of
|
|
678
|
+
* its values ("how many products sold between 1,000 and 2,000"). Bars touch,
|
|
679
|
+
* as bands of one axis do; the edges are labelled under the axis, every other
|
|
680
|
+
* one when they would crowd; each bar's tooltip says its band and count.
|
|
681
|
+
* The bars carry no category: one bar is many categories, so it neither
|
|
682
|
+
* cross-filters nor takes the keyboard's category focus.
|
|
683
|
+
*/
|
|
684
|
+
declare function histogramMarks(input: ShapeChartInput & {
|
|
685
|
+
binCount?: number;
|
|
686
|
+
countLabel?: string;
|
|
687
|
+
}): ChartMark[];
|
|
603
688
|
/** The chart types laid out here. */
|
|
604
|
-
declare const SHAPE_CHART_TYPES: readonly ["waterfall", "funnel", "treemap", "heatmap", "rangeBar", "sunburst"];
|
|
689
|
+
declare const SHAPE_CHART_TYPES: readonly ["waterfall", "funnel", "treemap", "heatmap", "rangeBar", "sunburst", "histogram"];
|
|
605
690
|
type ShapeChartType = (typeof SHAPE_CHART_TYPES)[number];
|
|
606
691
|
|
|
692
|
+
interface ChartStyleDefaults {
|
|
693
|
+
/** Tick-label size, px. */
|
|
694
|
+
tick: number;
|
|
695
|
+
/** Data-label size, px. */
|
|
696
|
+
label: number;
|
|
697
|
+
/** Axis-title size, px. */
|
|
698
|
+
title: number;
|
|
699
|
+
/** The renderer's own category-label slant, in degrees (negative = up to the right). */
|
|
700
|
+
angle: number;
|
|
701
|
+
/** Area fill opacity, unstacked / stacked. */
|
|
702
|
+
fill: number;
|
|
703
|
+
stackedFill: number;
|
|
704
|
+
}
|
|
705
|
+
interface ChartStyle {
|
|
706
|
+
tickSize: number;
|
|
707
|
+
labelSize: number;
|
|
708
|
+
titleSize: number;
|
|
709
|
+
/** Undefined: the theme's. */
|
|
710
|
+
fontFamily: string | undefined;
|
|
711
|
+
/** Undefined: the theme's colour for that text. */
|
|
712
|
+
textColor: string | undefined;
|
|
713
|
+
fontWeight: 'bold' | undefined;
|
|
714
|
+
fontStyle: 'italic' | undefined;
|
|
715
|
+
/** Category-label rotation in degrees, as SVG `rotate()` takes it (0 = flat). */
|
|
716
|
+
labelAngle: number;
|
|
717
|
+
/** Grid lines at the value ticks / at the categories. */
|
|
718
|
+
valueGrid: boolean;
|
|
719
|
+
categoryGrid: boolean;
|
|
720
|
+
/** `stroke-dasharray` for grid lines; undefined = solid. */
|
|
721
|
+
gridDash: string | undefined;
|
|
722
|
+
lineWidth: number;
|
|
723
|
+
/** `stroke-dasharray` for series lines; undefined = solid. */
|
|
724
|
+
lineDash: string | undefined;
|
|
725
|
+
/** Fill opacity for an area (stacked or not). */
|
|
726
|
+
areaOpacity(stacked: boolean): number;
|
|
727
|
+
/** Fill opacity for a mark whose renderer default is `base` (radar, bubble). */
|
|
728
|
+
fillOpacity(base: number): number;
|
|
729
|
+
}
|
|
730
|
+
declare function resolveChartStyle(format: ChartFormat | undefined, defaults: ChartStyleDefaults): ChartStyle;
|
|
731
|
+
|
|
732
|
+
interface FrameRect {
|
|
733
|
+
x: number;
|
|
734
|
+
y: number;
|
|
735
|
+
width: number;
|
|
736
|
+
height: number;
|
|
737
|
+
}
|
|
738
|
+
interface FrameSize {
|
|
739
|
+
width: number;
|
|
740
|
+
height: number;
|
|
741
|
+
}
|
|
742
|
+
/** Where a window first appears: the preferred size, centred in the container. */
|
|
743
|
+
declare function centredFrame(bounds: FrameSize, preferred: FrameSize, min?: FrameSize): FrameRect;
|
|
744
|
+
/** A saved rectangle, read defensively (it came from storage, not from us). */
|
|
745
|
+
declare function readFrameRect(value: unknown): FrameRect | null;
|
|
746
|
+
interface FloatingFrameOptions {
|
|
747
|
+
/** The window element. Positioned absolutely inside the container. */
|
|
748
|
+
frame: HTMLElement;
|
|
749
|
+
/**
|
|
750
|
+
* Pressing here moves the window — its title bar. Controls inside it
|
|
751
|
+
* (buttons, fields, labels) keep their own clicks; only the bar itself and
|
|
752
|
+
* the move grip start a move.
|
|
753
|
+
*/
|
|
754
|
+
dragHandle: HTMLElement;
|
|
755
|
+
/** A focusable grip INSIDE `dragHandle`: pointer drags move the window, arrow keys too. */
|
|
756
|
+
moveGrip?: HTMLElement;
|
|
757
|
+
/** The bottom-right grip: pointer drags and arrow keys resize. */
|
|
758
|
+
resizeGrip: HTMLElement;
|
|
759
|
+
/** The container's size now. */
|
|
760
|
+
bounds(): FrameSize;
|
|
761
|
+
min?: FrameSize;
|
|
762
|
+
/** Every step of a gesture, after the frame's style was updated. */
|
|
763
|
+
onMove?(rect: FrameRect): void;
|
|
764
|
+
/** Once per finished gesture: pointer released, or one arrow-key step. */
|
|
765
|
+
onCommit?(rect: FrameRect): void;
|
|
766
|
+
/**
|
|
767
|
+
* The stacking layer windows start above: higher than everything the grid
|
|
768
|
+
* itself stacks (sticky headers, overlays), lower than its popups and its
|
|
769
|
+
* fullscreen. Default 20 (the DataGrid's layers stop there); the PivotGrid's
|
|
770
|
+
* sticky headers go to 61 and its status layer to 70, so it passes 80 —
|
|
771
|
+
* at 21 a PivotGrid window slid UNDER the column header, which then took
|
|
772
|
+
* the clicks meant for the window's toolbar.
|
|
773
|
+
*/
|
|
774
|
+
layer?: number;
|
|
775
|
+
}
|
|
776
|
+
interface FloatingFrame {
|
|
777
|
+
get(): FrameRect;
|
|
778
|
+
/** Place the window (kept inside the container). Reports nothing. */
|
|
779
|
+
set(rect: FrameRect): void;
|
|
780
|
+
/**
|
|
781
|
+
* Pull the window back inside a container that changed size. Reports a
|
|
782
|
+
* commit when the window had to move or shrink.
|
|
783
|
+
*/
|
|
784
|
+
refit(): void;
|
|
785
|
+
dispose(): void;
|
|
786
|
+
}
|
|
787
|
+
declare function attachFloatingFrame(initial: FrameRect, options: FloatingFrameOptions): FloatingFrame;
|
|
788
|
+
|
|
789
|
+
/** `chart-2`, `chart-3`… — the first not in `taken` (the panel itself is chart 1). */
|
|
790
|
+
declare function nextChartWindowId(taken: ReadonlySet<string>): string;
|
|
791
|
+
/**
|
|
792
|
+
* Where a new chart window opens: a step down and to the right of the window
|
|
793
|
+
* it was copied from (`anchor`), or centred over the grid when it came from the
|
|
794
|
+
* docked panel — never exactly on top, where it would look as if nothing
|
|
795
|
+
* happened. The step grows with the windows already open (and wraps), so a
|
|
796
|
+
* row of copies fans out instead of stacking. The frame keeps it in the grid.
|
|
797
|
+
*/
|
|
798
|
+
declare function chartWindowFrame(grid: FrameSize, anchor: FrameRect | null, openCount: number): FrameRect;
|
|
799
|
+
|
|
800
|
+
type ChartCategoryKeyAction =
|
|
801
|
+
/** Move the focus to this category (by its index in the chart's model). */
|
|
802
|
+
{
|
|
803
|
+
kind: 'focus';
|
|
804
|
+
index: number;
|
|
805
|
+
}
|
|
806
|
+
/** Do what a click on this category does. */
|
|
807
|
+
| {
|
|
808
|
+
kind: 'pick';
|
|
809
|
+
index: number;
|
|
810
|
+
additive: boolean;
|
|
811
|
+
};
|
|
812
|
+
/**
|
|
813
|
+
* What a key does to the focused category, or null when the key is not the
|
|
814
|
+
* chart's (leave it to the browser). `focus` is null before the first move;
|
|
815
|
+
* the first arrow, Home/End, Enter or Space then lands on a category instead
|
|
816
|
+
* of acting on nothing. Up/Down step too, for a horizontal bar chart.
|
|
817
|
+
*/
|
|
818
|
+
declare function chartCategoryKey(event: {
|
|
819
|
+
key: string;
|
|
820
|
+
ctrlKey?: boolean;
|
|
821
|
+
metaKey?: boolean;
|
|
822
|
+
altKey?: boolean;
|
|
823
|
+
}, focus: number | null, total: number): ChartCategoryKeyAction | null;
|
|
824
|
+
/**
|
|
825
|
+
* The window start that keeps `index` in view, for a zoomed chart showing
|
|
826
|
+
* `count` of `total` categories from `start` — the focus walks off the edge
|
|
827
|
+
* and the view follows it, one category at a time.
|
|
828
|
+
*/
|
|
829
|
+
declare function windowStartFor(index: number, start: number, count: number, total: number): number;
|
|
830
|
+
|
|
607
831
|
type DateFormatContext = 'grid' | 'chart' | 'export';
|
|
608
|
-
type DateGranularity = 'year' | 'quarter' | 'month' | 'day' | 'dayOfWeek' | string | number;
|
|
832
|
+
type DateGranularity = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'dayOfWeek' | string | number;
|
|
609
833
|
declare class DateFormatter {
|
|
610
834
|
private static intlCache;
|
|
611
835
|
private static stringCache;
|
|
@@ -986,7 +1210,15 @@ interface FieldDistinctEntry {
|
|
|
986
1210
|
rawStr: string;
|
|
987
1211
|
rawVal: PivotValue;
|
|
988
1212
|
}
|
|
989
|
-
/**
|
|
1213
|
+
/**
|
|
1214
|
+
* Set the grid the engine entry points use when they are not given one.
|
|
1215
|
+
*
|
|
1216
|
+
* Read only at a call's START: every entry point takes the grid as a
|
|
1217
|
+
* parameter that defaults to this, and keeps it across its own `await`s.
|
|
1218
|
+
* Reading the global again after an `await` read whichever grid had run in
|
|
1219
|
+
* the meantime — on a page with several PivotGrids one then drove another's
|
|
1220
|
+
* worker (engineGridIsolation.test.ts). Callers that know their grid pass it.
|
|
1221
|
+
*/
|
|
990
1222
|
declare function setActiveEngineGrid(gridId: string): void;
|
|
991
1223
|
/**
|
|
992
1224
|
* Release a grid's worker when the grid unmounts. Termination is deferred by
|
|
@@ -1015,6 +1247,8 @@ declare function initPivotEngineAsync<TRow>(data: TRow[], rowFields: PivotField<
|
|
|
1015
1247
|
* follow-up filter request.
|
|
1016
1248
|
*/
|
|
1017
1249
|
filterState?: InitFilterState;
|
|
1250
|
+
/** The grid this init is for; defaults to the active grid at the call. */
|
|
1251
|
+
gridId?: string;
|
|
1018
1252
|
}): Promise<{
|
|
1019
1253
|
filtersApplied: boolean;
|
|
1020
1254
|
}>;
|
|
@@ -1034,13 +1268,13 @@ declare function reconfigurePivotEngineAsync<TRow>(data: TRow[], rowFields: Pivo
|
|
|
1034
1268
|
prefilterState?: {
|
|
1035
1269
|
fields: PivotField<TRow>[];
|
|
1036
1270
|
prefilter?: PivotPrefilter;
|
|
1037
|
-
}): Promise<boolean>;
|
|
1271
|
+
}, gridId?: string): Promise<boolean>;
|
|
1038
1272
|
/**
|
|
1039
1273
|
* Send filter specs to the worker. Converts field.filterValues to
|
|
1040
1274
|
* dictionary-encoded integer IDs so the worker can do fast integer
|
|
1041
1275
|
* set lookups on columnar data instead of string comparisons.
|
|
1042
1276
|
*/
|
|
1043
|
-
declare function filterPivotEngineAsync(fields: PivotField<any>[], prefilter?: PivotPrefilter): Promise<void>;
|
|
1277
|
+
declare function filterPivotEngineAsync(fields: PivotField<any>[], prefilter?: PivotPrefilter, gridId?: string): Promise<void>;
|
|
1044
1278
|
/**
|
|
1045
1279
|
* Live update (G-PIV-02): a resolved transaction, in positions of the array
|
|
1046
1280
|
* the engine holds. See controller/rowTransaction.ts.
|
|
@@ -1052,7 +1286,7 @@ interface EngineRowChange<TRow> {
|
|
|
1052
1286
|
removeIndex: number[];
|
|
1053
1287
|
addRows: TRow[];
|
|
1054
1288
|
}
|
|
1055
|
-
declare function computePivotMatrixAsync(expandedPaths: string[], expandedColPaths: string[]): Promise<PivotEngineResult>;
|
|
1289
|
+
declare function computePivotMatrixAsync(expandedPaths: string[], expandedColPaths: string[], gridId?: string): Promise<PivotEngineResult>;
|
|
1056
1290
|
/**
|
|
1057
1291
|
* Cached distinct values for a header filter.
|
|
1058
1292
|
*
|
|
@@ -1139,6 +1373,20 @@ declare function resolveColumnWidthDefaults(defaults?: PivotColumnWidthDefaults)
|
|
|
1139
1373
|
rowHeader: number;
|
|
1140
1374
|
data: number;
|
|
1141
1375
|
};
|
|
1376
|
+
/**
|
|
1377
|
+
* The body row height a `density` paints at — the number BOTH renderers'
|
|
1378
|
+
* virtualizers run on (window, spacers, keyboard scroll). The stylesheet's
|
|
1379
|
+
* `kanuni-pivot-density-*` rules set the matching cell line heights; the two
|
|
1380
|
+
* must agree or the frozen row headers drift away from the data rows. Anything
|
|
1381
|
+
* but `compact` / `comfortable` (unset, `normal`, a typo from plain JS) is the
|
|
1382
|
+
* historical 28px.
|
|
1383
|
+
*/
|
|
1384
|
+
declare function pivotRowHeight(density?: PivotDensity): number;
|
|
1385
|
+
/**
|
|
1386
|
+
* The class a density puts on the grid root (and its popups' hosts). `normal`
|
|
1387
|
+
* and unset add nothing, so a grid without `density` keeps its exact markup.
|
|
1388
|
+
*/
|
|
1389
|
+
declare function pivotDensityClass(density?: PivotDensity): string;
|
|
1142
1390
|
declare const ROW_HEADER_MIN_DATA_STRIP = 160;
|
|
1143
1391
|
declare const ROW_HEADER_MAX_PINNED_FRACTION = 0.6;
|
|
1144
1392
|
/** However tight it gets, a row-header column stays wide enough to read. */
|
|
@@ -1450,14 +1698,26 @@ interface PivotTransactionResult {
|
|
|
1450
1698
|
type PivotArea = 'row' | 'column' | 'data' | 'filter' | 'chooser';
|
|
1451
1699
|
/** Aggregation function applied to data fields in worker pre-aggregation. */
|
|
1452
1700
|
type PivotSummaryType = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'distinct' | 'custom';
|
|
1453
|
-
/** Post-aggregation display transformation applied after cell values are computed. */
|
|
1454
|
-
type PivotSummaryDisplayMode = 'absolute' | 'percentOfTotal' | 'percentOfColumnTotal' | 'percentOfRowTotal' | 'runningTotal' | 'difference' | 'percentDifference';
|
|
1455
1701
|
/**
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
1458
|
-
*
|
|
1702
|
+
* Post-aggregation display transformation applied after cell values are computed.
|
|
1703
|
+
*
|
|
1704
|
+
* - `percentOfRowTotal` / `percentOfColumnTotal`: the cell's share of its row's
|
|
1705
|
+
* (or column's) GRAND total.
|
|
1706
|
+
* - `percentOfParentRowTotal`: the share of the parent row group in the same
|
|
1707
|
+
* column — Berlin of Germany. A top-level row's parent is the grand total
|
|
1708
|
+
* row; the grand total row is 100%.
|
|
1709
|
+
* - `percentOfParentColumnTotal`: the same on the column axis, in the same row.
|
|
1710
|
+
*
|
|
1711
|
+
* A zero or missing divisor shows 0.
|
|
1712
|
+
*/
|
|
1713
|
+
type PivotSummaryDisplayMode = 'absolute' | 'percentOfTotal' | 'percentOfColumnTotal' | 'percentOfRowTotal' | 'percentOfParentRowTotal' | 'percentOfParentColumnTotal' | 'runningTotal' | 'difference' | 'percentDifference';
|
|
1714
|
+
/**
|
|
1715
|
+
* Date grouping interval. `'week'` is the ISO 8601 week, labelled with its
|
|
1716
|
+
* week-year (`"2026-W53"`; weeks start on Monday). `'numeric'` and `'custom'`
|
|
1717
|
+
* are accepted for compatibility and have no effect (the grid reports them):
|
|
1718
|
+
* numeric bins are set with a number on {@link PivotField.groupInterval}.
|
|
1459
1719
|
*/
|
|
1460
|
-
type PivotGroupInterval = 'year' | 'quarter' | 'month' | 'day' | 'numeric' | 'custom';
|
|
1720
|
+
type PivotGroupInterval = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'numeric' | 'custom';
|
|
1461
1721
|
/** Supported UI locale identifiers. */
|
|
1462
1722
|
type PivotLocale = 'tr' | 'en' | 'ar' | 'de' | 'fr' | 'es' | 'it' | 'pt' | 'ru' | 'zh-CN' | 'ja' | 'ko';
|
|
1463
1723
|
/** Union of all value types a pivot cell, node, or filter can hold. */
|
|
@@ -1484,11 +1744,21 @@ interface PivotTheme {
|
|
|
1484
1744
|
background?: string;
|
|
1485
1745
|
surface?: string;
|
|
1486
1746
|
surfaceHover?: string;
|
|
1747
|
+
/** Panels (filter area, field areas, footer, dialog headers) — and the column-header band unless `headerBackground` is set. */
|
|
1487
1748
|
surfaceHeader?: string;
|
|
1488
1749
|
border?: string;
|
|
1489
1750
|
text?: string;
|
|
1490
1751
|
textMuted?: string;
|
|
1752
|
+
/** Header text — on the panels, and on the column-header band unless `headerText` is set. */
|
|
1491
1753
|
textHeader?: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* The column-header band alone, apart from the panels: an ink band over light
|
|
1756
|
+
* panels (`headerBackground: '#1e293b', headerText: '#f8fafc'`). Unset, the
|
|
1757
|
+
* band follows `surfaceHeader` / `textHeader` as it always has.
|
|
1758
|
+
*/
|
|
1759
|
+
headerBackground?: string;
|
|
1760
|
+
/** Text on the column-header band; see `headerBackground`. */
|
|
1761
|
+
headerText?: string;
|
|
1492
1762
|
primary?: string;
|
|
1493
1763
|
primaryForeground?: string;
|
|
1494
1764
|
success?: string;
|
|
@@ -1500,6 +1770,12 @@ interface PivotTheme {
|
|
|
1500
1770
|
groupBorder?: string;
|
|
1501
1771
|
iconActive?: string;
|
|
1502
1772
|
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Row rhythm of the grid: `compact` 24px body rows, `normal` 28px (the
|
|
1775
|
+
* default, and what an unset value means), `comfortable` 36px. Independent of
|
|
1776
|
+
* the colours (`theme`).
|
|
1777
|
+
*/
|
|
1778
|
+
type PivotDensity = 'compact' | 'normal' | 'comfortable';
|
|
1503
1779
|
interface CustomSummaryOptions {
|
|
1504
1780
|
summaryProcess: 'start' | 'calculate' | 'finalize';
|
|
1505
1781
|
value: number | null;
|
|
@@ -1575,9 +1851,11 @@ interface PivotField<TRow = any, TCellTemplate = PivotCellTemplate, TStyle = any
|
|
|
1575
1851
|
/** Custom cell render function. */
|
|
1576
1852
|
cellTemplate?: TCellTemplate;
|
|
1577
1853
|
/**
|
|
1578
|
-
* Grouping interval: `'year' | 'quarter' | 'month' | 'day'` for a
|
|
1579
|
-
* field, or a bin width as a number for a number field (`100` → 0–99,
|
|
1580
|
-
* 100–199, …). `'
|
|
1854
|
+
* Grouping interval: `'year' | 'quarter' | 'month' | 'week' | 'day'` for a
|
|
1855
|
+
* date field, or a bin width as a number for a number field (`100` → 0–99,
|
|
1856
|
+
* 100–199, …). `'week'` is the ISO 8601 week, Monday first, keyed by its
|
|
1857
|
+
* week-year: 2027-01-01 groups under `"2026-W53"`. Dates are read as local
|
|
1858
|
+
* calendar dates. `'numeric'` and `'custom'` have no effect.
|
|
1581
1859
|
*/
|
|
1582
1860
|
groupInterval?: PivotGroupInterval | number;
|
|
1583
1861
|
/** Active filter values for header filter (include/exclude mode). */
|
|
@@ -1598,6 +1876,36 @@ interface PivotField<TRow = any, TCellTemplate = PivotCellTemplate, TStyle = any
|
|
|
1598
1876
|
topNShowOthers?: boolean;
|
|
1599
1877
|
/** Custom caption for the "Others" row when topN is active. */
|
|
1600
1878
|
topNOthersCaption?: string;
|
|
1879
|
+
/**
|
|
1880
|
+
* Keep only the members of this row or column field whose TOTAL for a data
|
|
1881
|
+
* field passes a condition — "regions selling over 1 million". Applied per
|
|
1882
|
+
* level after the sort and before `topN`; the totals keep counting every
|
|
1883
|
+
* member, as with `topN`. Tests the summary value, before any
|
|
1884
|
+
* `summaryDisplayMode`.
|
|
1885
|
+
*/
|
|
1886
|
+
valueFilter?: PivotValueFilter;
|
|
1887
|
+
/**
|
|
1888
|
+
* Keep only the members whose CAPTION passes a condition — "cities starting
|
|
1889
|
+
* with A". Compares the member's value as text, case-insensitively unless
|
|
1890
|
+
* `caseSensitive`; a blank member reads as empty text.
|
|
1891
|
+
*/
|
|
1892
|
+
labelFilter?: PivotLabelFilter;
|
|
1893
|
+
}
|
|
1894
|
+
/** A condition on a member's total — `PivotField.valueFilter`. */
|
|
1895
|
+
interface PivotValueFilter {
|
|
1896
|
+
/** The id of the data field whose total is tested. */
|
|
1897
|
+
dataField: string;
|
|
1898
|
+
operator: '>' | '>=' | '<' | '<=' | '=' | '!=' | 'between' | 'notBetween';
|
|
1899
|
+
value: number;
|
|
1900
|
+
/** The other bound, for `between` and `notBetween` (inclusive, either order). */
|
|
1901
|
+
value2?: number;
|
|
1902
|
+
}
|
|
1903
|
+
/** A condition on a member's caption — `PivotField.labelFilter`. */
|
|
1904
|
+
interface PivotLabelFilter {
|
|
1905
|
+
operator: 'equals' | 'notEquals' | 'contains' | 'notContains' | 'startsWith' | 'endsWith';
|
|
1906
|
+
value: string;
|
|
1907
|
+
/** Default false: "an" matches "Ankara". Lowercased in the grid's locale, so Turkish İ matches i. */
|
|
1908
|
+
caseSensitive?: boolean;
|
|
1601
1909
|
}
|
|
1602
1910
|
/** Controls pivot grid layout, totals visibility, and structural options. */
|
|
1603
1911
|
interface PivotLayoutState {
|
|
@@ -1859,6 +2167,8 @@ interface PivotControllerOptions<TRow = any> extends PivotControllerCallbacks<TR
|
|
|
1859
2167
|
* that is in `data` (mutated in place) and a remove cannot name a bare key.
|
|
1860
2168
|
*/
|
|
1861
2169
|
rowKey?: PivotRowKeyResolver<TRow>;
|
|
2170
|
+
/** How long `applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
|
|
2171
|
+
asyncTransactionWait?: number;
|
|
1862
2172
|
}
|
|
1863
2173
|
/**
|
|
1864
2174
|
* Starting widths, in pixels, for every column of a kind — the renderer's
|
|
@@ -1967,19 +2277,52 @@ interface PivotChartState {
|
|
|
1967
2277
|
format: ChartFormat;
|
|
1968
2278
|
/** Series switched off in the legend, by series key (a chart series' `dataKey`). */
|
|
1969
2279
|
hiddenSeries: string[];
|
|
2280
|
+
/**
|
|
2281
|
+
* Where the panel is: floating over the grid at this rectangle (px, relative
|
|
2282
|
+
* to the grid), or docked when absent — absent rather than `null`, so a
|
|
2283
|
+
* docked panel's state reads as it did before windows existed (rival
|
|
2284
|
+
* analysis, charts §E.1 #9). Read by the Enterprise panel, which owns it.
|
|
2285
|
+
*/
|
|
2286
|
+
floating?: FrameRect | null;
|
|
2287
|
+
/** Categories and series swapped (§E.1 #13); absent when not. Read by the Enterprise panel. */
|
|
2288
|
+
switched?: boolean;
|
|
2289
|
+
/** Unlinked from the pivot (§E.1 #8): the chart keeps its data. Absent while linked. */
|
|
2290
|
+
unlinked?: boolean;
|
|
2291
|
+
/** About how many bars a histogram cuts its values into (§E.1 #18); absent means 10. Read by the Enterprise panel. */
|
|
2292
|
+
bins?: number;
|
|
1970
2293
|
}
|
|
1971
2294
|
/** Which part of the state a `chartChanged` event moved. */
|
|
1972
|
-
type PivotChartChange = 'type' | 'stacking' | 'format' | 'hiddenSeries'
|
|
2295
|
+
type PivotChartChange = 'type' | 'stacking' | 'format' | 'hiddenSeries'
|
|
2296
|
+
/** Docked or floating, or the floating window moved or resized. */
|
|
2297
|
+
| 'placement'
|
|
2298
|
+
/** Categories and series swapped, or back. */
|
|
2299
|
+
| 'switched'
|
|
2300
|
+
/** Unlinked from the pivot, or linked again. */
|
|
2301
|
+
| 'linked'
|
|
2302
|
+
/** A histogram's bin count. */
|
|
2303
|
+
| 'bins';
|
|
1973
2304
|
interface PivotChartOpenedEvent {
|
|
1974
2305
|
state: PivotChartState;
|
|
2306
|
+
/** An extra chart window's id (`'chart-2'`…, §E.1 #10); absent for the grid's own panel. */
|
|
2307
|
+
chartId?: string;
|
|
1975
2308
|
}
|
|
1976
2309
|
interface PivotChartChangedEvent {
|
|
1977
2310
|
state: PivotChartState;
|
|
1978
2311
|
changes: PivotChartChange[];
|
|
2312
|
+
chartId?: string;
|
|
1979
2313
|
}
|
|
1980
2314
|
interface PivotChartClosedEvent {
|
|
1981
2315
|
state: PivotChartState;
|
|
2316
|
+
chartId?: string;
|
|
1982
2317
|
}
|
|
2318
|
+
/** A window as a saved report keeps it: its state, with its id. */
|
|
2319
|
+
type PivotChartWindowState = PivotChartState & {
|
|
2320
|
+
id: string;
|
|
2321
|
+
};
|
|
2322
|
+
/** The chart's part of a saved report: the panel's state and its extra windows. */
|
|
2323
|
+
type PivotChartReportPart = PivotChartState & {
|
|
2324
|
+
windows?: PivotChartWindowState[];
|
|
2325
|
+
};
|
|
1983
2326
|
/**
|
|
1984
2327
|
* Read a saved chart state defensively — it came from storage, a report or an
|
|
1985
2328
|
* older build. Fields of the wrong kind fall back to their defaults; `null`
|
|
@@ -2035,6 +2378,12 @@ declare class PivotStateStore<TRow> {
|
|
|
2035
2378
|
setImportPreview(importPreview: PivotControllerState<TRow>['importPreview']): void;
|
|
2036
2379
|
private createInitialSnapshot;
|
|
2037
2380
|
private schedulePersist;
|
|
2381
|
+
/**
|
|
2382
|
+
* Write a pending save NOW. The controller calls it on dispose: the write
|
|
2383
|
+
* waits for an idle moment (up to a second), so a change made just before
|
|
2384
|
+
* the grid went away — a route change in a single-page app — was lost.
|
|
2385
|
+
*/
|
|
2386
|
+
flush(): void;
|
|
2038
2387
|
private persist;
|
|
2039
2388
|
}
|
|
2040
2389
|
|
|
@@ -2086,6 +2435,7 @@ declare class PivotController<TRow> {
|
|
|
2086
2435
|
private readonly reportParts;
|
|
2087
2436
|
private pendingReportParts;
|
|
2088
2437
|
private readonly chartReporter;
|
|
2438
|
+
private readonly windowReporters;
|
|
2089
2439
|
private options;
|
|
2090
2440
|
private reportService;
|
|
2091
2441
|
private engineService;
|
|
@@ -2094,6 +2444,10 @@ declare class PivotController<TRow> {
|
|
|
2094
2444
|
/** Full row set of a parsed import awaiting preview commit (kept out of observable state). */
|
|
2095
2445
|
private pendingImportRows;
|
|
2096
2446
|
private disposed;
|
|
2447
|
+
/** `applyTransactionAsync`: the batch waiting for its window, and who to tell. */
|
|
2448
|
+
private asyncQueue;
|
|
2449
|
+
private asyncCallbacks;
|
|
2450
|
+
private asyncTimer;
|
|
2097
2451
|
/**
|
|
2098
2452
|
* The array the application last handed in. After a transaction the
|
|
2099
2453
|
* controller's rows are a NEW array; a binding that re-sends every option
|
|
@@ -2112,7 +2466,7 @@ declare class PivotController<TRow> {
|
|
|
2112
2466
|
* convenient: the same state twice is one event, and edits while the panel
|
|
2113
2467
|
* is closed arrive with the next `chartOpened`.
|
|
2114
2468
|
*/
|
|
2115
|
-
reportChartState(state: PivotChartState): void;
|
|
2469
|
+
reportChartState(state: PivotChartState, chartId?: string): void;
|
|
2116
2470
|
/**
|
|
2117
2471
|
* Keep a piece of state owned outside the core inside saved reports — the
|
|
2118
2472
|
* Enterprise chart panel keeps its chart this way. Order-independent: the
|
|
@@ -2142,6 +2496,22 @@ declare class PivotController<TRow> {
|
|
|
2142
2496
|
* the recomputed pivot follows (listen for `engineCompleted`).
|
|
2143
2497
|
*/
|
|
2144
2498
|
applyTransaction(transaction: PivotRowTransaction<TRow>): PivotTransactionResult;
|
|
2499
|
+
private applyNow;
|
|
2500
|
+
/**
|
|
2501
|
+
* Queue a transaction for a feed that ticks faster than anyone can look.
|
|
2502
|
+
* Every `applyTransaction` scans the rows for the keys it names and sends
|
|
2503
|
+
* the worker a message; a hundred ticks in a moment is a hundred of each for
|
|
2504
|
+
* one picture. Queued ones are merged and applied together after
|
|
2505
|
+
* `asyncTransactionWait` ms (default 50), or at once on
|
|
2506
|
+
* `flushAsyncTransactions()`. The callback runs when its batch has been
|
|
2507
|
+
* applied. A synchronous `applyTransaction` or `setData` applies the queue
|
|
2508
|
+
* first; `dispose` drops it.
|
|
2509
|
+
*/
|
|
2510
|
+
applyTransactionAsync(transaction: PivotRowTransaction<TRow>, callback?: () => void): void;
|
|
2511
|
+
/** Apply the queued transactions now, as one. */
|
|
2512
|
+
flushAsyncTransactions(): void;
|
|
2513
|
+
/** How many transactions are waiting to be applied. */
|
|
2514
|
+
getPendingAsyncTransactionCount(): number;
|
|
2145
2515
|
updateField(updatedField: PivotField<TRow>): void;
|
|
2146
2516
|
deleteField(fieldId: string): void;
|
|
2147
2517
|
changeFieldArea(fieldId: string, area: PivotArea): void;
|
|
@@ -2270,7 +2640,18 @@ declare class PivotController<TRow> {
|
|
|
2270
2640
|
getRawData(): TRow[];
|
|
2271
2641
|
getEngineResult(): PivotEngineResult | null;
|
|
2272
2642
|
getCell(rowPath: string[], colPath: string[]): PivotCell | null;
|
|
2643
|
+
/**
|
|
2644
|
+
* The click event with the source rows behind the cell as `records`.
|
|
2645
|
+
*
|
|
2646
|
+
* Resolved on first READ, not on the click (6d-16): the rows are found by a
|
|
2647
|
+
* scan of the whole dataset on the main thread, 0.3-0.5 s per click on a
|
|
2648
|
+
* million rows, and a click handler that never reads them paid it anyway.
|
|
2649
|
+
* The scan matches the cell's path first and runs the filters only on the
|
|
2650
|
+
* rows that matched — every filter judges one row at a time, so the order
|
|
2651
|
+
* does not change the result, and a cell is usually a sliver of the data.
|
|
2652
|
+
*/
|
|
2273
2653
|
resolveCellClick(event: CellClickEvent<TRow>): CellClickEvent<TRow>;
|
|
2654
|
+
private recordsAt;
|
|
2274
2655
|
getAreaFields(area: PivotArea): PivotField<TRow>[];
|
|
2275
2656
|
private cellIndexLookups;
|
|
2276
2657
|
private getCellIndexLookup;
|
|
@@ -2576,6 +2957,49 @@ declare function sortPivotTree(nodes: PivotNode[], fields: PivotField<any>[], en
|
|
|
2576
2957
|
*/
|
|
2577
2958
|
declare function collatorFor(locale?: string, numeric?: boolean): Intl.Collator;
|
|
2578
2959
|
|
|
2960
|
+
/** One row of the popup's list: the value as text (the row's key) and as stored. */
|
|
2961
|
+
interface HeaderFilterOption {
|
|
2962
|
+
rawStr: string;
|
|
2963
|
+
rawVal: unknown;
|
|
2964
|
+
}
|
|
2965
|
+
/** The part of a field the popup reads. */
|
|
2966
|
+
interface HeaderFilterState {
|
|
2967
|
+
filterValues?: Set<unknown>;
|
|
2968
|
+
filterType?: 'include' | 'exclude';
|
|
2969
|
+
}
|
|
2970
|
+
/** What OK writes back. */
|
|
2971
|
+
type HeaderFilterWrite = {
|
|
2972
|
+
kind: 'keep';
|
|
2973
|
+
} | {
|
|
2974
|
+
kind: 'clear';
|
|
2975
|
+
} | {
|
|
2976
|
+
kind: 'apply';
|
|
2977
|
+
values: Set<unknown>;
|
|
2978
|
+
filterType: 'include' | 'exclude';
|
|
2979
|
+
};
|
|
2980
|
+
/** The `rawStr` of every option the report shows now — the boxes to tick on open. */
|
|
2981
|
+
declare function headerFilterShown(options: readonly HeaderFilterOption[], field: HeaderFilterState): Set<string>;
|
|
2982
|
+
/**
|
|
2983
|
+
* The write that makes the shown set exactly the ticked set.
|
|
2984
|
+
*
|
|
2985
|
+
* - Nothing changed → `keep`: OK without touching anything must leave the
|
|
2986
|
+
* filter as it was, including values no current row holds (a live update
|
|
2987
|
+
* may still bring them).
|
|
2988
|
+
* - Nothing ticked → `keep`: an empty list cannot be expressed (an empty
|
|
2989
|
+
* `filterValues` means "no filter"), so the popup disables OK instead.
|
|
2990
|
+
* - All ticked → `clear`.
|
|
2991
|
+
* - A field that already has a filter keeps its mode: exclude lists the
|
|
2992
|
+
* unticked values, include the ticked ones.
|
|
2993
|
+
* - A field with no filter yet gets whichever list is SHORTER — exclude when
|
|
2994
|
+
* fewer values are unticked than ticked, include otherwise (ties: include).
|
|
2995
|
+
* Unticking three fee rows out of thousands of products stores three
|
|
2996
|
+
* values, not thousands.
|
|
2997
|
+
*
|
|
2998
|
+
* Each listed option contributes its `rawStr` and its `rawVal`, as the popup
|
|
2999
|
+
* always wrote (a number field stores both `'10'` and `10`).
|
|
3000
|
+
*/
|
|
3001
|
+
declare function headerFilterWrite(options: readonly HeaderFilterOption[], ticked: ReadonlySet<string>, field: HeaderFilterState): HeaderFilterWrite;
|
|
3002
|
+
|
|
2579
3003
|
declare function executePostAggregationPhase<TRow>(engineResult: PivotEngineResult, dataFields: PivotField<TRow>[], registry?: PivotEngineRegistry): void;
|
|
2580
3004
|
declare function executeSummaryDisplayModesPhase<TRow>(engineResult: PivotEngineResult, dataFields: PivotField<TRow>[]): void;
|
|
2581
3005
|
|
|
@@ -2587,6 +3011,32 @@ interface DimensionFieldInfo {
|
|
|
2587
3011
|
}
|
|
2588
3012
|
declare function formatDimensionValue(value: unknown, field: DimensionFieldInfo | undefined, context: DateFormatContext, locale: string): string;
|
|
2589
3013
|
|
|
3014
|
+
type AnnounceKey = 'sortAsc' | 'sortDesc' | 'clearSort' | 'columnFilter';
|
|
3015
|
+
/** The announcement for the first field whose sort or filter changed; null when none did. */
|
|
3016
|
+
declare function pivotChangeAnnouncement(prev: readonly PivotField<any>[], next: readonly PivotField<any>[], t: (key: AnnounceKey) => string): string | null;
|
|
3017
|
+
/**
|
|
3018
|
+
* Text for a polite live region. An identical message twice in a row is not
|
|
3019
|
+
* re-read by screen readers, so a repeat gets a trailing no-break space.
|
|
3020
|
+
*/
|
|
3021
|
+
declare function nextLiveText(current: string, message: string): string;
|
|
3022
|
+
|
|
3023
|
+
/** The text of a percent-mode value whose field has no format; null for every other case. */
|
|
3024
|
+
declare function percentModeText(value: number, field: PivotField<any> | undefined, locale: string): string | null;
|
|
3025
|
+
/** The Excel number format for the same case — the value stays 0-100, so the sign is literal. */
|
|
3026
|
+
declare function percentModeExcelNumFmt(field: PivotField<any> | undefined): string | undefined;
|
|
3027
|
+
|
|
3028
|
+
type CalculatedFieldTextKey = 'createFormulasWithoutCode' | 'measureName' | 'numericStandard' | 'numericDecimal' | 'currencyTRY' | 'currencyUSD' | 'measureNamePlaceholder' | 'customFormat' | 'customPrefix' | 'customSuffix' | 'minFraction' | 'maxFraction' | 'calculationLevel' | 'calcRowLevel' | 'calcSummaryLevel' | 'noFieldsFound' | 'deleteCalcField' | 'formulaPlaceholder' | 'saveAndAdd' | 'measureNameEmpty' | 'formulaEmpty' | 'formulaError' | 'calcRowLevelHint' | 'calcSummaryLevelHint' | 'formulaValid' | 'calcFieldsHint' | 'formulaUses';
|
|
3029
|
+
/** The designer's text for `key` in `locale` (`tr-TR` → `tr`, `zh` → `zh-CN`), or undefined. */
|
|
3030
|
+
declare function calculatedFieldText(locale: string | undefined, key: string): string | undefined;
|
|
3031
|
+
|
|
3032
|
+
type DrillDownTextKey = 'exportCsv' | 'pagerPage' | 'pagerOf' | 'pagerPrevious' | 'pagerNext' | 'drillDown' | 'drillDownRecords';
|
|
3033
|
+
/** The caption for `key` in `locale` (`tr-TR` → `tr`, `zh` → `zh-CN`), or undefined. */
|
|
3034
|
+
declare function drillDownText(locale: string | undefined, key: string): string | undefined;
|
|
3035
|
+
|
|
3036
|
+
type ChartKeyTextKey = 'chartCanvasHintPick' | 'chartCategoryFocus' | 'chartCategoryFiltered';
|
|
3037
|
+
/** The text for `key` in `locale` (`tr-TR` → `tr`, `zh` → `zh-CN`), English when the language is unknown. */
|
|
3038
|
+
declare function chartKeyText(locale: string | undefined, key: ChartKeyTextKey): string;
|
|
3039
|
+
|
|
2590
3040
|
declare class ExportStreamController {
|
|
2591
3041
|
private worker;
|
|
2592
3042
|
private static sharedWorker;
|
|
@@ -3015,6 +3465,26 @@ interface PivotAiSort {
|
|
|
3015
3465
|
/** Keep only the first N after sorting (needs `byValueField`). */
|
|
3016
3466
|
top: number | null;
|
|
3017
3467
|
}
|
|
3468
|
+
/**
|
|
3469
|
+
* A condition on the members of a row or column field (`valueFilter` /
|
|
3470
|
+
* `labelFilter`): by their TOTAL — "regions over 1 million" — or by their
|
|
3471
|
+
* CAPTION — "cities starting with A". Applied after the sort and before `top`.
|
|
3472
|
+
*/
|
|
3473
|
+
type PivotAiCondition = {
|
|
3474
|
+
fieldId: string;
|
|
3475
|
+
kind: 'value';
|
|
3476
|
+
/** The measure whose total is tested (one of the values). */
|
|
3477
|
+
dataField: string;
|
|
3478
|
+
operator: PivotValueFilter['operator'];
|
|
3479
|
+
value: number;
|
|
3480
|
+
/** The other bound, for between / notBetween; null otherwise. */
|
|
3481
|
+
value2: number | null;
|
|
3482
|
+
} | {
|
|
3483
|
+
fieldId: string;
|
|
3484
|
+
kind: 'label';
|
|
3485
|
+
operator: PivotLabelFilter['operator'];
|
|
3486
|
+
text: string;
|
|
3487
|
+
};
|
|
3018
3488
|
interface PivotAiTotals {
|
|
3019
3489
|
grandTotalRow: boolean;
|
|
3020
3490
|
grandTotalColumn: boolean;
|
|
@@ -3032,6 +3502,8 @@ interface PivotAiState {
|
|
|
3032
3502
|
values?: PivotAiValue[];
|
|
3033
3503
|
/** Every value filter; [] clears them. */
|
|
3034
3504
|
filters?: PivotAiFilter[];
|
|
3505
|
+
/** Every condition on a field's members by total or caption; [] clears them. */
|
|
3506
|
+
conditions?: PivotAiCondition[];
|
|
3035
3507
|
/** Every dimension sort; a dimension not listed keeps its data order. */
|
|
3036
3508
|
sort?: PivotAiSort[];
|
|
3037
3509
|
totals?: PivotAiTotals;
|
|
@@ -3155,4 +3627,4 @@ declare function rollupInMemory<TRow>(rows: readonly TRow[], request: PivotServe
|
|
|
3155
3627
|
/** Every value of a field in rows held in memory — the reference `loadFieldValues`. */
|
|
3156
3628
|
declare function fieldValuesInMemory<TRow>(rows: readonly TRow[], field: PivotServerField): unknown[];
|
|
3157
3629
|
|
|
3158
|
-
export { type AdvancedExportRequest, type AdvancedExporter, CHART_LEGEND_POSITIONS, type CellClickEvent, type CellPreparedEvent, type CellType, type ChartFormat, type ChartImageRequest, type ChartLegendPosition, type ChartMark, type ChartStacking, type ColHeaderCell, type ColumnSlot, type ColumnSlotOptions, type ConditionalVisual, type CsvParseProgress, CsvReader, type CustomSummaryOptions, DEFAULT_DATA_COLUMN_WIDTH, DEFAULT_ROW_HEADER_WIDTH, DataNormalizer, type DateFormatContext, DateFormatter, type DateGranularity, type DimensionFieldInfo, type DropIntent, type ExportFormat, type ExportOptions, ExportStreamController, type ExportingEvent, FastTrie, type FieldDistinctEntry, type FieldMoveEvent, type FilterCondition, type FilterGroup, type FilterOperator, type FlatCellMatrix, FlatPivotEngine, type FlatRow, type FunnelStage, type IFileReader, type ImportFormat, ImportManager, type ImportManagerOptions, type ImportProgress, type ImportResult, type ImportSnapshot, ImportStreamController, type ImportWorkerKind, type ImportWorkerResult, MAX_C, type MarkTone, PIVOT_AI_FEATURES, type ParseFileOptions, type PivotAiApplyResult, type PivotAiFeature, type PivotAiFieldOptions, type PivotAiFilter, type PivotAiOptions, type PivotAiSort, type PivotAiState, type PivotAiTotals, type PivotAiValue, type PivotArea, type PivotCell, PivotCellAggregator, type PivotCellTemplate, type PivotCellTextAccessor, type PivotCellValueAccessor, type PivotChartChange, type PivotChartChangedEvent, type PivotChartClosedEvent, type PivotChartOpenedEvent, type PivotChartState, type PivotColumnWidthDefaults, type PivotConditionRule, PivotController, type PivotControllerCallbacks, type PivotControllerEvents, type PivotControllerOptions, type PivotControllerState, type PivotDataSource, type PivotDictionary, type PivotDragIntentState, PivotEngineRegistry, type PivotEngineResult, PivotEngineService, type PivotEngineServiceConfig, PivotEventEmitter, type PivotEventHandler, type PivotEventMap, PivotExportService, type PivotField, PivotFieldService, type PivotGridRef, type PivotGroupInterval, type PivotImportField, type PivotImportLabels, type PivotImportPreviewState, type PivotImportStatus, type PivotLayoutProfile, type PivotLayoutState, type PivotLocale, type PivotNode, type PivotPlugin, type PivotPrefilter, type PivotReport, PivotReportManager, PivotReportService, type PivotReportState, type PivotRowKey, type PivotRowKeyResolver, type PivotRowSparkline, type PivotRowTransaction, type PivotSelectionMode, PivotSelectionModel, type PivotSelectionRange, type PivotSelectionState, type PivotSelectionStats, type PivotServerCell, type PivotServerField, type PivotServerInput, type PivotServerRequest, type PivotServerResponse, type PivotServerSource, type PivotServerSourceOptions, type PivotServerValue, type PivotStateListener, PivotStateStore, type PivotStateStoringConfig, type PivotSummaryDisplayMode, type PivotSummaryType, type PivotTheme, type PivotToolbarConfig, type PivotTransactionResult, type PivotValue, type PrefilterConditionSpec, type PrefilterGroupSpec, type ProcessFileStreamingOptions, type ProcessFromUrlOptions, ROW_HEADER_MAX_PINNED_FRACTION, ROW_HEADER_MIN_COL_WIDTH, ROW_HEADER_MIN_DATA_STRIP, type ReportStatePart, type RowHeaderLayout, SHAPE_CHART_TYPES, type ShapeChartInput, type ShapeChartType, type StackedSegment, type TreemapCell, type TrendShape, type ValidationResult, type ValueRange, type WaterfallStep, type WorkerComputeRequest, type WorkerFilterRequest, type WorkerFilterSpec, type WorkerInitRequest, type WorkerResponse, type WorkerTransactionRequest, type XYPair, type XYPairInput, XmlReader, applyPivotAiState, ar, buildCellLookup, buildColPathsList, buildColumnHeaders, buildEngineResult, buildPivotAOA, buildRowLabelCells, cellHash, cellHashCol, cellHashRow, chartPalette, classifyValue, clearFormatCache, coerceRecords, coerceValue, collatorFor, compileSafeFormula, computeFieldRanges, computePivotMatrixAsync, computeRowHeaderWidths, conditionRuleToExcelStyle, cssColorToRgb, de, dedupeHeaders, defaultPivotLayout, destroyEngineWorker, detectDelimiter, diffPivotChartState, en, es, escapeXmlText, executePostAggregationPhase, executeSummaryDisplayModesPhase, exportPivotData, extractGroupValue, fieldNeedsRange, fieldValuesInMemory, filterEmptySummaryTree, filterPivotEngineAsync, filterRecords, filterRecordsAsync, flattenExportRows, flattenRowTree, flattenRowTreeTabular, flattenRowTreeTree, formatCellValue, formatCellValueCached, formatDimensionValue, formatHeaderValue, fr, funnelMarks, funnelStages, getAdvancedExporter, getCellVal, getFieldDistinctValues, getPivotAiSchema, getPivotAiState, getVisibleColLeaves, getVisibleColSlots, getVisibleLeafCount, getVisibleMaxDepth, heatColor, heatTextColor, heatmapMarks, inferColumnType, initPivotEngineAsync, intlFormatToExcelNumFmt, invertRowHeaderWidth, it, ja, ko, logAxisTicks, pairSeriesForXY, parseBoolean, parseColor, parseCsvToRows, parseDelimited, parseFlexibleDate, parseLocaleNumber, percentAxisTicks, pivotRowTrend, pivotServerSource, pt, rangeBarMarks, rangeRatio, readChartFormat, readPivotChartState, reconfigurePivotEngineAsync, registerAdvancedExporter, resolveColPath, resolveColumnWidthDefaults, resolveConditionalVisual, rollupInMemory, ru, safeKey, sanitizeRows, scaleColor, serverRequestFor, setActiveEngineGrid, sortPivotTree, squarify, stackSeries, stripBom, sunburstMarks, testSafeFormula, tr, treemapMarks, trendColumnPaths, trendShape, waterfallDomain, waterfallMarks, waterfallSteps, zhCN };
|
|
3630
|
+
export { type AdvancedExportRequest, type AdvancedExporter, CHART_LEGEND_POSITIONS, CHART_PALETTE_NAMES, type CalculatedFieldTextKey, type CellClickEvent, type CellPreparedEvent, type CellType, type ChartCategoryKeyAction, type ChartFont, type ChartFormat, type ChartGridLines, type ChartImageRequest, type ChartKeyTextKey, type ChartLabelAngle, type ChartLegendPosition, type ChartMark, type ChartPaletteName, type ChartStacking, type ChartStyle, type ChartStyleDefaults, type ColHeaderCell, type ColumnSlot, type ColumnSlotOptions, type ConditionalVisual, type CsvParseProgress, CsvReader, type CustomSummaryOptions, DEFAULT_DATA_COLUMN_WIDTH, DEFAULT_ROW_HEADER_WIDTH, DataNormalizer, type DateFormatContext, DateFormatter, type DateGranularity, type DimensionFieldInfo, type DrillDownTextKey, type DropIntent, type ExportFormat, type ExportOptions, ExportStreamController, type ExportingEvent, FastTrie, type FieldDistinctEntry, type FieldMoveEvent, type FilterCondition, type FilterGroup, type FilterOperator, type FlatCellMatrix, FlatPivotEngine, type FlatRow, type FloatingFrame, type FrameRect, type FrameSize, type FunnelStage, type HeaderFilterOption, type HeaderFilterState, type HeaderFilterWrite, type HistogramBin, type IFileReader, type ImportFormat, ImportManager, type ImportManagerOptions, type ImportProgress, type ImportResult, type ImportSnapshot, ImportStreamController, type ImportWorkerKind, type ImportWorkerResult, MAX_C, type MarkTone, PIVOT_AI_FEATURES, type ParseFileOptions, type PivotAiApplyResult, type PivotAiCondition, type PivotAiFeature, type PivotAiFieldOptions, type PivotAiFilter, type PivotAiOptions, type PivotAiSort, type PivotAiState, type PivotAiTotals, type PivotAiValue, type PivotArea, type PivotCell, PivotCellAggregator, type PivotCellTemplate, type PivotCellTextAccessor, type PivotCellValueAccessor, type PivotChartChange, type PivotChartChangedEvent, type PivotChartClosedEvent, type PivotChartOpenedEvent, type PivotChartReportPart, type PivotChartState, type PivotChartWindowState, type PivotColumnWidthDefaults, type PivotConditionRule, PivotController, type PivotControllerCallbacks, type PivotControllerEvents, type PivotControllerOptions, type PivotControllerState, type PivotDataSource, type PivotDensity, type PivotDictionary, type PivotDragIntentState, PivotEngineRegistry, type PivotEngineResult, PivotEngineService, type PivotEngineServiceConfig, PivotEventEmitter, type PivotEventHandler, type PivotEventMap, PivotExportService, type PivotField, PivotFieldService, type PivotGridRef, type PivotGroupInterval, type PivotImportField, type PivotImportLabels, type PivotImportPreviewState, type PivotImportStatus, type PivotLabelFilter, type PivotLayoutProfile, type PivotLayoutState, type PivotLocale, type PivotNode, type PivotPlugin, type PivotPrefilter, type PivotReport, PivotReportManager, PivotReportService, type PivotReportState, type PivotRowKey, type PivotRowKeyResolver, type PivotRowSparkline, type PivotRowTransaction, type PivotSelectionMode, PivotSelectionModel, type PivotSelectionRange, type PivotSelectionState, type PivotSelectionStats, type PivotServerCell, type PivotServerField, type PivotServerInput, type PivotServerRequest, type PivotServerResponse, type PivotServerSource, type PivotServerSourceOptions, type PivotServerValue, type PivotStateListener, PivotStateStore, type PivotStateStoringConfig, type PivotSummaryDisplayMode, type PivotSummaryType, type PivotTheme, type PivotToolbarConfig, type PivotTransactionResult, type PivotValue, type PivotValueFilter, type PrefilterConditionSpec, type PrefilterGroupSpec, type ProcessFileStreamingOptions, type ProcessFromUrlOptions, ROW_HEADER_MAX_PINNED_FRACTION, ROW_HEADER_MIN_COL_WIDTH, ROW_HEADER_MIN_DATA_STRIP, type ReportStatePart, type RowHeaderLayout, SHAPE_CHART_TYPES, type ShapeChartInput, type ShapeChartType, type StackedSegment, type TreemapCell, type TrendShape, type ValidationResult, type ValueRange, type WaterfallStep, type WorkerComputeRequest, type WorkerFilterRequest, type WorkerFilterSpec, type WorkerInitRequest, type WorkerResponse, type WorkerTransactionRequest, type XYPair, type XYPairInput, XmlReader, applyPivotAiState, ar, attachFloatingFrame, buildCellLookup, buildColPathsList, buildColumnHeaders, buildEngineResult, buildPivotAOA, buildRowLabelCells, calculatedFieldText, cellHash, cellHashCol, cellHashRow, centredFrame, chartCategoryKey, chartKeyText, chartPalette, chartWindowFrame, classifyValue, clearFormatCache, coerceRecords, coerceValue, collatorFor, compileSafeFormula, computeFieldRanges, computePivotMatrixAsync, computeRowHeaderWidths, conditionRuleToExcelStyle, cssColorToRgb, de, dedupeHeaders, defaultPivotLayout, destroyEngineWorker, detectDelimiter, diffPivotChartState, drillDownText, en, es, escapeXmlText, executePostAggregationPhase, executeSummaryDisplayModesPhase, exportPivotData, extractGroupValue, fieldNeedsRange, fieldValuesInMemory, filterEmptySummaryTree, filterPivotEngineAsync, filterRecords, filterRecordsAsync, flattenExportRows, flattenRowTree, flattenRowTreeTabular, flattenRowTreeTree, formatCellValue, formatCellValueCached, formatDimensionValue, formatHeaderValue, fr, funnelMarks, funnelStages, getAdvancedExporter, getCellVal, getFieldDistinctValues, getPivotAiSchema, getPivotAiState, getVisibleColLeaves, getVisibleColSlots, getVisibleLeafCount, getVisibleMaxDepth, headerFilterShown, headerFilterWrite, heatColor, heatTextColor, heatmapMarks, histogramBins, histogramMarks, inferColumnType, initPivotEngineAsync, intlFormatToExcelNumFmt, invertRowHeaderWidth, it, ja, ko, logAxisTicks, nextChartWindowId, nextLiveText, pairSeriesForXY, parseBoolean, parseColor, parseCsvToRows, parseDelimited, parseFlexibleDate, parseLocaleNumber, percentAxisTicks, percentModeExcelNumFmt, percentModeText, pivotChangeAnnouncement, pivotDensityClass, pivotRowHeight, pivotRowTrend, pivotServerSource, pt, rangeBarMarks, rangeRatio, readChartFormat, readFrameRect, readPivotChartState, reconfigurePivotEngineAsync, registerAdvancedExporter, resolveChartPalette, resolveChartStyle, resolveColPath, resolveColumnWidthDefaults, resolveConditionalVisual, rollupInMemory, ru, safeKey, sanitizeRows, scaleColor, serverRequestFor, setActiveEngineGrid, sortPivotTree, squarify, stackSeries, stripBom, sunburstMarks, testSafeFormula, tr, treemapMarks, trendColumnPaths, trendShape, waterfallDomain, waterfallMarks, waterfallSteps, windowStartFor, zhCN };
|