pivotkit-react 0.4.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.
- package/CHANGELOG.md +219 -1
- package/README.md +2 -2
- package/dist/chunks/{chunk-YITKWZ4L.js → chunk-2AT72SLA.js} +604 -505
- package/dist/chunks/{chunk-ZYEYZSYL.js → chunk-3E4NB5RZ.js} +30 -2
- package/dist/chunks/{chunk-6MDAL3IO.js → chunk-3WUGQPWV.js} +78 -6
- package/dist/chunks/{chunk-WB4GKWFQ.js → chunk-4RS72AAA.js} +26 -4
- package/dist/chunks/{chunk-EM23V5GH.js → chunk-E6M57YLL.js} +19 -8
- package/dist/chunks/{chunk-RWYHJRQO.js → chunk-JMRTIOX4.js} +17 -7
- package/dist/chunks/{chunk-XN55BQ4M.js → chunk-RIOSIYGC.js} +54 -7
- package/dist/chunks/{chunk-LEN5RPBM.js → chunk-U5Q5I2D5.js} +34 -5
- package/dist/chunks/report-run-BZBFOMPF.js +12 -0
- package/dist/chunks/{unused-texts-K3VFH65P.js → unused-texts-Y4R67XSN.js} +1 -1
- package/dist/chunks/{unused-texts-de-OW4TGIVX.js → unused-texts-de-6YVPTNVS.js} +1 -1
- package/dist/echarts.js +38 -156
- package/dist/import-ui.js +8 -12
- package/dist/index.js +97 -82
- package/dist/labels.js +6 -6
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +650 -245
- package/dist/styles.css +207 -93
- package/package.json +8 -4
- package/types/chart-decorate.d.ts +28 -4
- package/types/chart-types.d.ts +2 -4
- package/types/echarts.d.ts +1 -1
- package/types/export-run.d.ts +37 -3
- package/types/filter.d.ts +1 -1
- package/types/icons.d.ts +1 -0
- package/types/import-labels.d.ts +41 -0
- package/types/import-limits.d.ts +6 -0
- package/types/index.d.ts +25 -7
- package/types/labels.d.ts +198 -2
- package/types/light-tokens.d.ts +16 -0
- package/types/menu-labels.d.ts +37 -14
- package/types/menu-ops.d.ts +161 -40
- package/types/menu-topics.d.ts +7 -4
- package/types/names.d.ts +47 -19
- package/types/place.d.ts +24 -0
- package/types/print-frame.d.ts +24 -0
- package/types/report-run.d.ts +14 -0
- package/types/share-actions.d.ts +3 -3
- package/types/share.d.ts +13 -17
- package/types/theme.d.ts +2 -16
- package/types/tips.d.ts +5 -0
- package/types/toolbar-panels.d.ts +5 -4
- package/types/unused-texts.d.ts +13 -3
- package/types/use-export.d.ts +2 -2
- package/types/view-ops.d.ts +65 -6
- package/types/chart-layout.d.ts +0 -111
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pivotkit-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React 18/19 pivot report builder on pivotkit-core: drag-and-drop fields, table and Apache ECharts chart, filters,
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "React 18/19 pivot report builder on pivotkit-core: drag-and-drop fields, table and Apache ECharts chart, filters, views as JSON files, undo, Excel and CSV export.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "eizedev <oss@eize.dev>",
|
|
7
7
|
"homepage": "https://pivotkit.eize.dev",
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
"reporting",
|
|
19
19
|
"drag-and-drop",
|
|
20
20
|
"echarts",
|
|
21
|
-
"self-service-bi"
|
|
21
|
+
"self-service-bi",
|
|
22
|
+
"pivot-grid",
|
|
23
|
+
"pivottable",
|
|
24
|
+
"excel-export"
|
|
22
25
|
],
|
|
23
26
|
"type": "module",
|
|
24
27
|
"sideEffects": [
|
|
@@ -61,7 +64,8 @@
|
|
|
61
64
|
"dependencies": {
|
|
62
65
|
"@dnd-kit/core": "6.3.1",
|
|
63
66
|
"@dnd-kit/sortable": "10.0.0",
|
|
64
|
-
"pivotkit-core": "^0.
|
|
67
|
+
"pivotkit-core": "^0.5.0",
|
|
68
|
+
"pivotkit-report": "^0.1.0"
|
|
65
69
|
},
|
|
66
70
|
"devDependencies": {
|
|
67
71
|
"echarts": "6.1.0"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Mark styles on top of the core's option: rounded bar ends, 2 px lines, tooltips in the theme, built
|
|
3
|
-
* as DOM nodes (chart-tooltip.js) so a strict Content-Security-Policy allows them.
|
|
4
2
|
* @param {any} option
|
|
5
|
-
* @param {
|
|
3
|
+
* @param {{ getPropertyValue(name: string): string }} style the report's tokens (chartStyle)
|
|
6
4
|
* @param {number} [height] the chart's height in px, for the room around a pie
|
|
7
5
|
* @param {Document} [doc] the chart's document, for the tooltip's nodes
|
|
8
6
|
* @param {number} [width] the chart's width in px, for the column names of a heatmap and the category axis
|
|
@@ -10,7 +8,33 @@
|
|
|
10
8
|
* tooltip's title when the axis writes them shorter) and the view's chart.axisLabels
|
|
11
9
|
* @returns {any} the option; `axisEvery` (not ECharts') is n when the category axis writes every n-th label
|
|
12
10
|
*/
|
|
13
|
-
export declare function decorate(option: any, style:
|
|
11
|
+
export declare function decorate(option: any, style: {
|
|
12
|
+
getPropertyValue(name: string): string;
|
|
13
|
+
}, height?: number, doc?: Document, width?: number, extra?: {
|
|
14
14
|
categoryNames?: string[];
|
|
15
15
|
axisLabels?: string;
|
|
16
16
|
}): any;
|
|
17
|
+
/**
|
|
18
|
+
* The tokens the chart reads as lengths in px (chartThemeFrom, decorateOption): the title's and the
|
|
19
|
+
* other text's size, the marks' corners. A computed custom property keeps the calc(), max() and em it
|
|
20
|
+
* was written with, so the report resolves them first.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LENGTH_TOKENS: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* Tokens that are lengths, in px as the report resolves them (em of its font): a probe inside the root
|
|
25
|
+
* takes each one as its margin. A token not set, or not a length CSS takes (a keyword: its margin would
|
|
26
|
+
* be 0), is left out, so the chart keeps its default.
|
|
27
|
+
* @param {HTMLElement} root the report's root
|
|
28
|
+
* @param {readonly string[]} [names]
|
|
29
|
+
* @returns {Record<string, string>} "16px" per token
|
|
30
|
+
*/
|
|
31
|
+
export declare function tokenLengths(root: HTMLElement, names?: readonly string[]): Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* The report's computed style with its length tokens in px: what chartThemeFrom and pivotkit-core's
|
|
34
|
+
* decorateOption read.
|
|
35
|
+
* @param {HTMLElement} root
|
|
36
|
+
* @returns {{ getPropertyValue(name: string): string }}
|
|
37
|
+
*/
|
|
38
|
+
export declare function chartStyle(root: HTMLElement): {
|
|
39
|
+
getPropertyValue(name: string): string;
|
|
40
|
+
};
|
package/types/chart-types.d.ts
CHANGED
|
@@ -27,10 +27,8 @@ export declare function chartTypeOf(chart: {
|
|
|
27
27
|
horizontal?: boolean;
|
|
28
28
|
}): string;
|
|
29
29
|
/**
|
|
30
|
-
* What the chart draws for a view
|
|
31
|
-
*
|
|
32
|
-
* columns swapped for the chart alone (`swap`), so the dates run along the axis and the table keeps
|
|
33
|
-
* its layout; else bars (pivotkit-core's autoChartType decides).
|
|
30
|
+
* What the chart draws for a view: pivotkit-core's chartPlan (the same on the screen, in an SVG and a
|
|
31
|
+
* printed report) with the picker entry drawn.
|
|
34
32
|
* @param {{ rows: string[], cols: string[], derived: any[], chart: { type: string, stacked?: boolean, horizontal?: boolean } }} view
|
|
35
33
|
* @param {import("pivotkit-core").Encoded} encoded
|
|
36
34
|
* @returns {{ name: string, auto: boolean, swap: boolean, chart: { type: string, stacked: boolean, horizontal: boolean } }}
|
package/types/echarts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { init } from "echarts/core";
|
|
2
2
|
export { init };
|
|
3
3
|
export { cleanChartOptions, mergeChartOptions } from "./chart-options.js";
|
|
4
|
-
export { decorate } from "./chart-decorate.js";
|
|
4
|
+
export { LENGTH_TOKENS, chartStyle, decorate, tokenLengths } from "./chart-decorate.js";
|
package/types/export-run.d.ts
CHANGED
|
@@ -32,6 +32,34 @@ export declare function copyOut(text: string, { type, container, onExport, ...fi
|
|
|
32
32
|
container: HTMLElement | null;
|
|
33
33
|
onExport?: (file: ExportFile) => unknown;
|
|
34
34
|
}): Promise<"copied" | "kept" | "blocked">;
|
|
35
|
+
/**
|
|
36
|
+
* A CSS colour as "#rrggbb", or null: through a canvas's fillStyle, which writes an opaque sRGB colour
|
|
37
|
+
* that way whatever syntax it was given (a name, rgb(), hsl()). A text that is no colour is refused
|
|
38
|
+
* first (a canvas would keep the colour it had).
|
|
39
|
+
* @param {string} text
|
|
40
|
+
* @param {{ fillStyle: unknown } | null} ctx a 2D context
|
|
41
|
+
* @param {(text: string) => boolean} [supports] whether the text is a colour
|
|
42
|
+
*/
|
|
43
|
+
export declare function hexColor(text: string, ctx: {
|
|
44
|
+
fillStyle: unknown;
|
|
45
|
+
} | null, supports?: (text: string) => boolean): string | null;
|
|
46
|
+
/** The tokens of a workbook's colours: its colour scale (--pk-scale-mid only when a host sets it) and data bars. */
|
|
47
|
+
export declare const XLSX_TOKENS: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* The colours of the theme the workbook gets for a conditional format whose view names none, as the
|
|
50
|
+
* report resolves its tokens (pivotkit-core's chartThemeFrom): the colour scale (--pk-scale-low, the
|
|
51
|
+
* host's --pk-scale-mid, -high) and the data bars (--pk-chart-1). Each one missing or not a colour
|
|
52
|
+
* stays pivotkit-core's default; a middle colour that is none is left out.
|
|
53
|
+
* @param {{ getPropertyValue(name: string): string }} style the report's light tokens
|
|
54
|
+
* @param {(text: string) => string | null} toHex
|
|
55
|
+
* @returns {{ colorScale?: string[], dataBar?: string }}
|
|
56
|
+
*/
|
|
57
|
+
export declare function xlsxThemeOf(style: {
|
|
58
|
+
getPropertyValue(name: string): string;
|
|
59
|
+
}, toHex: (text: string) => string | null): {
|
|
60
|
+
colorScale?: string[];
|
|
61
|
+
dataBar?: string;
|
|
62
|
+
};
|
|
35
63
|
export type ExportContext = {
|
|
36
64
|
fileName: string;
|
|
37
65
|
result: import("pivotkit-core").PivotResult | null;
|
|
@@ -44,16 +72,22 @@ export type ExportContext = {
|
|
|
44
72
|
tone?: "error";
|
|
45
73
|
}) => void;
|
|
46
74
|
onExport?: (file: ExportFile) => unknown;
|
|
75
|
+
title?: string | null;
|
|
76
|
+
source?: string | null;
|
|
77
|
+
loadECharts?: () => Promise<any>;
|
|
47
78
|
};
|
|
48
79
|
/**
|
|
49
80
|
* @typedef {{ fileName: string, result: import("pivotkit-core").PivotResult | null, locale: string,
|
|
50
81
|
* labels: import("./labels.js").UiLabels, limits: object | undefined, root: React.RefObject<HTMLElement | null>,
|
|
51
82
|
* chartRef: React.RefObject<any>, announce: (text: string, extra?: { tone?: "error" }) => void,
|
|
52
|
-
* onExport?: (file: ExportFile) => unknown }} ExportContext
|
|
83
|
+
* onExport?: (file: ExportFile) => unknown, title?: string | null, source?: string | null, loadECharts?: () => Promise<any> }} ExportContext
|
|
84
|
+
* `title`: the report's title in an HTML report (the loaded view's name); `source`: the data's name;
|
|
85
|
+
* `loadECharts`: chart.jsx's loader of dist/echarts.js (passed in: a module of the menus that
|
|
86
|
+
* imported chart.jsx would move it out of the first load into a shared chunk)
|
|
53
87
|
*/
|
|
54
88
|
/**
|
|
55
89
|
* One export of the Export menu.
|
|
56
|
-
* @param {"xlsx" | "csv" | "png" | "copy-table" | "copy-json"} kind
|
|
90
|
+
* @param {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json"} kind
|
|
57
91
|
* @param {ExportContext} context
|
|
58
92
|
*/
|
|
59
|
-
export declare function runExport(kind: "xlsx" | "csv" | "png" | "copy-table" | "copy-json", { fileName, result, locale, labels, limits, root, chartRef, announce, onExport }: ExportContext): Promise<void>;
|
|
93
|
+
export declare function runExport(kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json", { fileName, result, locale, labels, limits, root, chartRef, announce, onExport, title, source, loadECharts }: ExportContext): Promise<void>;
|
package/types/filter.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare function ValueList({ items, selected, onChange, labels, locale, a
|
|
|
35
35
|
/**
|
|
36
36
|
* @param {{ target: { field: string, anchor: HTMLElement, base?: object } | null, onClose: () => void, view: object,
|
|
37
37
|
* encoded: import("pivotkit-core").Encoded, locale: string, labels: import("./labels.js").UiLabels, commit: (v: object, note?: any) => void }} props
|
|
38
|
-
* `target.base`: the draft view of a field that is not
|
|
38
|
+
* `target.base`: the draft view of a field that is not in Filters yet (it goes there on Apply)
|
|
39
39
|
*/
|
|
40
40
|
export declare function FilterPopover({ target, onClose, view, encoded, locale, labels, commit }: {
|
|
41
41
|
target: {
|
package/types/icons.d.ts
CHANGED
package/types/import-labels.d.ts
CHANGED
|
@@ -56,6 +56,15 @@ export declare const en: {
|
|
|
56
56
|
originalShown: string;
|
|
57
57
|
failed: string;
|
|
58
58
|
refused: string;
|
|
59
|
+
overLimit: string;
|
|
60
|
+
limitWhat: {
|
|
61
|
+
rows: string;
|
|
62
|
+
columns: string;
|
|
63
|
+
fileBytes: string;
|
|
64
|
+
importCells: string;
|
|
65
|
+
archiveEntries: string;
|
|
66
|
+
unpackedBytes: string;
|
|
67
|
+
};
|
|
59
68
|
sourceLine: string;
|
|
60
69
|
sourceSheet: string;
|
|
61
70
|
notes: {
|
|
@@ -172,6 +181,15 @@ export declare const IMPORT_TEXTS: Readonly<{
|
|
|
172
181
|
originalShown: string;
|
|
173
182
|
failed: string;
|
|
174
183
|
refused: string;
|
|
184
|
+
overLimit: string;
|
|
185
|
+
limitWhat: {
|
|
186
|
+
rows: string;
|
|
187
|
+
columns: string;
|
|
188
|
+
fileBytes: string;
|
|
189
|
+
importCells: string;
|
|
190
|
+
archiveEntries: string;
|
|
191
|
+
unpackedBytes: string;
|
|
192
|
+
};
|
|
175
193
|
sourceLine: string;
|
|
176
194
|
sourceSheet: string;
|
|
177
195
|
notes: {
|
|
@@ -282,6 +300,15 @@ export declare const IMPORT_TEXTS: Readonly<{
|
|
|
282
300
|
originalShown: string;
|
|
283
301
|
failed: string;
|
|
284
302
|
refused: string;
|
|
303
|
+
overLimit: string;
|
|
304
|
+
limitWhat: {
|
|
305
|
+
rows: string;
|
|
306
|
+
columns: string;
|
|
307
|
+
fileBytes: string;
|
|
308
|
+
importCells: string;
|
|
309
|
+
archiveEntries: string;
|
|
310
|
+
unpackedBytes: string;
|
|
311
|
+
};
|
|
285
312
|
sourceLine: string;
|
|
286
313
|
sourceSheet: string;
|
|
287
314
|
notes: {
|
|
@@ -358,3 +385,17 @@ export declare function noteText(note: {
|
|
|
358
385
|
lang: string;
|
|
359
386
|
locale: string;
|
|
360
387
|
}): string;
|
|
388
|
+
/**
|
|
389
|
+
* Why a file could not be read, after "{name} could not be loaded:", which names the file: a limit of
|
|
390
|
+
* pivotkit-core (`LIMIT_EXCEEDED` with a limit this version has words for) in the report's language
|
|
391
|
+
* with its key (`limits.rows`, whose words fit `importLimits` too), else the reader's own English
|
|
392
|
+
* message without the file's name in front (`"name": ` of `fileError`, `"name" ` of `limitError`).
|
|
393
|
+
* @param {unknown} error
|
|
394
|
+
* @param {string} name the file's name
|
|
395
|
+
* @param {ImportTexts} texts
|
|
396
|
+
* @param {{ lang: string, locale: string }} where
|
|
397
|
+
*/
|
|
398
|
+
export declare function errorText(error: unknown, name: string, texts: ImportTexts, where: {
|
|
399
|
+
lang: string;
|
|
400
|
+
locale: string;
|
|
401
|
+
}): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {unknown} limits the host's `limits`
|
|
3
|
+
* @param {unknown} importLimits the host's `importLimits`
|
|
4
|
+
* @returns {Partial<import("pivotkit-core").Limits> | undefined} to pass as `options.limits`
|
|
5
|
+
*/
|
|
6
|
+
export declare function importLimitsOf(limits: unknown, importLimits: unknown): Partial<import("pivotkit-core").Limits> | undefined;
|
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")
|
|
@@ -223,7 +225,17 @@ export type PivotReportProps = {
|
|
|
223
225
|
* least height: "on" by default without `height`, "off" with it
|
|
224
226
|
*/
|
|
225
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
|
+
*/
|
|
226
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>;
|
|
227
239
|
/**
|
|
228
240
|
* the name of the report's region landmark (default the labels' `report`);
|
|
229
241
|
* several reports on one page each need their own
|
|
@@ -309,8 +321,8 @@ export type PivotReportProps = {
|
|
|
309
321
|
sources?: ViewSource[];
|
|
310
322
|
/**
|
|
311
323
|
* the `$schema` of the view files the report writes: by default
|
|
312
|
-
* https://pivotkit.eize.dev/schema/view-file-
|
|
313
|
-
* pivotkit-core as "pivotkit-core/schema/view-file-
|
|
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
|
|
314
326
|
* view never depends on it
|
|
315
327
|
*/
|
|
316
328
|
schemaUrl?: string | null;
|
|
@@ -450,7 +462,9 @@ export type TipDismiss = {
|
|
|
450
462
|
/**
|
|
451
463
|
* @typedef {object} ExportFile a file the report made, before it is downloaded, or a text before it
|
|
452
464
|
* goes on the clipboard
|
|
453
|
-
* @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);
|
|
454
468
|
* "json": the view file (Views, "Download view"); "copy-table", "copy-json": Export → Copy table,
|
|
455
469
|
* Copy data as JSON; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
|
|
456
470
|
* CSV, Download Excel)
|
|
@@ -499,7 +513,11 @@ export type TipDismiss = {
|
|
|
499
513
|
* (the page scrolls); with it the report stays inside that height and its result scrolls
|
|
500
514
|
* @property {"on" | "off"} [grow] whether the report grows past its height to keep the result's
|
|
501
515
|
* least height: "on" by default without `height`, "off" with it
|
|
502
|
-
* @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
|
|
503
521
|
* @property {string} [label] the name of the report's region landmark (default the labels' `report`);
|
|
504
522
|
* several reports on one page each need their own
|
|
505
523
|
* @property {string} [className]
|
|
@@ -539,8 +557,8 @@ export type TipDismiss = {
|
|
|
539
557
|
* @property {ViewSource[]} [sources] the other data the host can show: a view made for one of them
|
|
540
558
|
* offers "Switch to <name> and load" (with `onSourceSwitch`)
|
|
541
559
|
* @property {string | null} [schemaUrl] the `$schema` of the view files the report writes: by default
|
|
542
|
-
* https://pivotkit.eize.dev/schema/view-file-
|
|
543
|
-
* pivotkit-core as "pivotkit-core/schema/view-file-
|
|
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
|
|
544
562
|
* view never depends on it
|
|
545
563
|
* @property {(request: SourceSwitch) => void} [onSourceSwitch] the user chose to switch to the data a
|
|
546
564
|
* view was made for and load it there: the host shows that data and the view (as its start view)
|
package/types/labels.d.ts
CHANGED
|
@@ -139,7 +139,6 @@ export declare const en: {
|
|
|
139
139
|
topBadge: string;
|
|
140
140
|
bottomBadge: string;
|
|
141
141
|
by: string;
|
|
142
|
-
filter: string;
|
|
143
142
|
filtered: string;
|
|
144
143
|
filterSummary: string;
|
|
145
144
|
/** a text the user typed or a name, quoted as the language quotes: a text condition, field names */
|
|
@@ -238,6 +237,7 @@ export declare const en: {
|
|
|
238
237
|
percentRunningTotal: string;
|
|
239
238
|
percentDifferenceFromPrevious: string;
|
|
240
239
|
};
|
|
240
|
+
colSubtotals: string;
|
|
241
241
|
chartOverTime: string;
|
|
242
242
|
pieSlices: string;
|
|
243
243
|
pieColumns: string;
|
|
@@ -260,6 +260,7 @@ export declare const en: {
|
|
|
260
260
|
saveTemplate: string;
|
|
261
261
|
bars: string;
|
|
262
262
|
auto: string;
|
|
263
|
+
colSubtotalsOff: string;
|
|
263
264
|
};
|
|
264
265
|
dismissTip: string;
|
|
265
266
|
tipsTitle: string;
|
|
@@ -318,8 +319,11 @@ export declare const en: {
|
|
|
318
319
|
contains: string;
|
|
319
320
|
notContains: string;
|
|
320
321
|
beginsWith: string;
|
|
322
|
+
notBeginsWith: string;
|
|
321
323
|
endsWith: string;
|
|
324
|
+
notEndsWith: string;
|
|
322
325
|
};
|
|
326
|
+
notRule: string;
|
|
323
327
|
relative: {
|
|
324
328
|
year: string;
|
|
325
329
|
years: string;
|
|
@@ -330,6 +334,100 @@ export declare const en: {
|
|
|
330
334
|
};
|
|
331
335
|
withRange: string;
|
|
332
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
|
+
};
|
|
333
431
|
withShare: string;
|
|
334
432
|
noData: {
|
|
335
433
|
one: string;
|
|
@@ -482,7 +580,6 @@ export declare const de: {
|
|
|
482
580
|
topBadge: string;
|
|
483
581
|
bottomBadge: string;
|
|
484
582
|
by: string;
|
|
485
|
-
filter: string;
|
|
486
583
|
filtered: string;
|
|
487
584
|
filterSummary: string;
|
|
488
585
|
quote: string;
|
|
@@ -583,6 +680,7 @@ export declare const de: {
|
|
|
583
680
|
chartOverTime: string;
|
|
584
681
|
pieSlices: string;
|
|
585
682
|
pieColumns: string;
|
|
683
|
+
colSubtotals: string;
|
|
586
684
|
chartDates: string;
|
|
587
685
|
chartTrend: string;
|
|
588
686
|
chartSeries: string;
|
|
@@ -602,6 +700,7 @@ export declare const de: {
|
|
|
602
700
|
saveTemplate: string;
|
|
603
701
|
bars: string;
|
|
604
702
|
auto: string;
|
|
703
|
+
colSubtotalsOff: string;
|
|
605
704
|
};
|
|
606
705
|
dismissTip: string;
|
|
607
706
|
tipsTitle: string;
|
|
@@ -660,8 +759,11 @@ export declare const de: {
|
|
|
660
759
|
contains: string;
|
|
661
760
|
notContains: string;
|
|
662
761
|
beginsWith: string;
|
|
762
|
+
notBeginsWith: string;
|
|
663
763
|
endsWith: string;
|
|
764
|
+
notEndsWith: string;
|
|
664
765
|
};
|
|
766
|
+
notRule: string;
|
|
665
767
|
relative: {
|
|
666
768
|
year: string;
|
|
667
769
|
years: string;
|
|
@@ -672,6 +774,100 @@ export declare const de: {
|
|
|
672
774
|
};
|
|
673
775
|
withRange: string;
|
|
674
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
|
+
};
|
|
675
871
|
withShare: string;
|
|
676
872
|
noData: {
|
|
677
873
|
one: string;
|
|
@@ -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>;
|