@ex-grid/pivot 0.0.0-stage → 0.2.0-beta.3
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/LICENSE +21 -0
- package/README.md +39 -2
- package/dist/index.d.ts +814 -0
- package/dist/index.js +5870 -0
- package/dist/index.js.map +7 -0
- package/ex-pivot.min.css +4 -0
- package/ex-pivot.min.css.map +1 -0
- package/package.json +32 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExPivot's Script Core (ADR-0370, section 1): Excel's PivotTable drawn by ExGrid as that grid's Consumer,
|
|
3
|
+
* with its Field List, in TypeScript and free of any UI framework. The report is computed by
|
|
4
|
+
* `@ex-grid/pivot-engine` and drawn by `@ex-grid/core`; a Framework Adapter mounts it.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { CellTextMetrics } from '@ex-grid/core';
|
|
10
|
+
import type { GridChrome } from '@ex-grid/core';
|
|
11
|
+
import { GridDensity } from '@ex-grid/core';
|
|
12
|
+
import { GridHandle } from '@ex-grid/core';
|
|
13
|
+
import { GridPresentationDefaults } from '@ex-grid/core';
|
|
14
|
+
import { GridSelection } from '@ex-grid/core';
|
|
15
|
+
import type { PivotAggregation } from '@ex-grid/pivot-engine';
|
|
16
|
+
import type { PivotArea } from '@ex-grid/pivot-engine';
|
|
17
|
+
import { PivotDetailPage } from '@ex-grid/pivot-engine';
|
|
18
|
+
import { PivotDetailsQuery } from '@ex-grid/pivot-engine';
|
|
19
|
+
import type { PivotEntry } from '@ex-grid/pivot-engine';
|
|
20
|
+
import { PivotField } from '@ex-grid/pivot-engine';
|
|
21
|
+
import { PivotFieldItem } from '@ex-grid/pivot-engine';
|
|
22
|
+
import type { PivotItemKey } from '@ex-grid/pivot-engine';
|
|
23
|
+
import { PivotLabel } from '@ex-grid/pivot-engine';
|
|
24
|
+
import { PivotLayout } from '@ex-grid/pivot-engine';
|
|
25
|
+
import type { PivotShowValuesAs } from '@ex-grid/pivot-engine';
|
|
26
|
+
import { PivotSlicing } from '@ex-grid/pivot-engine';
|
|
27
|
+
import { PivotSource } from '@ex-grid/pivot-engine';
|
|
28
|
+
import { SelectionSummary } from '@ex-grid/core';
|
|
29
|
+
import { SummaryFigure } from '@ex-grid/core';
|
|
30
|
+
import { ViewportSize } from '@ex-grid/core';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The first of `languages`, in the browser's order, that the pivot writes in, matched whole and without
|
|
34
|
+
* regard to case. A list with none it holds throws a `RangeError` that says to pass `locale`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function browserPivotLocale(languages: readonly string[]): string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Draws an ExPivot into `element`, which becomes its root (ADR-0370 section 1): the report, drawn by ExGrid,
|
|
40
|
+
* beside the Field List. The pivot owns everything inside it; a Framework Adapter renders the element and
|
|
41
|
+
* hands the pivot its props, and nothing here assumes React's lifecycle or Blazor's.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createPivot(element: HTMLElement, options: PivotViewOptions): PivotHandle;
|
|
44
|
+
|
|
45
|
+
/** What one cell of the report stands for (ADR-0340): its row's Items and, for a value cell, its column's. */
|
|
46
|
+
export declare interface PivotCellItems {
|
|
47
|
+
/** The Items its row's path names, outermost first. */
|
|
48
|
+
readonly row: readonly PivotFieldItem[];
|
|
49
|
+
/** The Items its column's path names, outermost first; none for a label cell. */
|
|
50
|
+
readonly column: readonly PivotFieldItem[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A choice a panel offers: its value, its words, and whether it may be chosen. */
|
|
54
|
+
export declare interface PivotChoice<T> {
|
|
55
|
+
/** The choice. */
|
|
56
|
+
readonly value: T;
|
|
57
|
+
/** What it is called. */
|
|
58
|
+
readonly label: string;
|
|
59
|
+
/** Whether it may be chosen: an Aggregation the Pivot Source does not answer is offered, and not available
|
|
60
|
+
* (ADR-0066). */
|
|
61
|
+
readonly enabled: boolean;
|
|
62
|
+
/** Why it may not be chosen, in words; absent while it may. */
|
|
63
|
+
readonly reason?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The Chrome slots a pivot takes (ADR-0061, ADR-0390): the parts a Wrapper draws, each in place of the built-in
|
|
68
|
+
* markup's. A slot not given is the built-in markup's. A slot is read when its part opens: a part standing keeps the
|
|
69
|
+
* slot it opened with.
|
|
70
|
+
*/
|
|
71
|
+
export declare interface PivotChrome {
|
|
72
|
+
/** The stylesheets this Chrome brings (ADR-0123): the pivot's root renders a notice for each beside its own, which
|
|
73
|
+
* only another version's stylesheet shows. The report grid's Chrome declares its own. None where not given. */
|
|
74
|
+
readonly stylesheets?: readonly PivotChromeStylesheet[];
|
|
75
|
+
/** The report grid's Chrome, and Show Details' grids', so one Chrome dresses the pivot and the grids it draws. The
|
|
76
|
+
* Context Menu's commands are worded by the pivot. */
|
|
77
|
+
readonly grid?: GridChrome<unknown>;
|
|
78
|
+
/** A placed field's menu and the Layout menu. */
|
|
79
|
+
readonly menu?: PivotChromeSlot<PivotMenuSlotContext>;
|
|
80
|
+
/** Filter…, under a field's entry or a report filter's button. */
|
|
81
|
+
readonly itemFilter?: PivotChromeSlot<PivotItemFilterSlotContext>;
|
|
82
|
+
/** Field Settings… of a row or column field. */
|
|
83
|
+
readonly fieldSettings?: PivotChromeSlot<PivotFieldSettingsSlotContext>;
|
|
84
|
+
/** Value Field Settings…. */
|
|
85
|
+
readonly valueFieldSettings?: PivotChromeSlot<PivotValueFieldSettingsSlotContext>;
|
|
86
|
+
/** The Pivot Toolbar above the report. */
|
|
87
|
+
readonly toolbar?: PivotChromeSlot<PivotToolbarSlotContext>;
|
|
88
|
+
/** The report filter band, on the Pivot Toolbar's left. */
|
|
89
|
+
readonly reportFilters?: PivotChromeSlot<PivotReportFiltersSlotContext>;
|
|
90
|
+
/** The Stale Report's notice, under the Pivot Toolbar. */
|
|
91
|
+
readonly staleReport?: PivotChromeSlot<PivotStaleReportSlotContext>;
|
|
92
|
+
/** The Field List: Excel's PivotTable Fields pane. Its slot draws no box of its own, so the contents fill the
|
|
93
|
+
* Field List's height (`height: 100%`). */
|
|
94
|
+
readonly fieldList?: PivotChromeSlot<PivotFieldListSlotContext>;
|
|
95
|
+
/** The sheet tabs at the report's foot, while Show Details' records stand in a tab. */
|
|
96
|
+
readonly detailsTabs?: PivotChromeSlot<PivotDetailsTabsSlotContext>;
|
|
97
|
+
/** What the Show Details dialog draws inside its frame, a flex column; the slot draws no box of its own. */
|
|
98
|
+
readonly detailsDialog?: PivotChromeSlot<PivotDetailsDialogSlotContext>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A Chrome slot's mount function (ADR-0350 section 9): it draws the part into `slot`, the element the pivot made for
|
|
103
|
+
* it, from `context`, and answers the function that takes what it drew away. The pivot calls that cleanup before the
|
|
104
|
+
* slot goes, and before it mounts again on the same slot with a new context.
|
|
105
|
+
*/
|
|
106
|
+
export declare type PivotChromeSlot<Context> = (slot: HTMLElement, context: Context) => () => void;
|
|
107
|
+
|
|
108
|
+
/** A stylesheet a Chrome brings (ADR-0123), as its notice names it: a Wrapper has no root of its own (ADR-0062), so
|
|
109
|
+
* its Chrome declares the stylesheets it brings, and the pivot's root renders a notice for each beside its own. */
|
|
110
|
+
export declare interface PivotChromeStylesheet {
|
|
111
|
+
/** The stylesheet's source file name, as the rules at the end of the shipped stylesheet name it: `mud-ex-pivot.css`. */
|
|
112
|
+
readonly name: string;
|
|
113
|
+
/** The SHA-256 of that source, as lower-case hex: the stamp the stylesheet the Chrome was built with hides its
|
|
114
|
+
* notice for. */
|
|
115
|
+
readonly stamp: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** One Item of a cell's path: its field's caption and its label, as the report shows them. */
|
|
119
|
+
export declare interface PivotDetailItem {
|
|
120
|
+
/** The caption of the Item's field. */
|
|
121
|
+
readonly field: string;
|
|
122
|
+
/** The Item's label. */
|
|
123
|
+
readonly item: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** What the Show Details dialog's contents are handed (ADR-0059): its title, the anchor its records stand in and
|
|
127
|
+
* Close, inside the pivot's modal frame, which keeps the backdrop and Escape. Close takes the keyboard as the dialog
|
|
128
|
+
* opens, and the report's grid takes it back however it closes. */
|
|
129
|
+
export declare interface PivotDetailsDialogSlotContext extends PivotStandingSlotContext<PivotDetailsDialogView> {
|
|
130
|
+
/** Close pressed. */
|
|
131
|
+
readonly close: () => void;
|
|
132
|
+
/** Hands in Close. */
|
|
133
|
+
readonly control: (name: 'close') => PivotPartRef;
|
|
134
|
+
/** Hands in the element the records stand in: their box takes the room the dialog gives it. */
|
|
135
|
+
readonly anchor: (name: 'records') => PivotPartRef;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** What the Show Details dialog shows now (ADR-0059). */
|
|
139
|
+
export declare interface PivotDetailsDialogView {
|
|
140
|
+
/** The cell the records are behind, which names the dialog. */
|
|
141
|
+
readonly title: string;
|
|
142
|
+
/** Close's words. */
|
|
143
|
+
readonly closeLabel: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** What the sheet tabs' contents are handed (ADR-0059), at the report's foot while a Show Details sheet stands. The
|
|
147
|
+
* selected sheet's records are the pivot's, in a panel of its own over the report; the tab that opens takes the
|
|
148
|
+
* keyboard, and so does the one selected once a tab holding it closes. */
|
|
149
|
+
export declare interface PivotDetailsTabsSlotContext extends PivotStandingSlotContext<PivotDetailsTabsView> {
|
|
150
|
+
/** A tab pressed, by its `key`: its sheet is selected. */
|
|
151
|
+
readonly select: (key: string) => void;
|
|
152
|
+
/** A details tab's close pressed, by its `key`: Excel's next sheet is selected, or the report. */
|
|
153
|
+
readonly close: (key: string) => void;
|
|
154
|
+
/** Hands in the control of the tab of `key`. */
|
|
155
|
+
readonly control: (key: string) => PivotPartRef;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** What the sheet tabs show now (ADR-0059). */
|
|
159
|
+
export declare interface PivotDetailsTabsView {
|
|
160
|
+
/** The tab list's name. */
|
|
161
|
+
readonly name: string;
|
|
162
|
+
/** The report's tab, then each Show Details sheet's, in the order they opened. */
|
|
163
|
+
readonly tabs: readonly PivotDetailsTabView[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** A sheet's tab at the report's foot (ADR-0059): the report's own, first, or a Show Details sheet's. */
|
|
167
|
+
export declare interface PivotDetailsTabView {
|
|
168
|
+
/** The name the tab's control is handed in by, and `select` and `close` are handed. */
|
|
169
|
+
readonly key: string;
|
|
170
|
+
/** What the tab reads: the report's own words, or the cell the records are behind. */
|
|
171
|
+
readonly title: string;
|
|
172
|
+
/** Whether it is the selected sheet: a details sheet's records then cover the report. */
|
|
173
|
+
readonly selected: boolean;
|
|
174
|
+
/** The id of the panel its records stand in, for the control's `aria-controls`; absent on the report's tab. */
|
|
175
|
+
readonly panelId?: string;
|
|
176
|
+
/** Its close button's words, said as "Close …"; absent on the report's tab, which does not close. */
|
|
177
|
+
readonly closeLabel?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Where the pivot shows the records when the Consumer does not take them: a tab at the report's foot, or a dialog. */
|
|
181
|
+
export declare type PivotDetailsView = 'tab' | 'dialog';
|
|
182
|
+
|
|
183
|
+
/** What is dragged in the Field List: a declared field from the list of fields, or a placed entry of an Area. */
|
|
184
|
+
export declare type PivotDragSubject = {
|
|
185
|
+
readonly field: string;
|
|
186
|
+
} | {
|
|
187
|
+
readonly entry: PivotEntry;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/** The Pivot Source failed to answer the report's newest question (ADR-0067). */
|
|
191
|
+
export declare interface PivotFailedEvent {
|
|
192
|
+
/** What the source threw. */
|
|
193
|
+
readonly error: unknown;
|
|
194
|
+
/** Whether the report on screen stays as a Stale Report, whose notice says the failure: such a failure is raised here
|
|
195
|
+
* and thrown no further. Any other is said in the Pivot Toolbar, and thrown on after it is raised. */
|
|
196
|
+
readonly stale: boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** One Area of the Field List (ADR-0061). */
|
|
200
|
+
export declare interface PivotFieldListAreaView {
|
|
201
|
+
/** Which Area. */
|
|
202
|
+
readonly area: PivotArea;
|
|
203
|
+
/** Its name: Filters, Columns, Rows, Values. */
|
|
204
|
+
readonly title: string;
|
|
205
|
+
/** What stands in it, Σ Values last where it stands. */
|
|
206
|
+
readonly entries: readonly PivotFieldListEntryView[];
|
|
207
|
+
/** The index a `dragenter` or a `drop` on the Area's box itself hands on: past its last entry. */
|
|
208
|
+
readonly end: number;
|
|
209
|
+
/** Whether what is dragged is over it, and may be dropped there. */
|
|
210
|
+
readonly dropTarget: boolean;
|
|
211
|
+
/** While a drop there would pass the leaf cap, by the counts, the words that say so, in a `role="status"`: a hint,
|
|
212
|
+
* never a refusal (ADR-0370 section 3). Absent otherwise. */
|
|
213
|
+
readonly overCap?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** A placed entry of an Area (ADR-0061). */
|
|
217
|
+
export declare interface PivotFieldListEntryView {
|
|
218
|
+
/** Which entry it is: its Area and index there, −1 for Σ Values. */
|
|
219
|
+
readonly entry: PivotEntry;
|
|
220
|
+
/** The name its button and the anchor around it are handed in by, through `control` and `anchor`. */
|
|
221
|
+
readonly key: string;
|
|
222
|
+
/** What it is called: the field's caption, a Value Field's caption, Σ Values. */
|
|
223
|
+
readonly caption: string;
|
|
224
|
+
/** The button's accessible name: "Options for Region". */
|
|
225
|
+
readonly menuLabel: string;
|
|
226
|
+
/** Whether its field hides Items now. */
|
|
227
|
+
readonly filtered: boolean;
|
|
228
|
+
/** Whether it is Σ Values. */
|
|
229
|
+
readonly values: boolean;
|
|
230
|
+
/** Whether its menu, or a panel the menu opened, stands under it: the entry is then not draggable, so a press that
|
|
231
|
+
* moves a little on the menu is the menu's. */
|
|
232
|
+
readonly menuOpen: boolean;
|
|
233
|
+
/** Whether it is the one being dragged. */
|
|
234
|
+
readonly dragging: boolean;
|
|
235
|
+
/** Whether a drop now would land before it. */
|
|
236
|
+
readonly dropBefore: boolean;
|
|
237
|
+
/** The index a `dragenter` on it hands `dragEnter`, and a `drop` on it hands `drop`: its own, or for Σ Values,
|
|
238
|
+
* which always stands last, its Area's `end`. */
|
|
239
|
+
readonly dropIndex: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** A declared field in the Field List (ADR-0061). */
|
|
243
|
+
export declare interface PivotFieldListFieldView {
|
|
244
|
+
/** The field's name. */
|
|
245
|
+
readonly name: string;
|
|
246
|
+
/** What it is called. */
|
|
247
|
+
readonly caption: string;
|
|
248
|
+
/** The name its tick box is handed in by, through `control`. */
|
|
249
|
+
readonly key: string;
|
|
250
|
+
/** Whether it stands in any Area: its tick box. */
|
|
251
|
+
readonly placed: boolean;
|
|
252
|
+
/** Whether it hides Items now. */
|
|
253
|
+
readonly filtered: boolean;
|
|
254
|
+
/** Its count of Items, written in the pivot's locale, where the source counted them; absent otherwise. */
|
|
255
|
+
readonly count?: string;
|
|
256
|
+
/** The count as said: "12 Items"; absent with the count. */
|
|
257
|
+
readonly countLabel?: string;
|
|
258
|
+
/** Whether it is the one being dragged. */
|
|
259
|
+
readonly dragging: boolean;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** The Field List shown or hidden by the user. */
|
|
263
|
+
export declare interface PivotFieldListShownEvent {
|
|
264
|
+
/** Whether it now stands beside the report. */
|
|
265
|
+
readonly shown: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* What the Field List's contents are handed (ADR-0061): the fields with their tick boxes and search, and the four
|
|
270
|
+
* Areas with their entries, each entry's open menu or panel placed by the pivot in the anchor around its button.
|
|
271
|
+
* Drag and drop is the browser's own: a draggable element calls `startDrag` on `dragstart` and `endDrag` on `dragend`;
|
|
272
|
+
* a drop target calls `dragOver` on `dragover` always — whether it may be dropped on is decided at the drop, never by a
|
|
273
|
+
* render that may still be on its way — `dragEnter` on `dragenter` for the marks, and `drop` (or `dropOnList`) on
|
|
274
|
+
* `drop`. Each Area's box is handed in by `area`, so a drag that leaves every Area is seen to.
|
|
275
|
+
*/
|
|
276
|
+
export declare interface PivotFieldListSlotContext extends PivotStandingSlotContext<PivotFieldListView> {
|
|
277
|
+
/** The search as it is typed. */
|
|
278
|
+
readonly setSearch: (text: string) => void;
|
|
279
|
+
/** A field's tick box pressed: ticks it into the layout, or takes it out. */
|
|
280
|
+
readonly toggle: (field: string) => void;
|
|
281
|
+
/** An entry's button pressed: opens its menu, or closes the one standing under it. */
|
|
282
|
+
readonly openMenu: (entry: PivotEntry) => void;
|
|
283
|
+
/** The heading's close button pressed: hides the Field List, keeping the layout and any pending one. */
|
|
284
|
+
readonly close: () => void;
|
|
285
|
+
/** A `dragstart` on a field or an entry: the drag starts, against the layout the pane shows. */
|
|
286
|
+
readonly startDrag: (event: DragEvent, subject: PivotDragSubject) => void;
|
|
287
|
+
/** A `dragover` on any drop target: takes the drop while a drag of the pane's is on. */
|
|
288
|
+
readonly dragOver: (event: DragEvent) => void;
|
|
289
|
+
/** A `dragenter` on an Area (`index` its entries' count) or an entry (`index` its own): where a drop would land. */
|
|
290
|
+
readonly dragEnter: (area: PivotArea, index: number) => void;
|
|
291
|
+
/** A `drop` on an Area or an entry, at the index `dragEnter` takes. */
|
|
292
|
+
readonly drop: (event: DragEvent, area: PivotArea, index: number) => void;
|
|
293
|
+
/** A `drop` on the list of fields: an entry dragged back is taken out of the layout. */
|
|
294
|
+
readonly dropOnList: (event: DragEvent) => void;
|
|
295
|
+
/** A `dragend`, whether or not anything was dropped. */
|
|
296
|
+
readonly endDrag: () => void;
|
|
297
|
+
/** Defer Layout Update ticked or unticked; unticking applies the pending layout, as Excel does. */
|
|
298
|
+
readonly setDeferred: (deferred: boolean) => void;
|
|
299
|
+
/** Update pressed: applies the pending layout in one change. */
|
|
300
|
+
readonly update: () => void;
|
|
301
|
+
/** Hands in a control: `search`, a field's tick box by its `key`, or an entry's button by its `key`. */
|
|
302
|
+
readonly control: (key: string) => PivotPartRef;
|
|
303
|
+
/** Hands in the anchor around an entry's button, or beside it, by the entry's `key`: an element of no position of
|
|
304
|
+
* its own, so the frame the pivot places in it takes the pane's width (ADR-0061). A press or focus on the entry's
|
|
305
|
+
* button, handed in by `control`, is inside its open menu wherever the anchor stands. */
|
|
306
|
+
readonly anchor: (key: string) => PivotPartRef;
|
|
307
|
+
/** Hands in an Area's box. */
|
|
308
|
+
readonly area: (area: PivotArea) => PivotPartRef;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** What the Field List shows now (ADR-0061). */
|
|
312
|
+
export declare interface PivotFieldListView {
|
|
313
|
+
/** The pane's name: "PivotTable Fields". */
|
|
314
|
+
readonly title: string;
|
|
315
|
+
/** The heading's close button's accessible name: "Hide Field List". */
|
|
316
|
+
readonly hideLabel: string;
|
|
317
|
+
/** The caption above the fields: "Choose fields to add to report:". */
|
|
318
|
+
readonly chooseCaption: string;
|
|
319
|
+
/** The search's accessible name and placeholder. */
|
|
320
|
+
readonly searchLabel: string;
|
|
321
|
+
/** The search as typed. */
|
|
322
|
+
readonly search: string;
|
|
323
|
+
/** The declared fields the search leaves, in declaration order. */
|
|
324
|
+
readonly fields: readonly PivotFieldListFieldView[];
|
|
325
|
+
/** The caption above the Areas: "Drag fields between areas below:". */
|
|
326
|
+
readonly dragCaption: string;
|
|
327
|
+
/** The four Areas, in Excel's order: Filters, Columns, Rows, Values. */
|
|
328
|
+
readonly areas: readonly PivotFieldListAreaView[];
|
|
329
|
+
/** Whether a drop on the list of fields, or on the report, removes what is dragged: a placed field's entry. */
|
|
330
|
+
readonly dropRemoves: boolean;
|
|
331
|
+
/** Defer Layout Update, at the pane's foot: its words, and whether it is ticked. */
|
|
332
|
+
readonly defer: {
|
|
333
|
+
readonly label: string;
|
|
334
|
+
readonly ticked: boolean;
|
|
335
|
+
};
|
|
336
|
+
/** Update: its words, and whether it would apply anything. */
|
|
337
|
+
readonly update: {
|
|
338
|
+
readonly label: string;
|
|
339
|
+
readonly enabled: boolean;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** What Field Settings…' contents are handed (ADR-0061): a row or column field's subtotals and order. A request for
|
|
344
|
+
* the keyboard is for the first control, the subtotals' choice. */
|
|
345
|
+
export declare interface PivotFieldSettingsSlotContext extends PivotPanelSlotContext {
|
|
346
|
+
/** What the panel shows now. */
|
|
347
|
+
readonly view: () => PivotFieldSettingsView;
|
|
348
|
+
/** Sets the draft's subtotals. */
|
|
349
|
+
readonly setSubtotals: (automatic: boolean) => void;
|
|
350
|
+
/** Sets the draft's order, by its index in the view's `sorts`. */
|
|
351
|
+
readonly setSort: (index: number) => void;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** What Field Settings… shows now (ADR-0061): a new object at each change, and the same one otherwise. */
|
|
355
|
+
export declare interface PivotFieldSettingsView {
|
|
356
|
+
/** The field's caption, the panel's title. */
|
|
357
|
+
readonly caption: string;
|
|
358
|
+
/** The draft's subtotals: Automatic (`true`) or None. */
|
|
359
|
+
readonly subtotals: boolean;
|
|
360
|
+
/** The orders there are, each by its words: A to Z and Z to A by label, then each Value Field's two. */
|
|
361
|
+
readonly sorts: readonly string[];
|
|
362
|
+
/** The draft's order, by its index in `sorts`. */
|
|
363
|
+
readonly sort: number;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** An ExPivot drawn into an element, handed back by {@link createPivot}. */
|
|
367
|
+
export declare interface PivotHandle {
|
|
368
|
+
/** Takes the options again, whole: what did not change asks nothing again. */
|
|
369
|
+
update(options: PivotViewOptions): void;
|
|
370
|
+
/** Opens the records of a Show Details event this pivot raised, as `detailsView` says: what a Consumer that
|
|
371
|
+
* heard `onShowDetails` and does not take them hands back (ADR-0059). */
|
|
372
|
+
openDetails(event: PivotShowDetailsEvent): void;
|
|
373
|
+
/**
|
|
374
|
+
* The grid that takes the inputs made at `element` (ADR-0240 section 6): a Show Details grid's, where `element`
|
|
375
|
+
* stands in that grid's Input Root, else the report's; undefined while the report draws no grid. For a Framework
|
|
376
|
+
* Adapter whose Chrome's contents arrive later than their slot, to hold that grid's inputs and Settled Mark until
|
|
377
|
+
* they stand (ADR-0410 section 5).
|
|
378
|
+
*/
|
|
379
|
+
gridAround(element: Element): GridHandle<unknown> | undefined;
|
|
380
|
+
/** Holds the Settled Mark (ADR-0220) of the grid `element` stands in, as `gridAround` finds it, until the
|
|
381
|
+
* function it answers is called. Where no grid stands there yet, the hold waits for the grid that comes to: the
|
|
382
|
+
* report's next one while the report draws none, and a grid being made for a part it mounted before placing it,
|
|
383
|
+
* which meanwhile holds every grid. */
|
|
384
|
+
holdSettled(element: Element): () => void;
|
|
385
|
+
/** Stops the pivot: it asks and hears nothing more, and empties its element. The source stays the
|
|
386
|
+
* Consumer's. */
|
|
387
|
+
destroy(): void;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** One Item as Filter… lists it. */
|
|
391
|
+
export declare interface PivotItemChoice {
|
|
392
|
+
/** The Item. */
|
|
393
|
+
readonly key: PivotItemKey;
|
|
394
|
+
/** Its label. */
|
|
395
|
+
readonly label: string;
|
|
396
|
+
/** Whether it is shown in the draft. */
|
|
397
|
+
readonly ticked: boolean;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/** What Filter…' contents are handed (ADR-0061, ADR-0066): a field's Items, each ticked while shown, a search that
|
|
401
|
+
* narrows them, and OK and Cancel. A request for the keyboard is for the search. */
|
|
402
|
+
export declare interface PivotItemFilterSlotContext extends PivotPanelSlotContext {
|
|
403
|
+
/** What the panel shows now. */
|
|
404
|
+
readonly view: () => PivotItemFilterView;
|
|
405
|
+
/** The search as typed. */
|
|
406
|
+
readonly setSearch: (text: string) => void;
|
|
407
|
+
/** Ticks or unticks one Item. */
|
|
408
|
+
readonly setTicked: (key: PivotItemKey, ticked: boolean) => void;
|
|
409
|
+
/** (Select All): ticks or unticks every Item the search lists. */
|
|
410
|
+
readonly setAll: (ticked: boolean) => void;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** What Filter… shows now (ADR-0061, ADR-0066): a new object at each change, and the same one otherwise. */
|
|
414
|
+
export declare interface PivotItemFilterView {
|
|
415
|
+
/** The field's caption, which names the list. */
|
|
416
|
+
readonly caption: string;
|
|
417
|
+
/** The search as typed. */
|
|
418
|
+
readonly search: string;
|
|
419
|
+
/** The Items the search leaves, in the field's order, at most the most Filter… lists. */
|
|
420
|
+
readonly items: readonly PivotItemChoice[];
|
|
421
|
+
/** (Select All)'s state over `items`: `true` for every one, `false` for none (and over no Items), or `undefined` for
|
|
422
|
+
* some. */
|
|
423
|
+
readonly allTicked: boolean | undefined;
|
|
424
|
+
/** Whether the Items, or the source's answer to the search, are on their way, with nothing yet to list. */
|
|
425
|
+
readonly loading: boolean;
|
|
426
|
+
/** Whether newer Items are on their way while what is shown stands: an earlier Source Version's Items, kept in
|
|
427
|
+
* view (ADR-0066 refined), or why they could not be listed, while they are asked again. A Chrome may mark the list
|
|
428
|
+
* as updating; it does not blank it, nor dim it. */
|
|
429
|
+
readonly updating: boolean;
|
|
430
|
+
/** Why the Items cannot be listed, in words, said in place of the list; absent while they can. */
|
|
431
|
+
readonly unavailable?: string;
|
|
432
|
+
/** A note under the Items: that more match than are listed, or that none matches the search; absent otherwise. */
|
|
433
|
+
readonly note?: string;
|
|
434
|
+
/** Whether OK may be pressed: not while every Item is unticked, nor while the Items are on their way. */
|
|
435
|
+
readonly canApply: boolean;
|
|
436
|
+
/** Why OK cannot apply, in words; absent while it can. */
|
|
437
|
+
readonly refusal?: string;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** A Pivot Layout the user made and the report now shows. */
|
|
441
|
+
export declare interface PivotLayoutChangedEvent {
|
|
442
|
+
/** The layout the report shows. */
|
|
443
|
+
readonly layout: PivotLayout;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/** One command of a menu the pivot decides (ADR-0061): what it is called, whether it is available, and what it does. */
|
|
447
|
+
export declare interface PivotMenuCommand {
|
|
448
|
+
/** The command's id, which is also the id of its word, stable for an icon. */
|
|
449
|
+
readonly id: string;
|
|
450
|
+
/** What it is called, in the pivot's words. */
|
|
451
|
+
readonly label: string;
|
|
452
|
+
/** Whether it can be pressed: one that would change nothing is disabled. */
|
|
453
|
+
readonly enabled: boolean;
|
|
454
|
+
/** For a choice among others, the Layout menu's, whether it is the current one, which the menu marks; absent on a
|
|
455
|
+
* plain command. */
|
|
456
|
+
readonly checked?: boolean;
|
|
457
|
+
/** The heading of the group of choices that starts at this command: the Layout menu's Subtotals, Grand Totals and
|
|
458
|
+
* Report Layout; absent where it continues the group above. */
|
|
459
|
+
readonly heading?: string;
|
|
460
|
+
/** Runs it and closes the menu, or opens the panel it names in the menu's place. A disabled command runs nothing,
|
|
461
|
+
* and so does one pressed once the menu has closed or been drawn again without it. */
|
|
462
|
+
readonly invoke: () => void;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* What a menu's contents are handed (ADR-0061): a placed field's menu, under its entry in the Field List, or the
|
|
467
|
+
* Layout menu, under Layout ▾. The slot stands inside the pivot's frame (`role="menu"`, named by the pivot), which
|
|
468
|
+
* Escape anywhere in it closes. The contents draw one item per command, in this order, a choice as a
|
|
469
|
+
* `menuitemradio` marked while it is the current one and a group's heading where one starts. A request for the
|
|
470
|
+
* keyboard is for the first enabled command; with none enabled the pivot gives the frame the keyboard itself.
|
|
471
|
+
*/
|
|
472
|
+
export declare interface PivotMenuSlotContext extends PivotPartSlotContext {
|
|
473
|
+
/** What the menu shows now. */
|
|
474
|
+
readonly view: () => PivotMenuView;
|
|
475
|
+
/** Hears each change to the view; answers the function that stops it. */
|
|
476
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
477
|
+
/** Closes the menu without running anything, for a dismissal of the contents' own; the keyboard goes back to what
|
|
478
|
+
* opened it. */
|
|
479
|
+
readonly close: () => void;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** What a menu shows now (ADR-0061): a new object at each change, and the same one otherwise. */
|
|
483
|
+
export declare interface PivotMenuView {
|
|
484
|
+
/** The menu's accessible name, which its frame carries. */
|
|
485
|
+
readonly name: string;
|
|
486
|
+
/** Excel's commands, in its order. */
|
|
487
|
+
readonly commands: readonly PivotMenuCommand[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** What the slots of a panel share (ADR-0061): its exits, and a popup of the contents' own. A panel holds a draft the
|
|
491
|
+
* pivot keeps; OK says it as the next layout, and Cancel and Escape drop it. */
|
|
492
|
+
export declare interface PivotPanelSlotContext extends PivotPartSlotContext {
|
|
493
|
+
/** Hears each change to the view; answers the function that stops it. */
|
|
494
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
495
|
+
/** OK: the draft is applied and the panel closes. While the view says it cannot be, or the pivot refuses it, the
|
|
496
|
+
* panel stands and says why. */
|
|
497
|
+
readonly apply: () => void;
|
|
498
|
+
/** Cancel: the draft is dropped, the panel closes, and the keyboard goes back to what opened it. */
|
|
499
|
+
readonly cancel: () => void;
|
|
500
|
+
/** The contents report a popup of their own (a select's list) opening (`true`) and closing (`false`): while one
|
|
501
|
+
* is open, Escape is the popup's, and the next closes the panel (ADR-0039). */
|
|
502
|
+
readonly innerPopupChanged: (open: boolean) => void;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/** Takes one of a standing part's elements, or `null` once it is gone, as a callback ref does: hand it the element
|
|
506
|
+
* itself (a React `ref`, or a call with the element once it is drawn). */
|
|
507
|
+
export declare type PivotPartRef = (element: HTMLElement | null) => void;
|
|
508
|
+
|
|
509
|
+
/** What the slots of a part that takes the keyboard share: their words, and the keyboard's requests. */
|
|
510
|
+
export declare interface PivotPartSlotContext {
|
|
511
|
+
/** One of the pivot's words by its id: the Consumer's `label`, else the built-in English. */
|
|
512
|
+
readonly label: (id: string) => string;
|
|
513
|
+
/** The count of the pivot's requests for the part to take the keyboard; zero asks nothing. Each request mounts the
|
|
514
|
+
* contents again, and whenever the count differs from the one they last answered they give DOM focus, through
|
|
515
|
+
* `takeFocus`, to the control the part's context names. */
|
|
516
|
+
readonly focusRequest: number;
|
|
517
|
+
/** Gives `control` DOM focus: wherever DOM focus stands while a request is owed, until the contents answer it or
|
|
518
|
+
* the user makes an input in the part, and otherwise only while the keyboard is still the pivot's (ADR-0204). */
|
|
519
|
+
readonly takeFocus: (control: HTMLElement) => void;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** A move the report could not take, said where the user sees it (ADR-0066, ADR-0370 section 3). */
|
|
523
|
+
export declare interface PivotRefusedEvent {
|
|
524
|
+
/** The sentence the pivot shows. */
|
|
525
|
+
readonly message: string;
|
|
526
|
+
/** The fields the refusal names, in the order they were moved: every move taken against the refused
|
|
527
|
+
* question, which went with it. Empty where it names none. */
|
|
528
|
+
readonly fields: readonly string[];
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/** What the report filter band's contents are handed (ADR-0061): one entry per field in Filters, its caption and a
|
|
532
|
+
* button that says what it shows and opens Filter… in the anchor around it, over the report. */
|
|
533
|
+
export declare interface PivotReportFiltersSlotContext extends PivotStandingSlotContext<PivotReportFiltersView> {
|
|
534
|
+
/** A filter's button pressed: opens its Filter…, or closes it when it is open. */
|
|
535
|
+
readonly toggle: (field: string) => void;
|
|
536
|
+
/** Hands in the button of the filter of `field`. */
|
|
537
|
+
readonly control: (field: string) => PivotPartRef;
|
|
538
|
+
/** Hands in the anchor around the button of the filter of `field`. */
|
|
539
|
+
readonly anchor: (field: string) => PivotPartRef;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/** What the report filter band shows now (ADR-0061). */
|
|
543
|
+
export declare interface PivotReportFiltersView {
|
|
544
|
+
/** The band's accessible name, which a `role="group"` around it carries. */
|
|
545
|
+
readonly name: string;
|
|
546
|
+
/** One per field in Filters, in their order. */
|
|
547
|
+
readonly filters: readonly PivotReportFilterView[];
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/** One report filter (ADR-0061). */
|
|
551
|
+
export declare interface PivotReportFilterView {
|
|
552
|
+
/** The field's name. */
|
|
553
|
+
readonly field: string;
|
|
554
|
+
/** Its caption. */
|
|
555
|
+
readonly caption: string;
|
|
556
|
+
/** What it shows: (All), the one Item shown, or (Multiple Items). */
|
|
557
|
+
readonly summary: string;
|
|
558
|
+
/** Whether it hides Items. */
|
|
559
|
+
readonly filtered: boolean;
|
|
560
|
+
/** Whether its Filter… is open. */
|
|
561
|
+
readonly open: boolean;
|
|
562
|
+
/** The button's accessible name: "Filter Region". */
|
|
563
|
+
readonly buttonLabel: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/** The report's selection, as the grid raised it, and what its cells stand for. */
|
|
567
|
+
export declare interface PivotSelectionChangedEvent {
|
|
568
|
+
/** The selection of the report grid. */
|
|
569
|
+
readonly selection: GridSelection;
|
|
570
|
+
/** Each selected cell's row and column Items, each cell once, in the order selected (ADR-0340); `undefined`
|
|
571
|
+
* when the selection reaches a row the grid does not hold drawn now, which is read from no Items rather than
|
|
572
|
+
* from some of them (spine rule 1), and when no report is shown. A selection dropped over a report is said with
|
|
573
|
+
* an empty list. */
|
|
574
|
+
readonly items: readonly PivotCellItems[] | undefined;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/** The records behind a value cell, which Show Details opens (ADR-0059): handed to `onShowDetails` when the Consumer
|
|
578
|
+
* listens, and otherwise shown by the pivot. */
|
|
579
|
+
export declare interface PivotShowDetailsEvent {
|
|
580
|
+
/** What the cell stands for, as its sheet is titled: `Details: EU / Rates`. */
|
|
581
|
+
readonly title: string;
|
|
582
|
+
/** The Items of the cell's row, outermost first. */
|
|
583
|
+
readonly rowItems: readonly PivotDetailItem[];
|
|
584
|
+
/** The Items of the cell's column, outermost first. */
|
|
585
|
+
readonly columnItems: readonly PivotDetailItem[];
|
|
586
|
+
/** The caption of the cell's Value Field, or `undefined` where the cell is not one Value Field's. */
|
|
587
|
+
readonly valueField: string | undefined;
|
|
588
|
+
/** The question for the records, plain data a Consumer may send elsewhere, as the Razor component's
|
|
589
|
+
* `PivotDetails.Query` (ADR-0151): the cell's Items, the Hidden Items and the Source Version it is answered under. */
|
|
590
|
+
readonly query: PivotDetailsQuery;
|
|
591
|
+
/** The Pivot Source the report was computed from, which the records are asked of. */
|
|
592
|
+
readonly source: PivotSource;
|
|
593
|
+
/** The source's fields, which each record holds a value of, in order. */
|
|
594
|
+
readonly fields: readonly PivotField[];
|
|
595
|
+
/** A page of the records, from `start`, at most `count` of them, under the Source Version the report was computed
|
|
596
|
+
* from: a source that no longer holds it refuses, rather than answer records that do not add up. */
|
|
597
|
+
readonly records: (start: number, count: number, signal?: AbortSignal) => Promise<PivotDetailPage>;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** What the Stale Report's notice's contents are handed (ADR-0067), inside the pivot's polite live region under the
|
|
601
|
+
* Pivot Toolbar, while the report is stale; the contents add no live region of their own. */
|
|
602
|
+
export declare interface PivotStaleReportSlotContext extends PivotStandingSlotContext<PivotStaleReportView> {
|
|
603
|
+
/** Retry pressed: asks again what failed. */
|
|
604
|
+
readonly retry: () => void;
|
|
605
|
+
/** Hands in Retry. */
|
|
606
|
+
readonly control: (name: 'retry') => PivotPartRef;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/** What the Stale Report's notice shows now (ADR-0067). */
|
|
610
|
+
export declare interface PivotStaleReportView {
|
|
611
|
+
/** The whole sentence: "Showing the data as of 14:32:05: the newest data needs more than 200,000 cells." */
|
|
612
|
+
readonly message: string;
|
|
613
|
+
/** When the data on screen arrived, as the sentence writes it. */
|
|
614
|
+
readonly asOfText: string;
|
|
615
|
+
/** What happened, as the sentence ends it. */
|
|
616
|
+
readonly reason: string;
|
|
617
|
+
/** Retry: its words, and whether it can be pressed — not while what it would ask is already out. */
|
|
618
|
+
readonly retry: {
|
|
619
|
+
readonly label: string;
|
|
620
|
+
readonly enabled: boolean;
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/** What the slots of the pivot's standing parts share (ADR-0390): the Pivot Toolbar, the report filter band and the
|
|
625
|
+
* Stale Report's notice. Their contents are mounted once while the part stands, and draw its view again at each change.
|
|
626
|
+
* They hand in their controls by name, through `control`, so the pivot gives the keyboard to the one it means, as it
|
|
627
|
+
* does with the built-in markup's: after a menu closes, to the button that opened it. They hand in the anchors the
|
|
628
|
+
* pivot places a popup's frame in, through `anchor`: an element around the button that opens it, positioned, so the
|
|
629
|
+
* frame needs no position the pivot would have to measure (ADR-0061). */
|
|
630
|
+
export declare interface PivotStandingSlotContext<View> {
|
|
631
|
+
/** What the part shows now: a new object at each change, and the same one otherwise. */
|
|
632
|
+
readonly view: () => View;
|
|
633
|
+
/** Hears each change to the view; answers the function that stops it. */
|
|
634
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
635
|
+
/** One of the pivot's words by its id: the Consumer's `label`, else the built-in English. */
|
|
636
|
+
readonly label: (id: string) => string;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* What the Pivot Toolbar's contents are handed (ADR-0061): the report filter band on its left, and on its right, in
|
|
641
|
+
* this order, Layout ▾, Refresh where the source can be refreshed, and the Field List's toggle. The Layout menu opens
|
|
642
|
+
* in the anchor around Layout ▾, over the report, with a backdrop that closes it.
|
|
643
|
+
*/
|
|
644
|
+
export declare interface PivotToolbarSlotContext extends PivotStandingSlotContext<PivotToolbarView> {
|
|
645
|
+
/** Layout ▾ pressed: opens the Layout menu, or closes it when it is open. */
|
|
646
|
+
readonly toggleLayoutMenu: () => void;
|
|
647
|
+
/** Refresh pressed: asks the source again. */
|
|
648
|
+
readonly refresh: () => void;
|
|
649
|
+
/** The Field List's toggle pressed: shows the list, or hides it. */
|
|
650
|
+
readonly toggleFieldList: () => void;
|
|
651
|
+
/** Hands in a button: `layout`, `refresh` or `field-list`. */
|
|
652
|
+
readonly control: (name: 'layout' | 'refresh' | 'field-list') => PivotPartRef;
|
|
653
|
+
/** Hands in an anchor: `layout`, around Layout ▾, and `report-filters`, where the band stands. */
|
|
654
|
+
readonly anchor: (name: 'layout' | 'report-filters') => PivotPartRef;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/** What the Pivot Toolbar shows now (ADR-0061). */
|
|
658
|
+
export declare interface PivotToolbarView {
|
|
659
|
+
/** Layout ▾: its words, and whether its menu is open. */
|
|
660
|
+
readonly layoutMenu: {
|
|
661
|
+
readonly label: string;
|
|
662
|
+
readonly open: boolean;
|
|
663
|
+
};
|
|
664
|
+
/** Refresh, while the source can be refreshed (ADR-0066); absent otherwise, and then there is no button. */
|
|
665
|
+
readonly refresh?: {
|
|
666
|
+
readonly label: string;
|
|
667
|
+
};
|
|
668
|
+
/** The Field List's toggle: its words, and whether the list is shown. */
|
|
669
|
+
readonly fieldList: {
|
|
670
|
+
readonly label: string;
|
|
671
|
+
readonly shown: boolean;
|
|
672
|
+
};
|
|
673
|
+
/** Whether the report filter band stands, on the toolbar's left: the contents then hand in its anchor,
|
|
674
|
+
* `anchor('report-filters')`, in which the pivot places the band. */
|
|
675
|
+
readonly reportFilters: boolean;
|
|
676
|
+
/** What the report could not do with the last change, in words — a layout refused by name, or the source's
|
|
677
|
+
* failure — said where the user sees it, as an alert (`role="alert"`); absent otherwise. Data that could not be
|
|
678
|
+
* shown is the Stale Report's notice's to say, not this. */
|
|
679
|
+
readonly refusal?: string;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/** What Value Field Settings…' contents are handed (ADR-0061). A request for the keyboard is for the first control,
|
|
683
|
+
* the caption's field. */
|
|
684
|
+
export declare interface PivotValueFieldSettingsSlotContext extends PivotPanelSlotContext {
|
|
685
|
+
/** What the panel shows now. */
|
|
686
|
+
readonly view: () => PivotValueFieldSettingsView;
|
|
687
|
+
/** The caption as typed. */
|
|
688
|
+
readonly setCaption: (text: string) => void;
|
|
689
|
+
/** Sets the draft's Aggregation: one the source does not answer is never chosen. */
|
|
690
|
+
readonly setAggregation: (aggregation: PivotAggregation) => void;
|
|
691
|
+
/** Sets the draft's Show Values As. */
|
|
692
|
+
readonly setShowValuesAs: (showValuesAs: PivotShowValuesAs) => void;
|
|
693
|
+
/** The number format as typed. */
|
|
694
|
+
readonly setNumberFormat: (text: string) => void;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/** What Value Field Settings… shows now (ADR-0061): a new object at each change, and the same one otherwise. */
|
|
698
|
+
export declare interface PivotValueFieldSettingsView {
|
|
699
|
+
/** The Pivot Field's caption, the Source Name. */
|
|
700
|
+
readonly sourceCaption: string;
|
|
701
|
+
/** The draft's caption, as its field shows it: one the user has not written follows the Aggregation. */
|
|
702
|
+
readonly caption: string;
|
|
703
|
+
/** The draft's Aggregation. */
|
|
704
|
+
readonly aggregation: PivotAggregation;
|
|
705
|
+
/** Every Aggregation, with its name and whether the source answers it. */
|
|
706
|
+
readonly aggregations: readonly PivotChoice<PivotAggregation>[];
|
|
707
|
+
/** The draft's Show Values As. */
|
|
708
|
+
readonly showValuesAs: PivotShowValuesAs;
|
|
709
|
+
/** Every Show Values As, with its name. */
|
|
710
|
+
readonly showValuesAsChoices: readonly PivotChoice<PivotShowValuesAs>[];
|
|
711
|
+
/** The draft's number format, as typed; empty for General. */
|
|
712
|
+
readonly numberFormat: string;
|
|
713
|
+
/** What an empty number format means, the field's placeholder: General. */
|
|
714
|
+
readonly numberFormatPlaceholder: string;
|
|
715
|
+
/** A number shown in the draft's format, or the reason it cannot be. */
|
|
716
|
+
readonly sample: string;
|
|
717
|
+
/** Why OK last refused, in words: a caption taken or empty, a format that cannot be used; absent otherwise. */
|
|
718
|
+
readonly refusal?: string;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/** An ExPivot's options (ADR-0370 section 1): what the Consumer hands, whole, on every update. */
|
|
722
|
+
export declare interface PivotViewOptions {
|
|
723
|
+
/** The Pivot Source the report is computed from: its fields are what the Field List offers. A new
|
|
724
|
+
* instance is a refresh. */
|
|
725
|
+
readonly source: PivotSource;
|
|
726
|
+
/** The Pivot Layout, View State the Consumer holds (ADR-0059). A layout handed in replaces the one on
|
|
727
|
+
* screen; one this pivot raised through `onLayoutChanged` and handed back, however late, is its own and asks
|
|
728
|
+
* nothing, so an earlier layout is asked for again by handing in one of the Consumer's own making. Left out,
|
|
729
|
+
* the pivot starts from nothing and keeps the user's changes itself. A layout naming a field the source
|
|
730
|
+
* does not offer is refused by name. */
|
|
731
|
+
readonly layout?: PivotLayout;
|
|
732
|
+
/** Raised with the layout the report shows after each change the user made, once it is answered: never
|
|
733
|
+
* for one a newer move superseded, nor for one refused. */
|
|
734
|
+
readonly onLayoutChanged?: (event: PivotLayoutChangedEvent) => void;
|
|
735
|
+
/** Raised when a move is refused, with the sentence the pivot shows. */
|
|
736
|
+
readonly onRefused?: (event: PivotRefusedEvent) => void;
|
|
737
|
+
/** Raised when the Pivot Source fails to answer the report's newest question, as the Razor component keeps
|
|
738
|
+
* `LastError`: a live source whose transport is down is heard of here (ADR-0067). */
|
|
739
|
+
readonly onFailed?: (event: PivotFailedEvent) => void;
|
|
740
|
+
/** The locale numbers, dates and counts are written in and text Items ordered by: a BCP 47 tag, or
|
|
741
|
+
* `invariant`, which the pivot reads unless given (ADR-0370 section 10). A React adapter passes the
|
|
742
|
+
* browser's language. It changes no word. */
|
|
743
|
+
readonly locale?: string;
|
|
744
|
+
/** The Consumer's word for an id, or `undefined` to keep the English (ADR-0370 section 10).
|
|
745
|
+
* `japanesePivotWords` gives Excel's Japanese edition's words in one line. */
|
|
746
|
+
readonly label?: PivotLabel;
|
|
747
|
+
/** Whether the Field List stands beside the report; true unless given. */
|
|
748
|
+
readonly showFieldList?: boolean;
|
|
749
|
+
/** Raised when the report's selection changes, with what its cells stand for: what a Board reads its links
|
|
750
|
+
* by (ADR-0340). */
|
|
751
|
+
readonly onSelectionChanged?: (event: PivotSelectionChangedEvent) => void;
|
|
752
|
+
/** Raised when the user shows or hides the Field List. */
|
|
753
|
+
readonly onShowFieldListChanged?: (event: PivotFieldListShownEvent) => void;
|
|
754
|
+
/** The Field List's width in pixels; 300 unless given. */
|
|
755
|
+
readonly fieldListWidth?: number;
|
|
756
|
+
/** The report grid's height, header included: pixels, or `stretch` for the parent's; 400 unless given. */
|
|
757
|
+
readonly viewportHeight?: ViewportSize;
|
|
758
|
+
/** The report grid's width; `stretch` unless given, what the Field List leaves. */
|
|
759
|
+
readonly viewportWidth?: ViewportSize;
|
|
760
|
+
/** The most leaves a question may ask the source for (ADR-0066): 200,000 unless given. A layout past it is
|
|
761
|
+
* refused by name, and the report stays on the layout before. */
|
|
762
|
+
readonly maxLeaves?: number;
|
|
763
|
+
/** The most rows a report may have (ADR-0066): Excel's 1,048,576 unless given. A layout past it is refused, and
|
|
764
|
+
* newer data past it leaves a Stale Report. */
|
|
765
|
+
readonly maxRows?: number;
|
|
766
|
+
/** The most columns a report may have, its label columns included (ADR-0066): Excel's 16,384 unless given. A layout
|
|
767
|
+
* past it is refused, and newer data past it leaves a Stale Report. */
|
|
768
|
+
readonly maxColumns?: number;
|
|
769
|
+
/** How long after a change of data reached the screen the next is asked for, in milliseconds: 250 unless given
|
|
770
|
+
* (ADR-0067). The source's notices that come meanwhile are gathered and asked for once, so a source that changes
|
|
771
|
+
* many times a second redraws the report at most once per interval; a notice after a quiet spell is asked for at
|
|
772
|
+
* once. */
|
|
773
|
+
readonly redrawInterval?: number;
|
|
774
|
+
/** The report's row height, or the Density's. */
|
|
775
|
+
readonly rowHeight?: number;
|
|
776
|
+
/** The report's Density, beating a Wrapper's. */
|
|
777
|
+
readonly density?: GridDensity;
|
|
778
|
+
/** The widths the report's grids charge each glyph, beating a Wrapper's and the Density's (ADR-0016): whoever sets
|
|
779
|
+
* the font the cells are drawn in hands its widths, so `####` and the label widths are judged by the face on
|
|
780
|
+
* screen. */
|
|
781
|
+
readonly cellMetrics?: CellTextMetrics;
|
|
782
|
+
/** What a Wrapper hands the report's grids (ADR-0030): the widths of the font it sets, its Density, and its hover
|
|
783
|
+
* band and Row Stripes. A value the pivot is given beats these. */
|
|
784
|
+
readonly presentationDefaults?: GridPresentationDefaults;
|
|
785
|
+
/** How long the Change Highlight marks a value that changed with the data, in milliseconds: one second unless
|
|
786
|
+
* given (ADR-0068). The source's changes are marked when newer data is shown, and a Refresh marks what changed
|
|
787
|
+
* too; a move of the user's marks nothing. Zero marks nothing, and a negative or endless one is refused. */
|
|
788
|
+
readonly changeHighlightDuration?: number;
|
|
789
|
+
/** How the report's work shares the thread: a slice of 30 ms between macrotasks unless given (PV-40). Read
|
|
790
|
+
* once, when the pivot is made. */
|
|
791
|
+
readonly slicing?: PivotSlicing;
|
|
792
|
+
/** Hears Show Details (ADR-0059, ADR-0063): the records behind a value cell double clicked. A Consumer that
|
|
793
|
+
* listens takes them, and the pivot shows nothing; otherwise they open as `detailsView` says. */
|
|
794
|
+
readonly onShowDetails?: (event: PivotShowDetailsEvent) => void;
|
|
795
|
+
/** Where the records open when nobody hears `onShowDetails`: a tab at the report's foot, which covers the report
|
|
796
|
+
* while it is selected, or a dialog; `tab` unless given. */
|
|
797
|
+
readonly detailsView?: PivotDetailsView;
|
|
798
|
+
/** Whether the Selection Summary is shown under the report (ADR-0130): Excel's status-bar figures over the cells
|
|
799
|
+
* selected, summed by the report source over the whole report, rows not drawn included. On unless given. */
|
|
800
|
+
readonly showSelectionSummary?: boolean;
|
|
801
|
+
/** The Selection Summary's figures, Excel's Average, Count and Sum unless given (ADR-0130). The report holds the
|
|
802
|
+
* choice made in the figures menu from then on; figures handed in that differ from the ones last handed replace
|
|
803
|
+
* it. */
|
|
804
|
+
readonly summaryFigures?: readonly SummaryFigure[];
|
|
805
|
+
/** Raised when the figures menu changes the figures shown (ADR-0130). */
|
|
806
|
+
readonly onSummaryFiguresChanged?: (figures: readonly SummaryFigure[]) => void;
|
|
807
|
+
/** Hears the Selection Summary as it now stands (ADR-0130), for an application that shows the figures elsewhere. */
|
|
808
|
+
readonly onSelectionSummaryChanged?: (summary: SelectionSummary) => void;
|
|
809
|
+
/** The parts a Wrapper's Chrome, or the Consumer's own, draws in place of the built-in markup (ADR-0061, ADR-0390),
|
|
810
|
+
* its `grid` dressing the report's grid and Show Details' grids. A part standing keeps the slot it opened with. */
|
|
811
|
+
readonly chrome?: PivotChrome;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
export { }
|