pivotkit-react 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +339 -1
  2. package/README.md +2 -2
  3. package/dist/chunks/{chunk-IOPAM4JD.js → chunk-2AT72SLA.js} +635 -980
  4. package/dist/chunks/chunk-3E4NB5RZ.js +215 -0
  5. package/dist/chunks/{chunk-32Z33U6S.js → chunk-3WUGQPWV.js} +106 -9
  6. package/dist/chunks/{chunk-7CC4JHDY.js → chunk-4RS72AAA.js} +27 -8
  7. package/dist/chunks/{chunk-EM23V5GH.js → chunk-E6M57YLL.js} +19 -8
  8. package/dist/chunks/{chunk-RWYHJRQO.js → chunk-JMRTIOX4.js} +17 -7
  9. package/dist/chunks/chunk-RIOSIYGC.js +665 -0
  10. package/dist/chunks/{chunk-APB4NW4O.js → chunk-U5Q5I2D5.js} +36 -10
  11. package/dist/chunks/report-run-BZBFOMPF.js +12 -0
  12. package/dist/chunks/{unused-texts-K3VFH65P.js → unused-texts-Y4R67XSN.js} +1 -1
  13. package/dist/chunks/{unused-texts-de-OW4TGIVX.js → unused-texts-de-6YVPTNVS.js} +1 -1
  14. package/dist/echarts.js +38 -156
  15. package/dist/import-ui.js +765 -0
  16. package/dist/import-worker.js +20 -0
  17. package/dist/index.js +683 -244
  18. package/dist/labels.js +14 -10
  19. package/dist/menu-texts-de.js +1 -1
  20. package/dist/menus.js +768 -299
  21. package/dist/styles.css +322 -100
  22. package/package.json +9 -4
  23. package/types/chart-decorate.d.ts +28 -4
  24. package/types/chart-types.d.ts +2 -4
  25. package/types/data-history.d.ts +85 -0
  26. package/types/data-keep.d.ts +51 -0
  27. package/types/data-menu.d.ts +11 -0
  28. package/types/dom.d.ts +40 -7
  29. package/types/echarts.d.ts +1 -1
  30. package/types/export-run.d.ts +37 -3
  31. package/types/field-info.d.ts +32 -0
  32. package/types/filter.d.ts +1 -1
  33. package/types/icons.d.ts +1 -0
  34. package/types/import-host.d.ts +53 -0
  35. package/types/import-labels.d.ts +401 -0
  36. package/types/import-limits.d.ts +6 -0
  37. package/types/import-module.d.ts +2 -0
  38. package/types/import-run.d.ts +73 -0
  39. package/types/import-source.d.ts +32 -0
  40. package/types/import-steps.d.ts +121 -0
  41. package/types/import-ui.d.ts +108 -0
  42. package/types/import-worker.d.ts +1 -0
  43. package/types/index.d.ts +81 -11
  44. package/types/labels.d.ts +224 -4
  45. package/types/lazy-import.d.ts +4 -0
  46. package/types/lazy-menus.d.ts +2 -2
  47. package/types/levels.d.ts +3 -2
  48. package/types/light-tokens.d.ts +16 -0
  49. package/types/menu-labels.d.ts +37 -17
  50. package/types/menu-ops.d.ts +161 -40
  51. package/types/menu-topics.d.ts +9 -8
  52. package/types/menus.d.ts +1 -0
  53. package/types/names.d.ts +47 -19
  54. package/types/overflow.d.ts +29 -17
  55. package/types/place.d.ts +24 -0
  56. package/types/popover.d.ts +47 -5
  57. package/types/print-frame.d.ts +24 -0
  58. package/types/report-run.d.ts +14 -0
  59. package/types/section.d.ts +2 -2
  60. package/types/share-actions.d.ts +3 -3
  61. package/types/share.d.ts +13 -17
  62. package/types/theme.d.ts +2 -16
  63. package/types/tips.d.ts +5 -0
  64. package/types/toasts.d.ts +1 -1
  65. package/types/toolbar-panels.d.ts +11 -9
  66. package/types/unused-keep.d.ts +20 -0
  67. package/types/unused-texts.d.ts +13 -3
  68. package/types/unused.d.ts +1 -0
  69. package/types/use-export.d.ts +2 -2
  70. package/types/use-view-history.d.ts +12 -4
  71. package/types/view-ops.d.ts +65 -6
  72. package/types/virtual.d.ts +15 -0
  73. package/types/chart-layout.d.ts +0 -111
@@ -0,0 +1,108 @@
1
+ import React from "react";
2
+ /** Rows and columns the preview shows. */
3
+ export declare const PREVIEW_ROWS = 8;
4
+ export declare const PREVIEW_COLUMNS = 60;
5
+ /**
6
+ * The Data menu: where the data shown comes from, and loading.
7
+ * @param {{ labels: any, locale: string, source: { name: string | null, rows: number, columns: number, imported: boolean },
8
+ * plugins: any[], onPick: () => void, onBack: () => void, close: () => void }} props
9
+ */
10
+ export declare function DataPanel({ labels, locale, source, plugins, onPick, onBack, close }: {
11
+ labels: any;
12
+ locale: string;
13
+ source: {
14
+ name: string | null;
15
+ rows: number;
16
+ columns: number;
17
+ imported: boolean;
18
+ };
19
+ plugins: any[];
20
+ onPick: () => void;
21
+ onBack: () => void;
22
+ close: () => void;
23
+ }): React.JSX.Element;
24
+ /**
25
+ * Over the whole report while a file is dragged over it: where to let go, and what it reads. In the
26
+ * top layer like the menus, placed on the part of the report on screen; it takes no pointer events,
27
+ * so the report's drop handlers get them.
28
+ * @param {{ labels: any, locale: string, plugins: any[], box: () => DOMRect | undefined }} props `box`: the report's
29
+ */
30
+ export declare function DropOverlay({ labels, locale, plugins, box: boxOf }: {
31
+ labels: any;
32
+ locale: string;
33
+ plugins: any[];
34
+ box: () => DOMRect | undefined;
35
+ }): React.ReactPortal | null;
36
+ /**
37
+ * Where the data shown comes from, under the result while a file's data is shown.
38
+ * @param {{ labels: any, source: { name: string, sheet?: string | null } }} props
39
+ */
40
+ export declare function SourceLine({ labels, source }: {
41
+ labels: any;
42
+ source: {
43
+ name: string;
44
+ sheet?: string | null;
45
+ };
46
+ }): React.JSX.Element;
47
+ export type LoadedData = {
48
+ encoded: import("pivotkit-core").Encoded;
49
+ /**
50
+ * the id for the saved views (import-source.js), the name shown
51
+ */
52
+ source: {
53
+ id: string;
54
+ name: string;
55
+ };
56
+ file: {
57
+ name: string;
58
+ size: number;
59
+ type: string;
60
+ };
61
+ sheet: string | null;
62
+ rows: number;
63
+ columns: Array<{
64
+ name: string;
65
+ type: string;
66
+ }>;
67
+ notes: Array<{
68
+ code: string;
69
+ params: Record<string, unknown>;
70
+ message: string;
71
+ }>;
72
+ };
73
+ /**
74
+ * @typedef {object} LoadedData what "Load data" hands the report
75
+ * @property {import("pivotkit-core").Encoded} encoded
76
+ * @property {{ id: string, name: string }} source the id for the saved views (import-source.js), the name shown
77
+ * @property {{ name: string, size: number, type: string }} file
78
+ * @property {string | null} sheet
79
+ * @property {number} rows
80
+ * @property {Array<{ name: string, type: string }>} columns
81
+ * @property {Array<{ code: string, params: Record<string, unknown>, message: string }>} notes
82
+ */
83
+ /**
84
+ * Reads a file (progress, Cancel) and shows it before it replaces the data: the sheet, the first
85
+ * rows with a type per column, the readers' notes; "Load data" or Cancel. Modal, in the top layer:
86
+ * the focus moves in, Tab stays inside, Escape cancels, the focus goes back to where it was. A file
87
+ * that cannot be read closes it with a note; the report's data stays.
88
+ * @param {{ job: { file: File, n: number }, labels: any, locale: string, plugins: any[], worker?: () => Worker,
89
+ * limits?: object, timeZone?: string, onApply: (data: LoadedData) => void, onClose: () => void,
90
+ * announce: (text: string, extra?: { tone?: "error" }) => void }} props
91
+ */
92
+ export declare function ImportDialog({ job, labels, locale, plugins, worker, limits, timeZone, onApply, onClose, announce }: {
93
+ job: {
94
+ file: File;
95
+ n: number;
96
+ };
97
+ labels: any;
98
+ locale: string;
99
+ plugins: any[];
100
+ worker?: () => Worker;
101
+ limits?: object;
102
+ timeZone?: string;
103
+ onApply: (data: LoadedData) => void;
104
+ onClose: () => void;
105
+ announce: (text: string, extra?: {
106
+ tone?: "error";
107
+ }) => void;
108
+ }): React.ReactPortal | null;
@@ -0,0 +1 @@
1
+ export {};
package/types/index.d.ts CHANGED
@@ -99,11 +99,13 @@ export type CellClick = {
99
99
  };
100
100
  export type ExportFile = {
101
101
  /**
102
+ * "html": the HTML report; "svg": the chart as SVG; "print": the HTML report before it is printed
103
+ * (returning false prints nothing: the host prints it, e.g. as a PDF of its own);
102
104
  * "json": the view file (Views, "Download view"); "copy-table", "copy-json": Export → Copy table,
103
105
  * Copy data as JSON; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
104
106
  * CSV, Download Excel)
105
107
  */
106
- kind: "xlsx" | "csv" | "png" | "json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx";
108
+ kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx";
107
109
  /**
108
110
  * with the extension ("pivot.xlsx"), made safe; for a copy the name it
109
111
  * would have as a file ("pivot.tsv", "Central – Jul 2026.json")
@@ -125,9 +127,11 @@ export type ExportFile = {
125
127
  };
126
128
  export type PivotReportProps = {
127
129
  /**
128
- * the rows; encoded once per array, or once per `dataKey`
130
+ * the rows, or columnar data
131
+ * (`{ columns, types, data }`, one array per column, as pivotkit-core's encode takes it); encoded once
132
+ * per array or object, or once per `dataKey`
129
133
  */
130
- data?: object[];
134
+ data?: object[] | import("pivotkit-core").ColumnarData;
131
135
  /**
132
136
  * identity of `data`: a new array with the same key is not encoded again
133
137
  */
@@ -221,7 +225,17 @@ export type PivotReportProps = {
221
225
  * least height: "on" by default without `height`, "off" with it
222
226
  */
223
227
  grow?: "on" | "off";
228
+ /**
229
+ * pivotkit-core's limits for the host's data
230
+ * (and for a loaded file, where `importLimits` leaves a key out)
231
+ */
224
232
  limits?: Partial<import("pivotkit-core").Limits>;
233
+ /**
234
+ * the limits a file loaded with
235
+ * `allowImport` is read and shown with, merged key by key over `limits` (default: `limits`), so a
236
+ * host can keep uploads small without capping its own data
237
+ */
238
+ importLimits?: Partial<import("pivotkit-core").Limits>;
225
239
  /**
226
240
  * the name of the report's region landmark (default the labels' `report`);
227
241
  * several reports on one page each need their own
@@ -307,8 +321,8 @@ export type PivotReportProps = {
307
321
  sources?: ViewSource[];
308
322
  /**
309
323
  * the `$schema` of the view files the report writes: by default
310
- * https://pivotkit.eize.dev/schema/view-file-1.json, a host's own copy of the schema (it ships in
311
- * pivotkit-core as "pivotkit-core/schema/view-file-1.json"), or null or "" to leave it out; loading a
324
+ * https://pivotkit.eize.dev/schema/view-file-2.json, a host's own copy of the schema (it ships in
325
+ * pivotkit-core as "pivotkit-core/schema/view-file-2.json"), or null or "" to leave it out; loading a
312
326
  * view never depends on it
313
327
  */
314
328
  schemaUrl?: string | null;
@@ -328,7 +342,35 @@ export type PivotReportProps = {
328
342
  * the first data) or covers its result (later loads)
329
343
  */
330
344
  loading?: boolean;
345
+ /**
346
+ * people may load a file into the report in the browser: a Data
347
+ * button with "Load data…", a file dropped onto the report, a preview before it replaces the data
348
+ * (nothing is uploaded; Undo and "Back to original data" bring the host's data back). With a
349
+ * `storageKey` a report mounted again over the same host data shows the file again (memory only).
350
+ * Default false
351
+ */
352
+ allowImport?: boolean;
353
+ /**
354
+ * reader plugins (contract v1,
355
+ * pivotkit-core/import's validatePlugin) for more formats, such as pivotkit-xlsx; CSV, TSV, text and
356
+ * JSON are built in
357
+ */
358
+ plugins?: import("pivotkit-core/import").ReaderPlugin[];
359
+ /**
360
+ * the data shown changed: a file is loaded
361
+ * (`cause` "load"; returning false refuses it, the data stays), the host's data shown again
362
+ * ("original"), one of those undone or redone ("undo", "redo"), or the file shown again by a report
363
+ * mounted again with its storageKey ("restore")
364
+ */
365
+ onDataLoad?: (load: DataLoad) => unknown;
366
+ /**
367
+ * starts a module worker that runs pivotkit-react's
368
+ * `import-worker` entry, so CSV and JSON files are read off the page; without it they are read on
369
+ * the page (pivotkit-element brings its own)
370
+ */
371
+ importWorker?: () => Worker;
331
372
  };
373
+ export type DataLoad = import("./import-steps.js").DataLoad;
332
374
  export type ViewSource = {
333
375
  /**
334
376
  * stable, as the host names the data ("sales", a table's or an endpoint's name)
@@ -387,7 +429,9 @@ export type TipDismiss = {
387
429
  * @property {"shared" | "user"} scope
388
430
  */
389
431
  /**
390
- * @typedef {object} FieldDefaults the host's settings for a field
432
+ * @typedef {object} FieldDefaults the host's settings for a field. A number field of whole numbers
433
+ * named ID, …Id, …_id, Nr, No, Number, Key or # without `agg`, `format` and `drillFormat` is an
434
+ * identifier: `{ agg: "count", drillFormat: "text" }` (field-info.js fieldDefaultsFor)
391
435
  * @property {string} [agg] aggregator of a new value, when it fits the field's type ("average" for durations)
392
436
  * @property {string} [format] a format of pivotkit-core ("duration:h", "currency:EUR") for a new value,
393
437
  * and for the field's own numbers in the drill-down unless `drillFormat` is set
@@ -418,7 +462,9 @@ export type TipDismiss = {
418
462
  /**
419
463
  * @typedef {object} ExportFile a file the report made, before it is downloaded, or a text before it
420
464
  * goes on the clipboard
421
- * @property {"xlsx" | "csv" | "png" | "json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx"} kind
465
+ * @property {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx"} kind
466
+ * "html": the HTML report; "svg": the chart as SVG; "print": the HTML report before it is printed
467
+ * (returning false prints nothing: the host prints it, e.g. as a PDF of its own);
422
468
  * "json": the view file (Views, "Download view"); "copy-table", "copy-json": Export → Copy table,
423
469
  * Copy data as JSON; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
424
470
  * CSV, Download Excel)
@@ -431,7 +477,9 @@ export type TipDismiss = {
431
477
  */
432
478
  /**
433
479
  * @typedef {object} PivotReportProps
434
- * @property {object[]} [data] the rows; encoded once per array, or once per `dataKey`
480
+ * @property {object[] | import("pivotkit-core").ColumnarData} [data] the rows, or columnar data
481
+ * (`{ columns, types, data }`, one array per column, as pivotkit-core's encode takes it); encoded once
482
+ * per array or object, or once per `dataKey`
435
483
  * @property {string | number} [dataKey] identity of `data`: a new array with the same key is not encoded again
436
484
  * @property {import("pivotkit-core").Encoded} [encoded] already encoded data, instead of `data`
437
485
  * @property {ViewInput} [view] controlled: the view to show; pass back what onViewChange gives
@@ -465,7 +513,11 @@ export type TipDismiss = {
465
513
  * (the page scrolls); with it the report stays inside that height and its result scrolls
466
514
  * @property {"on" | "off"} [grow] whether the report grows past its height to keep the result's
467
515
  * least height: "on" by default without `height`, "off" with it
468
- * @property {Partial<import("pivotkit-core").Limits>} [limits]
516
+ * @property {Partial<import("pivotkit-core").Limits>} [limits] pivotkit-core's limits for the host's data
517
+ * (and for a loaded file, where `importLimits` leaves a key out)
518
+ * @property {Partial<import("pivotkit-core").Limits>} [importLimits] the limits a file loaded with
519
+ * `allowImport` is read and shown with, merged key by key over `limits` (default: `limits`), so a
520
+ * host can keep uploads small without capping its own data
469
521
  * @property {string} [label] the name of the report's region landmark (default the labels' `report`);
470
522
  * several reports on one page each need their own
471
523
  * @property {string} [className]
@@ -505,8 +557,8 @@ export type TipDismiss = {
505
557
  * @property {ViewSource[]} [sources] the other data the host can show: a view made for one of them
506
558
  * offers "Switch to <name> and load" (with `onSourceSwitch`)
507
559
  * @property {string | null} [schemaUrl] the `$schema` of the view files the report writes: by default
508
- * https://pivotkit.eize.dev/schema/view-file-1.json, a host's own copy of the schema (it ships in
509
- * pivotkit-core as "pivotkit-core/schema/view-file-1.json"), or null or "" to leave it out; loading a
560
+ * https://pivotkit.eize.dev/schema/view-file-2.json, a host's own copy of the schema (it ships in
561
+ * pivotkit-core as "pivotkit-core/schema/view-file-2.json"), or null or "" to leave it out; loading a
510
562
  * view never depends on it
511
563
  * @property {(request: SourceSwitch) => void} [onSourceSwitch] the user chose to switch to the data a
512
564
  * view was made for and load it there: the host shows that data and the view (as its start view)
@@ -515,6 +567,24 @@ export type TipDismiss = {
515
567
  * decides. With it the user can still change it until the page is loaded again
516
568
  * @property {boolean} [loading] the host is loading the data: the report shows its skeleton (before
517
569
  * the first data) or covers its result (later loads)
570
+ * @property {boolean} [allowImport] people may load a file into the report in the browser: a Data
571
+ * button with "Load data…", a file dropped onto the report, a preview before it replaces the data
572
+ * (nothing is uploaded; Undo and "Back to original data" bring the host's data back). With a
573
+ * `storageKey` a report mounted again over the same host data shows the file again (memory only).
574
+ * Default false
575
+ * @property {import("pivotkit-core/import").ReaderPlugin[]} [plugins] reader plugins (contract v1,
576
+ * pivotkit-core/import's validatePlugin) for more formats, such as pivotkit-xlsx; CSV, TSV, text and
577
+ * JSON are built in
578
+ * @property {(load: DataLoad) => unknown} [onDataLoad] the data shown changed: a file is loaded
579
+ * (`cause` "load"; returning false refuses it, the data stays), the host's data shown again
580
+ * ("original"), one of those undone or redone ("undo", "redo"), or the file shown again by a report
581
+ * mounted again with its storageKey ("restore")
582
+ * @property {() => Worker} [importWorker] starts a module worker that runs pivotkit-react's
583
+ * `import-worker` entry, so CSV and JSON files are read off the page; without it they are read on
584
+ * the page (pivotkit-element brings its own)
585
+ */
586
+ /**
587
+ * @typedef {import("./import-steps.js").DataLoad} DataLoad
518
588
  */
519
589
  /**
520
590
  * @typedef {object} ViewSource the data a view is made for
package/types/labels.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  export type UiLabels = typeof en & import("./menu-labels.js").MenuTexts & {
2
2
  unused?: import("./unused-texts.js").UnusedTexts;
3
+ dataImport?: import("./import-labels.js").ImportTexts;
3
4
  };
4
5
  /**
5
6
  * Every text of the UI: these and the menus' (menu-labels.js, loaded with the menus; a type import
6
7
  * only, so they stay out of the first load).
7
- * @typedef {typeof en & import("./menu-labels.js").MenuTexts & { unused?: import("./unused-texts.js").UnusedTexts }} UiLabels
8
+ * @typedef {typeof en & import("./menu-labels.js").MenuTexts & { unused?: import("./unused-texts.js").UnusedTexts, dataImport?: import("./import-labels.js").ImportTexts }} UiLabels
8
9
  * `unused`: the texts of a view's unused parts (unused-texts.js), loaded when a view has such parts;
9
- * a host's are kept aside as the menus' are
10
+ * `dataImport`: those of loading data (import-labels.js), loaded with the import UI; a host's of
11
+ * both are kept aside as the menus' are
10
12
  */
11
13
  export declare const en: {
12
14
  /** the language of the texts, for the report's lang attribute */
@@ -69,8 +71,13 @@ export declare const en: {
69
71
  };
70
72
  undo: string;
71
73
  redo: string;
74
+ startOver: string;
72
75
  reset: string;
73
76
  resetHint: string;
77
+ resetAlready: string;
78
+ resetStartEmpty: string;
79
+ newHint: string;
80
+ newAlready: string;
74
81
  unsavedChanges: string;
75
82
  swap: string;
76
83
  layout: string;
@@ -78,6 +85,12 @@ export declare const en: {
78
85
  layoutEmpty: string;
79
86
  more: string;
80
87
  views: string;
88
+ data: string;
89
+ dataLoaded: string;
90
+ loadData: string;
91
+ emptyLoad: string;
92
+ emptyDrop: string;
93
+ emptyNoData: string;
81
94
  exportLabel: string;
82
95
  options: string;
83
96
  expand: string;
@@ -126,7 +139,6 @@ export declare const en: {
126
139
  topBadge: string;
127
140
  bottomBadge: string;
128
141
  by: string;
129
- filter: string;
130
142
  filtered: string;
131
143
  filterSummary: string;
132
144
  /** a text the user typed or a name, quoted as the language quotes: a text condition, field names */
@@ -225,6 +237,7 @@ export declare const en: {
225
237
  percentRunningTotal: string;
226
238
  percentDifferenceFromPrevious: string;
227
239
  };
240
+ colSubtotals: string;
228
241
  chartOverTime: string;
229
242
  pieSlices: string;
230
243
  pieColumns: string;
@@ -247,6 +260,7 @@ export declare const en: {
247
260
  saveTemplate: string;
248
261
  bars: string;
249
262
  auto: string;
263
+ colSubtotalsOff: string;
250
264
  };
251
265
  dismissTip: string;
252
266
  tipsTitle: string;
@@ -305,8 +319,11 @@ export declare const en: {
305
319
  contains: string;
306
320
  notContains: string;
307
321
  beginsWith: string;
322
+ notBeginsWith: string;
308
323
  endsWith: string;
324
+ notEndsWith: string;
309
325
  };
326
+ notRule: string;
310
327
  relative: {
311
328
  year: string;
312
329
  years: string;
@@ -317,6 +334,100 @@ export declare const en: {
317
334
  };
318
335
  withRange: string;
319
336
  relativeTo: string;
337
+ relativeMore: {
338
+ last: {
339
+ hour: {
340
+ one: string;
341
+ other: string;
342
+ };
343
+ day: {
344
+ one: string;
345
+ other: string;
346
+ };
347
+ week: {
348
+ one: string;
349
+ other: string;
350
+ };
351
+ month: {
352
+ one: string;
353
+ other: string;
354
+ };
355
+ quarter: {
356
+ one: string;
357
+ other: string;
358
+ };
359
+ year: {
360
+ one: string;
361
+ other: string;
362
+ };
363
+ };
364
+ next: {
365
+ hour: {
366
+ one: string;
367
+ other: string;
368
+ };
369
+ day: {
370
+ one: string;
371
+ other: string;
372
+ };
373
+ week: {
374
+ one: string;
375
+ other: string;
376
+ };
377
+ month: {
378
+ one: string;
379
+ other: string;
380
+ };
381
+ quarter: {
382
+ one: string;
383
+ other: string;
384
+ };
385
+ year: {
386
+ one: string;
387
+ other: string;
388
+ };
389
+ };
390
+ before: {
391
+ hour: {
392
+ one: string;
393
+ other: string;
394
+ };
395
+ day: {
396
+ one: string;
397
+ other: string;
398
+ };
399
+ week: {
400
+ one: string;
401
+ other: string;
402
+ };
403
+ month: {
404
+ one: string;
405
+ other: string;
406
+ };
407
+ quarter: {
408
+ one: string;
409
+ other: string;
410
+ };
411
+ year: {
412
+ one: string;
413
+ other: string;
414
+ };
415
+ };
416
+ this: {
417
+ hour: string;
418
+ day: string;
419
+ week: string;
420
+ month: string;
421
+ quarter: string;
422
+ year: string;
423
+ };
424
+ rolling: string;
425
+ withoutCurrent: string;
426
+ fromLatest: string;
427
+ fromFirst: string;
428
+ fromDate: string;
429
+ until: string;
430
+ };
320
431
  withShare: string;
321
432
  noData: {
322
433
  one: string;
@@ -401,8 +512,13 @@ export declare const de: {
401
512
  };
402
513
  undo: string;
403
514
  redo: string;
515
+ startOver: string;
404
516
  reset: string;
405
517
  resetHint: string;
518
+ resetAlready: string;
519
+ resetStartEmpty: string;
520
+ newHint: string;
521
+ newAlready: string;
406
522
  unsavedChanges: string;
407
523
  swap: string;
408
524
  layout: string;
@@ -410,6 +526,12 @@ export declare const de: {
410
526
  layoutEmpty: string;
411
527
  more: string;
412
528
  views: string;
529
+ data: string;
530
+ dataLoaded: string;
531
+ loadData: string;
532
+ emptyLoad: string;
533
+ emptyDrop: string;
534
+ emptyNoData: string;
413
535
  exportLabel: string;
414
536
  options: string;
415
537
  expand: string;
@@ -458,7 +580,6 @@ export declare const de: {
458
580
  topBadge: string;
459
581
  bottomBadge: string;
460
582
  by: string;
461
- filter: string;
462
583
  filtered: string;
463
584
  filterSummary: string;
464
585
  quote: string;
@@ -559,6 +680,7 @@ export declare const de: {
559
680
  chartOverTime: string;
560
681
  pieSlices: string;
561
682
  pieColumns: string;
683
+ colSubtotals: string;
562
684
  chartDates: string;
563
685
  chartTrend: string;
564
686
  chartSeries: string;
@@ -578,6 +700,7 @@ export declare const de: {
578
700
  saveTemplate: string;
579
701
  bars: string;
580
702
  auto: string;
703
+ colSubtotalsOff: string;
581
704
  };
582
705
  dismissTip: string;
583
706
  tipsTitle: string;
@@ -636,8 +759,11 @@ export declare const de: {
636
759
  contains: string;
637
760
  notContains: string;
638
761
  beginsWith: string;
762
+ notBeginsWith: string;
639
763
  endsWith: string;
764
+ notEndsWith: string;
640
765
  };
766
+ notRule: string;
641
767
  relative: {
642
768
  year: string;
643
769
  years: string;
@@ -648,6 +774,100 @@ export declare const de: {
648
774
  };
649
775
  withRange: string;
650
776
  relativeTo: string;
777
+ relativeMore: {
778
+ last: {
779
+ hour: {
780
+ one: string;
781
+ other: string;
782
+ };
783
+ day: {
784
+ one: string;
785
+ other: string;
786
+ };
787
+ week: {
788
+ one: string;
789
+ other: string;
790
+ };
791
+ month: {
792
+ one: string;
793
+ other: string;
794
+ };
795
+ quarter: {
796
+ one: string;
797
+ other: string;
798
+ };
799
+ year: {
800
+ one: string;
801
+ other: string;
802
+ };
803
+ };
804
+ next: {
805
+ hour: {
806
+ one: string;
807
+ other: string;
808
+ };
809
+ day: {
810
+ one: string;
811
+ other: string;
812
+ };
813
+ week: {
814
+ one: string;
815
+ other: string;
816
+ };
817
+ month: {
818
+ one: string;
819
+ other: string;
820
+ };
821
+ quarter: {
822
+ one: string;
823
+ other: string;
824
+ };
825
+ year: {
826
+ one: string;
827
+ other: string;
828
+ };
829
+ };
830
+ before: {
831
+ hour: {
832
+ one: string;
833
+ other: string;
834
+ };
835
+ day: {
836
+ one: string;
837
+ other: string;
838
+ };
839
+ week: {
840
+ one: string;
841
+ other: string;
842
+ };
843
+ month: {
844
+ one: string;
845
+ other: string;
846
+ };
847
+ quarter: {
848
+ one: string;
849
+ other: string;
850
+ };
851
+ year: {
852
+ one: string;
853
+ other: string;
854
+ };
855
+ };
856
+ this: {
857
+ hour: string;
858
+ day: string;
859
+ week: string;
860
+ month: string;
861
+ quarter: string;
862
+ year: string;
863
+ };
864
+ rolling: string;
865
+ withoutCurrent: string;
866
+ fromLatest: string;
867
+ fromFirst: string;
868
+ fromDate: string;
869
+ until: string;
870
+ };
651
871
  withShare: string;
652
872
  noData: {
653
873
  one: string;
@@ -0,0 +1,4 @@
1
+ /** The import UI, imported once; a failed import is forgotten, so the next call tries again. */
2
+ export declare function loadImport(): Promise<typeof import("./import-module.js")>;
3
+ /** The import UI when it is loaded, else null. */
4
+ export declare const importNow: () => typeof import("./import-module.js") | null;
@@ -17,12 +17,12 @@ export declare function loadMenus(lang?: string): Promise<typeof import("./menus
17
17
  export declare const menusNow: (lang?: string) => typeof import("./menus.js") | null;
18
18
  /**
19
19
  * One panel of menus.js with its props.
20
- * @param {{ name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "ChartTypePanel" | "OptionsPanel" | "ViewsPanel" | "ExportPanel" | "LoadCheck" | "FilterPopover" | "DrillPanel", loadingText?: string, props: Record<string, any> }} props
20
+ * @param {{ name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "ChartTypePanel" | "OptionsPanel" | "ViewsPanel" | "ExportPanel" | "LoadCheck" | "FilterPopover" | "DrillPanel" | "DataMenu", loadingText?: string, props: Record<string, any> }} props
21
21
  * `loadingText`: shown while loading; without it nothing is (a popover or panel of its own).
22
22
  * `props.labels` gives the texts of a failed load
23
23
  */
24
24
  export declare function MenuPanel({ name, loadingText, props }: {
25
- name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "ChartTypePanel" | "OptionsPanel" | "ViewsPanel" | "ExportPanel" | "LoadCheck" | "FilterPopover" | "DrillPanel";
25
+ name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "ChartTypePanel" | "OptionsPanel" | "ViewsPanel" | "ExportPanel" | "LoadCheck" | "FilterPopover" | "DrillPanel" | "DataMenu";
26
26
  loadingText?: string;
27
27
  props: Record<string, any>;
28
28
  }): React.JSX.Element;
package/types/levels.d.ts CHANGED
@@ -2,8 +2,9 @@ import React from "react";
2
2
  /** The button that opened the popover around `el` (MenuButton's aria-controls names it). */
3
3
  export declare function openerOf(el: any): HTMLElement | null;
4
4
  /**
5
- * Tab in a menu leaves it: the focus goes to its button first, so the browser's Tab moves on from
6
- * there to what follows it, and the menu closes.
5
+ * Tab in a menu leaves it: the focus goes to what follows its button, else (at the end of the page)
6
+ * to the button; the menu closes. The Tab is taken (preventDefault), so the popover or sheet around
7
+ * the menu leaves it alone (dom.js: who takes Tab).
7
8
  * @param {KeyboardEvent | React.KeyboardEvent} e
8
9
  * @param {() => void} close
9
10
  */
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Tokens as the report's light theme resolves them, in either theme: a workbook and an HTML report are
3
+ * light (black text in Excel, paper), so a host's light colours go into them from a dark report too.
4
+ * A dark report shows the light theme for the read, on its root and, inside pivotkit-element, on the
5
+ * element whose :host rules declare the tokens, and the dark one again in the same task, so nothing is
6
+ * drawn in between; --pk-duration is 0ms meanwhile (on the root, important), so no transition of the
7
+ * report's starts on the way there or back. A host's dark rules on data-pk-theme="dark" are left out
8
+ * that way; rules on something else (an html[data-theme] of the page) apply in both. Lengths are
9
+ * resolved by the chart's module (chart-decorate.js, tokenLengths), passed in as `more`, read in the
10
+ * light theme too.
11
+ * @param {HTMLElement} root the report's root
12
+ * @param {readonly string[]} names
13
+ * @param {() => Record<string, string>} [more] further tokens read while the light theme shows
14
+ * @returns {Record<string, string>} the tokens that are set
15
+ */
16
+ export declare function lightTokens(root: HTMLElement, names: readonly string[], more?: () => Record<string, string>): Record<string, string>;