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/echarts.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { init } from "echarts/core";
|
|
2
|
-
export { init };
|
|
1
|
+
import { color, init } from "echarts/core";
|
|
2
|
+
export { color, init };
|
|
3
|
+
export { toEChartsOption } from "pivotkit-core/chart";
|
|
3
4
|
export { cleanChartOptions, mergeChartOptions } from "./chart-options.js";
|
|
4
|
-
export {
|
|
5
|
+
export { colorMapFor } from "./chart-colors.js";
|
|
6
|
+
export { LENGTH_TOKENS, chartStyle, decorate, drawOption, screenColor, tokenLengths } from "./chart-decorate.js";
|
|
7
|
+
export { chartKeeper, shownOf, zoomKeyProps } from "./chart-legend.js";
|
|
8
|
+
export { chartLines } from "./chart-tooltip.js";
|
package/types/export-run.d.ts
CHANGED
|
@@ -10,6 +10,18 @@ export declare function loadExporters(): Promise<typeof import("pivotkit-core/ex
|
|
|
10
10
|
export declare const exportersNow: () => typeof import("pivotkit-core/export") | null;
|
|
11
11
|
/** Starts loading the export module (a menu that copies, when it opens); a failure waits for the click. */
|
|
12
12
|
export declare const prepareExporters: () => undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Makes the Export menu's exports ready to happen in the click (use-export.js). When the menu opens
|
|
15
|
+
* ("menu"): the export module (a copy) and an empty print frame (print-frame.js); the function it
|
|
16
|
+
* returns removes the frame when the menu closes without a print. When Print is pointed at or focused
|
|
17
|
+
* ("print"): the report's modules, ECharts with them (a chunk too large to load whenever the menu
|
|
18
|
+
* opens). A failure waits for the click.
|
|
19
|
+
* @param {"menu" | "print"} what
|
|
20
|
+
* @param {React.RefObject<HTMLElement | null>} root the report's root
|
|
21
|
+
* @param {(() => Promise<any>) | undefined} loadECharts chart.jsx's
|
|
22
|
+
* @returns {(() => void) | undefined}
|
|
23
|
+
*/
|
|
24
|
+
export declare function prepareExport(what: "menu" | "print", root: React.RefObject<HTMLElement | null>, loadECharts: (() => Promise<any>) | undefined): (() => void) | undefined;
|
|
13
25
|
/**
|
|
14
26
|
* Hands the file to the host's onExport, then downloads it unless onExport returned false.
|
|
15
27
|
* @returns {boolean} whether the report downloaded it
|
|
@@ -72,27 +84,20 @@ export type ExportContext = {
|
|
|
72
84
|
chartRef: React.RefObject<any>;
|
|
73
85
|
announce: (text: string, extra?: {
|
|
74
86
|
tone?: "error";
|
|
87
|
+
action?: {
|
|
88
|
+
label: string;
|
|
89
|
+
run: () => void;
|
|
90
|
+
};
|
|
75
91
|
}) => void;
|
|
76
92
|
onExport?: (file: ExportFile) => unknown;
|
|
77
93
|
title?: string | null;
|
|
78
94
|
source?: string | null;
|
|
79
95
|
loadECharts?: () => Promise<any>;
|
|
96
|
+
colorMap?: unknown;
|
|
80
97
|
};
|
|
81
|
-
/**
|
|
82
|
-
* @typedef {{ fileName: string, result: import("pivotkit-core").PivotResult | null, encoded?: import("pivotkit-core").Encoded | null, exportData?: unknown, locale: string,
|
|
83
|
-
* labels: import("./labels.js").UiLabels, limits: object | undefined, root: React.RefObject<HTMLElement | null>,
|
|
84
|
-
* chartRef: React.RefObject<any>, announce: (text: string, extra?: { tone?: "error" }) => void,
|
|
85
|
-
* onExport?: (file: ExportFile) => unknown, title?: string | null, source?: string | null, loadECharts?: () => Promise<any> }} ExportContext
|
|
86
|
-
* `title`: the report's title in an HTML report (the loaded view's name); `source`: the data's name;
|
|
87
|
-
* `encoded`: the data shown (the host's or a loaded file's), which the source data exports, only
|
|
88
|
-
* with the host's `exportData` (read by export-scope.js: the menu hides it otherwise, and no other
|
|
89
|
-
* way reaches it; `{ columns }`: only those);
|
|
90
|
-
* `loadECharts`: chart.jsx's loader of dist/echarts.js (passed in: a module of the menus that
|
|
91
|
-
* imported chart.jsx would move it out of the first load into a shared chunk)
|
|
92
|
-
*/
|
|
93
98
|
/**
|
|
94
99
|
* One export of the Export menu.
|
|
95
|
-
* @param {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "data-csv" | "data-json"} kind
|
|
100
|
+
* @param {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "copy-chart" | "data-csv" | "data-json"} kind
|
|
96
101
|
* @param {ExportContext} context
|
|
97
102
|
*/
|
|
98
|
-
export declare function runExport(kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "data-csv" | "data-json", { fileName, result, encoded, exportData, locale, labels, limits, root, chartRef, announce, onExport, title, source, loadECharts }: ExportContext): Promise<void>;
|
|
103
|
+
export declare function runExport(kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "copy-chart" | "data-csv" | "data-json", { fileName, result, encoded, exportData, locale, labels, limits, root, chartRef, announce, onExport, title, source, loadECharts, colorMap }: ExportContext): Promise<void>;
|
package/types/export-scope.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export type DataExport = {
|
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* The host's `exportData` against the data's own columns (not the derived fields a view adds):
|
|
19
|
-
* - off (false, absent, or a shape it does not know): no Source data; the drill-down's exports
|
|
20
|
-
*
|
|
19
|
+
* - off (false, absent, or a shape it does not know): no Source data; the drill-down's exports
|
|
20
|
+
* only with the host's `drillDownExport` (drillExportOn), every column;
|
|
21
21
|
* - `{ columns }` that is no list (`"Region"`, a function): both off, as an empty list, so a mistake
|
|
22
22
|
* hands out nothing;
|
|
23
23
|
* - true or `{}`: Source data with every column;
|
|
@@ -29,6 +29,17 @@ export type DataExport = {
|
|
|
29
29
|
* @returns {DataExport}
|
|
30
30
|
*/
|
|
31
31
|
export declare function dataExportOf(exportData: unknown, names: string[]): DataExport;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the drill-down panel offers its copies and downloads: with `exportData` on and a column
|
|
34
|
+
* left, or with `drillDownExport` while `exportData` is off (#263). `drillDownExport` never widens
|
|
35
|
+
* the host's columns: none left stays off.
|
|
36
|
+
* @param {DataExport} scope dataExportOf's answer
|
|
37
|
+
* @param {{ drillDownExport?: boolean }} [options]
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
export declare function drillExportOn(scope: DataExport, { drillDownExport }?: {
|
|
41
|
+
drillDownExport?: boolean;
|
|
42
|
+
}): boolean;
|
|
32
43
|
/**
|
|
33
44
|
* The places of the wanted columns among `names`, in the wanted order, matched case-insensitively as
|
|
34
45
|
* pivotkit-core's exporters match them; a name not there is left out, each column once.
|
package/types/field-info.d.ts
CHANGED
|
@@ -33,6 +33,18 @@ export declare function typesOf(fieldDefaults: unknown): Record<string, string>
|
|
|
33
33
|
* @param {FieldInfo | undefined} info
|
|
34
34
|
*/
|
|
35
35
|
export declare function fieldMatches(field: string, query: string, info: FieldInfo | undefined): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The fields a search shows: the field list's and the "+ Add" menus' search, by name, display name and
|
|
38
|
+
* description (fieldMatches), in the data's order.
|
|
39
|
+
* @template {{ name: string }} F
|
|
40
|
+
* @param {F[]} fields
|
|
41
|
+
* @param {string} query as typed
|
|
42
|
+
* @param {Map<string, FieldInfo>} info the host's descriptions by lower-case field name
|
|
43
|
+
* @returns {F[]}
|
|
44
|
+
*/
|
|
45
|
+
export declare function matchingFields<F extends {
|
|
46
|
+
name: string;
|
|
47
|
+
}>(fields: F[], query: string, info: Map<string, FieldInfo>): F[];
|
|
36
48
|
/** Whether a field's name says it is an identifier: pivotkit-core's rule, which its suggestions share. */
|
|
37
49
|
export { isIdentifierName };
|
|
38
50
|
/**
|
package/types/files.d.ts
CHANGED
|
@@ -25,3 +25,17 @@ export declare function saveBlob(blob: Blob, name: string, doc?: Document): void
|
|
|
25
25
|
* @returns {Promise<boolean>}
|
|
26
26
|
*/
|
|
27
27
|
export declare function copyText(text: string, container: HTMLElement | null): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Puts an image on the clipboard (the chart's PNG). The write starts in the click: Safari allows it
|
|
30
|
+
* only there. false where the page has no clipboard for images, or the browser refuses.
|
|
31
|
+
* @param {Blob} blob image/png
|
|
32
|
+
* @param {{ clipboard?: { write: (items: any[]) => Promise<void> }, ClipboardItem?: any }} [env] the
|
|
33
|
+
* browser's, by default
|
|
34
|
+
* @returns {Promise<boolean>}
|
|
35
|
+
*/
|
|
36
|
+
export declare function copyImage(blob: Blob, env?: {
|
|
37
|
+
clipboard?: {
|
|
38
|
+
write: (items: any[]) => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
ClipboardItem?: any;
|
|
41
|
+
}): Promise<boolean>;
|
package/types/filter.d.ts
CHANGED
|
@@ -32,6 +32,24 @@ export declare function ValueList({ items, selected, onChange, labels, locale, a
|
|
|
32
32
|
};
|
|
33
33
|
children?: React.ReactNode;
|
|
34
34
|
}): React.JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* The filter's form: its values, its condition, Cancel and Apply. `onCancel`: what Cancel does (else
|
|
37
|
+
* `close`); `titled` false: no heading of its own (a menu's level has its title above it).
|
|
38
|
+
* @param {{ view: any, base?: any, field: string, encoded: import("pivotkit-core").Encoded, locale: string,
|
|
39
|
+
* labels: any, commit: (v: object, note?: any) => void, close: () => void, onCancel?: () => void, titled?: boolean }} props
|
|
40
|
+
*/
|
|
41
|
+
export declare function FilterBody({ view: current, base, field, encoded, locale, labels, commit, close, onCancel, titled }: {
|
|
42
|
+
view: any;
|
|
43
|
+
base?: any;
|
|
44
|
+
field: string;
|
|
45
|
+
encoded: import("pivotkit-core").Encoded;
|
|
46
|
+
locale: string;
|
|
47
|
+
labels: any;
|
|
48
|
+
commit: (v: object, note?: any) => void;
|
|
49
|
+
close: () => void;
|
|
50
|
+
onCancel?: () => void;
|
|
51
|
+
titled?: boolean;
|
|
52
|
+
}): React.JSX.Element | null;
|
|
35
53
|
/**
|
|
36
54
|
* @param {{ target: { field: string, anchor: HTMLElement, base?: object } | null, onClose: () => void, view: object,
|
|
37
55
|
* encoded: import("pivotkit-core").Encoded, locale: string, labels: import("./labels.js").UiLabels, commit: (v: object, note?: any) => void }} props
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Scan the dictionary once for all Group choices, not once per choice.
|
|
2
|
+
* @param {import("pivotkit-core").Encoded | undefined} encoded @param {string} field */
|
|
3
|
+
export declare function groupStats(encoded: import("pivotkit-core").Encoded | undefined, field: string): {
|
|
4
|
+
span: {
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
};
|
|
8
|
+
first: Date;
|
|
9
|
+
last: Date;
|
|
10
|
+
years: number;
|
|
11
|
+
months: any[];
|
|
12
|
+
} | null;
|
|
13
|
+
/** Inclusive calendar days, independent of the endpoint times. @param {{min: number, max: number}} span */
|
|
14
|
+
export declare const calendarDays: (span: {
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
}) => number;
|
|
18
|
+
/** Data-derived hints in the Group level; wall-clock dates are formatted in UTC.
|
|
19
|
+
* @param {import("pivotkit-core").Encoded} encoded @param {string} field @param {string} unit @param {string} locale @param {any} labels @param {ReturnType<typeof groupStats>} [stats] */
|
|
20
|
+
export declare function groupHint(encoded: import("pivotkit-core").Encoded, field: string, unit: string, locale: string, labels: any, stats?: ReturnType<typeof groupStats>): any;
|
package/types/index.d.ts
CHANGED
|
@@ -118,10 +118,10 @@ export type ExportFile = {
|
|
|
118
118
|
* (returning false prints nothing: the host prints it, e.g. as a PDF of its own);
|
|
119
119
|
* "json": the view file (Views, "Download view"); "data-csv", "data-json": Export → Source data, every
|
|
120
120
|
* row of the data shown as it is (`<fileName>-data.csv`, `<fileName>-data.json`); "copy-table", "copy-json": Export → Copy table,
|
|
121
|
-
* Copy data as JSON; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
|
|
121
|
+
* Copy data as JSON; "copy-chart": Export → Copy chart image, the PNG before it goes on the clipboard; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
|
|
122
122
|
* CSV, Download Excel)
|
|
123
123
|
*/
|
|
124
|
-
kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "data-csv" | "data-json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx";
|
|
124
|
+
kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "data-csv" | "data-json" | "copy-table" | "copy-json" | "copy-chart" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx";
|
|
125
125
|
/**
|
|
126
126
|
* with the extension ("pivot.xlsx"), made safe; for a copy the name it
|
|
127
127
|
* would have as a file ("pivot.tsv", "Central – Jul 2026.json")
|
|
@@ -278,11 +278,17 @@ export type PivotReportProps = {
|
|
|
278
278
|
* of the data shown, as a CSV or JSON file, for the user's own analysis or the command line.
|
|
279
279
|
* `true`: every column; `{ columns }`: only these, in this order, which the drill-down panel's
|
|
280
280
|
* copies and files keep to as well (none left: both off). Default false: the rows may hold more
|
|
281
|
-
* than the report shows (docs/security.md)
|
|
281
|
+
* than the report shows (docs/security.md). Off, the drill-down panel shows its rows but has no
|
|
282
|
+
* copy and no download, unless `drillDownExport` is set
|
|
282
283
|
*/
|
|
283
284
|
exportData?: boolean | {
|
|
284
285
|
columns?: string[];
|
|
285
286
|
};
|
|
287
|
+
/**
|
|
288
|
+
* the drill-down panel's copy and download while `exportData`
|
|
289
|
+
* is off, with every column (default false). With `exportData` on, the panel has them anyway
|
|
290
|
+
*/
|
|
291
|
+
drillDownExport?: boolean;
|
|
286
292
|
/**
|
|
287
293
|
* the tips above the result: "on" (default), "off"
|
|
288
294
|
* (none, and no switch in Options), or the ids of the tips allowed (an array, or a comma-separated text)
|
|
@@ -313,6 +319,13 @@ export type PivotReportProps = {
|
|
|
313
319
|
* with a console warning
|
|
314
320
|
*/
|
|
315
321
|
chartOptions?: Record<string, unknown>;
|
|
322
|
+
/**
|
|
323
|
+
* a fixed colour per series or
|
|
324
|
+
* slice name across charts: `{ Failed: "#e3000f", Success: ["#287233", "#4caf50"] }` (one colour,
|
|
325
|
+
* or one for light and one for dark). Names match without regard to case; hex, rgb(), hsl() or a
|
|
326
|
+
* CSS name. The view's own colours (Display → Colours) win over it
|
|
327
|
+
*/
|
|
328
|
+
colorMap?: Record<string, string | [string, string]>;
|
|
316
329
|
/**
|
|
317
330
|
* "Copy link" in the Views menu and opening a shared
|
|
318
331
|
* link: `true` links to the page's own address without its query, a string is the base URL as it is; the view travels in the
|
|
@@ -368,6 +381,12 @@ export type PivotReportProps = {
|
|
|
368
381
|
* decides. With it the user can still change it until the page is loaded again
|
|
369
382
|
*/
|
|
370
383
|
fieldList?: "open" | "collapsed";
|
|
384
|
+
/**
|
|
385
|
+
* the zones' start state: open, or folded to the heading row
|
|
386
|
+
* "Fields in the report"; without it the report's height decides (folded below 600 px, 820 px when
|
|
387
|
+
* the zones stack). The user can still fold or open them until the page is loaded again
|
|
388
|
+
*/
|
|
389
|
+
zones?: "open" | "folded";
|
|
371
390
|
/**
|
|
372
391
|
* the host is loading the data: the report shows its skeleton (before
|
|
373
392
|
* the first data) or covers its result (later loads)
|
|
@@ -500,12 +519,12 @@ export type TipDismiss = {
|
|
|
500
519
|
/**
|
|
501
520
|
* @typedef {object} ExportFile a file the report made, before it is downloaded, or a text before it
|
|
502
521
|
* goes on the clipboard
|
|
503
|
-
* @property {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "data-csv" | "data-json" | "copy-table" | "copy-json" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx"} kind
|
|
522
|
+
* @property {"xlsx" | "csv" | "png" | "html" | "svg" | "print" | "json" | "data-csv" | "data-json" | "copy-table" | "copy-json" | "copy-chart" | "drill-copy" | "drill-json" | "drill-csv" | "drill-xlsx"} kind
|
|
504
523
|
* "html": the HTML report; "svg": the chart as SVG; "print": the HTML report before it is printed
|
|
505
524
|
* (returning false prints nothing: the host prints it, e.g. as a PDF of its own);
|
|
506
525
|
* "json": the view file (Views, "Download view"); "data-csv", "data-json": Export → Source data, every
|
|
507
526
|
* row of the data shown as it is (`<fileName>-data.csv`, `<fileName>-data.json`); "copy-table", "copy-json": Export → Copy table,
|
|
508
|
-
* Copy data as JSON; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
|
|
527
|
+
* Copy data as JSON; "copy-chart": Export → Copy chart image, the PNG before it goes on the clipboard; "drill-*": the drill-down panel's Export menu (Copy, Copy as JSON, Download
|
|
509
528
|
* CSV, Download Excel)
|
|
510
529
|
* @property {string} fileName with the extension ("pivot.xlsx"), made safe; for a copy the name it
|
|
511
530
|
* would have as a file ("pivot.tsv", "Central – Jul 2026.json")
|
|
@@ -571,7 +590,10 @@ export type TipDismiss = {
|
|
|
571
590
|
* of the data shown, as a CSV or JSON file, for the user's own analysis or the command line.
|
|
572
591
|
* `true`: every column; `{ columns }`: only these, in this order, which the drill-down panel's
|
|
573
592
|
* copies and files keep to as well (none left: both off). Default false: the rows may hold more
|
|
574
|
-
* than the report shows (docs/security.md)
|
|
593
|
+
* than the report shows (docs/security.md). Off, the drill-down panel shows its rows but has no
|
|
594
|
+
* copy and no download, unless `drillDownExport` is set
|
|
595
|
+
* @property {boolean} [drillDownExport] the drill-down panel's copy and download while `exportData`
|
|
596
|
+
* is off, with every column (default false). With `exportData` on, the panel has them anyway
|
|
575
597
|
* @property {"on" | "off" | string | string[]} [tips] the tips above the result: "on" (default), "off"
|
|
576
598
|
* (none, and no switch in Options), or the ids of the tips allowed (an array, or a comma-separated text)
|
|
577
599
|
* @property {string} [storageKey] remembers dismissed tips in localStorage under this key (one per
|
|
@@ -587,6 +609,10 @@ export type TipDismiss = {
|
|
|
587
609
|
* it wins over the view's chart settings. Functions, values that are not plain JSON and the
|
|
588
610
|
* options that are markup or addresses (a string `formatter`, `rich`, `link`, `image`) are left out
|
|
589
611
|
* with a console warning
|
|
612
|
+
* @property {Record<string, string | [string, string]>} [colorMap] a fixed colour per series or
|
|
613
|
+
* slice name across charts: `{ Failed: "#e3000f", Success: ["#287233", "#4caf50"] }` (one colour,
|
|
614
|
+
* or one for light and one for dark). Names match without regard to case; hex, rgb(), hsl() or a
|
|
615
|
+
* CSS name. The view's own colours (Display → Colours) win over it
|
|
590
616
|
* @property {boolean | string} [shareLink] "Copy link" in the Views menu and opening a shared
|
|
591
617
|
* link: `true` links to the page's own address without its query, a string is the base URL as it is; the view travels in the
|
|
592
618
|
* URL fragment (`#pivot=`, `#pivot-<storageKey>=` with a storageKey). Off by default
|
|
@@ -612,6 +638,9 @@ export type TipDismiss = {
|
|
|
612
638
|
* @property {"open" | "collapsed"} [fieldList] the field list of a wide or medium report open or
|
|
613
639
|
* collapsed to a rail; without it the user's choice («, remembered with the tips per storageKey)
|
|
614
640
|
* decides. With it the user can still change it until the page is loaded again
|
|
641
|
+
* @property {"open" | "folded"} [zones] the zones' start state: open, or folded to the heading row
|
|
642
|
+
* "Fields in the report"; without it the report's height decides (folded below 600 px, 820 px when
|
|
643
|
+
* the zones stack). The user can still fold or open them until the page is loaded again
|
|
615
644
|
* @property {boolean} [loading] the host is loading the data: the report shows its skeleton (before
|
|
616
645
|
* the first data) or covers its result (later loads)
|
|
617
646
|
* @property {boolean} [allowImport] people may load a file into the report in the browser: a Data
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The room of the table's row label columns (#584). A table that fits its box keeps its labels at
|
|
3
|
+
* their natural width. A wider one caps them: table.jsx measures how much room the value columns
|
|
4
|
+
* leave, and this is the one cap that shares it out.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The widest each label may be so that the labels together take `room`: short ones keep their width,
|
|
8
|
+
* long ones share what the short ones leave. Infinity when all of them fit, 0 when there is no room.
|
|
9
|
+
* @param {number[]} widths the natural width of each label column
|
|
10
|
+
* @param {number} room the width the columns may take together
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export declare function commonCap(widths: number[], room: number): number;
|
package/types/labels.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ export type UiLabels = typeof en & import("./menu-labels.js").MenuTexts & {
|
|
|
13
13
|
export declare const en: {
|
|
14
14
|
/** the language of the texts, for the report's lang attribute */
|
|
15
15
|
lang: string;
|
|
16
|
+
dateYearsCombined: string;
|
|
17
|
+
dateYearOnly: string;
|
|
18
|
+
dateRangeTitle: string;
|
|
19
|
+
dateRangeData: string;
|
|
20
|
+
dateRangeField: string;
|
|
16
21
|
/** the name of the report's region landmark */
|
|
17
22
|
report: string;
|
|
18
23
|
core: import("pivotkit-core").Labels;
|
|
@@ -37,6 +42,9 @@ export declare const en: {
|
|
|
37
42
|
addTo: string;
|
|
38
43
|
addAgain: string;
|
|
39
44
|
alreadyIn: string;
|
|
45
|
+
addField: string;
|
|
46
|
+
addFieldTo: string;
|
|
47
|
+
movedFrom: string;
|
|
40
48
|
move: string;
|
|
41
49
|
moveTo: string;
|
|
42
50
|
dragHandle: string;
|
|
@@ -80,8 +88,8 @@ export declare const en: {
|
|
|
80
88
|
newAlready: string;
|
|
81
89
|
unsavedChanges: string;
|
|
82
90
|
swap: string;
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
zonesTitle: string;
|
|
92
|
+
zonesHint: string;
|
|
85
93
|
layoutEmpty: string;
|
|
86
94
|
more: string;
|
|
87
95
|
views: string;
|
|
@@ -92,7 +100,9 @@ export declare const en: {
|
|
|
92
100
|
emptyDrop: string;
|
|
93
101
|
emptyNoData: string;
|
|
94
102
|
exportLabel: string;
|
|
95
|
-
|
|
103
|
+
tableSettings: string;
|
|
104
|
+
chartSettings: string;
|
|
105
|
+
settingsShort: string;
|
|
96
106
|
expand: string;
|
|
97
107
|
collapse: string;
|
|
98
108
|
showAs: string;
|
|
@@ -121,9 +131,7 @@ export declare const en: {
|
|
|
121
131
|
bin: string;
|
|
122
132
|
};
|
|
123
133
|
derivedName: string;
|
|
124
|
-
unitInName:
|
|
125
|
-
[x: string]: string;
|
|
126
|
-
};
|
|
134
|
+
unitInName: Readonly<Record<string, string>>;
|
|
127
135
|
binsName: string;
|
|
128
136
|
top: string;
|
|
129
137
|
topBadge: string;
|
|
@@ -160,10 +168,14 @@ export declare const en: {
|
|
|
160
168
|
dismissIssues: string;
|
|
161
169
|
loadingChart: string;
|
|
162
170
|
noChartData: string;
|
|
163
|
-
rowsCount: {
|
|
171
|
+
rowsCount: Readonly<{
|
|
164
172
|
one: string;
|
|
165
173
|
other: string;
|
|
166
|
-
}
|
|
174
|
+
}>;
|
|
175
|
+
rowsFiltered: Readonly<{
|
|
176
|
+
one: string;
|
|
177
|
+
other: string;
|
|
178
|
+
}>;
|
|
167
179
|
tableName: string;
|
|
168
180
|
emptyCell: string;
|
|
169
181
|
emptyValue: string;
|
|
@@ -179,7 +191,17 @@ export declare const en: {
|
|
|
179
191
|
other: string;
|
|
180
192
|
};
|
|
181
193
|
chartExtremes: string;
|
|
194
|
+
chartLines: string;
|
|
195
|
+
chartTrendSpan: string;
|
|
182
196
|
chartTableHint: string;
|
|
197
|
+
chartTotal: string;
|
|
198
|
+
chartMore: string;
|
|
199
|
+
chartMoreInTotal: string;
|
|
200
|
+
chartShares: string;
|
|
201
|
+
chartZoom: string;
|
|
202
|
+
chartZoomWindow: string;
|
|
203
|
+
chartHidden: string;
|
|
204
|
+
chartShown: string;
|
|
183
205
|
categories: string;
|
|
184
206
|
close: string;
|
|
185
207
|
toastRemoved: string;
|
|
@@ -445,6 +467,11 @@ export declare const en: {
|
|
|
445
467
|
};
|
|
446
468
|
export declare const de: {
|
|
447
469
|
lang: string;
|
|
470
|
+
dateYearsCombined: string;
|
|
471
|
+
dateYearOnly: string;
|
|
472
|
+
dateRangeTitle: string;
|
|
473
|
+
dateRangeData: string;
|
|
474
|
+
dateRangeField: string;
|
|
448
475
|
report: string;
|
|
449
476
|
core: import("pivotkit-core").Labels;
|
|
450
477
|
zones: {
|
|
@@ -468,6 +495,9 @@ export declare const de: {
|
|
|
468
495
|
addTo: string;
|
|
469
496
|
addAgain: string;
|
|
470
497
|
alreadyIn: string;
|
|
498
|
+
addField: string;
|
|
499
|
+
addFieldTo: string;
|
|
500
|
+
movedFrom: string;
|
|
471
501
|
move: string;
|
|
472
502
|
moveTo: string;
|
|
473
503
|
dragHandle: string;
|
|
@@ -511,8 +541,8 @@ export declare const de: {
|
|
|
511
541
|
newAlready: string;
|
|
512
542
|
unsavedChanges: string;
|
|
513
543
|
swap: string;
|
|
514
|
-
|
|
515
|
-
|
|
544
|
+
zonesTitle: string;
|
|
545
|
+
zonesHint: string;
|
|
516
546
|
layoutEmpty: string;
|
|
517
547
|
more: string;
|
|
518
548
|
views: string;
|
|
@@ -523,7 +553,9 @@ export declare const de: {
|
|
|
523
553
|
emptyDrop: string;
|
|
524
554
|
emptyNoData: string;
|
|
525
555
|
exportLabel: string;
|
|
526
|
-
|
|
556
|
+
tableSettings: string;
|
|
557
|
+
chartSettings: string;
|
|
558
|
+
settingsShort: string;
|
|
527
559
|
expand: string;
|
|
528
560
|
collapse: string;
|
|
529
561
|
showAs: string;
|
|
@@ -552,9 +584,7 @@ export declare const de: {
|
|
|
552
584
|
bin: string;
|
|
553
585
|
};
|
|
554
586
|
derivedName: string;
|
|
555
|
-
unitInName:
|
|
556
|
-
[x: string]: string;
|
|
557
|
-
};
|
|
587
|
+
unitInName: Readonly<Record<string, string>>;
|
|
558
588
|
binsName: string;
|
|
559
589
|
top: string;
|
|
560
590
|
topBadge: string;
|
|
@@ -590,10 +620,14 @@ export declare const de: {
|
|
|
590
620
|
dismissIssues: string;
|
|
591
621
|
loadingChart: string;
|
|
592
622
|
noChartData: string;
|
|
593
|
-
rowsCount: {
|
|
623
|
+
rowsCount: Readonly<{
|
|
594
624
|
one: string;
|
|
595
625
|
other: string;
|
|
596
|
-
}
|
|
626
|
+
}>;
|
|
627
|
+
rowsFiltered: Readonly<{
|
|
628
|
+
one: string;
|
|
629
|
+
other: string;
|
|
630
|
+
}>;
|
|
597
631
|
tableName: string;
|
|
598
632
|
emptyCell: string;
|
|
599
633
|
emptyValue: string;
|
|
@@ -609,7 +643,17 @@ export declare const de: {
|
|
|
609
643
|
other: string;
|
|
610
644
|
};
|
|
611
645
|
chartExtremes: string;
|
|
646
|
+
chartLines: string;
|
|
647
|
+
chartTrendSpan: string;
|
|
612
648
|
chartTableHint: string;
|
|
649
|
+
chartTotal: string;
|
|
650
|
+
chartMore: string;
|
|
651
|
+
chartMoreInTotal: string;
|
|
652
|
+
chartShares: string;
|
|
653
|
+
chartZoom: string;
|
|
654
|
+
chartZoomWindow: string;
|
|
655
|
+
chartHidden: string;
|
|
656
|
+
chartShown: string;
|
|
613
657
|
categories: string;
|
|
614
658
|
close: string;
|
|
615
659
|
toastRemoved: string;
|
|
@@ -916,6 +960,15 @@ export declare function plural(forms: Partial<Record<string, string>>, count: nu
|
|
|
916
960
|
lang: string;
|
|
917
961
|
locale: string;
|
|
918
962
|
}): string;
|
|
963
|
+
/**
|
|
964
|
+
* The row count under the result: "15,344 rows", or "5,110 of 15,344 rows" when a filter (Top N and
|
|
965
|
+
* value conditions too) leaves rows of the data out (#108).
|
|
966
|
+
* @param {number} shown the source rows left after every filter
|
|
967
|
+
* @param {number} total the data's rows
|
|
968
|
+
* @param {UiLabels} labels
|
|
969
|
+
* @param {string} locale
|
|
970
|
+
*/
|
|
971
|
+
export declare function rowCount(shown: number, total: number, labels: UiLabels, locale: string): string;
|
|
919
972
|
/** Where resolved labels keep a host's texts for the menus (menu-labels.js); a symbol, so it is no text. */
|
|
920
973
|
export declare const MENU_TEXTS: unique symbol;
|
|
921
974
|
/**
|
|
@@ -924,6 +977,22 @@ export declare const MENU_TEXTS: unique symbol;
|
|
|
924
977
|
* in a host's labels cannot break the UI. Keys `base` does not have are ignored.
|
|
925
978
|
*/
|
|
926
979
|
export declare function mergeLabels(base: any, over: any): any;
|
|
980
|
+
/**
|
|
981
|
+
* Label keys the report no longer shows (#580), with the key that holds that text now. A host's
|
|
982
|
+
* labels may still set them; the report ignores them and says so once in the console.
|
|
983
|
+
*/
|
|
984
|
+
export declare const REMOVED_LABELS: Readonly<{
|
|
985
|
+
layout: "zonesTitle";
|
|
986
|
+
showLayout: "zonesTitle";
|
|
987
|
+
options: "tableSettings";
|
|
988
|
+
chartDisplay: "chartSettings";
|
|
989
|
+
}>;
|
|
990
|
+
/**
|
|
991
|
+
* The keys of REMOVED_LABELS a host's labels set, in their order, each with its replacement.
|
|
992
|
+
* @param {unknown} custom
|
|
993
|
+
* @returns {Array<[string, string]>}
|
|
994
|
+
*/
|
|
995
|
+
export declare function removedLabels(custom: unknown): Array<[string, string]>;
|
|
927
996
|
/**
|
|
928
997
|
* The labels for a locale: the language of the locale picks en or de (default en), the host's
|
|
929
998
|
* partial labels are merged over them.
|
package/types/lazy-menus.d.ts
CHANGED
|
@@ -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" | "
|
|
20
|
+
* @param {{ name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "AddMenu" | "ChartSettingsPanel" | "TableSettingsPanel" | "MorePanel" | "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" | "
|
|
25
|
+
name: "AxisMenu" | "FilterMenu" | "ValueMenu" | "AddMenu" | "ChartSettingsPanel" | "TableSettingsPanel" | "MorePanel" | "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
|
@@ -13,11 +13,12 @@ export declare function tabLeaves(e: KeyboardEvent | React.KeyboardEvent, close:
|
|
|
13
13
|
* An ARIA menu: one Tab stop (the item focused last, else the one marked `data-pk-start`, else the
|
|
14
14
|
* first), the arrow keys, Home and End, type-ahead; left and right move inside a group of choices
|
|
15
15
|
* side by side (`data-pk-seg`). `onKey` runs first and may take a key (return true).
|
|
16
|
-
* @param {{ label?: string, labelledBy?: string, className?: string, close: () => void, children: React.ReactNode, testId?: string }} props
|
|
16
|
+
* @param {{ label?: string, labelledBy?: string, describedBy?: string, className?: string, close: () => void, children: React.ReactNode, testId?: string }} props
|
|
17
17
|
*/
|
|
18
|
-
export declare function MenuList({ label, labelledBy, className, close, children, testId }: {
|
|
18
|
+
export declare function MenuList({ label, labelledBy, describedBy, className, close, children, testId }: {
|
|
19
19
|
label?: string;
|
|
20
20
|
labelledBy?: string;
|
|
21
|
+
describedBy?: string;
|
|
21
22
|
className?: string;
|
|
22
23
|
close: () => void;
|
|
23
24
|
children: React.ReactNode;
|
|
@@ -29,12 +30,13 @@ export declare function MenuList({ label, labelledBy, className, close, children
|
|
|
29
30
|
* @param {{ id: string, text: React.ReactNode, onSelect: () => void, checked?: boolean, checkbox?: boolean,
|
|
30
31
|
* hint?: string, icon?: string, danger?: boolean, testId?: string, start?: boolean, plain?: string,
|
|
31
32
|
* label?: string, className?: string, disabled?: boolean, reason?: string, haspopup?: "menu" | "dialog", level?: string,
|
|
32
|
-
* description?: string | null, current?: boolean, children?: React.ReactNode }} props
|
|
33
|
+
* description?: string | null, current?: boolean, note?: string, children?: React.ReactNode }} props
|
|
33
34
|
* `plain`: the text type-ahead matches; `start`: takes Tab first; `level`: the topic it opens;
|
|
35
|
+
* `note`: a line under the text of an entry that can be chosen, read with it (what a pick does);
|
|
34
36
|
* `description`: an explanation a screen reader reads with it (the "i" next to it shows it);
|
|
35
37
|
* `current`: the entry shown now (the view loaded), with a check and aria-current
|
|
36
38
|
*/
|
|
37
|
-
export declare function MenuItem({ id, text, onSelect, checked, checkbox, hint, icon, danger, testId, start, plain, label, className, disabled, reason, haspopup, level, description, current, children }: {
|
|
39
|
+
export declare function MenuItem({ id, text, onSelect, checked, checkbox, hint, icon, danger, testId, start, plain, label, className, disabled, reason, haspopup, level, description, current, note, children }: {
|
|
38
40
|
id: string;
|
|
39
41
|
text: React.ReactNode;
|
|
40
42
|
onSelect: () => void;
|
|
@@ -54,19 +56,24 @@ export declare function MenuItem({ id, text, onSelect, checked, checkbox, hint,
|
|
|
54
56
|
level?: string;
|
|
55
57
|
description?: string | null;
|
|
56
58
|
current?: boolean;
|
|
59
|
+
note?: string;
|
|
57
60
|
children?: React.ReactNode;
|
|
58
61
|
}): React.JSX.Element;
|
|
59
62
|
/**
|
|
60
63
|
* A menu in levels.
|
|
61
64
|
* @param {{ name: string, labels: any, topics: import("./menu-topics.js").Topic[], close: () => void,
|
|
62
65
|
* onPick: (choice: import("./menu-topics.js").Choice) => void, panel: (id: string, back: (focus?: string) => void, hint?: string) => React.ReactNode,
|
|
63
|
-
* head?: React.ReactNode, foot?: React.ReactNode, search?: boolean, locale?: string, focusAgain?: unknown
|
|
66
|
+
* head?: React.ReactNode, foot?: React.ReactNode, search?: boolean, locale?: string, focusAgain?: unknown,
|
|
67
|
+
* filter?: (query: string) => import("./menu-topics.js").Topic[], searchText?: string }} props
|
|
64
68
|
* `onPick`: applies a choice (the menu then goes back to its first level, unless the choice closes
|
|
65
69
|
* it); `panel`: the form of a "panel" topic, with `back` (one level back, the focus where the level
|
|
66
70
|
* was opened from, or `focus`); `foot`: items after the topics (Remove field); `focusAgain`: when it
|
|
67
|
-
* changes, the focus goes once more where the last step sent it (that element may come later)
|
|
71
|
+
* changes, the focus goes once more where the last step sent it (that element may come later);
|
|
72
|
+
* `filter`: the search shows the first level with the topics this gives for what is typed, instead
|
|
73
|
+
* of the hits of every level (a menu of fields searched as the field list is); `searchText`: the
|
|
74
|
+
* search's name and placeholder instead of "Search in the menu of …"
|
|
68
75
|
*/
|
|
69
|
-
export declare function LevelMenu({ name, labels, topics, close, onPick, panel, head, foot, search, locale, focusAgain }: {
|
|
76
|
+
export declare function LevelMenu({ name, labels, topics, close, onPick, panel, head, foot, search, locale, focusAgain, filter, searchText }: {
|
|
70
77
|
name: string;
|
|
71
78
|
labels: any;
|
|
72
79
|
topics: import("./menu-topics.js").Topic[];
|
|
@@ -78,6 +85,8 @@ export declare function LevelMenu({ name, labels, topics, close, onPick, panel,
|
|
|
78
85
|
search?: boolean;
|
|
79
86
|
locale?: string;
|
|
80
87
|
focusAgain?: unknown;
|
|
88
|
+
filter?: (query: string) => import("./menu-topics.js").Topic[];
|
|
89
|
+
searchText?: string;
|
|
81
90
|
}): React.JSX.Element;
|
|
82
91
|
/**
|
|
83
92
|
* Runs the last function handed to `later` a moment after the last call (the typing stopped); `now`
|