pivotkit-react 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -1
- package/README.md +33 -15
- package/dist/chunks/{chunk-JMRTIOX4.js → chunk-2N2UGSIG.js} +7 -0
- package/dist/chunks/{chunk-ZK5RVCHP.js → chunk-BHHIZHUE.js} +1 -1
- package/dist/chunks/{chunk-YXLANLGL.js → chunk-GUSQWPTH.js} +56 -3
- package/dist/chunks/{chunk-JOWAEZAD.js → chunk-JAOOFDNR.js} +21 -1
- package/dist/chunks/{chunk-E6M57YLL.js → chunk-MU5BTKSY.js} +7 -0
- package/dist/chunks/{chunk-TR2HROIK.js → chunk-RNQ32FCN.js} +66 -5
- package/dist/chunks/{chunk-XN5HNKJ2.js → chunk-SJCG4I57.js} +98 -33
- package/dist/chunks/{chunk-3LDE2GPG.js → chunk-VMJMDP7C.js} +372 -33
- package/dist/chunks/{report-run-BZBFOMPF.js → report-run-HU4WPOB7.js} +3 -1
- package/dist/chunks/{unused-texts-Y4R67XSN.js → unused-texts-LRYVWFFN.js} +1 -1
- package/dist/chunks/{unused-texts-de-6YVPTNVS.js → unused-texts-de-GB3IWWEM.js} +1 -1
- package/dist/echarts.js +426 -35
- package/dist/import-ui.js +3 -3
- package/dist/index.js +769 -435
- package/dist/labels.js +6 -6
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +1133 -542
- package/dist/styles.css +271 -158
- package/package.json +8 -4
- package/styles.css.d.ts +3 -0
- package/types/PivotReport.d.ts +6 -0
- package/types/add-menu.d.ts +48 -0
- package/types/chart-colors.d.ts +8 -0
- package/types/chart-decorate.d.ts +66 -3
- package/types/chart-legend.d.ts +176 -0
- package/types/chart-summary.d.ts +8 -3
- package/types/chart-tooltip.d.ts +159 -17
- package/types/chart.d.ts +21 -3
- package/types/date-context.d.ts +30 -0
- package/types/drill-panel.d.ts +4 -2
- package/types/echarts.d.ts +7 -3
- package/types/export-run.d.ts +19 -14
- package/types/export-scope.d.ts +13 -2
- package/types/field-info.d.ts +12 -0
- package/types/files.d.ts +14 -0
- package/types/filter.d.ts +18 -0
- package/types/group-context.d.ts +20 -0
- package/types/index.d.ts +35 -6
- package/types/label-room.d.ts +13 -0
- package/types/labels.d.ts +85 -16
- package/types/lazy-menus.d.ts +2 -2
- package/types/levels.d.ts +16 -7
- package/types/menu-labels.d.ts +67 -1
- package/types/menu-ops.d.ts +10 -0
- package/types/menu-topics.d.ts +110 -21
- package/types/menus.d.ts +3 -2
- package/types/names.d.ts +32 -3
- package/types/overflow.d.ts +18 -30
- package/types/print-frame.d.ts +32 -3
- package/types/report-run.d.ts +5 -0
- package/types/rove.d.ts +10 -0
- package/types/theme-tokens.d.ts +17 -0
- package/types/toolbar-panels.d.ts +43 -15
- package/types/unused-texts.d.ts +7 -0
- package/types/use-big-result.d.ts +24 -9
- package/types/use-export.d.ts +8 -4
- package/types/view-ops.d.ts +19 -8
- package/types/view-tabs.d.ts +12 -0
- package/types/zones.d.ts +41 -9
- package/types/light-tokens.d.ts +0 -16
package/types/menu-labels.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export declare const en: {
|
|
|
20
20
|
drillCopy: string;
|
|
21
21
|
drillJson: string;
|
|
22
22
|
groupLabels: string;
|
|
23
|
+
chartColors: string;
|
|
24
|
+
tooltip: string;
|
|
25
|
+
stackPercent: string;
|
|
26
|
+
zoom: string;
|
|
23
27
|
labelPosition: string;
|
|
24
28
|
sharedView: string;
|
|
25
29
|
valuesFilter: string;
|
|
@@ -31,6 +35,9 @@ export declare const en: {
|
|
|
31
35
|
searchMenuShort: string;
|
|
32
36
|
searchResults: string;
|
|
33
37
|
searchNothing: string;
|
|
38
|
+
addAlready: string;
|
|
39
|
+
addMoves: string;
|
|
40
|
+
addSecond: string;
|
|
34
41
|
sortByValue: string;
|
|
35
42
|
sortOldestShort: string;
|
|
36
43
|
sortNewestShort: string;
|
|
@@ -330,6 +337,14 @@ export declare const en: {
|
|
|
330
337
|
groupNone: string;
|
|
331
338
|
groupTimeline: string;
|
|
332
339
|
groupCyclic: string;
|
|
340
|
+
groupDataRange: {
|
|
341
|
+
one: string;
|
|
342
|
+
other: string;
|
|
343
|
+
};
|
|
344
|
+
groupYearsTogether: {
|
|
345
|
+
one: string;
|
|
346
|
+
other: string;
|
|
347
|
+
};
|
|
333
348
|
unitHints: {
|
|
334
349
|
year: string;
|
|
335
350
|
yearQuarter: string;
|
|
@@ -379,10 +394,16 @@ export declare const en: {
|
|
|
379
394
|
exportPrint: string;
|
|
380
395
|
exportPngNeedsChart: string;
|
|
381
396
|
exportNeedsField: string;
|
|
397
|
+
exportNeedsRows: string;
|
|
382
398
|
exportDataGroup: string;
|
|
383
399
|
exportDataCsv: string;
|
|
384
400
|
exportDataJson: string;
|
|
385
401
|
copyTable: string;
|
|
402
|
+
copyChart: string;
|
|
403
|
+
toastChartCopied: string;
|
|
404
|
+
toastImageCopyBlocked: string;
|
|
405
|
+
toastChartNotDrawn: string;
|
|
406
|
+
downloadPng: string;
|
|
386
407
|
copyDataJson: string;
|
|
387
408
|
toastTableCopied: string;
|
|
388
409
|
toastDataCopied: string;
|
|
@@ -408,6 +429,7 @@ export declare const en: {
|
|
|
408
429
|
resetTips: string;
|
|
409
430
|
sectionChanged: string;
|
|
410
431
|
help: string;
|
|
432
|
+
helpAndShortcuts: string;
|
|
411
433
|
shortcutsTitle: string;
|
|
412
434
|
keys: {
|
|
413
435
|
Mod: string;
|
|
@@ -446,6 +468,22 @@ export declare const en: {
|
|
|
446
468
|
chartTitle: string;
|
|
447
469
|
chartTitleNone: string;
|
|
448
470
|
smoothLines: string;
|
|
471
|
+
referenceLines: string;
|
|
472
|
+
targetNone: string;
|
|
473
|
+
linesOff: string;
|
|
474
|
+
targetPercent: string;
|
|
475
|
+
targetPercent100: string;
|
|
476
|
+
targetPercentHigh: string;
|
|
477
|
+
targetRemove: string;
|
|
478
|
+
linesNotes: {
|
|
479
|
+
noTotal: string;
|
|
480
|
+
negative: string;
|
|
481
|
+
percentStack: string;
|
|
482
|
+
noTime: string;
|
|
483
|
+
byIndex: string;
|
|
484
|
+
mixedUnits: string;
|
|
485
|
+
table: string;
|
|
486
|
+
};
|
|
449
487
|
labelPosition: string;
|
|
450
488
|
labelPositionNames: {
|
|
451
489
|
outside: string;
|
|
@@ -463,6 +501,28 @@ export declare const en: {
|
|
|
463
501
|
on: string;
|
|
464
502
|
off: string;
|
|
465
503
|
};
|
|
504
|
+
tooltip: string;
|
|
505
|
+
tooltipNames: {
|
|
506
|
+
auto: string;
|
|
507
|
+
axis: string;
|
|
508
|
+
};
|
|
509
|
+
zoom: string;
|
|
510
|
+
zoomNames: {
|
|
511
|
+
auto: string;
|
|
512
|
+
on: string;
|
|
513
|
+
off: string;
|
|
514
|
+
};
|
|
515
|
+
stackPercent: string;
|
|
516
|
+
shownSeries: string;
|
|
517
|
+
seriesShownOf: string;
|
|
518
|
+
chartAxis: string;
|
|
519
|
+
chartLayout: string;
|
|
520
|
+
tooltipShare: string;
|
|
521
|
+
colorOf: string;
|
|
522
|
+
colorDefault: string;
|
|
523
|
+
colorRemove: string;
|
|
524
|
+
colorsNotShown: string;
|
|
525
|
+
seriesOnly: string;
|
|
466
526
|
defaultName: string;
|
|
467
527
|
shareThisView: string;
|
|
468
528
|
copyLink: string;
|
|
@@ -518,7 +578,13 @@ export declare const en: {
|
|
|
518
578
|
one: string;
|
|
519
579
|
other: string;
|
|
520
580
|
};
|
|
521
|
-
|
|
581
|
+
chartShowEach: string;
|
|
582
|
+
chartShowOnly: string;
|
|
583
|
+
chartShowDetails: string;
|
|
584
|
+
chartShowTotals: string;
|
|
585
|
+
chartFoldEach: string;
|
|
586
|
+
chartFoldOnly: string;
|
|
587
|
+
chartFoldSome: string;
|
|
522
588
|
toastExported: string;
|
|
523
589
|
toastLinkCopied: string;
|
|
524
590
|
toastJsonCopied: string;
|
package/types/menu-ops.d.ts
CHANGED
|
@@ -430,3 +430,13 @@ export declare const dateInputValue: (iso: string) => string;
|
|
|
430
430
|
* @param {string} text
|
|
431
431
|
*/
|
|
432
432
|
export declare function dateFromInput(text: string): string | null;
|
|
433
|
+
/**
|
|
434
|
+
* A target line's value as typed (Display -> Reference lines): a number as a filter's value reads it
|
|
435
|
+
* (numbers.js), or for a value shown in percent a percentage, "25%": a share, 0.25, or 25 where the
|
|
436
|
+
* value counts in percent itself (format percent100). null when it is no number.
|
|
437
|
+
* @param {string} text
|
|
438
|
+
* @param {string} locale
|
|
439
|
+
* @param {string | undefined} format the value's format (toSeries)
|
|
440
|
+
* @returns {number | null}
|
|
441
|
+
*/
|
|
442
|
+
export declare function parseTarget(text: string, locale: string, format: string | undefined): number | null;
|
package/types/menu-topics.d.ts
CHANGED
|
@@ -23,11 +23,24 @@ export type Choice = {
|
|
|
23
23
|
current?: boolean;
|
|
24
24
|
testId?: string;
|
|
25
25
|
label?: string;
|
|
26
|
+
color?: {
|
|
27
|
+
id: string;
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
pick: (color: string) => void;
|
|
31
|
+
};
|
|
32
|
+
tags?: Array<{
|
|
33
|
+
icon: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
className?: string;
|
|
37
|
+
note?: string;
|
|
26
38
|
};
|
|
27
39
|
export type Topic = {
|
|
28
40
|
id: string;
|
|
29
41
|
title: string;
|
|
30
42
|
kind: "segmented" | "inline" | "menu" | "panel";
|
|
43
|
+
testId?: string;
|
|
31
44
|
groups?: Array<{
|
|
32
45
|
title?: string;
|
|
33
46
|
choices: Choice[];
|
|
@@ -41,6 +54,7 @@ export type Topic = {
|
|
|
41
54
|
levelTitle?: string;
|
|
42
55
|
note?: string | null;
|
|
43
56
|
noteId?: string;
|
|
57
|
+
intro?: string;
|
|
44
58
|
keywords?: string;
|
|
45
59
|
searchExtra?: Array<{
|
|
46
60
|
id: string;
|
|
@@ -63,10 +77,17 @@ export type Topic = {
|
|
|
63
77
|
* away). `checkbox`: a switch (`checked` on or off) instead of one of several; `disabled` with the
|
|
64
78
|
* `reason`; `info`: the id of its explanation (labels.settingInfo). `open`: the id of a topic whose
|
|
65
79
|
* level it opens (after `run`; Back puts the focus on `backTo`, else on the choice), instead of applying; `actions`: an entry's own actions next to it
|
|
66
|
-
* (choices themselves, drawn as icon buttons with `label`); `
|
|
80
|
+
* (choices themselves, drawn as icon buttons with `label`); `color`: a colour field beside it, a menu
|
|
81
|
+
* item that opens the browser's colour picker (`pick` gets #rrggbb); `current`: the entry shown now. A switch
|
|
82
|
+
* (`checkbox`) keeps its level open after it, so people flip several in a row.
|
|
67
83
|
* @typedef {{ id: string, text: string, change?: () => { view: any, note: any } | null, run?: () => void, checked?: boolean,
|
|
68
84
|
* hint?: string, icon?: string, closes?: boolean, checkbox?: boolean, disabled?: boolean, reason?: string, info?: string,
|
|
69
|
-
* keywords?: string, open?: string, backTo?: string, actions?: Array<Choice & { label: string }>, current?: boolean, testId?: string, label?: string
|
|
85
|
+
* keywords?: string, open?: string, backTo?: string, actions?: Array<Choice & { label: string }>, current?: boolean, testId?: string, label?: string,
|
|
86
|
+
* color?: { id: string, value: string, label: string, pick: (color: string) => void },
|
|
87
|
+
* tags?: Array<{ icon: string, text: string }>, className?: string, note?: string }} Choice
|
|
88
|
+
* `tags`: small marks after the text (the zones a field is in), hidden from assistive technology;
|
|
89
|
+
* `note`: a line under the text that says what choosing it does, read with it; `className`: the
|
|
90
|
+
* item's own class (a field's type).
|
|
70
91
|
*/
|
|
71
92
|
/**
|
|
72
93
|
* One topic of a menu. `kind`: "segmented" its choices on the first level side by side, "inline" one
|
|
@@ -75,9 +96,9 @@ export type Topic = {
|
|
|
75
96
|
* `state` is what is set, in short, on the row's right; `changed` marks a setting that is not the
|
|
76
97
|
* default; `info` the id of an explanation next to the level's title. `hidden`: a level a choice
|
|
77
98
|
* opens, with no row of its own (`levelTitle` its title); `note`: a line under its choices.
|
|
78
|
-
* @typedef {{ id: string, title: string, kind: "segmented" | "inline" | "menu" | "panel",
|
|
99
|
+
* @typedef {{ id: string, title: string, kind: "segmented" | "inline" | "menu" | "panel", testId?: string,
|
|
79
100
|
* groups?: Array<{ title?: string, choices: Choice[] }>, state?: string | null, changed?: boolean,
|
|
80
|
-
* icon?: string, titled?: boolean, info?: string, hidden?: boolean, levelTitle?: string, note?: string | null, noteId?: string,
|
|
101
|
+
* icon?: string, titled?: boolean, info?: string, hidden?: boolean, levelTitle?: string, note?: string | null, noteId?: string, intro?: string,
|
|
81
102
|
* keywords?: string, searchExtra?: Array<{ id: string, text: string, focus?: string, choice?: Choice, keywords?: string }>,
|
|
82
103
|
* searchFor?: (query: string) => Array<{ id: string, text: string, focus?: string, choice: Choice, keywords?: string }> }} Topic
|
|
83
104
|
* `keywords`: more words the search finds the topic's entries by (a choice's own `keywords` put it
|
|
@@ -177,44 +198,112 @@ export declare function valueTopics({ view, index, types, labels, locale, defaul
|
|
|
177
198
|
earlier?: () => any[];
|
|
178
199
|
}): Topic[];
|
|
179
200
|
/**
|
|
180
|
-
* The
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* @param {
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
201
|
+
* The words of folding the groups of Rows (Expand all and Collapse all), from the fields: Collapse all
|
|
202
|
+
* keeps the first field's groups ("Show Region only"), Expand all shows every item of the last field
|
|
203
|
+
* ("Show each Country"). With fewer than two fields in Rows there is nothing to name: the plain words
|
|
204
|
+
* ("Show details", "Show group totals only"), `named` false.
|
|
205
|
+
* @param {any} view
|
|
206
|
+
* @param {any} labels with the menus' texts
|
|
207
|
+
* @returns {{ expand: string, collapse: string, named: boolean }}
|
|
208
|
+
*/
|
|
209
|
+
export declare function rowFoldTexts(view: any, labels: any): {
|
|
210
|
+
expand: string;
|
|
211
|
+
collapse: string;
|
|
212
|
+
named: boolean;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* The Table settings menu: the totals as switches (off, with the reason, where the table has no such
|
|
216
|
+
* total), then Rows with Expand all and Collapse all; Collapse all says what it keeps in the chart's
|
|
217
|
+
* words ("Show Region only"). A switch applies at once and the menu stays open; Expand all and
|
|
218
|
+
* Collapse all close it.
|
|
219
|
+
* @param {{ view: any, labels: any, folding: { canExpand: boolean, canCollapse: boolean, why: any },
|
|
220
|
+
* act: { total: (key: string, on: boolean) => void, expand: () => void, collapse: () => void } }} input
|
|
188
221
|
* @returns {Topic[]}
|
|
189
222
|
*/
|
|
190
|
-
export declare function
|
|
223
|
+
export declare function tableTopics({ view, labels, folding, act }: {
|
|
191
224
|
view: any;
|
|
192
225
|
labels: any;
|
|
193
226
|
folding: {
|
|
194
227
|
canExpand: boolean;
|
|
195
228
|
canCollapse: boolean;
|
|
196
|
-
why:
|
|
197
|
-
expand?: string | null;
|
|
198
|
-
collapse?: string | null;
|
|
199
|
-
};
|
|
229
|
+
why: any;
|
|
200
230
|
};
|
|
231
|
+
act: {
|
|
232
|
+
total: (key: string, on: boolean) => void;
|
|
233
|
+
expand: () => void;
|
|
234
|
+
collapse: () => void;
|
|
235
|
+
};
|
|
236
|
+
}): Topic[];
|
|
237
|
+
/**
|
|
238
|
+
* The topics of "More": Help first, a level with the tips' switches (where the host leaves them to
|
|
239
|
+
* the user) and a row that opens the keyboard shortcuts (a panel, toolbar-panels.jsx). The toolbar's
|
|
240
|
+
* buttons that moved into More follow below it (toolbar.jsx).
|
|
241
|
+
* @param {{ labels: any, tips: { controls: boolean, on: boolean, canReset: boolean }, explanations: { on: boolean } | null,
|
|
242
|
+
* act: { tipsOn: (on: boolean) => void, resetTips: () => void, explain: (on: boolean) => void } }} input
|
|
243
|
+
* @returns {Topic[]}
|
|
244
|
+
*/
|
|
245
|
+
export declare function moreTopics({ labels, tips, explanations, act }: {
|
|
246
|
+
labels: any;
|
|
201
247
|
tips: {
|
|
202
248
|
controls: boolean;
|
|
203
249
|
on: boolean;
|
|
204
250
|
canReset: boolean;
|
|
205
251
|
};
|
|
206
|
-
explanations
|
|
252
|
+
explanations: {
|
|
207
253
|
on: boolean;
|
|
208
254
|
} | null;
|
|
209
255
|
act: {
|
|
210
|
-
total: (key: string, on: boolean) => void;
|
|
211
|
-
expand: () => void;
|
|
212
|
-
collapse: () => void;
|
|
213
256
|
tipsOn: (on: boolean) => void;
|
|
214
257
|
resetTips: () => void;
|
|
215
258
|
explain: (on: boolean) => void;
|
|
216
259
|
};
|
|
217
260
|
}): Topic[];
|
|
261
|
+
/**
|
|
262
|
+
* The topics of Chart settings after its types (#106, #580), each a row with what is set that opens
|
|
263
|
+
* its level: Value labels, Legend, Title (a form), Axis (axis and group labels, the zoom slider),
|
|
264
|
+
* Tooltip (and the share in it), Reference lines (a form), Series (one switch and one colour per
|
|
265
|
+
* series or slice) and Layout (100 % stacks, smooth lines, a pie's label position, the groups of
|
|
266
|
+
* Rows folded). A topic the chart has nothing for is left out. Every choice applies `act.display(patch)`
|
|
267
|
+
* (pivotkit-core's chart settings); the type stays. Reference lines come after Tooltip: a level with
|
|
268
|
+
* a form (toolbar-panels.jsx), its row saying which lines are on.
|
|
269
|
+
* @param {{ view: any, drawn: string, labels: any, names: string[], act: { display: (patch: object) => void, expand?: () => void, collapse?: () => void }, drawnColors?: Map<string, string>,
|
|
270
|
+
* lines?: { rules: { average: boolean, trend: boolean, target: boolean, notes?: string[] }, targetText: string },
|
|
271
|
+
* folding?: { canExpand: boolean, canCollapse: boolean, collapsed: number, why: any } }} input
|
|
272
|
+
* `drawn`: the picker entry drawn (chart-types.js); `names`: the legend's entries (series, a pie's slices);
|
|
273
|
+
* `lines`: which reference lines the chart can draw (pivotkit-core's referenceLineChecks, or its
|
|
274
|
+
* view's rules with the note "table" while the chart is not drawn yet), and the target as the locale writes it;
|
|
275
|
+
* `drawnColors`: the colour the chart draws each name with, as #rrggbb (the colour fields start from it);
|
|
276
|
+
* `folding`: rowFolding() of view-ops.js. With it, Layout ends with the groups of Rows folded or
|
|
277
|
+
* not, in the words of the fields ("Show each Country", "Show Region only"; rowFoldTexts)
|
|
278
|
+
* @returns {Topic[]}
|
|
279
|
+
*/
|
|
280
|
+
export declare function chartTopics({ view, drawn, labels, names, act, lines, drawnColors, folding }: {
|
|
281
|
+
view: any;
|
|
282
|
+
drawn: string;
|
|
283
|
+
labels: any;
|
|
284
|
+
names: string[];
|
|
285
|
+
act: {
|
|
286
|
+
display: (patch: object) => void;
|
|
287
|
+
expand?: () => void;
|
|
288
|
+
collapse?: () => void;
|
|
289
|
+
};
|
|
290
|
+
drawnColors?: Map<string, string>;
|
|
291
|
+
lines?: {
|
|
292
|
+
rules: {
|
|
293
|
+
average: boolean;
|
|
294
|
+
trend: boolean;
|
|
295
|
+
target: boolean;
|
|
296
|
+
notes?: string[];
|
|
297
|
+
};
|
|
298
|
+
targetText: string;
|
|
299
|
+
};
|
|
300
|
+
folding?: {
|
|
301
|
+
canExpand: boolean;
|
|
302
|
+
canCollapse: boolean;
|
|
303
|
+
collapsed: number;
|
|
304
|
+
why: any;
|
|
305
|
+
};
|
|
306
|
+
}): Topic[];
|
|
218
307
|
/**
|
|
219
308
|
* The ids of the Views menu's entries: by their group, their name and how often the name came
|
|
220
309
|
* before in that group, so an entry keeps its id when one before it is deleted, and two entries of
|
package/types/menus.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { AxisMenu, FilterMenu, ValueMenu } from "./chip-menus.jsx";
|
|
2
|
-
export {
|
|
2
|
+
export { AddMenu } from "./add-menu.jsx";
|
|
3
|
+
export { ChartSettingsPanel, ExportPanel, LoadCheck, MorePanel, TableSettingsPanel, ViewsPanel } from "./toolbar-panels.jsx";
|
|
3
4
|
export { FilterPopover } from "./filter.jsx";
|
|
4
5
|
export { DrillPanel } from "./drill-panel.jsx";
|
|
5
6
|
export { DataMenu } from "./data-menu.jsx";
|
|
6
7
|
export { addMenuTexts, hasMenuTexts, menuLabels } from "./menu-labels.js";
|
|
7
8
|
export { storedViews } from "./view-store.js";
|
|
8
|
-
export {
|
|
9
|
+
export { prepareExport, runExport } from "./export-run.js";
|
package/types/names.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names of a view's values, the chips' and the table headers': a repeated one numbered as the
|
|
3
|
+
* exports name it ("Sum of Revenue (2)", pivotkit-core's numberRepeats).
|
|
4
|
+
*/
|
|
5
|
+
export declare const valueLabels: (values: any, labels: any) => string[];
|
|
1
6
|
/** "Sum of Revenue", "% of grand total of Revenue", or the value's own name. */
|
|
2
7
|
export declare function valueLabel(spec: any, labels: any): any;
|
|
3
8
|
/**
|
|
@@ -85,6 +90,24 @@ export declare function relativeDays(f: {
|
|
|
85
90
|
from: string;
|
|
86
91
|
to: string;
|
|
87
92
|
} | null;
|
|
93
|
+
/** Today in a time zone as an ISO day (`now`, default the current time); the UTC day beyond what a Date holds. */
|
|
94
|
+
export declare const todayIn: (timeZone: any, now: any) => string;
|
|
95
|
+
/**
|
|
96
|
+
* The last day of a range whose lack of data is worth a word (#586): yesterday when the range holds
|
|
97
|
+
* today and the data have no date after today (the days from today on cannot have data yet), else
|
|
98
|
+
* the range's end. Rows dated after today (end-of-life dates, plans) keep every day, and so does a
|
|
99
|
+
* range wholly after today.
|
|
100
|
+
* @param {{ from: string, to: string }} range ISO days (a minute's day is read)
|
|
101
|
+
* @param {{ min: number, max: number }} span the data's first and last date (wall-clock ms)
|
|
102
|
+
* @param {string} today today in the data's time zone (ISO day)
|
|
103
|
+
*/
|
|
104
|
+
export declare function namedUntil(range: {
|
|
105
|
+
from: string;
|
|
106
|
+
to: string;
|
|
107
|
+
}, span: {
|
|
108
|
+
min: number;
|
|
109
|
+
max: number;
|
|
110
|
+
}, today: string): any;
|
|
88
111
|
/**
|
|
89
112
|
* Whether a relative range is said in short with its periods ("last 3 months (Aug–Oct 2026)", "this
|
|
90
113
|
* quarter (Q4 2026)"): the last N or this day, week, month, quarter or year, in whole calendar
|
|
@@ -131,7 +154,10 @@ export declare function rangeText(f: {
|
|
|
131
154
|
* @param {string} unit
|
|
132
155
|
* @param {{ min: number, max: number }} span the data's first and last date (wall-clock ms)
|
|
133
156
|
* @param {string} locale
|
|
134
|
-
* @
|
|
157
|
+
* @param {string} today today in the data's time zone (ISO day). The days `namedUntil` leaves out are
|
|
158
|
+
* not named: null when only they lack data; `none` with `to`, the last day to name, when that is
|
|
159
|
+
* before the range's end
|
|
160
|
+
* @returns {{ none: true, to?: string } | { none: false, data: string, missing: string[], count: number } | null} `count`: how many
|
|
135
161
|
* periods have no data, for the words ("2026 has no data", "2021–2022 have no data")
|
|
136
162
|
*/
|
|
137
163
|
export declare function rangeShare(range: {
|
|
@@ -140,8 +166,9 @@ export declare function rangeShare(range: {
|
|
|
140
166
|
}, unit: string, span: {
|
|
141
167
|
min: number;
|
|
142
168
|
max: number;
|
|
143
|
-
}, locale: string): {
|
|
169
|
+
}, locale: string, today: string): {
|
|
144
170
|
none: true;
|
|
171
|
+
to?: string;
|
|
145
172
|
} | {
|
|
146
173
|
none: false;
|
|
147
174
|
data: string;
|
|
@@ -151,7 +178,9 @@ export declare function rangeShare(range: {
|
|
|
151
178
|
/**
|
|
152
179
|
* A relative date range in short, with the days it keeps: "last 5 years (2022–2026)", "this year
|
|
153
180
|
* (2026)". With the data's span, the data's share of them: "last 2 years (2025; 2026 has no data)",
|
|
154
|
-
* "this year (2026 has no data)".
|
|
181
|
+
* "this year (2026 has no data)". The days from today on are not named while the data have no date
|
|
182
|
+
* after today: they cannot have data yet (namedUntil, #586).
|
|
183
|
+
* Anchored at the data's latest date: "last 12 months to Dec 2025",
|
|
155
184
|
* its days only when the data do not cover them all.
|
|
156
185
|
* @param {{ unit: string, count?: number, anchor?: string, direction?: string, calendar?: boolean, includeCurrent?: boolean }} f a `relative` filter
|
|
157
186
|
* @param {import("./labels.js").UiLabels} labels
|
package/types/overflow.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The buttons that move into "More" when the toolbar is too narrow, first to go first: a fixed
|
|
3
|
-
* priority. The order never depends on a button's own state
|
|
4
|
-
*
|
|
5
|
-
* and Views
|
|
6
|
-
* a user saves the report. "data" is the place of a Data button (loading data):
|
|
3
|
+
* priority. The order never depends on a button's own state, so a click never moves it. Data goes
|
|
4
|
+
* first. Start over and Views go last: Start over holds New, which must be as easy to find as Reset,
|
|
5
|
+
* and Views is where a user saves the report. "data" is the place of a Data button (loading data):
|
|
7
6
|
* a toolbar without one leaves it out and pays nothing for it. Redo is not in the list: it stays next
|
|
8
|
-
* to Undo, which always stays, as do
|
|
7
|
+
* to Undo, which always stays, as do Export and More itself (Help is its first entry).
|
|
9
8
|
*/
|
|
10
9
|
export declare const OVERFLOW_ORDER: readonly string[];
|
|
11
10
|
/**
|
|
12
|
-
* The groups of "More", in order, each with a rule between it and the one before:
|
|
13
|
-
* two actions as entries of their own),
|
|
14
|
-
*
|
|
11
|
+
* The groups of "More" below Help, in order, each with a rule between it and the one before:
|
|
12
|
+
* starting over (its two actions as entries of their own), data, the saved views. A group without an
|
|
13
|
+
* entry in More is not shown.
|
|
15
14
|
*/
|
|
16
15
|
export declare const MORE_GROUPS: readonly (readonly string[])[];
|
|
17
16
|
/**
|
|
@@ -21,50 +20,39 @@ export declare const MORE_GROUPS: readonly (readonly string[])[];
|
|
|
21
20
|
*/
|
|
22
21
|
export declare const TOOLBAR_ROOM: Readonly<{
|
|
23
22
|
fields: 6.4;
|
|
24
|
-
display: 15.3;
|
|
25
|
-
chartType: 12.9;
|
|
26
|
-
sep: 1;
|
|
27
23
|
undo: 8.75;
|
|
28
24
|
redo: 9.15;
|
|
29
25
|
startOver: 10.9;
|
|
30
|
-
layout: 8.4;
|
|
31
|
-
options: 8.75;
|
|
32
26
|
data: 7.4;
|
|
33
27
|
views: 9.1;
|
|
34
28
|
export: 7.5;
|
|
35
29
|
more: 7.2;
|
|
36
30
|
}>;
|
|
37
31
|
/**
|
|
38
|
-
* Every text each part of the toolbar can show with the report's labels: a list of texts per part
|
|
39
|
-
* (the chart type: every type's name, so picking one never moves a button); for `display`
|
|
40
|
-
* (Table | Chart) the pair.
|
|
32
|
+
* Every text each part of the toolbar can show with the report's labels: a list of texts per part.
|
|
41
33
|
* @param {any} labels
|
|
42
|
-
* @returns {Record<string, string[]>
|
|
34
|
+
* @returns {Record<string, string[]>}
|
|
43
35
|
*/
|
|
44
|
-
export declare function toolbarTexts(labels: any): Record<string, string[]
|
|
45
|
-
display: string[][];
|
|
46
|
-
};
|
|
36
|
+
export declare function toolbarTexts(labels: any): Record<string, string[]>;
|
|
47
37
|
/**
|
|
48
38
|
* The room (px) each part takes with its widest text: what a button has around its text (`chrome`:
|
|
49
|
-
* a text button's, a menu button's
|
|
50
|
-
*
|
|
39
|
+
* a text button's, a menu button's; measured from those on screen) plus the widest text (`measure`,
|
|
40
|
+
* in the toolbar's font) plus the gap after it.
|
|
51
41
|
* @param {ReturnType<typeof toolbarTexts>} texts
|
|
52
|
-
* @param {(text: string
|
|
53
|
-
* @param {{ text: number, menu: number,
|
|
42
|
+
* @param {(text: string) => number} measure
|
|
43
|
+
* @param {{ text: number, menu: number, gap: number }} chrome
|
|
54
44
|
* @returns {Record<string, number>}
|
|
55
45
|
*/
|
|
56
|
-
export declare function toolbarRoom(texts: ReturnType<typeof toolbarTexts>, measure: (text: string
|
|
46
|
+
export declare function toolbarRoom(texts: ReturnType<typeof toolbarTexts>, measure: (text: string) => number, chrome: {
|
|
57
47
|
text: number;
|
|
58
48
|
menu: number;
|
|
59
|
-
display: number;
|
|
60
|
-
sep: number;
|
|
61
49
|
gap: number;
|
|
62
50
|
}): Record<string, number>;
|
|
63
51
|
/**
|
|
64
52
|
* The entries of OVERFLOW_ORDER that go into "More" in a toolbar `width` wide: first as few as the
|
|
65
|
-
* order allows (the first ones go until the rest fits
|
|
66
|
-
* room left still holds comes back, the last in the order first. A button moves only when the
|
|
67
|
-
* left really cannot hold it.
|
|
53
|
+
* order allows (the first ones go until the rest fits; More is always there), then every one of them
|
|
54
|
+
* that the room left still holds comes back, the last in the order first. A button moves only when the
|
|
55
|
+
* room left really cannot hold it.
|
|
68
56
|
* @param {number} width in the unit of `room` (em for TOOLBAR_ROOM, px for toolbarRoom)
|
|
69
57
|
* @param {boolean} narrow the report is narrow: the Fields button is there too
|
|
70
58
|
* @param {ReadonlyArray<string>} present the entries of OVERFLOW_ORDER this toolbar has
|
package/types/print-frame.d.ts
CHANGED
|
@@ -15,10 +15,39 @@ export declare function printParts(html: string, parser: DOMParser): {
|
|
|
15
15
|
title: string;
|
|
16
16
|
body: HTMLElement;
|
|
17
17
|
};
|
|
18
|
+
export type PrintSlot = {
|
|
19
|
+
frame: HTMLIFrameElement;
|
|
20
|
+
loaded: Promise<boolean>;
|
|
21
|
+
isLoaded: boolean;
|
|
22
|
+
};
|
|
18
23
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
24
|
+
* Makes an empty frame ready in `container` for the next print, unless one is (the Export menu, when
|
|
25
|
+
* it opens).
|
|
26
|
+
* @param {HTMLElement} container the report's root
|
|
27
|
+
*/
|
|
28
|
+
export declare function preparePrintFrame(container: HTMLElement): void;
|
|
29
|
+
/**
|
|
30
|
+
* Removes the ready frame no print took (the Export menu, when it closes).
|
|
31
|
+
* @param {HTMLElement} container
|
|
32
|
+
*/
|
|
33
|
+
export declare function releasePrintFrame(container: HTMLElement): void;
|
|
34
|
+
/**
|
|
35
|
+
* Takes the frame for a print, in the click before anything is awaited (so the menu, closing, leaves
|
|
36
|
+
* it): the ready one, or a new one when none is. Every other print frame in `container` goes.
|
|
21
37
|
* @param {HTMLElement} container the report's root
|
|
38
|
+
* @returns {PrintSlot}
|
|
39
|
+
*/
|
|
40
|
+
export declare function takePrintFrame(container: HTMLElement): PrintSlot;
|
|
41
|
+
/**
|
|
42
|
+
* Removes a frame takePrintFrame gave that will not print (the host took the report, or it failed).
|
|
43
|
+
* @param {PrintSlot} slot
|
|
44
|
+
*/
|
|
45
|
+
export declare const dropPrintFrame: (slot: PrintSlot) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Prints the report's HTML from a frame takePrintFrame gave: at once when the frame has loaded (in
|
|
48
|
+
* the click), else once it has.
|
|
49
|
+
* @param {string} html pivotkit-report's HTML (format "html", chartEmbed "inline")
|
|
50
|
+
* @param {PrintSlot} slot
|
|
22
51
|
* @returns {Promise<boolean>} false when the frame could not be used (blocked by the page)
|
|
23
52
|
*/
|
|
24
|
-
export declare function printHtml(html: string,
|
|
53
|
+
export declare function printHtml(html: string, slot: PrintSlot): Promise<boolean>;
|
package/types/report-run.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ export { render };
|
|
|
6
6
|
* The chart's lengths in px come from the chart's module (LENGTH_TOKENS).
|
|
7
7
|
*/
|
|
8
8
|
export declare const REPORT_TOKENS: readonly string[];
|
|
9
|
+
/**
|
|
10
|
+
* The colours of an HTML report on a dark screen, as the report's dark theme resolves them
|
|
11
|
+
* (export-run.js): pivotkit-report's dark colours and a host's middle colour of a colour scale.
|
|
12
|
+
*/
|
|
13
|
+
export declare const REPORT_DARK_TOKENS: readonly string[];
|
|
9
14
|
/**
|
|
10
15
|
* The HTML report's font sizes, in px as the report resolves them (export-run.js): its text and
|
|
11
16
|
* secondary text, so the file's text is the size the screen's is, and a host's title and print sizes
|
package/types/rove.d.ts
CHANGED
|
@@ -18,3 +18,13 @@ export declare function roveTarget(key: string, at: {
|
|
|
18
18
|
} | null;
|
|
19
19
|
/** The key that opens the menu of the field in focus: Shift+F10 or the context menu key. */
|
|
20
20
|
export declare const opensMenu: (e: any) => any;
|
|
21
|
+
/**
|
|
22
|
+
* The tab a key moves the focus to (ARIA tabs, manual activation: the key only moves the focus, Enter
|
|
23
|
+
* or Space shows the tab): left and right wrap around, Home and End go to the ends. Null for any
|
|
24
|
+
* other key.
|
|
25
|
+
* @param {string} key KeyboardEvent.key
|
|
26
|
+
* @param {number} at the tab in focus
|
|
27
|
+
* @param {number} count the tabs
|
|
28
|
+
* @returns {number | null}
|
|
29
|
+
*/
|
|
30
|
+
export declare function tabStep(key: string, at: number, count: number): number | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens as the report's `theme` resolves them, in either theme the report shows: the light ones for
|
|
3
|
+
* a workbook and an HTML report (so a host's light colours go into them from a dark report too), the
|
|
4
|
+
* dark ones for the HTML report on a dark screen. A report showing the other theme shows this one for
|
|
5
|
+
* the read, on its root and, inside pivotkit-element, on the element whose :host rules declare the
|
|
6
|
+
* tokens, and its own again in the same task, so nothing is drawn in between; --pk-duration is 0ms
|
|
7
|
+
* meanwhile (on the root, important), so no transition of the report's starts on the way there or
|
|
8
|
+
* back. A host's rules on data-pk-theme="dark" (or "light") are read that way; rules on something
|
|
9
|
+
* else (an html[data-theme] of the page) apply in both. Lengths are resolved by the chart's module
|
|
10
|
+
* (chart-decorate.js, tokenLengths), passed in as `more`, read in that theme too.
|
|
11
|
+
* @param {HTMLElement} root the report's root
|
|
12
|
+
* @param {"light" | "dark"} theme
|
|
13
|
+
* @param {readonly string[]} names
|
|
14
|
+
* @param {() => Record<string, string>} [more] further tokens read while that theme shows
|
|
15
|
+
* @returns {Record<string, string>} the tokens that are set
|
|
16
|
+
*/
|
|
17
|
+
export declare function themeTokens(root: HTMLElement, theme: "light" | "dark", names: readonly string[], more?: () => Record<string, string>): Record<string, string>;
|