@kanunilabs/pivotgrid-core 1.11.9 → 1.11.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
@@ -1172,6 +1172,8 @@ declare class FlatPivotEngine {
1172
1172
  * compute. Returns the number of rows stored afterwards.
1173
1173
  */
1174
1174
  applyTransaction(req: WorkerTransactionRequest): number;
1175
+ /** 10^precision per data field (B.97), 0 where the field has none. */
1176
+ private precisionScales;
1175
1177
  /** Reset the touched groups and fold their rows back in — the same arithmetic, in the same order, as processRange. */
1176
1178
  private resumGroups;
1177
1179
  /**
@@ -1432,6 +1434,91 @@ declare function rowHeaderGroupEnd(rows: ReadonlyArray<{
1432
1434
  dfIndex: number;
1433
1435
  isGrandTotal: boolean;
1434
1436
  }>, index: number, depth: number, tree: boolean): boolean;
1437
+ /** The row fields a keyboard walk over the row headers reads (B.98). */
1438
+ type RowHeaderNavRow = {
1439
+ flatRow: {
1440
+ depth: number;
1441
+ isSubtotal?: boolean;
1442
+ rowSpans: readonly number[];
1443
+ } | null;
1444
+ dfIndex: number;
1445
+ isGrandTotal: boolean;
1446
+ };
1447
+ /**
1448
+ * Whether row `index`'s cell in row-header column `col` is a continuation: drawn empty because the group above
1449
+ * spans it (no `data-group-start`, B.79). The renderers draw it so when `rowSpans[col]` is 0 or the row repeats a
1450
+ * flat row for another measure (`dfIndex > 0`).
1451
+ */
1452
+ declare function isRowHeaderContinuation(rows: ReadonlyArray<RowHeaderNavRow>, index: number, col: number, tree: boolean): boolean;
1453
+ /**
1454
+ * The cell a keyboard focus on (r, c) shows as (B.98), the way a spreadsheet treats a merged cell: a row-header
1455
+ * cell drawn as part of a bigger one is that bigger one. A continuation cell is its group's first cell (up the
1456
+ * column); a cell right of a row's own label (a collapsed or subtotal row's empty cells, the grand total's) is that
1457
+ * label. `headerCols` is the number of row-field columns (the measure column of data-in-rows is not one of them);
1458
+ * a data column is returned as is.
1459
+ */
1460
+ declare function rowHeaderCellAt(rows: ReadonlyArray<RowHeaderNavRow>, r: number, c: number, headerCols: number, tree: boolean): {
1461
+ r: number;
1462
+ c: number;
1463
+ };
1464
+ /**
1465
+ * {@link rowHeaderCellAt} for many cells at once (a copied rectangle, B.99): each column's group start is
1466
+ * remembered, so the walk up a merged cell is done once per group instead of once per row — a selection
1467
+ * down a 10,000-row group was quadratic. Same answers as `rowHeaderCellAt`.
1468
+ */
1469
+ declare function rowHeaderCellLookup(rows: ReadonlyArray<RowHeaderNavRow>, headerCols: number, tree: boolean): (r: number, c: number) => {
1470
+ r: number;
1471
+ c: number;
1472
+ };
1473
+ /** The last row of the group whose cell in row-header column `col` starts at or covers row `r` (B.98). */
1474
+ declare function rowHeaderGroupLastRow(rows: ReadonlyArray<RowHeaderNavRow>, r: number, col: number, tree: boolean): number;
1475
+ /**
1476
+ * How many row-header columns a row's own label cell spans (B.105): a collapsed group (or a childless member above
1477
+ * the last row field) has nothing in the columns right of its label, so the label's cell runs to the last row-header
1478
+ * column and its text is cut only there, as the "Total: ..." rows already were. 1 everywhere else: the tree layout,
1479
+ * subtotal and grand-total rows, a label in the last column, a continuation row of a merged group (`dfIndex > 0`).
1480
+ * The columns it covers draw no cell of their own in that row.
1481
+ */
1482
+ declare function rowHeaderLabelSpan(row: RowHeaderNavRow | undefined, headerCols: number, tree: boolean): number;
1483
+ /**
1484
+ * The rows a row-header selection paints and copies (B.103): rows `minR`..`maxR` grown to whole merged cells of
1485
+ * column `col` (the rectangle's last column, as the copy has read it since B.99). A selection that starts on a
1486
+ * continuation cell starts at its group's first row, the one with the text; one that ends inside a group ends at its
1487
+ * last row. Tree layout and data columns: unchanged.
1488
+ */
1489
+ declare function rowHeaderSelectionRows(rows: ReadonlyArray<RowHeaderNavRow>, minR: number, maxR: number, col: number, headerCols: number, tree: boolean): {
1490
+ minR: number;
1491
+ maxR: number;
1492
+ };
1493
+ /**
1494
+ * Where an arrow key, Home/End or PageUp/PageDown takes the keyboard focus over the pivot's cells (B.98).
1495
+ * `at` is the cell shown, `want` the cell asked for: moving through a merged row-header cell keeps the row (or
1496
+ * column) the walk came from, so leaving it on the other axis goes back there, as a spreadsheet's merged cell does.
1497
+ * Down leaves a merged cell from its last row; Right steps over the empty cells right of a row's label. Returns
1498
+ * the new `want` and the cell it shows (`at`); null for a key that is not a move.
1499
+ */
1500
+ declare function pivotFocusMove(rows: ReadonlyArray<RowHeaderNavRow>, key: string, at: {
1501
+ r: number;
1502
+ c: number;
1503
+ }, want: {
1504
+ r: number;
1505
+ c: number;
1506
+ }, opts: {
1507
+ totalCols: number;
1508
+ headerCols: number;
1509
+ tree: boolean;
1510
+ page: number;
1511
+ ctrl: boolean;
1512
+ }): {
1513
+ want: {
1514
+ r: number;
1515
+ c: number;
1516
+ };
1517
+ at: {
1518
+ r: number;
1519
+ c: number;
1520
+ };
1521
+ } | null;
1435
1522
  interface RowHeaderLayout {
1436
1523
  /** Widths as PAINTED, one per row-header column. */
1437
1524
  widths: number[];
@@ -1955,6 +2042,34 @@ interface PivotField<TRow = any, TCellTemplate = PivotCellTemplate, TStyle = any
1955
2042
  * rows the worker grouped.
1956
2043
  */
1957
2044
  summaryType?: PivotSummaryType;
2045
+ /**
2046
+ * Decimal places of a Values field's source values, for exact totals
2047
+ * (Tekax B.97) — e.g. `2` for a `decimal(18,2)` column. Not set (the
2048
+ * default), values are added as doubles, as before: thousands of
2049
+ * two-decimal values can sum to 343649.74999999994 instead of 343649.75,
2050
+ * and a one-decimal format then writes "343.649,7" instead of "343.649,8".
2051
+ *
2052
+ * With an integer `0`..`10`, each value is rounded once to that many
2053
+ * decimals (half away from zero) and added as a whole number of units, so
2054
+ * cells, subtotals and grand totals are the double nearest the decimal
2055
+ * result, and exports and the selection statistics read the same value.
2056
+ * Applies to `sum`, `avg` (the sum is exact, then divided by the count),
2057
+ * `min` and `max`; `count`, `distinct` and `custom` are unchanged. The
2058
+ * display modes read the exact totals (a running total or difference is
2059
+ * added in the same units; a percentage divides two exact totals). A row
2060
+ * level `calculateExpression` result is rounded like a source value; a
2061
+ * `calculateSummaryExpression` reads the exact totals and its own result is
2062
+ * not rounded, under a display mode or in the selection statistics either
2063
+ * (nor is an average). Totals are exact while they stay within
2064
+ * `Number.MAX_SAFE_INTEGER / 10^precision` (about 90 trillion at 2); past
2065
+ * that they are added as doubles, as without the setting. A value beyond
2066
+ * about `1.8e308 / 10^precision` overflows to `Infinity` when converted to
2067
+ * units, where a plain double sum would still be finite. Any other value
2068
+ * is ignored and reported through `onError` (or the console). With a `serverSource` the
2069
+ * browser does not add: the request carries `precision` on each value and
2070
+ * the server sums as it likes (`rollupInMemory` honours it).
2071
+ */
2072
+ precision?: number;
1958
2073
  /** Post-aggregation display transformation (e.g. percent of total). */
1959
2074
  summaryDisplayMode?: PivotSummaryDisplayMode;
1960
2075
  /**
@@ -2238,9 +2353,68 @@ interface PivotLayoutState {
2238
2353
  filterArea?: boolean;
2239
2354
  footer?: boolean;
2240
2355
  };
2356
+ /**
2357
+ * How the body draws its rows (Tekax B.96). With no setting, nothing changes: only the rows in view are drawn,
2358
+ * plus a small margin. See {@link PivotVirtualizationOptions}. A view setting: it can change on a live grid, the
2359
+ * body is redrawn and the data is not recomputed. The app's setting: not saved with
2360
+ * the state (`getPersistedState`, `stateStoring`, reports), and a restored state keeps the grid's current value.
2361
+ */
2362
+ virtualization?: PivotVirtualizationOptions;
2363
+ /**
2364
+ * Which field zones draw their title row (Tekax B.104): the filter strip's "FILTER AREA" row (its name, its collapse
2365
+ * button and, collapsed, the count of filtering fields), and the "VALUES" / "COLUMNS" rows of the zones above the
2366
+ * table. Each defaults to `true` (today's look); `false` leaves the zone without its title row: the chips, the
2367
+ * empty zone's hint and the drop target stay where they were, and the zone keeps its name for assistive technology
2368
+ * (`role="group"` with an `aria-label`). Without its row the filter strip has no collapse button: the app collapses
2369
+ * it with `filterAreaCollapsed` (its own button). Collapsed to `filterAreaCollapsedRows: 0` with no title row, the
2370
+ * filter strip has nothing to show and is not drawn at all, not even while a field is dragged; a field reaches it
2371
+ * again once the app opens it. A view setting. The app's setting: not saved with the state (`getPersistedState`,
2372
+ * `stateStoring`, reports), and a restored state keeps the grid's current value.
2373
+ */
2374
+ areaHeaders?: {
2375
+ filter?: boolean;
2376
+ data?: boolean;
2377
+ column?: boolean;
2378
+ };
2241
2379
  /** Chart integration type when rendering in chart mode. */
2242
2380
  chartType?: string;
2243
2381
  }
2382
+ /**
2383
+ * How the pivot's body draws its rows (`layout.virtualization`, Tekax B.96). Every member is optional and the
2384
+ * defaults are today's behaviour. Only ROWS: the data columns are still drawn in a window once there are more than
2385
+ * 40 of them, whatever `mode` says (a pivot can have thousands of columns; drawing every column of every row is the
2386
+ * one thing that cannot be made cheap).
2387
+ */
2388
+ interface PivotVirtualizationOptions {
2389
+ /**
2390
+ * `true` (default): only the rows in view are drawn, plus a margin (`overscanY`). `false`: every row is drawn at
2391
+ * once, so nothing is ever blank while scrolling; keep it to small tables, since a table of tens of thousands of
2392
+ * rows takes seconds to draw and the page freezes meanwhile, again on every expand, collapse, sort or filter.
2393
+ * `'auto'`: every row while there are at most `threshold` of them, a window above that. The count is the rows the
2394
+ * table shows (subtotal rows and the grand-total row included), not the source rows. While every row is drawn and
2395
+ * the columns are windowed (more than 40 data columns), each sideways scroll step redraws every row.
2396
+ */
2397
+ mode?: boolean | 'auto';
2398
+ /**
2399
+ * The most rows `mode: 'auto'` draws at once (default 2000; a value that is not a finite number of 0 or more means
2400
+ * the default). Ignored by the other modes.
2401
+ */
2402
+ threshold?: number;
2403
+ /**
2404
+ * While the rows of the part scrolled into view are not drawn yet (a jump to the end, a fast fling), that part
2405
+ * shows row-height lines instead of a blank area, in the row-header block and the data alike. Default `false`.
2406
+ * The colours are the CSS variables `--pivot-placeholder-row-line` (default `--pivot-border`) and
2407
+ * `--pivot-placeholder-row-bg` (default transparent). No effect while every row is drawn.
2408
+ */
2409
+ placeholderRows?: boolean;
2410
+ /**
2411
+ * Rows drawn beyond the view, above it and below it alike (a whole number, 0 or more; anything else is ignored); a
2412
+ * row only partly in view counts as in view. Not set: the margin of
2413
+ * before, about 5 rows each side in React and 5 above / 10 below in plain JS. A wider margin keeps a short fast
2414
+ * scroll from showing blank rows; every row of it is drawn on each scroll step.
2415
+ */
2416
+ overscanY?: number;
2417
+ }
2244
2418
  interface PivotLayoutProfile {
2245
2419
  id: string;
2246
2420
  name: string;
@@ -2565,8 +2739,14 @@ interface PivotServerRequest {
2565
2739
  /** Column fields, outermost first. */
2566
2740
  columns: PivotServerField[];
2567
2741
  /** Measures, in the order the cells carry them. */
2742
+ /**
2743
+ * The Values fields; `precision` is there when the field sets it (B.97): the
2744
+ * decimal places to add its values at, which a server reading a DECIMAL
2745
+ * column already does.
2746
+ */
2568
2747
  values: Array<PivotServerField & {
2569
2748
  summaryType: PivotSummaryType;
2749
+ precision?: number;
2570
2750
  }>;
2571
2751
  /** Value filters (header filter, filter area): keep or drop the listed values. */
2572
2752
  filters: Array<PivotServerField & {
@@ -3513,6 +3693,50 @@ declare class PivotCellAggregator<TRow> {
3513
3693
  finalize(): Record<string, number>;
3514
3694
  }
3515
3695
 
3696
+ /** The largest `precision` honoured; 10^10 units still leave totals up to ~900,000 exact. */
3697
+ declare const MAX_PRECISION = 10;
3698
+ /**
3699
+ * 10^precision for a field whose `precision` is an integer in
3700
+ * 0..{@link MAX_PRECISION} and whose summary type adds or compares values
3701
+ * (`sum`, `avg`, `min`, `max`); 0 (no scaling) for every other field.
3702
+ */
3703
+ declare function precisionScale(field: {
3704
+ precision?: number;
3705
+ summaryType?: string;
3706
+ }): number;
3707
+ /**
3708
+ * The scale a field's FINISHED cell values are whole numbers of: 10^precision
3709
+ * for `sum`, `min` and `max`, 0 for an average (the exact sum divided by a
3710
+ * count is not a whole number of units) and for a `calculateSummaryExpression`
3711
+ * field (its own result is not rounded). What a step reading cell values
3712
+ * back — a display mode, the selection statistics — may convert them with;
3713
+ * a scale there would round 2.3333 to 2.33.
3714
+ */
3715
+ declare function cellUnitScale(field: {
3716
+ precision?: number;
3717
+ summaryType?: string;
3718
+ isCalculated?: boolean;
3719
+ calculateSummaryExpression?: unknown;
3720
+ formulaType?: string;
3721
+ }): number;
3722
+ /**
3723
+ * A running total that stays exact for values of fields with a precision.
3724
+ * `add(value, scale)` takes each value with its field's scale (0 = none);
3725
+ * while every value has a scale, they are added as integers at the largest
3726
+ * scale seen, so the total is the double nearest the decimal sum. One value
3727
+ * without a scale (or a total past the safe-integer range) makes `value` the
3728
+ * plain double sum, added in the same order as before — what a selection of
3729
+ * fields without `precision` has always shown.
3730
+ */
3731
+ declare class ExactSum {
3732
+ private plain;
3733
+ private scaled;
3734
+ private scale;
3735
+ private exact;
3736
+ add(value: number, scale: number): void;
3737
+ get value(): number;
3738
+ }
3739
+
3516
3740
  declare class FastTrie {
3517
3741
  size: number;
3518
3742
  nodeToParent: Int32Array;
@@ -3753,6 +3977,13 @@ declare const FILTER_AREA_PADDING = 8;
3753
3977
  * header alone.
3754
3978
  */
3755
3979
  declare function filterAreaRows(layout: Pick<PivotLayoutState, 'filterAreaMaxRows' | 'filterAreaCollapsed' | 'filterAreaCollapsedRows'>): number | null;
3980
+ /** Whether a field zone draws its title row (`layout.areaHeaders`, B.104). Default: yes. */
3981
+ declare function areaHeaderShown(layout: Pick<PivotLayoutState, 'areaHeaders'> | undefined, area: 'filter' | 'data' | 'column'): boolean;
3982
+ /**
3983
+ * The filter strip has nothing to draw (B.104 with B.63): no title row, and collapsed to 0 rows of chips. The renderers
3984
+ * then leave the whole strip out (its padding and line would be an empty band).
3985
+ */
3986
+ declare function filterStripEmpty(layout: Pick<PivotLayoutState, 'areaHeaders' | 'filterAreaMaxRows' | 'filterAreaCollapsed' | 'filterAreaCollapsedRows'>): boolean;
3756
3987
  /** The strip content's max height in px for `rows` rows of `chipHeight` px chips. */
3757
3988
  declare function filterAreaMaxHeight(rows: number, chipHeight: number): number;
3758
3989
  /** How many filter-area fields filter something (shown on the collapsed strip). */
@@ -3811,6 +4042,61 @@ interface FocusKeeperController {
3811
4042
  }
3812
4043
  declare function keepFocusAcross(root: HTMLElement | null | undefined, controller: FocusKeeperController, run: () => boolean): boolean;
3813
4044
 
4045
+ /** Why a copy did not reach the clipboard (B.99). */
4046
+ type PivotCopyErrorReason = 'insecure-context' | 'permission-denied' | 'empty-selection' | 'unsupported';
4047
+ /** What a successful copy wrote (B.99). */
4048
+ interface PivotCopyInfo {
4049
+ /** Tab-separated rows, one line each: what a spreadsheet pastes. */
4050
+ text: string;
4051
+ /** The same cells as an HTML table. */
4052
+ html: string;
4053
+ rows: number;
4054
+ cols: number;
4055
+ }
4056
+ /** The error `onCopyError` is given; `reason` says why. */
4057
+ interface PivotCopyError extends Error {
4058
+ reason: PivotCopyErrorReason;
4059
+ }
4060
+ declare function pivotCopyError(reason: PivotCopyErrorReason, cause?: unknown): PivotCopyError;
4061
+ /**
4062
+ * The text a painted cell copies: what it reads, without the decoration a screen reader skips too (an
4063
+ * `aria-hidden` expand/collapse glyph, an icon). Whitespace collapsed. `textContent`-based, so jsdom agrees.
4064
+ */
4065
+ declare function cellCopyText(cell: Element): string;
4066
+ /** The text and the HTML table of a rectangle of cell texts. A tab or line break inside a cell becomes a space. */
4067
+ declare function copyPayload(table: string[][]): PivotCopyInfo;
4068
+ /**
4069
+ * Whether a Ctrl/Cmd+C is the pivot's to answer (B.99). Not while a text field has the focus, not when the user
4070
+ * has selected text of the page outside the pivot, not when another component (outside `root`) has the focus.
4071
+ * With nothing focused (the page itself) it is, as the copy has always worked after the focus left the grid.
4072
+ */
4073
+ declare function pivotOwnsCopy(root: Element | null, doc?: Document): boolean;
4074
+ /** Writes the payload into a `copy` event's clipboardData (works on plain HTTP). False when the event has none. */
4075
+ declare function writeCopyEvent(e: ClipboardEvent, payload: PivotCopyInfo): boolean;
4076
+ /**
4077
+ * Writes the payload when no `copy` event came to carry it: `execCommand('copy')` (plain HTTP too, inside the
4078
+ * user's gesture), then `navigator.clipboard` where the page is a secure context. Rejects with a PivotCopyError.
4079
+ */
4080
+ declare function writeClipboardFallback(payload: PivotCopyInfo, doc?: Document): Promise<void>;
4081
+ interface CopyBindingOptions {
4082
+ /** The pivot's root element: the focus must be in it (or nowhere) for the copy to be the pivot's. */
4083
+ root: () => Element | null;
4084
+ /** The selected rectangle's cell texts, or null with nothing selected. Called once per copy. */
4085
+ table: () => string[][] | null;
4086
+ /** Whether this grid is the one the user last selected in (two grids on a page). */
4087
+ isActive: () => boolean;
4088
+ onCopy?: (info: PivotCopyInfo) => void;
4089
+ onCopyError?: (error: PivotCopyError, info: {
4090
+ reason: PivotCopyErrorReason;
4091
+ }) => void;
4092
+ }
4093
+ /**
4094
+ * Ctrl/Cmd+C for one grid (B.99): the keydown is left alone so the browser fires its `copy` event, which writes
4095
+ * TSV + an HTML table into `clipboardData`. A browser that fires no copy event (no text selected, some Safari
4096
+ * versions) gets the fallback right after the key. Returns the unbind function.
4097
+ */
4098
+ declare function bindPivotCopy(opts: CopyBindingOptions, doc?: Document): () => void;
4099
+
3814
4100
  /**
3815
4101
  * Below this height (CSS px) the header parts of a narrow pivot take one chip row each. The full-size parts
3816
4102
  * (30% strip, 88px zones, two header rows) leave the data under 200px below about 490px.
@@ -3819,6 +4105,30 @@ declare const SHORT_PIVOT_HEIGHT = 480;
3819
4105
  /** Keep `data-pivot-short` on `wrapper` while it is shorter than SHORT_PIVOT_HEIGHT. Returns the unbind function. */
3820
4106
  declare function watchShortPivot(wrapper: HTMLElement): () => void;
3821
4107
 
4108
+ /** Set on the element whose rows follow `--pivot-row-height`; the stylesheet's line heights key on it. */
4109
+ declare const PIVOT_CUSTOM_ROW_HEIGHT_CLASS = "kanuni-pivot-custom-row-height";
4110
+ /** The rounded row height the stylesheet reads, written next to the class. */
4111
+ declare const PIVOT_ROW_HEIGHT_RESOLVED_VAR = "--pivot-row-h";
4112
+ /** Smallest and largest `--pivot-row-height` honoured, in CSS px. */
4113
+ declare const PIVOT_ROW_HEIGHT_RANGE: {
4114
+ readonly min: 16;
4115
+ readonly max: 200;
4116
+ };
4117
+ /**
4118
+ * The row height `--pivot-row-height` gives at `el` in whole CSS px, or null when it is unset or not a length
4119
+ * within {@link PIVOT_ROW_HEIGHT_RANGE}. A px value is read directly; another unit (`rem`, `em`, `calc()`) is
4120
+ * resolved through a hidden probe's computed height.
4121
+ */
4122
+ declare function readPivotRowHeightVar(el: Element | null): number | null;
4123
+ /** Puts (or, for null, removes) the class and the rounded `--pivot-row-h` on `el`. */
4124
+ declare function applyPivotRowHeightVar(el: HTMLElement, px: number | null): void;
4125
+ /**
4126
+ * Calls `onChange` with {@link readPivotRowHeightVar}(`el`) now and whenever it changes: on a resize of `el`
4127
+ * and on a change of the class, style or data-theme attribute of `root` (the pivot's root) or of `el`.
4128
+ * Returns the stop function.
4129
+ */
4130
+ declare function watchPivotRowHeightVar(el: HTMLElement, root: HTMLElement | null, onChange: (px: number | null) => void): () => void;
4131
+
3822
4132
  interface PopupViewport {
3823
4133
  left: number;
3824
4134
  top: number;
@@ -3865,6 +4175,21 @@ interface ViewOptionsMenuItems {
3865
4175
  }
3866
4176
  declare function viewOptionsMenuItems(layout: Pick<PivotLayoutState, 'viewOptionsMenu'> | undefined): ViewOptionsMenuItems;
3867
4177
 
4178
+ /** The default `virtualization.threshold`: rows drawn at once under `mode: 'auto'`. */
4179
+ declare const PIVOT_VIRTUALIZATION_THRESHOLD = 2000;
4180
+ interface PivotRowVirtualization {
4181
+ /** Only the rows in view (plus a margin) are drawn. `false`: every row is. */
4182
+ windowed: boolean;
4183
+ /** Rows drawn beyond the view on each side; `undefined` keeps the renderer's own margin. */
4184
+ overscanY: number | undefined;
4185
+ /** Fill the not-yet-drawn part of a windowed body with placeholder rows. */
4186
+ placeholderRows: boolean;
4187
+ }
4188
+ /** What `layout.virtualization` means for a body of `rowCount` rows. */
4189
+ declare function pivotRowVirtualization(layout: Pick<PivotLayoutState, 'virtualization'> | undefined, rowCount: number): PivotRowVirtualization;
4190
+ /** The class of the cells that stand for rows not drawn yet (`placeholderRows`). */
4191
+ declare const PLACEHOLDER_ROWS_CLASS = "kanuni-pivot-placeholder-rows";
4192
+
3868
4193
  /** Keep the size a user dragged this field's popup to; the next open starts there. */
3869
4194
  declare function rememberFilterPopupSize(gridId: string | undefined, fieldId: string, width: number, height: number): void;
3870
4195
  /** The kept size, or undefined. */
@@ -3915,6 +4240,14 @@ declare function toCssPixels(distance: number, el: HTMLElement): number;
3915
4240
  * width. Cells the virtual window has not rendered are not measured. One measurement per call, not per cell.
3916
4241
  */
3917
4242
  declare function measureFitWidth(cells: Element[], root: HTMLElement): number;
4243
+ /**
4244
+ * B.105 review: the row-header column a drag is over when it crosses a collapsed group's label, which spans the
4245
+ * columns right of it (`colspan`). `closest('td')` gives the label's own column, so a rectangle dragged from an open
4246
+ * row's second column over it jumped to the first. The spanning cell carries one resize grip per covered column, each
4247
+ * on that column's end edge: the pointer's column is the first whose edge it has not passed (RTL: mirrored). Without
4248
+ * a layout to read (grips not drawn or zero-sized), `prevC` held inside the span: the drag keeps its column.
4249
+ */
4250
+ declare function spannedColumnAt(td: Element, clientX: number, prevC: number): number;
3918
4251
 
3919
4252
  interface PivotSummaryColumn {
3920
4253
  /** The field's id — the key of this column in every row. */
@@ -4325,4 +4658,4 @@ declare function rollupInMemory<TRow>(rows: readonly TRow[], request: PivotServe
4325
4658
  /** Every value of a field in rows held in memory — the reference `loadFieldValues`. */
4326
4659
  declare function fieldValuesInMemory<TRow>(rows: readonly TRow[], field: PivotServerField): unknown[];
4327
4660
 
4328
- export { type AdvancedExportRequest, type AdvancedExporter, BLANK_MEMBER, CHART_LEGEND_POSITIONS, CHART_PALETTE_NAMES, CHIP_AUTO_MAX_WIDTH, COLLAPSED_PREFIX, type CalculatedFieldTextKey, type CellClickEvent, type CellPath, type CellPreparedEvent, 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 CustomSummaryOptions, DEFAULT_DATA_COLUMN_WIDTH, DEFAULT_ROW_HEADER_WIDTH, type DateFormatContext, DateFormatter, type DateGranularity, type DimensionFieldInfo, type DrillDownTextKey, type DropIntent, EXCEL_MAX_COLUMN_WIDTH, EXCEL_MIN_COLUMN_WIDTH, EXCEL_WIDTH_SAMPLE_ROWS, ExcelWidthTracker, type ExportFormat, type ExportOptions, ExportStreamController, type ExportingEvent, FILTER_AREA_PADDING, FILTER_AREA_ROW_GAP, FastTrie, type FieldDistinctEntry, type FieldMoveEvent, type FilterCondition, type FilterGroup, type FilterOperator, type FilterPopupBox, type FlatCellMatrix, FlatPivotEngine, type FlatRow, type FloatingFrame, type FrameRect, type FrameSize, type FunnelStage, type HeaderFilterGroup, type HeaderFilterOption, type HeaderFilterState, type HeaderFilterWrite, type HistogramBin, type LargeExportInfo, MAX_C, type MarkTone, PIVOT_AI_FEATURES, PIVOT_LICENSE_TEXT, PIVOT_STATE_VERSION, type PersistedPivotFilters, type PersistedPivotState, 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 PivotChipView, 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 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, type PivotStateSession, PivotStateStore, type PivotStateStoringConfig, type PivotSummaryColumn, type PivotSummaryDisplayMode, type PivotSummaryTable, type PivotSummaryTableOptions, type PivotSummaryType, type PivotTheme, type PivotToolbarConfig, type PivotTransactionResult, type PivotValue, type PivotValueFilter, type PopupPlacement, type PopupViewport, type PrefilterConditionSpec, type PrefilterGroupSpec, ROW_HEADER_MAX_PINNED_FRACTION, ROW_HEADER_MIN_COL_WIDTH, ROW_HEADER_MIN_DATA_STRIP, type ReportStatePart, type RowHeaderLayout, SHAPE_CHART_TYPES, SHORT_PIVOT_HEIGHT, type ShapeChartInput, type ShapeChartType, type StackedSegment, type TreemapCell, type TrendShape, type ValueRange, type ViewOptionsMenuItems, type WaterfallStep, type WorkerComputeRequest, type WorkerFilterRequest, type WorkerFilterSpec, type WorkerInitRequest, type WorkerResponse, type WorkerTransactionRequest, type XYPair, type XYPairInput, applyPivotAiState, ar, attachFloatingFrame, bindPivotScrollMemory, blanksTextOf, buildCellLookup, buildColPathsList, buildColumnHeaders, buildEngineResult, buildPivotAOA, buildRowLabelCells, calculatedFieldText, cellHash, cellHashCol, cellHashRow, centredFrame, chartCategoryKey, chartKeyText, chartPalette, chartWindowFrame, clearFilterPopupSizes, clearFormatCache, collapsedKey, collapsedKeyPath, collatorFor, columnSlotOptions, compileSafeFormula, computeFieldRanges, computePivotMatrixAsync, computeRowHeaderWidths, computedFields, conditionRuleToExcelStyle, countFilteredFields, cssColorToRgb, cssZoomOf, de, defaultPivotLayout, destroyEngineWorker, diffPivotChartState, drillDownText, en, es, escapeXmlText, excelTextLength, excelValueLength, executePostAggregationPhase, executeSummaryDisplayModesPhase, exportPivotData, extractGroupValue, fieldNeedsRange, fieldValuesInMemory, filterAreaMaxHeight, filterAreaRows, filterEmptySummaryTree, filterPivotEngineAsync, filterPopupBox, filterPopupLimits, filterRecords, filterRecordsAsync, flattenExportRows, flattenRowTree, flattenRowTreeTabular, flattenRowTreeTree, formatCellValue, formatCellValueCached, formatDimensionValue, formatHeaderFilterLabel, formatHeaderValue, formattedGroupKey, fr, funnelMarks, funnelStages, getAdvancedExporter, getCellVal, getFieldDistinctValues, getPivotAiSchema, getPivotAiState, getRecordsForCells, getSummaryTable, getVisibleColLeaves, getVisibleColSlots, getVisibleLeafCount, getVisibleMaxDepth, grandTotalHeaderShown, grandTotalShown, groupHeaderFilterOptions, groupKeyOf, groupsByFormat, headerFilterGroupTick, headerFilterShown, headerFilterWrite, heatColor, heatTextColor, heatmapMarks, histogramBins, histogramMarks, initPivotEngineAsync, intlFormatToExcelNumFmt, invertRowHeaderWidth, isBlankMember, isCollapsedKey, isKeyExpanded, it, ja, keepFieldGroups, keepFocusAcross, ko, logAxisTicks, measureFitWidth, mergePersistedState, nextChartWindowId, nextLiveText, paintedFontWeight, pairSeriesForXY, parseColor, pathKey, pathParts, percentAxisTicks, percentModeExcelNumFmt, percentModeText, pivotChangeAnnouncement, pivotChipView, pivotDensityClass, pivotLicenseText, pivotRowHeight, pivotRowTrend, pivotSchemeTheme, pivotServerSource, placePopup, popupViewport, pt, rangeBarMarks, rangeRatio, readChartFormat, readFrameRect, readPivotChartState, recalledFilterPopupSize, reconfigurePivotEngineAsync, registerAdvancedExporter, rememberFilterPopupSize, resizeLineX, resolveChartPalette, resolveChartStyle, resolveColPath, resolveColumnWidthDefaults, resolveConditionalVisual, rollupInMemory, rowHeaderGroupEnd, rowHeadersUnpinned, ru, scaleColor, serverRequestFor, setActiveEngineGrid, setHeaderFilterGroups, setKeysIn, shownFields, sortPivotTree, splitPersistedState, squarify, stackSeries, subtotalFor, summaryTypeLabel, sunburstMarks, testSafeFormula, toCssPixels, toggleHeaderFilterGroup, toggleKeyIn, tr, treemapMarks, trendColumnPaths, trendShape, viewOptionsMenuItems, watchShortPivot, waterfallDomain, waterfallMarks, waterfallSteps, windowStartFor, withoutCollapsed, zhCN };
4661
+ export { type AdvancedExportRequest, type AdvancedExporter, BLANK_MEMBER, CHART_LEGEND_POSITIONS, CHART_PALETTE_NAMES, CHIP_AUTO_MAX_WIDTH, COLLAPSED_PREFIX, type CalculatedFieldTextKey, type CellClickEvent, type CellPath, type CellPreparedEvent, 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 CopyBindingOptions, type CustomSummaryOptions, DEFAULT_DATA_COLUMN_WIDTH, DEFAULT_ROW_HEADER_WIDTH, type DateFormatContext, DateFormatter, type DateGranularity, type DimensionFieldInfo, type DrillDownTextKey, type DropIntent, EXCEL_MAX_COLUMN_WIDTH, EXCEL_MIN_COLUMN_WIDTH, EXCEL_WIDTH_SAMPLE_ROWS, ExactSum, ExcelWidthTracker, type ExportFormat, type ExportOptions, ExportStreamController, type ExportingEvent, FILTER_AREA_PADDING, FILTER_AREA_ROW_GAP, FastTrie, type FieldDistinctEntry, type FieldMoveEvent, type FilterCondition, type FilterGroup, type FilterOperator, type FilterPopupBox, type FlatCellMatrix, FlatPivotEngine, type FlatRow, type FloatingFrame, type FrameRect, type FrameSize, type FunnelStage, type HeaderFilterGroup, type HeaderFilterOption, type HeaderFilterState, type HeaderFilterWrite, type HistogramBin, type LargeExportInfo, MAX_C, MAX_PRECISION, type MarkTone, PIVOT_AI_FEATURES, PIVOT_CUSTOM_ROW_HEIGHT_CLASS, PIVOT_LICENSE_TEXT, PIVOT_ROW_HEIGHT_RANGE, PIVOT_ROW_HEIGHT_RESOLVED_VAR, PIVOT_STATE_VERSION, PIVOT_VIRTUALIZATION_THRESHOLD, PLACEHOLDER_ROWS_CLASS, type PersistedPivotFilters, type PersistedPivotState, 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 PivotChipView, type PivotColumnWidthDefaults, type PivotConditionRule, PivotController, type PivotControllerCallbacks, type PivotControllerEvents, type PivotControllerOptions, type PivotControllerState, type PivotCopyError, type PivotCopyErrorReason, type PivotCopyInfo, 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 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 PivotRowVirtualization, 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, type PivotStateSession, PivotStateStore, type PivotStateStoringConfig, type PivotSummaryColumn, type PivotSummaryDisplayMode, type PivotSummaryTable, type PivotSummaryTableOptions, type PivotSummaryType, type PivotTheme, type PivotToolbarConfig, type PivotTransactionResult, type PivotValue, type PivotValueFilter, type PivotVirtualizationOptions, type PopupPlacement, type PopupViewport, type PrefilterConditionSpec, type PrefilterGroupSpec, ROW_HEADER_MAX_PINNED_FRACTION, ROW_HEADER_MIN_COL_WIDTH, ROW_HEADER_MIN_DATA_STRIP, type ReportStatePart, type RowHeaderLayout, type RowHeaderNavRow, SHAPE_CHART_TYPES, SHORT_PIVOT_HEIGHT, type ShapeChartInput, type ShapeChartType, type StackedSegment, type TreemapCell, type TrendShape, type ValueRange, type ViewOptionsMenuItems, type WaterfallStep, type WorkerComputeRequest, type WorkerFilterRequest, type WorkerFilterSpec, type WorkerInitRequest, type WorkerResponse, type WorkerTransactionRequest, type XYPair, type XYPairInput, applyPivotAiState, applyPivotRowHeightVar, ar, areaHeaderShown, attachFloatingFrame, bindPivotCopy, bindPivotScrollMemory, blanksTextOf, buildCellLookup, buildColPathsList, buildColumnHeaders, buildEngineResult, buildPivotAOA, buildRowLabelCells, calculatedFieldText, cellCopyText, cellHash, cellHashCol, cellHashRow, cellUnitScale, centredFrame, chartCategoryKey, chartKeyText, chartPalette, chartWindowFrame, clearFilterPopupSizes, clearFormatCache, collapsedKey, collapsedKeyPath, collatorFor, columnSlotOptions, compileSafeFormula, computeFieldRanges, computePivotMatrixAsync, computeRowHeaderWidths, computedFields, conditionRuleToExcelStyle, copyPayload, countFilteredFields, cssColorToRgb, cssZoomOf, de, defaultPivotLayout, destroyEngineWorker, diffPivotChartState, drillDownText, en, es, escapeXmlText, excelTextLength, excelValueLength, executePostAggregationPhase, executeSummaryDisplayModesPhase, exportPivotData, extractGroupValue, fieldNeedsRange, fieldValuesInMemory, filterAreaMaxHeight, filterAreaRows, filterEmptySummaryTree, filterPivotEngineAsync, filterPopupBox, filterPopupLimits, filterRecords, filterRecordsAsync, filterStripEmpty, flattenExportRows, flattenRowTree, flattenRowTreeTabular, flattenRowTreeTree, formatCellValue, formatCellValueCached, formatDimensionValue, formatHeaderFilterLabel, formatHeaderValue, formattedGroupKey, fr, funnelMarks, funnelStages, getAdvancedExporter, getCellVal, getFieldDistinctValues, getPivotAiSchema, getPivotAiState, getRecordsForCells, getSummaryTable, getVisibleColLeaves, getVisibleColSlots, getVisibleLeafCount, getVisibleMaxDepth, grandTotalHeaderShown, grandTotalShown, groupHeaderFilterOptions, groupKeyOf, groupsByFormat, headerFilterGroupTick, headerFilterShown, headerFilterWrite, heatColor, heatTextColor, heatmapMarks, histogramBins, histogramMarks, initPivotEngineAsync, intlFormatToExcelNumFmt, invertRowHeaderWidth, isBlankMember, isCollapsedKey, isKeyExpanded, isRowHeaderContinuation, it, ja, keepFieldGroups, keepFocusAcross, ko, logAxisTicks, measureFitWidth, mergePersistedState, nextChartWindowId, nextLiveText, paintedFontWeight, pairSeriesForXY, parseColor, pathKey, pathParts, percentAxisTicks, percentModeExcelNumFmt, percentModeText, pivotChangeAnnouncement, pivotChipView, pivotCopyError, pivotDensityClass, pivotFocusMove, pivotLicenseText, pivotOwnsCopy, pivotRowHeight, pivotRowTrend, pivotRowVirtualization, pivotSchemeTheme, pivotServerSource, placePopup, popupViewport, precisionScale, pt, rangeBarMarks, rangeRatio, readChartFormat, readFrameRect, readPivotChartState, readPivotRowHeightVar, recalledFilterPopupSize, reconfigurePivotEngineAsync, registerAdvancedExporter, rememberFilterPopupSize, resizeLineX, resolveChartPalette, resolveChartStyle, resolveColPath, resolveColumnWidthDefaults, resolveConditionalVisual, rollupInMemory, rowHeaderCellAt, rowHeaderCellLookup, rowHeaderGroupEnd, rowHeaderGroupLastRow, rowHeaderLabelSpan, rowHeaderSelectionRows, rowHeadersUnpinned, ru, scaleColor, serverRequestFor, setActiveEngineGrid, setHeaderFilterGroups, setKeysIn, shownFields, sortPivotTree, spannedColumnAt, splitPersistedState, squarify, stackSeries, subtotalFor, summaryTypeLabel, sunburstMarks, testSafeFormula, toCssPixels, toggleHeaderFilterGroup, toggleKeyIn, tr, treemapMarks, trendColumnPaths, trendShape, viewOptionsMenuItems, watchPivotRowHeightVar, watchShortPivot, waterfallDomain, waterfallMarks, waterfallSteps, windowStartFor, withoutCollapsed, writeClipboardFallback, writeCopyEvent, zhCN };