pivotkit-react 0.7.0 → 0.8.0

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