pivotkit-react 0.8.1 → 0.9.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 +102 -1
- package/dist/chunks/chunk-24T2VRMU.js +1010 -0
- package/dist/chunks/chunk-6R7TJHS3.js +212 -0
- package/dist/chunks/{chunk-GUSQWPTH.js → chunk-EPGRJSPP.js} +20 -5
- package/dist/chunks/{chunk-JAOOFDNR.js → chunk-FAAQZSR4.js} +4 -1
- package/dist/chunks/{chunk-2N2UGSIG.js → chunk-FI22Z6CC.js} +5 -2
- package/dist/chunks/{chunk-ZM45YU3W.js → chunk-G3R5C3J7.js} +28 -6
- package/dist/chunks/{chunk-MU5BTKSY.js → chunk-QCBVEI23.js} +6 -2
- package/dist/chunks/{chunk-6OWC6X5W.js → chunk-QVE7JM4G.js} +1 -1
- package/dist/chunks/{chunk-3WWWKPB4.js → chunk-V233JHVY.js} +75 -336
- package/dist/chunks/chunk-W6BG3GGS.js +679 -0
- package/dist/chunks/chunk-YAT2TFMK.js +138 -0
- package/dist/chunks/chunk-ZQ2M3U74.js +341 -0
- package/dist/chunks/{unused-texts-de-GB3IWWEM.js → labels-de-ZC3CSQZR.js} +1 -1
- package/dist/chunks/tips-SYGQPI3Q.js +22 -0
- package/dist/chunks/{unused-texts-LRYVWFFN.js → unused-texts-ERQ6ACNX.js} +1 -1
- package/dist/chunks/unused-texts-de-AC5GS3FS.js +6 -0
- package/dist/deferred-late.js +13 -0
- package/dist/deferred.js +18 -0
- package/dist/echarts.js +30 -6
- package/dist/import-ui.js +3 -3
- package/dist/index.js +442 -208
- package/dist/labels.js +15 -12
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +518 -381
- package/dist/styles.css +128 -9
- package/package.json +5 -4
- package/types/PivotReport.d.ts +3 -1
- package/types/chart-tooltip.d.ts +18 -1
- package/types/chart-types.d.ts +7 -2
- package/types/chart.d.ts +10 -2
- package/types/chip-menus.d.ts +1 -1
- package/types/deferred-late.d.ts +2 -0
- package/types/deferred.d.ts +28 -0
- package/types/field-info.d.ts +6 -3
- package/types/fields.d.ts +3 -2
- package/types/icons.d.ts +2 -0
- package/types/index.d.ts +20 -10
- package/types/labels-de.d.ts +2 -0
- package/types/labels.d.ts +55 -459
- package/types/lazy-menus.d.ts +2 -2
- package/types/menu-labels.d.ts +20 -0
- package/types/menu-ops.d.ts +33 -0
- package/types/menu-topics.d.ts +6 -3
- package/types/menus.d.ts +1 -0
- package/types/names.d.ts +20 -2
- package/types/notices.d.ts +212 -0
- package/types/point-menu.d.ts +21 -0
- package/types/quick-choices.d.ts +28 -0
- package/types/side-by-side.d.ts +19 -0
- package/types/tip-state.d.ts +97 -0
- package/types/tips.d.ts +13 -250
- package/types/unused-texts.d.ts +3 -0
- package/types/view-ops.d.ts +27 -14
- package/types/view-tabs.d.ts +4 -3
- package/dist/chunks/chunk-W2SVDHGN.js +0 -1898
package/dist/index.js
CHANGED
|
@@ -1,30 +1,67 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ALL_TIPS,
|
|
3
|
-
CHART_TYPES,
|
|
4
2
|
ClearInput,
|
|
5
3
|
DRILL_LIMIT,
|
|
6
|
-
FIELDS_COLLAPSED,
|
|
7
4
|
HelpContext,
|
|
8
5
|
InfoButton,
|
|
6
|
+
dateContext,
|
|
7
|
+
dateDisplayLocale,
|
|
8
|
+
dateRangeText,
|
|
9
|
+
displayNames,
|
|
10
|
+
drillRows,
|
|
11
|
+
fieldDefaultsFor,
|
|
12
|
+
fieldInfoOf,
|
|
13
|
+
importNow,
|
|
14
|
+
linkNow,
|
|
15
|
+
loadCheck,
|
|
16
|
+
loadImport,
|
|
17
|
+
loadLink,
|
|
18
|
+
matchingFields,
|
|
19
|
+
readLinkParam,
|
|
20
|
+
readStoredView,
|
|
21
|
+
shareBase,
|
|
22
|
+
typesOf,
|
|
23
|
+
viewFromObject,
|
|
24
|
+
writeStoredView
|
|
25
|
+
} from "./chunks/chunk-W6BG3GGS.js";
|
|
26
|
+
import {
|
|
27
|
+
FormNameContext,
|
|
28
|
+
Group,
|
|
29
|
+
Icon,
|
|
30
|
+
LayerContext,
|
|
31
|
+
MenuButton,
|
|
32
|
+
Option,
|
|
33
|
+
Popover,
|
|
34
|
+
TYPE_ICON,
|
|
35
|
+
ZONE_ICON,
|
|
36
|
+
activeIn,
|
|
37
|
+
rootOf,
|
|
38
|
+
tabStops,
|
|
39
|
+
useIsoLayoutEffect,
|
|
40
|
+
useModal
|
|
41
|
+
} from "./chunks/chunk-FAAQZSR4.js";
|
|
42
|
+
import {
|
|
43
|
+
NOTICES,
|
|
44
|
+
activeEntries,
|
|
45
|
+
tipActionText,
|
|
46
|
+
tipContext,
|
|
47
|
+
tipText
|
|
48
|
+
} from "./chunks/chunk-YAT2TFMK.js";
|
|
49
|
+
import {
|
|
50
|
+
ALL_TIPS,
|
|
51
|
+
CHART_TYPES,
|
|
52
|
+
FIELDS_COLLAPSED,
|
|
53
|
+
ITEM_TYPES,
|
|
9
54
|
MAX_CATEGORIES,
|
|
10
55
|
NO_EXPLANATIONS,
|
|
11
|
-
SLICE_TYPES,
|
|
12
56
|
ZONES,
|
|
13
|
-
activeTips,
|
|
14
57
|
addField,
|
|
15
58
|
allowedTips,
|
|
16
59
|
chartPlan,
|
|
17
60
|
chartTypeOf,
|
|
18
61
|
cleanDismissed,
|
|
19
|
-
|
|
20
|
-
dateDisplayLocale,
|
|
21
|
-
dateRangeText,
|
|
62
|
+
columnText,
|
|
22
63
|
dateSpan,
|
|
23
|
-
displayNames,
|
|
24
|
-
drillRows,
|
|
25
64
|
fieldAction,
|
|
26
|
-
fieldDefaultsFor,
|
|
27
|
-
fieldInfoOf,
|
|
28
65
|
fieldsCollapsed,
|
|
29
66
|
filterZoneFields,
|
|
30
67
|
filtersOf,
|
|
@@ -34,26 +71,18 @@ import {
|
|
|
34
71
|
headerSortTarget,
|
|
35
72
|
helpSwitch,
|
|
36
73
|
hiddenAfter,
|
|
37
|
-
importNow,
|
|
38
74
|
isEmptyPick,
|
|
39
75
|
isEmptyView,
|
|
40
76
|
itemRuleText,
|
|
41
77
|
keptOnReset,
|
|
42
78
|
layoutSummary,
|
|
43
|
-
linkNow,
|
|
44
|
-
loadCheck,
|
|
45
|
-
loadImport,
|
|
46
|
-
loadLink,
|
|
47
79
|
localStore,
|
|
48
|
-
matchingFields,
|
|
49
80
|
moveField,
|
|
50
81
|
nextHeaderSort,
|
|
51
82
|
numberRange,
|
|
52
83
|
parseStored,
|
|
53
84
|
readItem,
|
|
54
|
-
readLinkParam,
|
|
55
85
|
readStored,
|
|
56
|
-
readStoredView,
|
|
57
86
|
refLabel,
|
|
58
87
|
removeAt,
|
|
59
88
|
rowFolding,
|
|
@@ -65,62 +94,45 @@ import {
|
|
|
65
94
|
setDisplay,
|
|
66
95
|
setSort,
|
|
67
96
|
setTotal,
|
|
68
|
-
shareBase,
|
|
69
97
|
sortOf,
|
|
70
98
|
sortText,
|
|
99
|
+
sourceFieldName,
|
|
71
100
|
sourceOf,
|
|
72
101
|
subscribeItem,
|
|
73
102
|
subscribeStored,
|
|
74
103
|
swapAxes,
|
|
75
|
-
tipActionText,
|
|
76
|
-
tipContext,
|
|
77
|
-
tipText,
|
|
78
104
|
toggleCollapsed,
|
|
79
|
-
typesOf,
|
|
80
105
|
valueConditionText,
|
|
81
106
|
valueLabel,
|
|
82
107
|
valueLabels,
|
|
83
|
-
viewFromObject,
|
|
84
108
|
withHostOrders,
|
|
85
109
|
withoutFilters,
|
|
86
110
|
writeDismissed,
|
|
87
111
|
writeItem,
|
|
88
|
-
writeStoredView,
|
|
89
112
|
zoneMax,
|
|
90
113
|
zoneOverLimit
|
|
91
|
-
} from "./chunks/chunk-
|
|
92
|
-
import {
|
|
93
|
-
FormNameContext,
|
|
94
|
-
Group,
|
|
95
|
-
Icon,
|
|
96
|
-
LayerContext,
|
|
97
|
-
MenuButton,
|
|
98
|
-
Option,
|
|
99
|
-
Popover,
|
|
100
|
-
TYPE_ICON,
|
|
101
|
-
ZONE_ICON,
|
|
102
|
-
activeIn,
|
|
103
|
-
rootOf,
|
|
104
|
-
tabStops,
|
|
105
|
-
useIsoLayoutEffect,
|
|
106
|
-
useModal
|
|
107
|
-
} from "./chunks/chunk-JAOOFDNR.js";
|
|
114
|
+
} from "./chunks/chunk-24T2VRMU.js";
|
|
108
115
|
import {
|
|
109
116
|
MENU_TEXTS,
|
|
110
117
|
errorText,
|
|
111
118
|
fill,
|
|
119
|
+
hasLabels,
|
|
120
|
+
labelsHere,
|
|
121
|
+
langOf,
|
|
112
122
|
mergeLabels,
|
|
113
123
|
messageOf,
|
|
124
|
+
onLabels,
|
|
114
125
|
plural,
|
|
115
126
|
removedLabels,
|
|
127
|
+
requestLabels,
|
|
116
128
|
resolveLabels,
|
|
117
129
|
rowCount
|
|
118
|
-
} from "./chunks/chunk-
|
|
130
|
+
} from "./chunks/chunk-V233JHVY.js";
|
|
119
131
|
|
|
120
132
|
// src/PivotReport.jsx
|
|
121
|
-
import
|
|
133
|
+
import React14, { useCallback as useCallback10, useEffect as useEffect11, useId as useId5, useMemo as useMemo8, useRef as useRef13, useState as useState12, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
122
134
|
import { flushSync } from "react-dom";
|
|
123
|
-
import { computePivot, emptyView as emptyView2, encode, fieldLabel as fieldLabel5, normalize as normalize2, suggestDateUnit, toGrid, toSeries, viewFields } from "pivotkit-core";
|
|
135
|
+
import { computePivot, emptyView as emptyView2, encode, fieldLabel as fieldLabel5, normalize as normalize2, suggestDateUnit, toGrid, toSeries, viewFields, withFieldLabels } from "pivotkit-core";
|
|
124
136
|
|
|
125
137
|
// src/chart.jsx
|
|
126
138
|
import React, { useEffect, useId, useRef, useState } from "react";
|
|
@@ -188,6 +200,7 @@ function resolveTheme(wanted, htmlTheme, prefersDark) {
|
|
|
188
200
|
// src/chart.jsx
|
|
189
201
|
var loading = null;
|
|
190
202
|
var TAP_WAIT = 1e4;
|
|
203
|
+
var DOUBLE_WAIT = 300;
|
|
191
204
|
function loadECharts() {
|
|
192
205
|
loading ??= import("./echarts.js");
|
|
193
206
|
return loading;
|
|
@@ -212,6 +225,14 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
212
225
|
const summaryId = useId();
|
|
213
226
|
const type = plan ? plan.name : chartTypeOf(result.view.chart);
|
|
214
227
|
const drawAs = plan ? plan.chart : null;
|
|
228
|
+
const waiting = useRef(
|
|
229
|
+
/** @type {ReturnType<typeof setTimeout> | undefined} */
|
|
230
|
+
void 0
|
|
231
|
+
);
|
|
232
|
+
const anchor = useRef(
|
|
233
|
+
/** @type {HTMLSpanElement | null} */
|
|
234
|
+
null
|
|
235
|
+
);
|
|
215
236
|
const latest = useRef({ series, onPoint, onInstance, onLines, onLegend, type });
|
|
216
237
|
const keeper = useRef(
|
|
217
238
|
/** @type {any} */
|
|
@@ -260,15 +281,43 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
260
281
|
const instance = echarts.init(el.current, null, { renderer: "canvas" });
|
|
261
282
|
chart.current = instance;
|
|
262
283
|
latest.current.onInstance(instance);
|
|
263
|
-
|
|
264
|
-
const
|
|
284
|
+
const pointOf = (p) => {
|
|
285
|
+
const s = latest.current.series;
|
|
265
286
|
const kind = p.seriesType;
|
|
266
|
-
if (!s || kind === "
|
|
267
|
-
return;
|
|
287
|
+
if (!s || kind === "treemap") {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
if (kind === "pie") {
|
|
291
|
+
const path = s.categoryPaths[p.dataIndex];
|
|
292
|
+
return path ? { rowPath: path, colPath: [], valueIndex: s.series[0]?.valueIndex ?? 0, value: p.value, slice: true, rowLabel: s.categories[p.dataIndex] } : null;
|
|
268
293
|
}
|
|
269
294
|
const seriesEntry = kind === "heatmap" ? s.series.filter((x) => x.valueIndex === s.series[0]?.valueIndex)[p.value?.[0]] : s.series[p.seriesIndex];
|
|
270
295
|
const row = kind === "heatmap" ? p.value?.[1] : p.dataIndex;
|
|
271
296
|
if (!seriesEntry || !s.categoryPaths[row]) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
const value = kind === "heatmap" ? p.value[2] : typeof p.data?.raw === "number" ? p.data.raw : p.value;
|
|
300
|
+
return { rowPath: s.categoryPaths[row], colPath: seriesEntry.colPath, valueIndex: seriesEntry.valueIndex, value, rowLabel: s.categories[row], colLabel: seriesEntry.colPath.length ? seriesEntry.name : void 0 };
|
|
301
|
+
};
|
|
302
|
+
const placeAnchor = (p) => {
|
|
303
|
+
const at = anchor.current;
|
|
304
|
+
if (at && typeof p.event?.offsetX === "number") {
|
|
305
|
+
at.style.left = `${p.event.offsetX}px`;
|
|
306
|
+
at.style.top = `${p.event.offsetY}px`;
|
|
307
|
+
}
|
|
308
|
+
return at;
|
|
309
|
+
};
|
|
310
|
+
instance.on("dblclick", (p) => {
|
|
311
|
+
clearTimeout(waiting.current);
|
|
312
|
+
const point = pointOf(p);
|
|
313
|
+
if (point && !point.slice) {
|
|
314
|
+
instance.dispatchAction({ type: "hideTip" });
|
|
315
|
+
latest.current.onPoint({ ...point, direct: true, anchor: placeAnchor(p) });
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
instance.on("click", (p) => {
|
|
319
|
+
const point = pointOf(p);
|
|
320
|
+
if (!point) {
|
|
272
321
|
return;
|
|
273
322
|
}
|
|
274
323
|
const element = `${p.seriesIndex}:${p.dataIndex}`;
|
|
@@ -278,9 +327,16 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
278
327
|
return;
|
|
279
328
|
}
|
|
280
329
|
tapped.current = null;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
330
|
+
const open = () => {
|
|
331
|
+
instance.dispatchAction({ type: "hideTip" });
|
|
332
|
+
latest.current.onPoint({ ...point, anchor: placeAnchor(p), home: el.current });
|
|
333
|
+
};
|
|
334
|
+
clearTimeout(waiting.current);
|
|
335
|
+
if (touched.current) {
|
|
336
|
+
open();
|
|
337
|
+
} else {
|
|
338
|
+
waiting.current = setTimeout(open, DOUBLE_WAIT);
|
|
339
|
+
}
|
|
284
340
|
});
|
|
285
341
|
keeper.current = echarts.chartKeeper(instance, { categories: () => latest.current.series?.categories, onLegend: (change) => latest.current.onLegend?.(change), redraw: () => setZoomed((n) => n + 1), onWindow: (control) => setZoomKeys(control ? { ...control, props: echarts.zoomKeyProps } : null) });
|
|
286
342
|
const redraw = (e) => {
|
|
@@ -335,6 +391,7 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
335
391
|
);
|
|
336
392
|
return () => {
|
|
337
393
|
disposed = true;
|
|
394
|
+
clearTimeout(waiting.current);
|
|
338
395
|
keeper.current?.dispose();
|
|
339
396
|
ro?.disconnect();
|
|
340
397
|
if (onPress) {
|
|
@@ -362,7 +419,7 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
362
419
|
latest.current.onLines?.(lines?.checks ?? null);
|
|
363
420
|
const tooltip = { mode: result.view.chart.tooltip, share: result.view.chart.tooltipShare, hover, totalLabel: labels.chartTotal, moreLabel: labels.chartMore, moreInTotalLabel: labels.chartMoreInTotal, values, lines: lines?.lines ?? [] };
|
|
364
421
|
const doc = root.current.ownerDocument;
|
|
365
|
-
setShown(series ? lib.current.shownOf(series, option, result.view.chart.hidden,
|
|
422
|
+
setShown(series ? lib.current.shownOf(series, option, result.view.chart.hidden, ITEM_TYPES.includes(type)) : null);
|
|
366
423
|
const clean = chartOptions ? lib.current.cleanChartOptions(chartOptions) : null;
|
|
367
424
|
if (clean?.problems.length && warned2.current !== chartOptions) {
|
|
368
425
|
warned2.current = chartOptions;
|
|
@@ -374,7 +431,7 @@ function PivotChart({ result, series, labels, locale, themeName, root, onInstanc
|
|
|
374
431
|
}, [ready, result, series, labels, locale, themeName, root, box, chartOptions, colorMap, drawAs, zoomed, type]);
|
|
375
432
|
const empty = result.view.values.length === 0;
|
|
376
433
|
const summary = series && !empty ? chartSummary(shown?.series ?? series, { type, rows: result.view.rows.map((f) => fieldLabel(f, labels.core)), valueNames, labels, locale, shares: shown?.shares, linesText }) : labels.noChartData;
|
|
377
|
-
return /* @__PURE__ */ React.createElement("div", { className: "pk-chart-wrap" }, /* @__PURE__ */ React.createElement("div", { className: "pk-chart-box" }, /* @__PURE__ */ React.createElement("div", { ref: el, className: "pk-chart", "data-testid": "pivot-chart", role: "img", "aria-label": result.view.chart.title ? `${labels.chart}: ${result.view.chart.title}` : labels.chart, "aria-describedby": summaryId }), /* @__PURE__ */ React.createElement("p", { id: summaryId, className: "pk-sr", "data-testid": "chart-summary" }, summary), zoomKeys ? /* @__PURE__ */ React.createElement("div", { ...zoomKeys.props(zoomKeys, labels, fill, locale) }) : null, !ready && !failed ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note" }, labels.loadingChart) : null, failed ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note pk-error" }, failed) : null, ready && empty ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note" }, labels.noChartData) : null), ready && !empty && every > 1 ? /* @__PURE__ */ React.createElement("p", { className: "pk-axis-note", "data-testid": "axis-note" }, fill(labels.axisEvery, { n: every.toLocaleString(locale) })) : null);
|
|
434
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pk-chart-wrap" }, /* @__PURE__ */ React.createElement("div", { className: "pk-chart-box" }, /* @__PURE__ */ React.createElement("div", { ref: el, className: "pk-chart", "data-testid": "pivot-chart", role: "img", tabIndex: -1, "aria-label": result.view.chart.title ? `${labels.chart}: ${result.view.chart.title}` : labels.chart, "aria-describedby": summaryId }), /* @__PURE__ */ React.createElement("span", { ref: anchor, className: "pk-point-anchor", "aria-hidden": "true" }), /* @__PURE__ */ React.createElement("p", { id: summaryId, className: "pk-sr", "data-testid": "chart-summary" }, summary), zoomKeys ? /* @__PURE__ */ React.createElement("div", { ...zoomKeys.props(zoomKeys, labels, fill, locale) }) : null, !ready && !failed ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note" }, labels.loadingChart) : null, failed ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note pk-error" }, failed) : null, ready && empty ? /* @__PURE__ */ React.createElement("div", { className: "pk-chart-note" }, labels.noChartData) : null), ready && !empty && every > 1 ? /* @__PURE__ */ React.createElement("p", { className: "pk-axis-note", "data-testid": "axis-note" }, fill(labels.axisEvery, { n: every.toLocaleString(locale) })) : null);
|
|
378
435
|
}
|
|
379
436
|
|
|
380
437
|
// src/dnd.jsx
|
|
@@ -615,7 +672,7 @@ function tabStep(key, at, count) {
|
|
|
615
672
|
}
|
|
616
673
|
|
|
617
674
|
// src/fields.jsx
|
|
618
|
-
function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, info, showInfo, stop }) {
|
|
675
|
+
function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, source, info, showInfo, stop }) {
|
|
619
676
|
const { setNodeRef, isDragging, itemProps, handleProps } = useDragSource(`field:${field.name}`, { kind: "field", field: field.name, type: field.type, label: name });
|
|
620
677
|
const item = useRef2(
|
|
621
678
|
/** @type {HTMLLIElement | null} */
|
|
@@ -657,7 +714,8 @@ function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, info,
|
|
|
657
714
|
"aria-description": info ? void 0 : action.description || void 0,
|
|
658
715
|
"aria-describedby": info ? describedBy : void 0
|
|
659
716
|
},
|
|
660
|
-
/* @__PURE__ */ React3.createElement("span", { className: "pk-field-title", title: name }, wordsOf(name))
|
|
717
|
+
/* @__PURE__ */ React3.createElement("span", { className: "pk-field-title", title: source ? `${name} (${source})` : name }, wordsOf(name)),
|
|
718
|
+
source ? /* @__PURE__ */ React3.createElement("span", { className: "pk-field-source", title: source }, source) : null
|
|
661
719
|
), info ? /* @__PURE__ */ React3.createElement("span", { id: describedBy, className: "pk-sr" }, [action.description, info.description].filter(Boolean).join(". ")) : null, zones.length ? /* @__PURE__ */ React3.createElement("span", { className: "pk-badges", "aria-hidden": "true" }, zones.map((z) => /* @__PURE__ */ React3.createElement("span", { key: z, className: `pk-badge pk-badge-${z}`, "aria-hidden": "true", title: fill(labels.inZone, { zone: labels.zones[z] }) }, /* @__PURE__ */ React3.createElement(Icon, { name: (
|
|
662
720
|
/** @type {any} */
|
|
663
721
|
ZONE_ICON[z]
|
|
@@ -683,11 +741,11 @@ function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, info,
|
|
|
683
741
|
function wordsOf(name) {
|
|
684
742
|
return name.split(/(\s+)/).map((part, i) => i % 2 === 1 ? " " : part ? /* @__PURE__ */ React3.createElement("span", { key: i, className: "pk-word" }, part) : null);
|
|
685
743
|
}
|
|
686
|
-
function FieldPanel({ fields, placed, labels, onAdd, onNote, onFilter, drawer, open, onClose, nameOf, info, showInfo = true, onSkip, collapsed = false, onCollapse }) {
|
|
744
|
+
function FieldPanel({ fields, placed, labels, onAdd, onNote, onFilter, drawer, open, onClose, nameOf, sourceNameOf, info, showInfo = true, onSkip, collapsed = false, onCollapse }) {
|
|
687
745
|
const [query, setQuery] = useState3("");
|
|
688
746
|
const active = useActiveDrag();
|
|
689
747
|
const { setNodeRef, isOver } = useDropTarget("panel", { kind: "panel" });
|
|
690
|
-
const shown = useMemo2(() => matchingFields(fields, query, info), [fields, query, info]);
|
|
748
|
+
const shown = useMemo2(() => matchingFields(fields, query, info, nameOf), [fields, query, info, nameOf]);
|
|
691
749
|
const removing = active && active.kind !== "field";
|
|
692
750
|
const modal = drawer && open;
|
|
693
751
|
const el = useRef2(
|
|
@@ -797,6 +855,7 @@ function FieldPanel({ fields, placed, labels, onAdd, onNote, onFilter, drawer, o
|
|
|
797
855
|
showInfo,
|
|
798
856
|
stop: current && current.field === f.name ? current.slot : null,
|
|
799
857
|
name: nameOf(f.name),
|
|
858
|
+
source: sourceNameOf && sourceNameOf(f.name) !== nameOf(f.name) ? sourceNameOf(f.name) : void 0,
|
|
800
859
|
info: info.get(f.name.toLowerCase())?.description ? info.get(f.name.toLowerCase()) : void 0
|
|
801
860
|
}
|
|
802
861
|
))),
|
|
@@ -806,6 +865,9 @@ function FieldPanel({ fields, placed, labels, onAdd, onNote, onFilter, drawer, o
|
|
|
806
865
|
);
|
|
807
866
|
}
|
|
808
867
|
|
|
868
|
+
// src/PivotReport.jsx
|
|
869
|
+
import { DEFERRED } from "./deferred.js";
|
|
870
|
+
|
|
809
871
|
// src/lazy-menus.jsx
|
|
810
872
|
import React4, { useEffect as useEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
811
873
|
|
|
@@ -1228,7 +1290,10 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1228
1290
|
[]
|
|
1229
1291
|
);
|
|
1230
1292
|
const fixedWidths = virtual && labelsWide?.grid === grid ? labelsWide.widths : null;
|
|
1231
|
-
const focusNext = useRef4(
|
|
1293
|
+
const focusNext = useRef4(
|
|
1294
|
+
/** @type {{ r: number, c: number } | null} */
|
|
1295
|
+
null
|
|
1296
|
+
);
|
|
1232
1297
|
const [sortNote, setSortNote] = useState5("");
|
|
1233
1298
|
const focusToggle = useRef4(
|
|
1234
1299
|
/** @type {string | null} */
|
|
@@ -1381,7 +1446,7 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1381
1446
|
if (!valueAt(r, c)) {
|
|
1382
1447
|
return;
|
|
1383
1448
|
}
|
|
1384
|
-
focusNext.current =
|
|
1449
|
+
focusNext.current = { r, c };
|
|
1385
1450
|
setActive({ r, c });
|
|
1386
1451
|
const el = wrap.current;
|
|
1387
1452
|
if (virtual && el) {
|
|
@@ -1398,10 +1463,16 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1398
1463
|
const button = [...table.current.querySelectorAll("button[data-pk-toggle]")].find((b) => b.getAttribute("data-pk-toggle") === key);
|
|
1399
1464
|
button?.focus({ preventScroll: true });
|
|
1400
1465
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
const td =
|
|
1404
|
-
|
|
1466
|
+
const next = focusNext.current;
|
|
1467
|
+
if (next && current && current.r === next.r && current.c === next.c) {
|
|
1468
|
+
const td = (
|
|
1469
|
+
/** @type {HTMLElement | null} */
|
|
1470
|
+
table.current?.querySelector(`td[data-r="${current.r}"][data-c="${current.c}"]`)
|
|
1471
|
+
);
|
|
1472
|
+
if (td) {
|
|
1473
|
+
focusNext.current = null;
|
|
1474
|
+
td.focus({ preventScroll: false });
|
|
1475
|
+
}
|
|
1405
1476
|
}
|
|
1406
1477
|
});
|
|
1407
1478
|
const onKeyDown = (e) => {
|
|
@@ -1422,7 +1493,9 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1422
1493
|
const state = headerSortState(view, target);
|
|
1423
1494
|
const next = nextHeaderSort(view, target, hostOrdered(target.field));
|
|
1424
1495
|
const field = fieldLabel2(target.field, labels.core);
|
|
1425
|
-
const
|
|
1496
|
+
const column = target.column ? columnNames.get(JSON.stringify(target.column)) : void 0;
|
|
1497
|
+
const words = (s) => sortText(view, s ?? { by: hostOrdered(target.field) ? "custom" : "label", order: "asc" }, labels, s?.column ? columnNames.get(JSON.stringify(s.column)) : void 0);
|
|
1498
|
+
const aside = Boolean(target.column);
|
|
1426
1499
|
const down = state.chosen ? state.order === "descending" : next?.order === "desc";
|
|
1427
1500
|
const click = () => {
|
|
1428
1501
|
onSort?.(target.field, next);
|
|
@@ -1431,9 +1504,25 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1431
1504
|
return {
|
|
1432
1505
|
// aria-sort only on the header whose sort was chosen (a custom order too): one at a time (WAI-ARIA APG)
|
|
1433
1506
|
sort: state.chosen || state.order === "other" ? state.order : null,
|
|
1434
|
-
content: /* @__PURE__ */ React6.createElement("button", { type: "button", className: `pk-th-sort${state.chosen ? " pk-sorted" : ""}`, title: target.ref && next ? fill(next.order === "desc" ? labels.headerSortDesc : labels.headerSortAsc, { value: refLabel(view, target.ref, labels) }) : fill(labels.headerSort, { field, order: words(next) }), onClick: click }, /* @__PURE__ */ React6.createElement("span", { className: "pk-th-text" }, cell.text), /* @__PURE__ */ React6.createElement(Icon, { name: down ? "arrowDown" : "arrowUp", size: 14, className: "pk-th-arrow" }))
|
|
1507
|
+
content: /* @__PURE__ */ React6.createElement("button", { type: "button", className: `pk-th-sort${state.chosen ? " pk-sorted" : ""}${aside ? " pk-th-sort-aside" : ""}`, title: target.ref && next ? fill(next.order === "desc" ? labels.headerSortDesc : labels.headerSortAsc, { value: column ? fill(labels.valueInColumn, { value: refLabel(view, target.ref, labels), column }) : refLabel(view, target.ref, labels) }) : fill(labels.headerSort, { field, order: words(next) }), onClick: click }, /* @__PURE__ */ React6.createElement("span", { className: "pk-th-text" }, cell.text), /* @__PURE__ */ React6.createElement(Icon, { name: down ? "arrowDown" : "arrowUp", size: 14, className: "pk-th-arrow" }))
|
|
1435
1508
|
};
|
|
1436
1509
|
};
|
|
1510
|
+
const columnNames = (() => {
|
|
1511
|
+
const texts = /* @__PURE__ */ new Map();
|
|
1512
|
+
for (const row of grid.rows.slice(0, grid.headerRows)) {
|
|
1513
|
+
for (const cell of row) {
|
|
1514
|
+
if (cell?.kind === "colHeader" && cell.valueIndex === void 0 && !cell.total && cell.colPath?.length) {
|
|
1515
|
+
texts.set(JSON.stringify(cell.colPath), cell.text);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
const names = /* @__PURE__ */ new Map();
|
|
1520
|
+
for (const key of texts.keys()) {
|
|
1521
|
+
const path = JSON.parse(key);
|
|
1522
|
+
names.set(key, path.map((_, i) => texts.get(JSON.stringify(path.slice(0, i + 1))) ?? String(path[i])).join(" \u203A "));
|
|
1523
|
+
}
|
|
1524
|
+
return names;
|
|
1525
|
+
})();
|
|
1437
1526
|
const subStart = (col) => {
|
|
1438
1527
|
const data = grid.dataColumns[col - grid.rowHeaderColumns];
|
|
1439
1528
|
return data && data.total === 1 && data.valueIndex <= 0 ? " pk-sub-start" : "";
|
|
@@ -1443,7 +1532,7 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1443
1532
|
const top = { top: tops[r] ?? r * rowHeight };
|
|
1444
1533
|
const sticky = c < grid.rowHeaderColumns;
|
|
1445
1534
|
const className = `pk-th pk-${cell.kind}${totalClass(cell.total)}${subStart(c)}${sticky ? " pk-sticky" : ""}`;
|
|
1446
|
-
const target = onSort
|
|
1535
|
+
const target = onSort ? headerSortTarget(view, cell, typeOf) : null;
|
|
1447
1536
|
const sorting = target ? sortButton(cell, target) : null;
|
|
1448
1537
|
const content = /* @__PURE__ */ React6.createElement("span", { className: "pk-th-content" }, cell.toggle ? /* @__PURE__ */ React6.createElement(Toggle, { toggle: cell.toggle, text: cell.text, labels, onToggle }) : null, sorting ? sorting.content : /* @__PURE__ */ React6.createElement("span", { className: "pk-th-text" }, cell.text));
|
|
1449
1538
|
const props = { className, style: stickyStyle(c, top), colSpan: cell.colSpan, rowSpan: cell.rowSpan, scope: cell.kind === "colHeader" ? "col" : void 0 };
|
|
@@ -1459,7 +1548,7 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
|
|
|
1459
1548
|
return /* @__PURE__ */ React6.createElement(DraggableHeader, { key: c, ...props, cell, source: { kind: "table", field: spec?.field ?? null, zone: "values", index: cell.valueIndex, label: cell.text }, description: spec?.field ? infoOf?.(spec.field)?.description : void 0, tooltip: showInfo, sort: sorting?.sort }, content);
|
|
1460
1549
|
}
|
|
1461
1550
|
const title = cell.kind === "colHeader" && cell.total === 1 && r < grid.headerRows - 1 ? labels.tips.colSubtotals : void 0;
|
|
1462
|
-
return /* @__PURE__ */ React6.createElement("th", { key: c, ...props, title }, content);
|
|
1551
|
+
return /* @__PURE__ */ React6.createElement("th", { key: c, ...props, title, "aria-sort": sorting?.sort ?? void 0 }, content);
|
|
1463
1552
|
};
|
|
1464
1553
|
const bodyCell = ({ cell, col, rowSpan, colSpan }, r) => {
|
|
1465
1554
|
if (cell.kind === "rowHeader") {
|
|
@@ -1668,7 +1757,7 @@ import React9, { useEffect as useEffect7, useMemo as useMemo4, useRef as useRef7
|
|
|
1668
1757
|
import { fieldLabel as fieldLabel3 } from "pivotkit-core";
|
|
1669
1758
|
|
|
1670
1759
|
// src/unused-load.js
|
|
1671
|
-
var UNUSED_TEXTS_OF = Object.freeze({ de: () => import("./chunks/unused-texts-de-
|
|
1760
|
+
var UNUSED_TEXTS_OF = Object.freeze({ de: () => import("./chunks/unused-texts-de-AC5GS3FS.js").then((m) => m.de) });
|
|
1672
1761
|
var pending2 = /* @__PURE__ */ new Map();
|
|
1673
1762
|
var loaded2 = /* @__PURE__ */ new Map();
|
|
1674
1763
|
var unusedNow = (lang) => loaded2.get(lang) ?? null;
|
|
@@ -1676,7 +1765,7 @@ function loadUnused(lang) {
|
|
|
1676
1765
|
let p = pending2.get(lang);
|
|
1677
1766
|
if (!p) {
|
|
1678
1767
|
const own = Object.hasOwn(UNUSED_TEXTS_OF, lang) ? UNUSED_TEXTS_OF[lang]().catch(() => null) : null;
|
|
1679
|
-
p = Promise.all([import("./chunks/unused-texts-
|
|
1768
|
+
p = Promise.all([import("./chunks/unused-texts-ERQ6ACNX.js"), own]).then(
|
|
1680
1769
|
([mod, texts]) => {
|
|
1681
1770
|
const out = { mod, lang: texts };
|
|
1682
1771
|
loaded2.set(lang, out);
|
|
@@ -2103,67 +2192,133 @@ function Toolbar(props) {
|
|
|
2103
2192
|
/* @__PURE__ */ React10.createElement(Group, { key: ids[0], menu: true, label: ids[0] === "startOver" ? labels.startOver : void 0 }, ids.map((id) => actions[id].entry(close)))
|
|
2104
2193
|
] : []
|
|
2105
2194
|
);
|
|
2106
|
-
return /* @__PURE__ */ React10.createElement("div", { className: `pk-toolbar${wrap ? " pk-wrap" : ""}`, role: "toolbar", "aria-label": labels.toolbar, ref: bar, "data-overflow": hidden.size }, size === "narrow" ? /* @__PURE__ */ React10.createElement("button", { type: "button", className: "pk-btn", onClick: onShowFields, "data-testid": "show-fields", "data-pk-opener": "fields" }, /* @__PURE__ */ React10.createElement(Icon, { name: "panel" }), /* @__PURE__ */ React10.createElement("span", { className: "pk-btn-text" }, labels.showFields)) : null, /* @__PURE__ */ React10.createElement("span", { className: "pk-toolbar-pair" }, /* @__PURE__ */ React10.createElement(TextButton, { icon: "undo", label: labels.undo, onClick: onUndo, disabled: !canUndo, testId: "undo", shortcut: `${mod}Z` }), /* @__PURE__ */ React10.createElement(TextButton, { icon: "redo", label: labels.redo, onClick: onRedo, disabled: !canRedo, testId: "redo", shortcut: `${mod}\u21E7Z` })), buttons("history"), /* @__PURE__ */ React10.createElement("span", { className: "pk-grow" }), end.slice(0, at), wrap ? null : name, end.slice(at), /* @__PURE__ */ React10.createElement(MenuButton, { label: labels.exportLabel, icon: "download", text: labels.exportLabel, role: "dialog", align: "end", testId: "export" }, (close) => /* @__PURE__ */ React10.createElement(MenuPanel, { name: "ExportPanel", loadingText: labels.loadingMenu, props: { labels, onExport, chartReady, display: view.display, empty, dataExport: props.dataExport, prepare: props.prepareExport, close } })), /* @__PURE__ */ React10.createElement(MenuButton, { label: labels.more, icon: "more", text: labels.more, role: "dialog", align: "end", testId: "more", buttonRef: more, arrowOpens: true, mark: hidden.has("views") && loadedView?.changed ? changedMark("more-changed") : hidden.has("data") ? loadedMark("more-loaded") : null }, (close) => /* @__PURE__ */ React10.createElement(MenuPanel, { name: "MorePanel", loadingText: labels.loadingMenu, props: { labels, tips, mod, help: props.help, close, foot: hidden.size > 0 ? moreGroups : void 0 } })), wrap ? name : null, panel ? /* @__PURE__ */ React10.createElement(Popover, { open: true, anchor: more, onClose: closePanel, label: panel === "views" ? labels.views : labels.data, role: "dialog", align: "end" }, panels[panel](closePanel)) : null);
|
|
2195
|
+
return /* @__PURE__ */ React10.createElement("div", { className: `pk-toolbar${wrap ? " pk-wrap" : ""}`, role: "toolbar", "aria-label": labels.toolbar, ref: bar, "data-overflow": hidden.size }, size === "narrow" ? /* @__PURE__ */ React10.createElement("button", { type: "button", className: "pk-btn", onClick: onShowFields, "data-testid": "show-fields", "data-pk-opener": "fields" }, /* @__PURE__ */ React10.createElement(Icon, { name: "panel" }), /* @__PURE__ */ React10.createElement("span", { className: "pk-btn-text" }, labels.showFields)) : null, /* @__PURE__ */ React10.createElement("span", { className: "pk-toolbar-pair" }, /* @__PURE__ */ React10.createElement(TextButton, { icon: "undo", label: labels.undo, onClick: onUndo, disabled: !canUndo, testId: "undo", shortcut: `${mod}Z` }), /* @__PURE__ */ React10.createElement(TextButton, { icon: "redo", label: labels.redo, onClick: onRedo, disabled: !canRedo, testId: "redo", shortcut: `${mod}\u21E7Z` })), buttons("history"), /* @__PURE__ */ React10.createElement("span", { className: "pk-grow" }), end.slice(0, at), wrap ? null : name, end.slice(at), /* @__PURE__ */ React10.createElement(MenuButton, { label: labels.exportLabel, icon: "download", text: labels.exportLabel, role: "dialog", align: "end", testId: "export" }, (close) => /* @__PURE__ */ React10.createElement(MenuPanel, { name: "ExportPanel", loadingText: labels.loadingMenu, props: { labels, onExport, chartReady, display: props.display ?? view.display, empty, dataExport: props.dataExport, prepare: props.prepareExport, close } })), /* @__PURE__ */ React10.createElement(MenuButton, { label: labels.more, icon: "more", text: labels.more, role: "dialog", align: "end", testId: "more", buttonRef: more, arrowOpens: true, mark: hidden.has("views") && loadedView?.changed ? changedMark("more-changed") : hidden.has("data") ? loadedMark("more-loaded") : null }, (close) => /* @__PURE__ */ React10.createElement(MenuPanel, { name: "MorePanel", loadingText: labels.loadingMenu, props: { labels, tips, mod, help: props.help, close, foot: hidden.size > 0 ? moreGroups : void 0 } })), wrap ? name : null, panel ? /* @__PURE__ */ React10.createElement(Popover, { open: true, anchor: more, onClose: closePanel, label: panel === "views" ? labels.views : labels.data, role: "dialog", align: "end" }, panels[panel](closePanel)) : null);
|
|
2107
2196
|
}
|
|
2108
2197
|
|
|
2109
|
-
// src/
|
|
2198
|
+
// src/side-by-side.jsx
|
|
2110
2199
|
import React11, { useRef as useRef9 } from "react";
|
|
2200
|
+
var SPLIT = Object.freeze({ start: 50, min: 25, max: 75, step: 5 });
|
|
2201
|
+
function SideBySide({ labels, split: split2, onSplit: setSplit, table, chart }) {
|
|
2202
|
+
const box = useRef9(
|
|
2203
|
+
/** @type {HTMLDivElement | null} */
|
|
2204
|
+
null
|
|
2205
|
+
);
|
|
2206
|
+
const clamp = (n) => Math.round(Math.min(SPLIT.max, Math.max(SPLIT.min, n)));
|
|
2207
|
+
const onPointerDown = (e) => {
|
|
2208
|
+
if (e.button !== 0) {
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
e.preventDefault();
|
|
2212
|
+
const bar = e.currentTarget;
|
|
2213
|
+
bar.setPointerCapture(e.pointerId);
|
|
2214
|
+
const move = (m) => {
|
|
2215
|
+
const rect = box.current?.getBoundingClientRect();
|
|
2216
|
+
if (rect && rect.width > 0) {
|
|
2217
|
+
setSplit(clamp((m.clientX - rect.left) / rect.width * 100));
|
|
2218
|
+
}
|
|
2219
|
+
};
|
|
2220
|
+
const up = () => {
|
|
2221
|
+
bar.removeEventListener("pointermove", move);
|
|
2222
|
+
bar.removeEventListener("pointerup", up);
|
|
2223
|
+
bar.removeEventListener("pointercancel", up);
|
|
2224
|
+
};
|
|
2225
|
+
bar.addEventListener("pointermove", move);
|
|
2226
|
+
bar.addEventListener("pointerup", up);
|
|
2227
|
+
bar.addEventListener("pointercancel", up);
|
|
2228
|
+
};
|
|
2229
|
+
const onKeyDown = (e) => {
|
|
2230
|
+
const next = e.key === "ArrowLeft" ? split2 - SPLIT.step : e.key === "ArrowRight" ? split2 + SPLIT.step : e.key === "Home" ? SPLIT.min : e.key === "End" ? SPLIT.max : null;
|
|
2231
|
+
if (next !== null) {
|
|
2232
|
+
e.preventDefault();
|
|
2233
|
+
setSplit(clamp(next));
|
|
2234
|
+
}
|
|
2235
|
+
};
|
|
2236
|
+
return /* @__PURE__ */ React11.createElement("div", { className: "pk-both", ref: box, style: (
|
|
2237
|
+
/** @type {any} */
|
|
2238
|
+
{ "--pk-split": `${split2}%` }
|
|
2239
|
+
), "data-testid": "side-by-side" }, /* @__PURE__ */ React11.createElement("div", { className: "pk-both-part pk-both-table" }, table), /* @__PURE__ */ React11.createElement(
|
|
2240
|
+
"div",
|
|
2241
|
+
{
|
|
2242
|
+
className: "pk-both-divider",
|
|
2243
|
+
role: "separator",
|
|
2244
|
+
"aria-orientation": "vertical",
|
|
2245
|
+
"aria-label": labels.splitDivider,
|
|
2246
|
+
"aria-valuemin": SPLIT.min,
|
|
2247
|
+
"aria-valuemax": SPLIT.max,
|
|
2248
|
+
"aria-valuenow": split2,
|
|
2249
|
+
"aria-valuetext": fill(labels.splitValue, { table: split2, chart: 100 - split2 }),
|
|
2250
|
+
tabIndex: 0,
|
|
2251
|
+
onPointerDown,
|
|
2252
|
+
onKeyDown,
|
|
2253
|
+
"data-testid": "split-divider"
|
|
2254
|
+
}
|
|
2255
|
+
), /* @__PURE__ */ React11.createElement("div", { className: "pk-both-part pk-both-chart" }, chart));
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
// src/view-tabs.jsx
|
|
2259
|
+
import React12, { useRef as useRef10 } from "react";
|
|
2111
2260
|
var TABS = Object.freeze(
|
|
2112
2261
|
/** @type {const} */
|
|
2113
|
-
["table", "chart"]
|
|
2262
|
+
["table", "chart", "both"]
|
|
2114
2263
|
);
|
|
2115
2264
|
var tabId = (panelId, display) => `${panelId}-${display}`;
|
|
2116
2265
|
function ViewTabs(props) {
|
|
2117
|
-
const { view, labels, panelId, narrow, onDisplay, plan, big } = props;
|
|
2118
|
-
const list =
|
|
2266
|
+
const { view, labels, panelId, narrow, shown = view.display, both = false, onDisplay, plan, big } = props;
|
|
2267
|
+
const list = useRef10(
|
|
2119
2268
|
/** @type {HTMLDivElement | null} */
|
|
2120
2269
|
null
|
|
2121
2270
|
);
|
|
2122
|
-
const
|
|
2123
|
-
const settings = chart ? labels.chartSettings : labels.tableSettings;
|
|
2271
|
+
const tabs = TABS.filter((d) => d !== "both" || both);
|
|
2124
2272
|
const onKeyDown = (e) => {
|
|
2125
|
-
const
|
|
2273
|
+
const buttons = (
|
|
2126
2274
|
/** @type {HTMLElement[]} */
|
|
2127
2275
|
[...list.current?.querySelectorAll('[role="tab"]') ?? []]
|
|
2128
2276
|
);
|
|
2129
|
-
const at =
|
|
2277
|
+
const at = buttons.indexOf(
|
|
2130
2278
|
/** @type {HTMLElement} */
|
|
2131
2279
|
e.target
|
|
2132
2280
|
);
|
|
2133
|
-
const next = at < 0 ? null : tabStep(e.key, at,
|
|
2281
|
+
const next = at < 0 ? null : tabStep(e.key, at, buttons.length);
|
|
2134
2282
|
if (next !== null) {
|
|
2135
2283
|
e.preventDefault();
|
|
2136
|
-
|
|
2284
|
+
buttons[next].focus();
|
|
2137
2285
|
}
|
|
2138
2286
|
};
|
|
2139
2287
|
const iconOnly = (name) => narrow ? { "aria-label": name, title: name } : {};
|
|
2140
|
-
|
|
2288
|
+
const enlargeTitle = shown === "both" && !big.enlarged ? { title: labels.enlargeBoth } : {};
|
|
2289
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "pk-result-head", "data-testid": "view-tabs-row" }, /* @__PURE__ */ React12.createElement("div", { ref: list, className: "pk-tabs", role: "tablist", "aria-label": labels.view, onKeyDown }, tabs.map((d) => /* @__PURE__ */ React12.createElement(
|
|
2141
2290
|
"button",
|
|
2142
2291
|
{
|
|
2143
2292
|
key: d,
|
|
2144
2293
|
type: "button",
|
|
2145
2294
|
role: "tab",
|
|
2146
2295
|
id: tabId(panelId, d),
|
|
2147
|
-
"aria-selected":
|
|
2296
|
+
"aria-selected": shown === d,
|
|
2148
2297
|
"aria-controls": panelId,
|
|
2149
|
-
tabIndex:
|
|
2298
|
+
tabIndex: shown === d ? 0 : -1,
|
|
2150
2299
|
className: "pk-tab",
|
|
2151
|
-
onClick: () =>
|
|
2300
|
+
onClick: () => shown === d ? void 0 : onDisplay(d),
|
|
2152
2301
|
"data-testid": `show-${d}`
|
|
2153
2302
|
},
|
|
2154
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ React12.createElement(Icon, { name: (
|
|
2155
2304
|
/** @type {any} */
|
|
2156
|
-
d === "table" ? "table" : CHART_TYPES[plan.name].icon
|
|
2305
|
+
d === "table" ? "table" : d === "both" ? "layout" : CHART_TYPES[plan.name].icon
|
|
2157
2306
|
) }),
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
))), /* @__PURE__ */
|
|
2307
|
+
/* @__PURE__ */ React12.createElement("span", null, d === "table" ? labels.table : d === "both" ? labels.both : labels.chart)
|
|
2308
|
+
))), /* @__PURE__ */ React12.createElement("span", { className: "pk-grow" }), shown !== "chart" ? /* @__PURE__ */ React12.createElement(SettingsButton, { kind: "table", ...props }) : null, shown !== "table" ? /* @__PURE__ */ React12.createElement(SettingsButton, { kind: "chart", ...props }) : null, /* @__PURE__ */ React12.createElement("button", { type: "button", className: "pk-btn pk-pressable pk-small-btn", "data-pk-on": big.enlarged ? "" : void 0, onClick: big.toggleEnlarged, "data-testid": "enlarge", ...enlargeTitle, ...iconOnly(big.enlarged ? labels.reduce : labels.enlarge) }, /* @__PURE__ */ React12.createElement(Icon, { name: "enlarge", size: 14 }), narrow ? null : /* @__PURE__ */ React12.createElement("span", { className: "pk-btn-text" }, big.enlarged ? labels.reduce : labels.enlarge)), big.fullOk ? /* @__PURE__ */ React12.createElement("button", { type: "button", className: "pk-btn pk-pressable pk-small-btn", "aria-pressed": big.full, onClick: big.toggleFull, "data-testid": "full-screen", ...iconOnly(labels.fullScreen) }, /* @__PURE__ */ React12.createElement(Icon, { name: "fullScreen", size: 14 }), narrow ? null : /* @__PURE__ */ React12.createElement("span", { className: "pk-btn-text" }, labels.fullScreen)) : null);
|
|
2309
|
+
}
|
|
2310
|
+
function SettingsButton(props) {
|
|
2311
|
+
const { kind, view, labels, narrow, plan } = props;
|
|
2312
|
+
const chart = kind === "chart";
|
|
2313
|
+
const settings = chart ? labels.chartSettings : labels.tableSettings;
|
|
2314
|
+
return /* @__PURE__ */ React12.createElement(MenuButton, { label: settings, icon: "sliders", text: narrow ? labels.settingsShort : settings, name: narrow ? settings : void 0, title: narrow ? settings : void 0, className: "pk-btn pk-small-btn", role: "dialog", align: "end", testId: props.shown === "both" ? `${kind}-settings` : "view-settings", popoverClass: chart ? "pk-chart-menu" : void 0 }, (close) => chart ? /* @__PURE__ */ React12.createElement(
|
|
2160
2315
|
MenuPanel,
|
|
2161
2316
|
{
|
|
2162
2317
|
name: "ChartSettingsPanel",
|
|
2163
2318
|
loadingText: labels.loadingMenu,
|
|
2164
2319
|
props: { view, plan, encoded: props.encoded, lineChecks: props.lineChecks, labels, locale: props.locale, onChart: props.onChart, onDisplay: props.onChartDisplay, close, series: props.chartSeries, colors: props.chartColors, folding: props.folding, onExpand: props.onExpand, onCollapse: props.onCollapse }
|
|
2165
2320
|
}
|
|
2166
|
-
) : /* @__PURE__ */
|
|
2321
|
+
) : /* @__PURE__ */ React12.createElement(MenuPanel, { name: "TableSettingsPanel", loadingText: labels.loadingMenu, props: { view, labels, onTotal: props.onTotal, onExpand: props.onExpand, onCollapse: props.onCollapse, close, folding: props.folding } }));
|
|
2167
2322
|
}
|
|
2168
2323
|
|
|
2169
2324
|
// src/use-export.js
|
|
@@ -2405,7 +2560,7 @@ function keptData(key, host) {
|
|
|
2405
2560
|
}
|
|
2406
2561
|
|
|
2407
2562
|
// src/use-big-result.js
|
|
2408
|
-
import { useCallback as useCallback8, useEffect as useEffect9, useRef as
|
|
2563
|
+
import { useCallback as useCallback8, useEffect as useEffect9, useRef as useRef11, useState as useState10, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
2409
2564
|
function fullScreenSupported() {
|
|
2410
2565
|
return typeof document !== "undefined" && Boolean(document.fullscreenEnabled) && typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype.requestFullscreen === "function";
|
|
2411
2566
|
}
|
|
@@ -2446,12 +2601,12 @@ function useBigResult(root) {
|
|
|
2446
2601
|
return { enlarged, setEnlarged, toggleEnlarged, full, fullOk, toggleFull };
|
|
2447
2602
|
}
|
|
2448
2603
|
function useFitHeight(root, main, grow, onOpen) {
|
|
2449
|
-
const fit =
|
|
2604
|
+
const fit = useRef11(
|
|
2450
2605
|
/** @type {FitState} */
|
|
2451
2606
|
{ need: 0, open: 0, grow, folded: null, size: null }
|
|
2452
2607
|
);
|
|
2453
|
-
const opened =
|
|
2454
|
-
const watch =
|
|
2608
|
+
const opened = useRef11(onOpen);
|
|
2609
|
+
const watch = useRef11(
|
|
2455
2610
|
/** @type {{ ro: ResizeObserver | null, parts: Set<Element> }} */
|
|
2456
2611
|
{ ro: null, parts: /* @__PURE__ */ new Set() }
|
|
2457
2612
|
);
|
|
@@ -2549,7 +2704,7 @@ function measureFit(el, m, fit) {
|
|
|
2549
2704
|
}
|
|
2550
2705
|
|
|
2551
2706
|
// src/zones.jsx
|
|
2552
|
-
import
|
|
2707
|
+
import React13, { useCallback as useCallback9, useEffect as useEffect10, useId as useId4, useMemo as useMemo7, useRef as useRef12, useState as useState11 } from "react";
|
|
2553
2708
|
import { fieldItems, fieldLabel as fieldLabel4 } from "pivotkit-core";
|
|
2554
2709
|
function fieldState(view, field, encoded, locale, labels, sourceType) {
|
|
2555
2710
|
const items = filtersOf(view, field, ["in"]).filter((f) => !isEmptyPick(f));
|
|
@@ -2566,7 +2721,9 @@ function fieldState(view, field, encoded, locale, labels, sourceType) {
|
|
|
2566
2721
|
const rules = filtersOf(view, field, ["relative", "compare", "text"]).map((f) => itemRuleText(f, labels, locale, { timeZone: encoded.timeZone, date, labelOf, span, weekStart: view.formatting?.weekStart }));
|
|
2567
2722
|
const top = filtersOf(view, field, ["top"])[0] ?? null;
|
|
2568
2723
|
const condition = filtersOf(view, field, ["value"])[0] ?? null;
|
|
2569
|
-
|
|
2724
|
+
const sort = sortOf(view, field);
|
|
2725
|
+
const sortColumn = sort?.column ? columnText(view, sort.column, encoded, labels, locale) : void 0;
|
|
2726
|
+
return { summary, rules, top, condition, sort, sortColumn };
|
|
2570
2727
|
}
|
|
2571
2728
|
function stateWords(state, view, labels, locale) {
|
|
2572
2729
|
if (!state) {
|
|
@@ -2584,7 +2741,7 @@ function stateWords(state, view, labels, locale) {
|
|
|
2584
2741
|
words.push(valueConditionText(view, state.condition, labels, locale));
|
|
2585
2742
|
}
|
|
2586
2743
|
if (state.sort) {
|
|
2587
|
-
words.push(fill(labels.stateSorted, { order: sortText(view, state.sort, labels) }));
|
|
2744
|
+
words.push(fill(labels.stateSorted, { order: sortText(view, state.sort, labels, state.sortColumn) }));
|
|
2588
2745
|
}
|
|
2589
2746
|
return words.join(", ");
|
|
2590
2747
|
}
|
|
@@ -2593,48 +2750,48 @@ function Badges({ state, view, labels, locale }) {
|
|
|
2593
2750
|
if (state.summary) {
|
|
2594
2751
|
const text = fill(labels.filterSummary, { shown: state.summary.shown.toLocaleString(locale), total: state.summary.total.toLocaleString(locale) });
|
|
2595
2752
|
parts.push(
|
|
2596
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ React13.createElement("span", { key: "filter", className: "pk-chip-badge pk-badge-text", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement(Icon, { name: "filter", size: 12 }), text)
|
|
2597
2754
|
);
|
|
2598
2755
|
}
|
|
2599
2756
|
if (state.rules.length) {
|
|
2600
2757
|
const more = state.rules.length - 1;
|
|
2601
2758
|
parts.push(
|
|
2602
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ React13.createElement("span", { key: "rules", className: "pk-chip-badge pk-badge-text pk-badge-condition", "data-testid": "rule-badge", "aria-hidden": "true" }, state.summary ? null : /* @__PURE__ */ React13.createElement(Icon, { name: "filter", size: 12 }), /* @__PURE__ */ React13.createElement("span", { className: "pk-badge-cut" }, state.rules[0]), more ? /* @__PURE__ */ React13.createElement("span", null, ` +${more.toLocaleString(locale)}`) : null)
|
|
2603
2760
|
);
|
|
2604
2761
|
}
|
|
2605
2762
|
if (state.top) {
|
|
2606
2763
|
const text = fill(state.top.bottom ? labels.bottomBadge : labels.topBadge, { count: state.top.count.toLocaleString(locale) });
|
|
2607
2764
|
parts.push(
|
|
2608
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ React13.createElement("span", { key: "top", className: "pk-chip-badge pk-badge-text", "data-testid": "top-badge", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement(Icon, { name: "top", size: 12 }), text)
|
|
2609
2766
|
);
|
|
2610
2767
|
}
|
|
2611
2768
|
if (state.condition) {
|
|
2612
2769
|
const text = valueConditionText(view, state.condition, labels, locale);
|
|
2613
2770
|
parts.push(
|
|
2614
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ React13.createElement("span", { key: "condition", className: "pk-chip-badge pk-badge-text pk-badge-condition", "data-testid": "condition-badge", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement(Icon, { name: "filter", size: 12 }), /* @__PURE__ */ React13.createElement("span", { className: "pk-badge-cut" }, text))
|
|
2615
2772
|
);
|
|
2616
2773
|
}
|
|
2617
2774
|
if (state.sort) {
|
|
2618
2775
|
const desc = state.sort.order === "desc";
|
|
2619
|
-
parts.push(/* @__PURE__ */
|
|
2776
|
+
parts.push(/* @__PURE__ */ React13.createElement(Icon, { key: "sort", name: desc ? "sortDesc" : "sortAsc", size: 12, className: "pk-chip-badge" }));
|
|
2620
2777
|
}
|
|
2621
|
-
return parts.length ? /* @__PURE__ */
|
|
2778
|
+
return parts.length ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, parts) : null;
|
|
2622
2779
|
}
|
|
2623
2780
|
function Chip({ id, zone, index, count, field, text, title, typeName, view, types, labels, commit, onRemove, state, locale, defaultsOf, earlier, rangeOf, info, showInfo, encoded }) {
|
|
2624
2781
|
const { setNodeRef, isDragging, style, itemProps, handleProps } = useChip(id, { kind: "chip", zone, index, count, field, label: text, type: typeName });
|
|
2625
|
-
const badges = state ? /* @__PURE__ */
|
|
2782
|
+
const badges = state ? /* @__PURE__ */ React13.createElement(Badges, { state, view, labels, locale }) : null;
|
|
2626
2783
|
const words = stateWords(state, view, labels, locale);
|
|
2627
2784
|
const full = title ?? text;
|
|
2628
2785
|
const name = words ? `${full}, ${words}` : title;
|
|
2629
2786
|
const remove = () => onRemove(zone, index, text);
|
|
2630
|
-
return /* @__PURE__ */
|
|
2787
|
+
return /* @__PURE__ */ React13.createElement("li", { ref: setNodeRef, style, className: `pk-chip pk-chip-${zone}${isDragging ? " pk-dragging" : ""}`, ...itemProps, "data-chip": text }, /* @__PURE__ */ React13.createElement("span", { className: "pk-handle", ...handleProps, "aria-label": fill(labels.dragHandle, { field: text }) }, /* @__PURE__ */ React13.createElement(Icon, { name: "grip", size: 16 })), /* @__PURE__ */ React13.createElement("span", { className: `pk-type pk-type-${typeName}`, "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement(Icon, { name: (
|
|
2631
2788
|
/** @type {any} */
|
|
2632
2789
|
TYPE_ICON[typeName] ?? "text"
|
|
2633
|
-
), size: 13 })), /* @__PURE__ */
|
|
2790
|
+
), size: 13 })), /* @__PURE__ */ React13.createElement(
|
|
2634
2791
|
MenuButton,
|
|
2635
2792
|
{
|
|
2636
2793
|
label: fill(labels.fieldMenu, { field: text }),
|
|
2637
|
-
text: /* @__PURE__ */
|
|
2794
|
+
text: /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("span", { className: "pk-chip-name" }, text), badges),
|
|
2638
2795
|
className: "pk-chip-label",
|
|
2639
2796
|
name,
|
|
2640
2797
|
title: name ?? text,
|
|
@@ -2643,12 +2800,12 @@ function Chip({ id, zone, index, count, field, text, title, typeName, view, type
|
|
|
2643
2800
|
fill: true,
|
|
2644
2801
|
testId: `chip-menu-${text}`
|
|
2645
2802
|
},
|
|
2646
|
-
(close) => zone === "values" ? /* @__PURE__ */
|
|
2647
|
-
), info && showInfo ? /* @__PURE__ */
|
|
2803
|
+
(close) => zone === "values" ? /* @__PURE__ */ React13.createElement(MenuPanel, { name: "ValueMenu", loadingText: labels.loadingMenu, props: { view, index, types, labels, commit, close, onRemove: remove, defaultsOf, info, locale, earlier } }) : zone === "filters" ? /* @__PURE__ */ React13.createElement(MenuPanel, { name: "FilterMenu", loadingText: labels.loadingMenu, props: { view, index, field, types, labels, commit, close, onRemove: remove, locale, info, state, encoded } }) : /* @__PURE__ */ React13.createElement(MenuPanel, { name: "AxisMenu", loadingText: labels.loadingMenu, props: { view, zone, index, field, types, labels, commit, close, onRemove: remove, defaultsOf, rangeOf, locale, info, state, encoded } })
|
|
2804
|
+
), info && showInfo ? /* @__PURE__ */ React13.createElement(InfoButton, { info, name: fieldLabel4(sourceOf(view, field), labels.core), labels, className: "pk-chip-info" }) : null, /* @__PURE__ */ React13.createElement("button", { type: "button", className: "pk-chip-x", onClick: remove, "aria-label": fill(labels.removeField, { field: text }), title: fill(labels.removeField, { field: text }) }, /* @__PURE__ */ React13.createElement(Icon, { name: "x", size: 14 })));
|
|
2648
2805
|
}
|
|
2649
2806
|
function AddButton({ zone, labels, menu }) {
|
|
2650
2807
|
const name = fill(labels.addFieldTo, { zone: labels.zones[zone] });
|
|
2651
|
-
return /* @__PURE__ */
|
|
2808
|
+
return /* @__PURE__ */ React13.createElement(MenuButton, { label: name, name, title: name, icon: "plus", text: labels.addField, className: "pk-zone-add", role: "dialog", popoverClass: "pk-chip-menu", fill: true, testId: `add-field-${zone}` }, (close) => /* @__PURE__ */ React13.createElement(MenuPanel, { name: "AddMenu", loadingText: labels.loadingMenu, props: { ...menu, labels, zone, close } }));
|
|
2652
2809
|
}
|
|
2653
2810
|
function Zone({ zone, entries, labels, children, explain, add }) {
|
|
2654
2811
|
const count = entries.length;
|
|
@@ -2670,10 +2827,10 @@ function Zone({ zone, entries, labels, children, explain, add }) {
|
|
|
2670
2827
|
const t = setTimeout(() => setFlash(false), 600);
|
|
2671
2828
|
return () => clearTimeout(t);
|
|
2672
2829
|
}, [flash]);
|
|
2673
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ React13.createElement("section", { ref: setNodeRef, tabIndex: -1, className: `pk-zone pk-zone-${zone}${isOver ? " pk-over" : ""}${dragging ? " pk-dropping" : ""}${flash ? " pk-flash" : ""}`, "aria-label": labels.zones[zone], "data-zone": zone }, /* @__PURE__ */ React13.createElement("div", { className: "pk-zone-head" }, /* @__PURE__ */ React13.createElement("h3", { className: "pk-zone-title" }, /* @__PURE__ */ React13.createElement(Icon, { name: (
|
|
2674
2831
|
/** @type {any} */
|
|
2675
2832
|
ZONE_ICON[zone]
|
|
2676
|
-
), size: 14 }), labels.zones[zone]), explain ? /* @__PURE__ */
|
|
2833
|
+
), size: 14 }), labels.zones[zone]), explain ? /* @__PURE__ */ React13.createElement(InfoButton, { info: { description: labels.zoneInfo[zone] }, name: labels.zones[zone], labels, className: "pk-zone-info", testId: `zone-info-${zone}` }) : null, add ? /* @__PURE__ */ React13.createElement(AddButton, { zone, labels, menu: add }) : null), /* @__PURE__ */ React13.createElement(ChipList, { ids: entries.map((e) => e.id) }, /* @__PURE__ */ React13.createElement("ul", { className: "pk-chips" }, children, count === 0 ? /* @__PURE__ */ React13.createElement("li", { className: "pk-zone-hint" }, labels.zoneHints[zone]) : null)));
|
|
2677
2834
|
}
|
|
2678
2835
|
var SAY_AFTER = 100;
|
|
2679
2836
|
var SAY_FOR = 8e3;
|
|
@@ -2698,7 +2855,7 @@ function SectionHead({ entries, labels, id, open, onFold, onSwap, canSwap, butto
|
|
|
2698
2855
|
const own = useId4();
|
|
2699
2856
|
const parts = layoutSummary(entries, labels);
|
|
2700
2857
|
const text = parts.length ? parts.map((p) => `${p.title}: ${p.fields}`).join(" \xB7 ") : labels.layoutEmpty;
|
|
2701
|
-
return /* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "pk-section-row" }, /* @__PURE__ */ React13.createElement(
|
|
2702
2859
|
"button",
|
|
2703
2860
|
{
|
|
2704
2861
|
ref: buttonRef,
|
|
@@ -2712,18 +2869,18 @@ function SectionHead({ entries, labels, id, open, onFold, onSwap, canSwap, butto
|
|
|
2712
2869
|
onClick: onFold,
|
|
2713
2870
|
"data-testid": "layout-summary"
|
|
2714
2871
|
},
|
|
2715
|
-
/* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
), explain ? /* @__PURE__ */
|
|
2872
|
+
/* @__PURE__ */ React13.createElement(Icon, { name: "chevronRight", className: "pk-section-chevron" }),
|
|
2873
|
+
/* @__PURE__ */ React13.createElement("span", { id: `${own}-t`, className: "pk-section-heading" }, labels.zonesTitle)
|
|
2874
|
+
), explain ? /* @__PURE__ */ React13.createElement(InfoButton, { info: { description: labels.zonesHint }, name: labels.zonesTitle, labels, className: "pk-section-info", testId: "zones-info" }) : null, open ? /* @__PURE__ */ React13.createElement("span", { className: "pk-grow" }) : (
|
|
2718
2875
|
// the button's description and a larger target for the pointer; the keys use the button
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
), /* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ React13.createElement("span", { id: `${own}-s`, className: "pk-section-sub", onClick: onFold, "data-testid": "zones-sub" }, parts.length ? parts.map((p, i) => /* @__PURE__ */ React13.createElement(React13.Fragment, { key: p.zone }, i ? " \xB7 " : null, /* @__PURE__ */ React13.createElement("span", { className: "pk-zones-summary-zone" }, p.title, ":"), " ", p.fields)) : labels.layoutEmpty)
|
|
2877
|
+
), /* @__PURE__ */ React13.createElement("button", { type: "button", className: "pk-btn pk-small-btn pk-swap", onClick: onSwap, disabled: !canSwap, "data-testid": "swap", title: labels.swap }, /* @__PURE__ */ React13.createElement(Icon, { name: "swap", size: 14 }), /* @__PURE__ */ React13.createElement("span", { className: "pk-btn-text" }, labels.swap)));
|
|
2721
2878
|
}
|
|
2722
2879
|
function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap, id, folded, onFold, defaultsOf, infoOf, titleOf, explain = false, showInfo = true, adding }) {
|
|
2723
2880
|
const entries = useMemo7(() => zoneEntries(view, types, labels), [view, types, labels]);
|
|
2724
2881
|
const dragging = Boolean(useActiveDrag());
|
|
2725
|
-
const focusInside =
|
|
2726
|
-
const summary =
|
|
2882
|
+
const focusInside = useRef12(false);
|
|
2883
|
+
const summary = useRef12(
|
|
2727
2884
|
/** @type {HTMLButtonElement | null} */
|
|
2728
2885
|
null
|
|
2729
2886
|
);
|
|
@@ -2737,11 +2894,11 @@ function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap,
|
|
|
2737
2894
|
return map;
|
|
2738
2895
|
}, [entries, view, encoded, locale, labels]);
|
|
2739
2896
|
const rangeOf = useCallback9((field) => numberRange(encoded, field), [encoded]);
|
|
2740
|
-
const root =
|
|
2897
|
+
const root = useRef12(
|
|
2741
2898
|
/** @type {HTMLDivElement | null} */
|
|
2742
2899
|
null
|
|
2743
2900
|
);
|
|
2744
|
-
const focusAfter =
|
|
2901
|
+
const focusAfter = useRef12(
|
|
2745
2902
|
/** @type {{ zone: string, index: number } | null} */
|
|
2746
2903
|
null
|
|
2747
2904
|
);
|
|
@@ -2763,12 +2920,12 @@ function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap,
|
|
|
2763
2920
|
);
|
|
2764
2921
|
target?.focus({ preventScroll: true });
|
|
2765
2922
|
});
|
|
2766
|
-
const added =
|
|
2923
|
+
const added = useRef12(
|
|
2767
2924
|
/** @type {{ zone: string, from: string | null, ids: Set<string> } | null} */
|
|
2768
2925
|
null
|
|
2769
2926
|
);
|
|
2770
2927
|
const [said, setSaid] = useState11("");
|
|
2771
|
-
const sayTimers =
|
|
2928
|
+
const sayTimers = useRef12(
|
|
2772
2929
|
/** @type {ReturnType<typeof setTimeout>[]} */
|
|
2773
2930
|
[]
|
|
2774
2931
|
);
|
|
@@ -2813,7 +2970,7 @@ function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap,
|
|
|
2813
2970
|
}
|
|
2814
2971
|
}, [folded]);
|
|
2815
2972
|
const open = !folded || dragging;
|
|
2816
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "pk-zone-section", "data-pk-open": open ? "" : void 0, "data-testid": "zone-section" }, /* @__PURE__ */ React13.createElement(SectionHead, { entries, labels, id, open, onFold, onSwap, canSwap: view.rows.length + view.cols.length > 0, buttonRef: summary, explain }), /* @__PURE__ */ React13.createElement("span", { className: "pk-sr", role: "status", "data-testid": "zones-status" }, said), open ? /* @__PURE__ */ React13.createElement(
|
|
2817
2974
|
"div",
|
|
2818
2975
|
{
|
|
2819
2976
|
className: "pk-zones",
|
|
@@ -2831,7 +2988,7 @@ function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap,
|
|
|
2831
2988
|
}
|
|
2832
2989
|
}
|
|
2833
2990
|
},
|
|
2834
|
-
ZONES.map((zone) => /* @__PURE__ */
|
|
2991
|
+
ZONES.map((zone) => /* @__PURE__ */ React13.createElement(
|
|
2835
2992
|
Zone,
|
|
2836
2993
|
{
|
|
2837
2994
|
key: zone,
|
|
@@ -2841,7 +2998,7 @@ function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap,
|
|
|
2841
2998
|
explain,
|
|
2842
2999
|
add: addMenu ? { ...addMenu, onAdded: addMenu.onAdded(zone) } : null
|
|
2843
3000
|
},
|
|
2844
|
-
entries[zone].map((e) => /* @__PURE__ */
|
|
3001
|
+
entries[zone].map((e) => /* @__PURE__ */ React13.createElement(
|
|
2845
3002
|
Chip,
|
|
2846
3003
|
{
|
|
2847
3004
|
key: e.id,
|
|
@@ -2953,24 +3110,64 @@ function PivotReport(props) {
|
|
|
2953
3110
|
clearTimeout(timer);
|
|
2954
3111
|
};
|
|
2955
3112
|
}, [deferred]);
|
|
2956
|
-
const
|
|
3113
|
+
const texts = useLabelsOf(props.locale);
|
|
3114
|
+
const waiting = Boolean(loading2) || deferred || !texts.shown;
|
|
2957
3115
|
if (!waiting && !started) {
|
|
2958
3116
|
setStarted(true);
|
|
2959
3117
|
}
|
|
2960
3118
|
if (waiting && !started) {
|
|
2961
|
-
return /* @__PURE__ */
|
|
3119
|
+
return /* @__PURE__ */ React14.createElement(WaitingReport, { ...props, locale: texts.locale, silent: !texts.shown });
|
|
2962
3120
|
}
|
|
2963
|
-
return /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ React14.createElement(Report, { ...props, locale: texts.locale });
|
|
2964
3122
|
}
|
|
2965
|
-
function
|
|
2966
|
-
const
|
|
3123
|
+
function useLabelsOf(locale) {
|
|
3124
|
+
const here2 = useSyncExternalStore3(onLabels, () => labelsHere(locale, DEFERRED.loadLabels), () => labelsHere(locale, DEFERRED.loadLabels));
|
|
3125
|
+
if (!here2) {
|
|
3126
|
+
requestLabels(locale, DEFERRED.loadLabels);
|
|
3127
|
+
}
|
|
3128
|
+
const lang = langOf(locale);
|
|
3129
|
+
useEffect11(() => requestLabels(lang, DEFERRED.loadLabels, { again: true }), [lang]);
|
|
3130
|
+
const [last, setLast] = useState12(() => here2 ? { locale } : null);
|
|
3131
|
+
if (here2 && (!last || last.locale !== locale)) {
|
|
3132
|
+
setLast({ locale });
|
|
3133
|
+
}
|
|
3134
|
+
return here2 ? { shown: true, locale } : { shown: last !== null, locale: last?.locale };
|
|
3135
|
+
}
|
|
3136
|
+
var tipsLoaded = DEFERRED.tips;
|
|
3137
|
+
var tipsPending = null;
|
|
3138
|
+
function useTipsTable() {
|
|
3139
|
+
const [mod, setMod] = useState12(() => tipsLoaded);
|
|
3140
|
+
useEffect11(() => {
|
|
3141
|
+
const load = DEFERRED.loadTips;
|
|
3142
|
+
if (mod || !load) {
|
|
3143
|
+
return void 0;
|
|
3144
|
+
}
|
|
3145
|
+
let live = true;
|
|
3146
|
+
tipsPending ??= load().then((m) => tipsLoaded = m, (error) => {
|
|
3147
|
+
tipsPending = null;
|
|
3148
|
+
warnOnce(`pivotkit: the tips did not load, the report shows none: ${error instanceof Error ? error.message : String(error)}`);
|
|
3149
|
+
throw error;
|
|
3150
|
+
});
|
|
3151
|
+
tipsPending.then(
|
|
3152
|
+
(m) => live && setMod(m),
|
|
3153
|
+
() => {
|
|
3154
|
+
}
|
|
3155
|
+
);
|
|
3156
|
+
return () => {
|
|
3157
|
+
live = false;
|
|
3158
|
+
};
|
|
3159
|
+
}, [mod]);
|
|
3160
|
+
return mod;
|
|
3161
|
+
}
|
|
3162
|
+
function WaitingReport({ locale = "en-US", labels: customLabels, theme = "auto", height = 640, className, label, silent = false }) {
|
|
3163
|
+
const root = useRef13(
|
|
2967
3164
|
/** @type {HTMLDivElement | null} */
|
|
2968
3165
|
null
|
|
2969
3166
|
);
|
|
2970
3167
|
const labelsKey = JSON.stringify(customLabels ?? null);
|
|
2971
3168
|
const labels = useMemo8(() => resolveLabels(locale, JSON.parse(labelsKey)), [locale, labelsKey]);
|
|
2972
3169
|
const themeName = useResolvedTheme(theme, root);
|
|
2973
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ React14.createElement("div", { ref: root, className: `pk-root${className ? ` ${className}` : ""}`, "data-pk-theme": themeName, lang: silent ? void 0 : labels.lang, role: "region", "aria-label": label || (silent ? void 0 : labels.report), style: { height } }, /* @__PURE__ */ React14.createElement(Skeleton, { full: true, text: silent ? "" : labels.loadingReport }));
|
|
2974
3171
|
}
|
|
2975
3172
|
function keyOfHostView(view) {
|
|
2976
3173
|
try {
|
|
@@ -2981,7 +3178,7 @@ function keyOfHostView(view) {
|
|
|
2981
3178
|
}
|
|
2982
3179
|
var staysTheSame = () => () => void 0;
|
|
2983
3180
|
function EmptyState({ labels, templates, onTemplate, onLoad, noData }) {
|
|
2984
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "pk-empty", "data-testid": "empty-state" }, /* @__PURE__ */ React14.createElement("div", { className: "pk-empty-art", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("span", { className: "pk-empty-chip pk-c1" }), /* @__PURE__ */ React14.createElement("span", { className: "pk-empty-chip pk-c2" }), /* @__PURE__ */ React14.createElement("span", { className: "pk-empty-chip pk-c3" })), /* @__PURE__ */ React14.createElement("h2", null, noData ? labels.emptyNoData : labels.emptyTitle), noData ? null : /* @__PURE__ */ React14.createElement("ol", { className: "pk-steps" }, labels.emptySteps.map((s, i) => /* @__PURE__ */ React14.createElement("li", { key: i }, /* @__PURE__ */ React14.createElement("span", { className: "pk-step-n", "aria-hidden": "true" }, i + 1), /* @__PURE__ */ React14.createElement("span", null, s)))), onLoad ? /* @__PURE__ */ React14.createElement("div", { className: "pk-drop-zone", "data-testid": "empty-drop" }, /* @__PURE__ */ React14.createElement("p", null, noData ? labels.emptyDrop : labels.emptyLoad), /* @__PURE__ */ React14.createElement("button", { type: "button", className: "pk-btn", onClick: onLoad, "data-testid": "empty-load" }, /* @__PURE__ */ React14.createElement(Icon, { name: "upload" }), /* @__PURE__ */ React14.createElement("span", { className: "pk-btn-text" }, labels.loadData))) : null, templates.length ? /* @__PURE__ */ React14.createElement("div", { className: "pk-empty-actions" }, templates.slice(0, 3).map((t, i) => /* @__PURE__ */ React14.createElement("button", { key: `${i}:${t.name}`, type: "button", className: "pk-btn", onClick: () => onTemplate(t) }, /* @__PURE__ */ React14.createElement(Icon, { name: "sparkle" }), /* @__PURE__ */ React14.createElement("span", { className: "pk-btn-text" }, fill(labels.tryView, { name: t.name }))))) : null);
|
|
2985
3182
|
}
|
|
2986
3183
|
function Report(props) {
|
|
2987
3184
|
const {
|
|
@@ -3045,14 +3242,14 @@ function Report(props) {
|
|
|
3045
3242
|
/** @type {import("./import-host.jsx").ImportJob | null} */
|
|
3046
3243
|
null
|
|
3047
3244
|
);
|
|
3048
|
-
const afterSheet =
|
|
3245
|
+
const afterSheet = useRef13(
|
|
3049
3246
|
/** @type {(() => void) | null} */
|
|
3050
3247
|
null
|
|
3051
3248
|
);
|
|
3052
3249
|
const [dragging, setDragging] = useState12(false);
|
|
3053
|
-
const dragDepth =
|
|
3250
|
+
const dragDepth = useRef13(0);
|
|
3054
3251
|
const [importMod, setImportMod] = useState12(importNow);
|
|
3055
|
-
const fileInput =
|
|
3252
|
+
const fileInput = useRef13(
|
|
3056
3253
|
/** @type {HTMLInputElement | null} */
|
|
3057
3254
|
null
|
|
3058
3255
|
);
|
|
@@ -3060,13 +3257,14 @@ function Report(props) {
|
|
|
3060
3257
|
const labelsKey = JSON.stringify(customLabels ?? null);
|
|
3061
3258
|
const defaultsKey = JSON.stringify(fieldDefaults ?? null);
|
|
3062
3259
|
const info = useMemo8(() => fieldInfoOf(JSON.parse(defaultsKey)), [defaultsKey]);
|
|
3063
|
-
const
|
|
3260
|
+
const textsHere = useSyncExternalStore3(onLabels, () => hasLabels(locale), () => hasLabels(locale));
|
|
3261
|
+
const baseLabels = useMemo8(() => resolveLabels(textsHere ? locale : "en", JSON.parse(labelsKey)), [textsHere, locale, labelsKey]);
|
|
3064
3262
|
const typesKey = JSON.stringify(typesOf(fieldDefaults));
|
|
3065
3263
|
const limitsKey = JSON.stringify(limitsProp ?? null);
|
|
3066
3264
|
const hostLimits = useMemo8(() => JSON.parse(limitsKey) ?? void 0, [limitsKey]);
|
|
3067
3265
|
const importLimitsKey = JSON.stringify(importLimitsProp ?? null);
|
|
3068
3266
|
const fileLimits = useMemo8(() => importLimitsOf(hostLimits, JSON.parse(importLimitsKey)), [hostLimits, importLimitsKey]);
|
|
3069
|
-
const root =
|
|
3267
|
+
const root = useRef13(
|
|
3070
3268
|
/** @type {HTMLDivElement | null} */
|
|
3071
3269
|
null
|
|
3072
3270
|
);
|
|
@@ -3082,7 +3280,7 @@ function Report(props) {
|
|
|
3082
3280
|
/** @type {boolean | null} */
|
|
3083
3281
|
zonesStart(zonesProp)
|
|
3084
3282
|
);
|
|
3085
|
-
const foldOpenWhileEmpty =
|
|
3283
|
+
const foldOpenWhileEmpty = useRef13(false);
|
|
3086
3284
|
const [zonesSeen, setZonesSeen] = useState12(zonesProp);
|
|
3087
3285
|
if (zonesProp !== zonesSeen) {
|
|
3088
3286
|
setZonesSeen(zonesProp);
|
|
@@ -3090,7 +3288,7 @@ function Report(props) {
|
|
|
3090
3288
|
}
|
|
3091
3289
|
const zonesId = useId5();
|
|
3092
3290
|
const resultId = useId5();
|
|
3093
|
-
const ownPrefix =
|
|
3291
|
+
const ownPrefix = useRef13(
|
|
3094
3292
|
/** @type {string | null} */
|
|
3095
3293
|
null
|
|
3096
3294
|
);
|
|
@@ -3105,7 +3303,7 @@ function Report(props) {
|
|
|
3105
3303
|
null
|
|
3106
3304
|
);
|
|
3107
3305
|
const [hinted, setHinted] = useState12(false);
|
|
3108
|
-
const changesRef =
|
|
3306
|
+
const changesRef = useRef13(0);
|
|
3109
3307
|
const [changes, setChanges] = useState12(0);
|
|
3110
3308
|
const [dragAt, setDragAt] = useState12(
|
|
3111
3309
|
/** @type {number | null} */
|
|
@@ -3133,7 +3331,7 @@ function Report(props) {
|
|
|
3133
3331
|
/** @type {string | null} */
|
|
3134
3332
|
null
|
|
3135
3333
|
);
|
|
3136
|
-
const chartRef =
|
|
3334
|
+
const chartRef = useRef13(null);
|
|
3137
3335
|
const [chartReady, setChartReady] = useState12(false);
|
|
3138
3336
|
const [lineChecks, setLineChecks] = useState12(
|
|
3139
3337
|
/** @type {any} */
|
|
@@ -3180,7 +3378,7 @@ function Report(props) {
|
|
|
3180
3378
|
const encoded = imported ? imported.encoded : source.encoded;
|
|
3181
3379
|
const limits = imported ? fileLimits : hostLimits;
|
|
3182
3380
|
const fieldNamesKey = encoded.schema.fields.map((f) => f.name).join("\0");
|
|
3183
|
-
const
|
|
3381
|
+
const hostLabels = useMemo8(() => {
|
|
3184
3382
|
const fields2 = displayNames(info, fieldNamesKey ? fieldNamesKey.split("\0") : []);
|
|
3185
3383
|
return fields2 ? { ...baseLabels, core: { ...baseLabels.core, fields: fields2 } } : baseLabels;
|
|
3186
3384
|
}, [baseLabels, info, fieldNamesKey]);
|
|
@@ -3197,8 +3395,22 @@ function Report(props) {
|
|
|
3197
3395
|
}
|
|
3198
3396
|
return (field) => orders.find(([name]) => name.toLowerCase() === field.toLowerCase())?.[1];
|
|
3199
3397
|
}, [ordersKey]);
|
|
3200
|
-
const history = useViewHistory({ encoded, view: viewProp, defaultView, onViewChange, limits, outsideNote:
|
|
3398
|
+
const history = useViewHistory({ encoded, view: viewProp, defaultView, onViewChange, limits, outsideNote: hostLabels.steps.outside, orderOf, dataKey: imported ? imported.key : 0, initial: kept2?.history });
|
|
3201
3399
|
const view = history.view;
|
|
3400
|
+
const fieldLabelsKey = view.fieldLabels ? JSON.stringify(view.fieldLabels) : "";
|
|
3401
|
+
const labels = useMemo8(() => {
|
|
3402
|
+
if (!fieldLabelsKey) {
|
|
3403
|
+
return hostLabels;
|
|
3404
|
+
}
|
|
3405
|
+
return { ...hostLabels, hostNames: hostLabels.core.fields ?? null, core: withFieldLabels(hostLabels.core, JSON.parse(fieldLabelsKey)) };
|
|
3406
|
+
}, [hostLabels, fieldLabelsKey]);
|
|
3407
|
+
const shown = view.display === "both" && size !== "wide" ? "table" : view.display;
|
|
3408
|
+
const tableShown = shown !== "chart";
|
|
3409
|
+
const [split2, setSplit] = useState12(
|
|
3410
|
+
/** @type {number} */
|
|
3411
|
+
SPLIT.start
|
|
3412
|
+
);
|
|
3413
|
+
const chartShown = shown !== "table";
|
|
3202
3414
|
const [startView] = useState12(() => defaultView);
|
|
3203
3415
|
const hostKey = keyOfHostView(viewProp !== void 0 ? viewProp : startView);
|
|
3204
3416
|
const keyOf = history.keyOf;
|
|
@@ -3226,13 +3438,13 @@ function Report(props) {
|
|
|
3226
3438
|
field: note.field ?? "",
|
|
3227
3439
|
name: note.name ?? "",
|
|
3228
3440
|
zone: labels.zones[note.zone] ?? note.zone ?? "",
|
|
3229
|
-
display: note.display ? labels[note.display] : "",
|
|
3441
|
+
display: note.display === "both" ? labels.bothShown : note.display ? labels[note.display] : "",
|
|
3230
3442
|
type: note.type ? labels.chartTypes[note.type] : ""
|
|
3231
3443
|
});
|
|
3232
3444
|
},
|
|
3233
3445
|
[labels]
|
|
3234
3446
|
);
|
|
3235
|
-
const apiNow =
|
|
3447
|
+
const apiNow = useRef13(
|
|
3236
3448
|
/** @type {any} */
|
|
3237
3449
|
null
|
|
3238
3450
|
);
|
|
@@ -3249,7 +3461,7 @@ function Report(props) {
|
|
|
3249
3461
|
}
|
|
3250
3462
|
};
|
|
3251
3463
|
const newStep = useCallback10(() => setDataSteps((s) => s.future.length ? { past: s.past, future: [] } : s), []);
|
|
3252
|
-
const undoLater =
|
|
3464
|
+
const undoLater = useRef13(undo2);
|
|
3253
3465
|
useEffect11(() => {
|
|
3254
3466
|
undoLater.current = undo2;
|
|
3255
3467
|
});
|
|
@@ -3259,11 +3471,11 @@ function Report(props) {
|
|
|
3259
3471
|
announce(labels.toastReset, { action: { label: labels.undo, run: () => undoLater.current() } });
|
|
3260
3472
|
}, [history, labels, announce, newStep]);
|
|
3261
3473
|
const [opening, setOpening] = useState12(false);
|
|
3262
|
-
const appliedLink =
|
|
3474
|
+
const appliedLink = useRef13(
|
|
3263
3475
|
/** @type {string | null} */
|
|
3264
3476
|
null
|
|
3265
3477
|
);
|
|
3266
|
-
const latest =
|
|
3478
|
+
const latest = useRef13({ history, encoded, limits, labels, announce, commit: (
|
|
3267
3479
|
/** @type {any} */
|
|
3268
3480
|
null
|
|
3269
3481
|
), sourceId, loaded: (
|
|
@@ -3440,7 +3652,7 @@ function Report(props) {
|
|
|
3440
3652
|
}, [view.formatting?.locale, locale]);
|
|
3441
3653
|
const plan = useMemo8(() => chartPlan(view, encoded), [view, encoded]);
|
|
3442
3654
|
const chartComputed = useMemo8(() => {
|
|
3443
|
-
if (!plan.swap ||
|
|
3655
|
+
if (!plan.swap || !chartShown || !result) {
|
|
3444
3656
|
return computed;
|
|
3445
3657
|
}
|
|
3446
3658
|
try {
|
|
@@ -3448,7 +3660,7 @@ function Report(props) {
|
|
|
3448
3660
|
} catch (error2) {
|
|
3449
3661
|
return { result: null, error: error2 };
|
|
3450
3662
|
}
|
|
3451
|
-
}, [plan.swap, view, encoded, locale, limits, computed, result]);
|
|
3663
|
+
}, [plan.swap, chartShown, view, encoded, locale, limits, computed, result]);
|
|
3452
3664
|
const titleOf = useCallback10((field) => context.titles.get(field), [context]);
|
|
3453
3665
|
const chartContext = useMemo8(() => chartComputed.result === computed.result ? context : dateContext(chartComputed.result, labels), [chartComputed.result, computed.result, context, labels]);
|
|
3454
3666
|
const chartResult = chartContext.result;
|
|
@@ -3458,7 +3670,7 @@ function Report(props) {
|
|
|
3458
3670
|
foldOpenWhileEmpty.current = empty && short && folded === null;
|
|
3459
3671
|
});
|
|
3460
3672
|
const gridState = useMemo8(() => {
|
|
3461
|
-
if (!result ||
|
|
3673
|
+
if (!result || !tableShown || empty) {
|
|
3462
3674
|
return { grid: null, error: null };
|
|
3463
3675
|
}
|
|
3464
3676
|
try {
|
|
@@ -3466,13 +3678,14 @@ function Report(props) {
|
|
|
3466
3678
|
} catch (error2) {
|
|
3467
3679
|
return { grid: null, error: error2 };
|
|
3468
3680
|
}
|
|
3469
|
-
}, [result,
|
|
3470
|
-
const error = source.error ?? computed.error ?? gridState.error ?? (
|
|
3681
|
+
}, [result, tableShown, empty, locale, context.labels, limits]);
|
|
3682
|
+
const error = source.error ?? computed.error ?? gridState.error ?? (chartShown ? chartComputed.error : null);
|
|
3471
3683
|
const dateLocale = useMemo8(() => dateDisplayLocale(view.formatting?.locale || locale), [view.formatting?.locale, locale]);
|
|
3472
3684
|
const fields = encoded.schema.fields;
|
|
3473
3685
|
const types = useMemo8(() => new Map(viewFields(view, encoded).map((f) => [f.name.toLowerCase(), f.type])), [view, encoded]);
|
|
3474
3686
|
const typeOf = useCallback10((field) => types.get(sourceOf(view, field ?? "").toLowerCase()) ?? "string", [types, view]);
|
|
3475
3687
|
const nameOf = useCallback10((field) => fieldLabel5(field, labels.core), [labels]);
|
|
3688
|
+
const sourceNameOf = useCallback10((field) => sourceFieldName(field, labels), [labels]);
|
|
3476
3689
|
const hostOrdered = useCallback10((field) => sourceOf(view, field) === field && (orderOf?.(field)?.length ?? 0) > 0, [view, orderOf]);
|
|
3477
3690
|
const sortFromHeader = useCallback10((field, sort) => commit(setSort(view, field, sort), { step: "sort", field: nameOf(field) }), [view, commit, nameOf]);
|
|
3478
3691
|
const infoOf = useCallback10(
|
|
@@ -3526,11 +3739,11 @@ function Report(props) {
|
|
|
3526
3739
|
live = false;
|
|
3527
3740
|
};
|
|
3528
3741
|
}, [lang]);
|
|
3529
|
-
const mainRef =
|
|
3742
|
+
const mainRef = useRef13(
|
|
3530
3743
|
/** @type {HTMLDivElement | null} */
|
|
3531
3744
|
null
|
|
3532
3745
|
);
|
|
3533
|
-
const checkLow =
|
|
3746
|
+
const checkLow = useRef13(() => {
|
|
3534
3747
|
});
|
|
3535
3748
|
const fit = useFitHeight(root, mainRef, grow, () => checkLow.current());
|
|
3536
3749
|
const big = useBigResult(root);
|
|
@@ -3635,7 +3848,7 @@ function Report(props) {
|
|
|
3635
3848
|
return () => mo.disconnect();
|
|
3636
3849
|
}, [measuredShort, short, layer]);
|
|
3637
3850
|
const drawerOpen = drawer && size === "narrow";
|
|
3638
|
-
const panelRef =
|
|
3851
|
+
const panelRef = useRef13(
|
|
3639
3852
|
/** @type {HTMLDivElement | null} */
|
|
3640
3853
|
null
|
|
3641
3854
|
);
|
|
@@ -3716,6 +3929,10 @@ function Report(props) {
|
|
|
3716
3929
|
},
|
|
3717
3930
|
[view, typeOf, commit, addTo, defaultsOf]
|
|
3718
3931
|
);
|
|
3932
|
+
const [pointTarget, setPointTarget] = useState12(
|
|
3933
|
+
/** @type {{ anchor: HTMLElement, home?: HTMLElement | null, point: any } | null} */
|
|
3934
|
+
null
|
|
3935
|
+
);
|
|
3719
3936
|
const openCell = useCallback10(
|
|
3720
3937
|
/** @param {any} cell */
|
|
3721
3938
|
({ rowPath = [], colPath = [], value, valueIndex, text }) => {
|
|
@@ -3735,6 +3952,7 @@ function Report(props) {
|
|
|
3735
3952
|
},
|
|
3736
3953
|
[result, encodedProp, imported, data, drillDownLimit, onCellClick, drillDown, defaultsOf, nameOf, infoOf]
|
|
3737
3954
|
);
|
|
3955
|
+
const openPoint = (p) => openCell({ rowPath: p.rowPath, colPath: p.colPath, value: p.value, valueIndex: p.valueIndex, text: String(p.value ?? "") });
|
|
3738
3956
|
const { run: doExport, prepare: prepareExport } = useExport({ fileName, result: computed.result, encoded, exportData, locale, labels, limits, root, chartRef, announce, onExport, title: viewName, source: sourceName, loadECharts, colorMap: stableColorMap });
|
|
3739
3957
|
const requestImport = () => loadImport().then((m) => (flushSync(() => setImportMod(() => m)), m));
|
|
3740
3958
|
const api = {
|
|
@@ -3769,7 +3987,7 @@ function Report(props) {
|
|
|
3769
3987
|
useEffect11(() => {
|
|
3770
3988
|
apiNow.current = api;
|
|
3771
3989
|
});
|
|
3772
|
-
const restored =
|
|
3990
|
+
const restored = useRef13(false);
|
|
3773
3991
|
useIsoLayoutEffect(() => {
|
|
3774
3992
|
if (kept2 && !restored.current) {
|
|
3775
3993
|
restored.current = true;
|
|
@@ -3778,8 +3996,8 @@ function Report(props) {
|
|
|
3778
3996
|
}
|
|
3779
3997
|
}, []);
|
|
3780
3998
|
const snapshot = history.snapshot;
|
|
3781
|
-
const keptKey =
|
|
3782
|
-
const fileShown =
|
|
3999
|
+
const keptKey = useRef13(keepKey);
|
|
4000
|
+
const fileShown = useRef13(false);
|
|
3783
4001
|
const hostHasColumns = source.encoded.schema.fields.length > 0;
|
|
3784
4002
|
useIsoLayoutEffect(() => {
|
|
3785
4003
|
if (keepKey !== null && !kept2 && hostHasColumns) {
|
|
@@ -3860,7 +4078,7 @@ function Report(props) {
|
|
|
3860
4078
|
loadTemplate(how === "missing" ? { ...t, sheet: SHEET_GONE } : t);
|
|
3861
4079
|
}
|
|
3862
4080
|
};
|
|
3863
|
-
const loadLater =
|
|
4081
|
+
const loadLater = useRef13(
|
|
3864
4082
|
/** @type {((what: { template?: any, file?: object }) => void) | null} */
|
|
3865
4083
|
null
|
|
3866
4084
|
);
|
|
@@ -3962,11 +4180,11 @@ function Report(props) {
|
|
|
3962
4180
|
}
|
|
3963
4181
|
};
|
|
3964
4182
|
const layerValue = useMemo8(() => ({ layer, size }), [layer, size]);
|
|
3965
|
-
const renderOverlay = (src) => /* @__PURE__ */
|
|
4183
|
+
const renderOverlay = (src) => /* @__PURE__ */ React14.createElement("div", { className: "pk-chip pk-overlay" }, /* @__PURE__ */ React14.createElement(Icon, { name: "grip", size: 14 }), /* @__PURE__ */ React14.createElement("span", { className: `pk-type pk-type-${src.type ?? typeOf(src.field)}` }, /* @__PURE__ */ React14.createElement(Icon, { name: (
|
|
3966
4184
|
/** @type {any} */
|
|
3967
4185
|
TYPE_ICON[src.type ?? typeOf(src.field)] ?? "text"
|
|
3968
|
-
), size: 13 })), /* @__PURE__ */
|
|
3969
|
-
const showTable = !error && !(empty &&
|
|
4186
|
+
), size: 13 })), /* @__PURE__ */ React14.createElement("span", { className: "pk-chip-text" }, src.label ?? src.field));
|
|
4187
|
+
const showTable = !error && !(empty && tableShown) && tableShown && gridState.grid;
|
|
3970
4188
|
const outer = useMemo8(() => result ? outerPaths(result) : [], [result]);
|
|
3971
4189
|
const folding = rowFolding(view, outer);
|
|
3972
4190
|
const expandAll = (texts) => {
|
|
@@ -3982,7 +4200,7 @@ function Report(props) {
|
|
|
3982
4200
|
announce(plural(texts.groupsCollapsed, folding.open, { lang: labels.lang, locale }));
|
|
3983
4201
|
};
|
|
3984
4202
|
const series = useMemo8(() => {
|
|
3985
|
-
if (!chartResult ||
|
|
4203
|
+
if (!chartResult || !chartShown || view.values.length === 0) {
|
|
3986
4204
|
return null;
|
|
3987
4205
|
}
|
|
3988
4206
|
try {
|
|
@@ -3990,7 +4208,7 @@ function Report(props) {
|
|
|
3990
4208
|
} catch {
|
|
3991
4209
|
return null;
|
|
3992
4210
|
}
|
|
3993
|
-
}, [chartResult,
|
|
4211
|
+
}, [chartResult, chartShown, view.values.length, chartContext.labels]);
|
|
3994
4212
|
const allowedKey = JSON.stringify(allowedTips(tipsProp));
|
|
3995
4213
|
const allowed = useMemo8(() => JSON.parse(allowedKey), [allowedKey]);
|
|
3996
4214
|
const dismissedKey = JSON.stringify(cleanDismissed(dismissedTips));
|
|
@@ -4062,8 +4280,9 @@ function Report(props) {
|
|
|
4062
4280
|
}
|
|
4063
4281
|
};
|
|
4064
4282
|
const toggle = (id, on) => changeDismissed(on ? dismissed.filter((d) => d !== id) : [...dismissed, id], on ? null : id);
|
|
4065
|
-
const
|
|
4066
|
-
const
|
|
4283
|
+
const tipsMod = useTipsTable();
|
|
4284
|
+
const ctx = tipContext({ view, display: shown, result, encoded, failed: Boolean(error), empty, typeOf, fields: labels.core.fields, series, tableShown: Boolean(showTable), drilled: hinted, changes, dragAt, canSave: Boolean(onSaveTemplate) || viewStore, savedAt, chartPlan: plan });
|
|
4285
|
+
const shownTips = activeEntries(tipsMod?.TIPS ?? NOTICES, ctx, { allowed, dismissed }).map((t) => ({
|
|
4067
4286
|
id: t.id,
|
|
4068
4287
|
params: t.params,
|
|
4069
4288
|
icon: t.entry.icon ?? "info",
|
|
@@ -4106,7 +4325,41 @@ function Report(props) {
|
|
|
4106
4325
|
);
|
|
4107
4326
|
const summaryParts = big.enlarged ? layoutSummary(zoneEntries(view, types, context.labels), context.labels) : [];
|
|
4108
4327
|
const summaryText = summaryParts.length ? summaryParts.map((p) => `${p.title}: ${p.fields}`).join(" \xB7 ") : labels.layoutEmpty;
|
|
4109
|
-
|
|
4328
|
+
const chartEl = chartResult ? /* @__PURE__ */ React14.createElement(
|
|
4329
|
+
PivotChart,
|
|
4330
|
+
{
|
|
4331
|
+
result: chartResult,
|
|
4332
|
+
plan,
|
|
4333
|
+
series,
|
|
4334
|
+
labels: context.labels,
|
|
4335
|
+
locale,
|
|
4336
|
+
themeName,
|
|
4337
|
+
root,
|
|
4338
|
+
valueNames: valueLabels(view.values, labels),
|
|
4339
|
+
chartOptions: stableChartOptions,
|
|
4340
|
+
colorMap: stableColorMap,
|
|
4341
|
+
onLegend: ({ name, shown: shown2 }) => {
|
|
4342
|
+
commit(setChartDisplay(view, { hidden: hiddenAfter(view.chart.hidden, name, shown2) }), { step: "chartDisplay" });
|
|
4343
|
+
announce(fill(shown2 ? labels.chartShown : labels.chartHidden, { name }));
|
|
4344
|
+
},
|
|
4345
|
+
onInstance: (c) => {
|
|
4346
|
+
chartRef.current = c;
|
|
4347
|
+
setChartReady(Boolean(c));
|
|
4348
|
+
},
|
|
4349
|
+
onLines: (checks) => setLineChecks(checks && { checks, view }),
|
|
4350
|
+
onPoint: (p) => {
|
|
4351
|
+
const point = { ...p, rowPath: plan.swap ? p.colPath : p.rowPath, colPath: plan.swap ? p.rowPath : p.colPath, anchor: void 0, home: void 0 };
|
|
4352
|
+
if (p.direct) {
|
|
4353
|
+
setPointTarget(null);
|
|
4354
|
+
openPoint(point);
|
|
4355
|
+
} else if (p.anchor) {
|
|
4356
|
+
setPointTarget({ anchor: p.anchor, home: p.home, point });
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
}
|
|
4360
|
+
) : null;
|
|
4361
|
+
const tableEl = gridState.grid ? /* @__PURE__ */ React14.createElement(PivotTable, { grid: gridState.grid, view, labels: context.labels, version: history.viewKey, hintId: view.values.length ? hintId : void 0, onRowLabel: setRowLabel, infoOf, showInfo: fieldSwitch.on, typeOf, hostOrdered, onSort: sortFromHeader, onToggle: (axis, path) => commit(toggleCollapsed(view, axis, path), { step: "collapse" }), onCell: (cell) => openCell(cell) }) : null;
|
|
4362
|
+
return /* @__PURE__ */ React14.createElement(
|
|
4110
4363
|
"div",
|
|
4111
4364
|
{
|
|
4112
4365
|
ref: root,
|
|
@@ -4128,7 +4381,7 @@ function Report(props) {
|
|
|
4128
4381
|
onDragLeave: allowImport ? fileDrag : void 0,
|
|
4129
4382
|
onDrop: allowImport ? fileDrag : void 0
|
|
4130
4383
|
},
|
|
4131
|
-
/* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ React14.createElement(LayerContext.Provider, { value: layerValue }, /* @__PURE__ */ React14.createElement(FormNameContext.Provider, { value: formPrefix }, /* @__PURE__ */ React14.createElement(HelpContext.Provider, { value: help }, /* @__PURE__ */ React14.createElement(
|
|
4132
4385
|
PivotDnd,
|
|
4133
4386
|
{
|
|
4134
4387
|
labels,
|
|
@@ -4140,7 +4393,7 @@ function Report(props) {
|
|
|
4140
4393
|
}
|
|
4141
4394
|
}
|
|
4142
4395
|
},
|
|
4143
|
-
/* @__PURE__ */
|
|
4396
|
+
/* @__PURE__ */ React14.createElement("div", { className: `pk-layout${drawerOpen ? " pk-drawer-open" : ""}` }, /* @__PURE__ */ React14.createElement("div", { className: "pk-panel-slot", ref: panelRef }, /* @__PURE__ */ React14.createElement(
|
|
4144
4397
|
FieldPanel,
|
|
4145
4398
|
{
|
|
4146
4399
|
fields,
|
|
@@ -4155,6 +4408,7 @@ function Report(props) {
|
|
|
4155
4408
|
onNote: (text) => announce(text),
|
|
4156
4409
|
onFilter: filterField,
|
|
4157
4410
|
nameOf,
|
|
4411
|
+
sourceNameOf,
|
|
4158
4412
|
info: fieldInfo,
|
|
4159
4413
|
showInfo: fieldSwitch.on,
|
|
4160
4414
|
drawer: size === "narrow",
|
|
@@ -4167,7 +4421,7 @@ function Report(props) {
|
|
|
4167
4421
|
root.current?.querySelector(".pk-toolbar button:not([disabled])")?.focus()
|
|
4168
4422
|
)
|
|
4169
4423
|
}
|
|
4170
|
-
)), drawerOpen ? /* @__PURE__ */
|
|
4424
|
+
)), drawerOpen ? /* @__PURE__ */ React14.createElement("div", { className: "pk-scrim pk-drawer-scrim", onClick: () => setDrawer(false), "aria-hidden": "true" }) : null, /* @__PURE__ */ React14.createElement("div", { className: "pk-main", ref: mainRef }, /* @__PURE__ */ React14.createElement(
|
|
4171
4425
|
Toolbar,
|
|
4172
4426
|
{
|
|
4173
4427
|
view,
|
|
@@ -4190,7 +4444,8 @@ function Report(props) {
|
|
|
4190
4444
|
onExport: doExport,
|
|
4191
4445
|
prepareExport,
|
|
4192
4446
|
dataExport: { exportData, encoded },
|
|
4193
|
-
chartReady:
|
|
4447
|
+
chartReady: chartShown && chartReady,
|
|
4448
|
+
display: shown,
|
|
4194
4449
|
empty,
|
|
4195
4450
|
onShowFields: () => setDrawer(true),
|
|
4196
4451
|
tipsControls: allowed !== "off",
|
|
@@ -4202,9 +4457,9 @@ function Report(props) {
|
|
|
4202
4457
|
explanations: explainUser ? { on: !dismissed.includes(NO_EXPLANATIONS), set: (on) => toggle(NO_EXPLANATIONS, on) } : null
|
|
4203
4458
|
},
|
|
4204
4459
|
viewsRequest,
|
|
4205
|
-
data: allowImport ? { loaded: Boolean(imported), panel: (close) => /* @__PURE__ */
|
|
4460
|
+
data: allowImport ? { loaded: Boolean(imported), panel: (close) => /* @__PURE__ */ React14.createElement(MenuPanel, { name: "DataMenu", loadingText: labels.loadingMenu, props: { api, close, labels } }) } : null
|
|
4206
4461
|
}
|
|
4207
|
-
), /* @__PURE__ */
|
|
4462
|
+
), /* @__PURE__ */ React14.createElement(
|
|
4208
4463
|
Zones,
|
|
4209
4464
|
{
|
|
4210
4465
|
view,
|
|
@@ -4225,7 +4480,7 @@ function Report(props) {
|
|
|
4225
4480
|
showInfo: fieldSwitch.on,
|
|
4226
4481
|
adding
|
|
4227
4482
|
}
|
|
4228
|
-
), linkCheck ? /* @__PURE__ */
|
|
4483
|
+
), linkCheck ? /* @__PURE__ */ React14.createElement("div", { className: "pk-link-check", "data-testid": "link-check" }, /* @__PURE__ */ React14.createElement(MenuPanel, { name: "LoadCheck", props: { check: linkCheck, labels, title: labels.linkCheckTitle, quiet: linkCheck.quiet, close: () => setLinkCheck(null), onCancel: cancelLink } })) : null, /* @__PURE__ */ React14.createElement(
|
|
4229
4484
|
Unused,
|
|
4230
4485
|
{
|
|
4231
4486
|
notes,
|
|
@@ -4243,7 +4498,7 @@ function Report(props) {
|
|
|
4243
4498
|
narrow: size === "narrow",
|
|
4244
4499
|
quiet: unusedSaid && !fromHost
|
|
4245
4500
|
}
|
|
4246
|
-
), /* @__PURE__ */
|
|
4501
|
+
), /* @__PURE__ */ React14.createElement(
|
|
4247
4502
|
Tips,
|
|
4248
4503
|
{
|
|
4249
4504
|
tips: shownTips,
|
|
@@ -4252,13 +4507,15 @@ function Report(props) {
|
|
|
4252
4507
|
onAction: runTip,
|
|
4253
4508
|
focusFallback: () => root.current?.focus({ preventScroll: true })
|
|
4254
4509
|
}
|
|
4255
|
-
), showTable && view.values.length ? /* @__PURE__ */
|
|
4510
|
+
), showTable && view.values.length ? /* @__PURE__ */ React14.createElement("p", { id: hintId, className: "pk-sr", "data-testid": "cell-hint" }, labels.tips.cells) : null, big.enlarged ? /* @__PURE__ */ React14.createElement("p", { className: "pk-enlarged-fields", "data-testid": "enlarged-fields" }, summaryText) : null, /* @__PURE__ */ React14.createElement(
|
|
4256
4511
|
ViewTabs,
|
|
4257
4512
|
{
|
|
4258
4513
|
view,
|
|
4259
4514
|
labels,
|
|
4260
4515
|
panelId: resultId,
|
|
4261
4516
|
narrow: size === "narrow",
|
|
4517
|
+
shown,
|
|
4518
|
+
both: size === "wide",
|
|
4262
4519
|
big,
|
|
4263
4520
|
plan,
|
|
4264
4521
|
encoded,
|
|
@@ -4274,33 +4531,10 @@ function Report(props) {
|
|
|
4274
4531
|
onCollapse: collapseAll,
|
|
4275
4532
|
folding
|
|
4276
4533
|
}
|
|
4277
|
-
), /* @__PURE__ */
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
plan,
|
|
4282
|
-
series,
|
|
4283
|
-
labels: context.labels,
|
|
4284
|
-
locale,
|
|
4285
|
-
themeName,
|
|
4286
|
-
root,
|
|
4287
|
-
valueNames: valueLabels(view.values, labels),
|
|
4288
|
-
chartOptions: stableChartOptions,
|
|
4289
|
-
colorMap: stableColorMap,
|
|
4290
|
-
onLegend: ({ name, shown }) => {
|
|
4291
|
-
commit(setChartDisplay(view, { hidden: hiddenAfter(view.chart.hidden, name, shown) }), { step: "chartDisplay" });
|
|
4292
|
-
announce(fill(shown ? labels.chartShown : labels.chartHidden, { name }));
|
|
4293
|
-
},
|
|
4294
|
-
onInstance: (c) => {
|
|
4295
|
-
chartRef.current = c;
|
|
4296
|
-
setChartReady(Boolean(c));
|
|
4297
|
-
},
|
|
4298
|
-
onLines: (checks) => setLineChecks(checks && { checks, view }),
|
|
4299
|
-
onPoint: (p) => openCell({ rowPath: plan.swap ? p.colPath : p.rowPath, colPath: plan.swap ? p.rowPath : p.colPath, value: p.value, valueIndex: p.valueIndex, text: String(p.value ?? "") })
|
|
4300
|
-
}
|
|
4301
|
-
) : gridState.grid ? /* @__PURE__ */ React13.createElement(PivotTable, { grid: gridState.grid, view, labels: context.labels, version: history.viewKey, hintId: view.values.length ? hintId : void 0, onRowLabel: setRowLabel, infoOf, showInfo: fieldSwitch.on, typeOf, hostOrdered, onSort: sortFromHeader, onToggle: (axis, path) => commit(toggleCollapsed(view, axis, path), { step: "collapse" }), onCell: (cell) => openCell(cell) }) : null), /* @__PURE__ */ React13.createElement("div", { className: "pk-status" }, /* @__PURE__ */ React13.createElement("span", { className: "pk-row-count", "data-testid": "row-count" }, result ? rowCount(result.rows.length, result.encoded.length, labels, locale) : ""), context.ranges.map(({ field, text }) => /* @__PURE__ */ React13.createElement("span", { key: field, "data-testid": "date-range", title: fill(labels.dateRangeTitle, { field: fieldLabel5(field, labels.core) }) }, context.ranges.length > 1 ? fill(labels.dateRangeField, { field: fieldLabel5(field, labels.core), range: text }) : fill(labels.dateRangeData, { range: text }))), importMod ? /* @__PURE__ */ React13.createElement(importMod.SourceLine, { api }) : null, rowLabel && showTable ? /* @__PURE__ */ React13.createElement("span", { className: "pk-row-label", "data-testid": "row-label" }, fill(labels.rowLabel, { label: rowLabel })) : null), /* @__PURE__ */ React13.createElement("div", { className: "pk-toast-dock" }, /* @__PURE__ */ React13.createElement(Toasts, { toasts, dismiss, pause, closeLabel: labels.close }))), drill ? /* @__PURE__ */ React13.createElement(MenuPanel, { name: "DrillPanel", props: { drill, onClose: () => setDrill(null), labels: context.labels, locale, exportContext: { encoded, onExport, announce, root, exportData, drillDownExport } } }) : null),
|
|
4302
|
-
filterTarget ? /* @__PURE__ */ React13.createElement(MenuPanel, { name: "FilterPopover", props: { target: filterTarget, onClose: closeFilter, view, encoded, locale, labels, commit } }) : null
|
|
4303
|
-
), allowImport && importMod ? /* @__PURE__ */ React13.createElement(importMod.ImportLayer, { api, input: fileInput }) : null, /* @__PURE__ */ React13.createElement("div", { className: "pk-layer", ref: setLayer }, /* @__PURE__ */ React13.createElement("span", { className: "pk-origin", "aria-hidden": "true" })))))
|
|
4534
|
+
), /* @__PURE__ */ React14.createElement("section", { className: "pk-result", id: resultId, role: "tabpanel", "aria-labelledby": tabId(resultId, shown) }, loading2 || opening ? /* @__PURE__ */ React14.createElement(Skeleton, { text: labels.loadingReport }) : error ? /* @__PURE__ */ React14.createElement("div", { className: "pk-message pk-error", role: "alert" }, /* @__PURE__ */ React14.createElement(Icon, { name: "info" }), /* @__PURE__ */ React14.createElement("p", null, errorText(error, labels, locale))) : empty && tableShown ? /* @__PURE__ */ React14.createElement(EmptyState, { labels, templates: entries, onTemplate: openTemplate, onLoad: allowImport ? () => requestImport().then((m) => m.pickFile(fileInput.current), () => announce(labels.menuFailed, { tone: "error" })) : void 0, noData: allowImport && fields.length === 0 }) : shown === "both" ? /* @__PURE__ */ React14.createElement(SideBySide, { labels, split: split2, onSplit: setSplit, table: gridState.grid ? tableEl : null, chart: chartResult ? chartEl : null }) : shown === "chart" && chartResult ? chartEl : gridState.grid ? tableEl : null), /* @__PURE__ */ React14.createElement("div", { className: "pk-status" }, /* @__PURE__ */ React14.createElement("span", { className: "pk-row-count", "data-testid": "row-count" }, result ? rowCount(result.rows.length, result.encoded.length, labels, locale) : ""), context.ranges.map(({ field, text }) => /* @__PURE__ */ React14.createElement("span", { key: field, "data-testid": "date-range", title: fill(labels.dateRangeTitle, { field: fieldLabel5(field, labels.core) }) }, context.ranges.length > 1 ? fill(labels.dateRangeField, { field: fieldLabel5(field, labels.core), range: text }) : fill(labels.dateRangeData, { range: text }))), importMod ? /* @__PURE__ */ React14.createElement(importMod.SourceLine, { api }) : null, rowLabel && showTable ? /* @__PURE__ */ React14.createElement("span", { className: "pk-row-label", "data-testid": "row-label" }, fill(labels.rowLabel, { label: rowLabel })) : null), /* @__PURE__ */ React14.createElement("div", { className: "pk-toast-dock" }, /* @__PURE__ */ React14.createElement(Toasts, { toasts, dismiss, pause, closeLabel: labels.close }))), drill ? /* @__PURE__ */ React14.createElement(MenuPanel, { name: "DrillPanel", props: { drill, onClose: () => setDrill(null), labels: context.labels, locale, exportContext: { encoded, onExport, announce, root, exportData, drillDownExport } } }) : null),
|
|
4535
|
+
filterTarget ? /* @__PURE__ */ React14.createElement(MenuPanel, { name: "FilterPopover", props: { target: filterTarget, onClose: closeFilter, view, encoded, locale, labels, commit } }) : null,
|
|
4536
|
+
pointTarget ? /* @__PURE__ */ React14.createElement(MenuPanel, { name: "PointMenu", props: { target: pointTarget, onClose: () => setPointTarget(null), onRows: openPoint, view, encoded, locale, labels, commit, showRows: drillDown || Boolean(onCellClick) } }) : null
|
|
4537
|
+
), allowImport && importMod ? /* @__PURE__ */ React14.createElement(importMod.ImportLayer, { api, input: fileInput }) : null, /* @__PURE__ */ React14.createElement("div", { className: "pk-layer", ref: setLayer }, /* @__PURE__ */ React14.createElement("span", { className: "pk-origin", "aria-hidden": "true" })))))
|
|
4304
4538
|
);
|
|
4305
4539
|
}
|
|
4306
4540
|
export {
|