pivotkit-react 0.1.0 → 0.2.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 (53) hide show
  1. package/CHANGELOG.md +143 -1
  2. package/README.md +48 -298
  3. package/dist/chunks/chunk-53ZMK4BH.js +177 -0
  4. package/dist/chunks/{chunk-ILHFIV2P.js → chunk-F6MVUAQD.js} +35 -78
  5. package/dist/chunks/chunk-LQCWFJBS.js +310 -0
  6. package/dist/chunks/chunk-OYY4BKIL.js +93 -0
  7. package/dist/chunks/chunk-QBD4FOBB.js +254 -0
  8. package/dist/chunks/{chunk-KKJO36W5.js → chunk-X7H7BAVT.js} +243 -324
  9. package/dist/chunks/unused-texts-YTNJCFFC.js +10 -0
  10. package/dist/chunks/unused-texts-de-SGOHV4N7.js +6 -0
  11. package/dist/echarts.js +96 -11
  12. package/dist/index.js +619 -527
  13. package/dist/labels.js +13 -4
  14. package/dist/menu-texts-de.js +6 -0
  15. package/dist/menus.js +787 -191
  16. package/dist/styles.css +113 -31
  17. package/package.json +2 -2
  18. package/types/chart-layout.d.ts +111 -0
  19. package/types/chart-types.d.ts +0 -91
  20. package/types/drill-panel.d.ts +5 -22
  21. package/types/drill-table.d.ts +71 -0
  22. package/types/drill.d.ts +0 -36
  23. package/types/help.d.ts +21 -0
  24. package/types/icons.d.ts +4 -0
  25. package/types/labels.d.ts +43 -101
  26. package/types/lazy-menus.d.ts +16 -4
  27. package/types/menu-labels-de.d.ts +2 -0
  28. package/types/menu-labels.d.ts +71 -9
  29. package/types/menu-ops.d.ts +145 -0
  30. package/types/menu-texts.d.ts +2 -0
  31. package/types/menus.d.ts +1 -1
  32. package/types/names.d.ts +19 -19
  33. package/types/overflow.d.ts +4 -1
  34. package/types/popover.d.ts +10 -6
  35. package/types/section.d.ts +7 -24
  36. package/types/sections.d.ts +2 -0
  37. package/types/share-actions.d.ts +99 -0
  38. package/types/share.d.ts +0 -9
  39. package/types/table.d.ts +9 -3
  40. package/types/templates.d.ts +7 -1
  41. package/types/tips.d.ts +9 -7
  42. package/types/toolbar-panels.d.ts +8 -5
  43. package/types/unused-load.d.ts +23 -0
  44. package/types/unused-texts-de.d.ts +2 -0
  45. package/types/unused-texts.d.ts +130 -0
  46. package/types/unused.d.ts +22 -0
  47. package/types/use-view-history.d.ts +7 -4
  48. package/types/view-history.d.ts +23 -6
  49. package/types/view-ops.d.ts +72 -123
  50. package/types/view-save.d.ts +76 -0
  51. package/types/view-store.d.ts +13 -6
  52. package/dist/chunks/chunk-C32TYSHG.js +0 -441
  53. package/dist/chunks/chunk-XYP47DJ3.js +0 -123
package/types/labels.d.ts CHANGED
@@ -1,8 +1,12 @@
1
- export type UiLabels = typeof en & import("./menu-labels.js").MenuTexts;
1
+ export type UiLabels = typeof en & import("./menu-labels.js").MenuTexts & {
2
+ unused?: import("./unused-texts.js").UnusedTexts;
3
+ };
2
4
  /**
3
5
  * Every text of the UI: these and the menus' (menu-labels.js, loaded with the menus; a type import
4
6
  * only, so they stay out of the first load).
5
- * @typedef {typeof en & import("./menu-labels.js").MenuTexts} UiLabels
7
+ * @typedef {typeof en & import("./menu-labels.js").MenuTexts & { unused?: import("./unused-texts.js").UnusedTexts }} UiLabels
8
+ * `unused`: the texts of a view's unused parts (unused-texts.js), loaded when a view has such parts;
9
+ * a host's are kept aside as the menus' are
6
10
  */
7
11
  export declare const en: {
8
12
  /** the language of the texts, for the report's lang attribute */
@@ -29,6 +33,7 @@ export declare const en: {
29
33
  noFieldMatch: string;
30
34
  fieldMenu: string;
31
35
  addTo: string;
36
+ addAgain: string;
32
37
  alreadyIn: string;
33
38
  move: string;
34
39
  moveTo: string;
@@ -66,6 +71,7 @@ export declare const en: {
66
71
  redo: string;
67
72
  reset: string;
68
73
  resetHint: string;
74
+ unsavedChanges: string;
69
75
  swap: string;
70
76
  layout: string;
71
77
  showLayout: string;
@@ -74,11 +80,6 @@ export declare const en: {
74
80
  views: string;
75
81
  exportLabel: string;
76
82
  options: string;
77
- totals: string;
78
- grandTotalRow: string;
79
- grandTotalColumn: string;
80
- rowSubtotals: string;
81
- colSubtotals: string;
82
83
  expand: string;
83
84
  collapse: string;
84
85
  showAs: string;
@@ -89,6 +90,10 @@ export declare const en: {
89
90
  sortCustomDesc: string;
90
91
  sortValueDesc: string;
91
92
  sortValueAsc: string;
93
+ headerSort: string;
94
+ headerSortDesc: string;
95
+ headerSortAsc: string;
96
+ headerSorted: string;
92
97
  units: {
93
98
  year: string;
94
99
  yearQuarter: string;
@@ -126,14 +131,6 @@ export declare const en: {
126
131
  filterSummary: string;
127
132
  filterTitle: string;
128
133
  condition: string;
129
- labelOps: {
130
- equals: string;
131
- notEquals: string;
132
- contains: string;
133
- notContains: string;
134
- beginsWith: string;
135
- endsWith: string;
136
- };
137
134
  emptyTitle: string;
138
135
  emptySteps: string[];
139
136
  emptyFields: string;
@@ -146,7 +143,16 @@ export declare const en: {
146
143
  tooMuchWork: string;
147
144
  zoneFull: string;
148
145
  viewTrimmed: string;
149
- issues: string;
146
+ unusedParts: {
147
+ one: string;
148
+ other: string;
149
+ };
150
+ unusedPath: string;
151
+ unusedMore: {
152
+ one: string;
153
+ other: string;
154
+ };
155
+ unusedFewer: string;
150
156
  dismissIssues: string;
151
157
  loadingChart: string;
152
158
  noChartData: string;
@@ -176,7 +182,7 @@ export declare const en: {
176
182
  toastUndone: string;
177
183
  toastRedone: string;
178
184
  toastReset: string;
179
- toastExported: string;
185
+ newEmpty: string;
180
186
  toastLoaded: string;
181
187
  toastExportFailed: string;
182
188
  steps: {
@@ -197,6 +203,7 @@ export declare const en: {
197
203
  swap: string;
198
204
  template: string;
199
205
  reset: string;
206
+ new: string;
200
207
  outside: string;
201
208
  viewLoaded: string;
202
209
  chartDisplay: string;
@@ -241,16 +248,6 @@ export declare const en: {
241
248
  };
242
249
  dismissTip: string;
243
250
  tipsTitle: string;
244
- shortcuts: {
245
- undo: string;
246
- redo: string;
247
- move: string;
248
- open: string;
249
- drag: string;
250
- close: string;
251
- fields: string;
252
- fieldMenu: string;
253
- };
254
251
  skipToToolbar: string;
255
252
  aboutField: string;
256
253
  learnMore: string;
@@ -273,13 +270,8 @@ export declare const en: {
273
270
  loadingMenu: string;
274
271
  menuFailed: string;
275
272
  tryAgain: string;
276
- chartDisplay: string;
277
273
  axisEvery: string;
278
274
  clearText: string;
279
- toastLinkCopied: string;
280
- toastJsonCopied: string;
281
- toastCopyFailed: string;
282
- toastLinkTooLong: string;
283
275
  toastViewLoaded: string;
284
276
  toastViewLoadedPartly: string;
285
277
  toastLinkOpened: string;
@@ -290,9 +282,6 @@ export declare const en: {
290
282
  loadCheckMissing: string;
291
283
  loadCheckChanged: string;
292
284
  linkCheckTitle: string;
293
- viewMissingFields: string;
294
- viewOtherIssue: string;
295
- viewOtherIssues: string;
296
285
  viewFailed: {
297
286
  empty: string;
298
287
  tooLarge: string;
@@ -302,7 +291,6 @@ export declare const en: {
302
291
  badLink: string;
303
292
  file: string;
304
293
  };
305
- filterIs: string;
306
294
  valueConditions: {
307
295
  compare: string;
308
296
  between: string;
@@ -314,24 +302,9 @@ export declare const en: {
314
302
  values: string;
315
303
  filters: string;
316
304
  };
317
- expandNothing: string;
318
- collapseNeedsRows: string;
319
- needsRowField: string;
320
- needsColField: string;
321
- needsRowFields: string;
322
- needsColFields: string;
323
305
  enlarge: string;
324
306
  reduce: string;
325
307
  fullScreen: string;
326
- collapseAllDone: string;
327
- groupsCollapsed: {
328
- one: string;
329
- other: string;
330
- };
331
- groupsExpanded: {
332
- one: string;
333
- other: string;
334
- };
335
308
  };
336
309
  export declare const de: {
337
310
  lang: string;
@@ -356,6 +329,7 @@ export declare const de: {
356
329
  noFieldMatch: string;
357
330
  fieldMenu: string;
358
331
  addTo: string;
332
+ addAgain: string;
359
333
  alreadyIn: string;
360
334
  move: string;
361
335
  moveTo: string;
@@ -393,6 +367,7 @@ export declare const de: {
393
367
  redo: string;
394
368
  reset: string;
395
369
  resetHint: string;
370
+ unsavedChanges: string;
396
371
  swap: string;
397
372
  layout: string;
398
373
  showLayout: string;
@@ -401,11 +376,6 @@ export declare const de: {
401
376
  views: string;
402
377
  exportLabel: string;
403
378
  options: string;
404
- totals: string;
405
- grandTotalRow: string;
406
- grandTotalColumn: string;
407
- rowSubtotals: string;
408
- colSubtotals: string;
409
379
  expand: string;
410
380
  collapse: string;
411
381
  showAs: string;
@@ -416,6 +386,10 @@ export declare const de: {
416
386
  sortCustomDesc: string;
417
387
  sortValueDesc: string;
418
388
  sortValueAsc: string;
389
+ headerSort: string;
390
+ headerSortDesc: string;
391
+ headerSortAsc: string;
392
+ headerSorted: string;
419
393
  units: {
420
394
  year: string;
421
395
  yearQuarter: string;
@@ -453,14 +427,6 @@ export declare const de: {
453
427
  filterSummary: string;
454
428
  filterTitle: string;
455
429
  condition: string;
456
- labelOps: {
457
- equals: string;
458
- notEquals: string;
459
- contains: string;
460
- notContains: string;
461
- beginsWith: string;
462
- endsWith: string;
463
- };
464
430
  emptyTitle: string;
465
431
  emptySteps: string[];
466
432
  emptyFields: string;
@@ -473,7 +439,16 @@ export declare const de: {
473
439
  tooMuchWork: string;
474
440
  zoneFull: string;
475
441
  viewTrimmed: string;
476
- issues: string;
442
+ unusedParts: {
443
+ one: string;
444
+ other: string;
445
+ };
446
+ unusedPath: string;
447
+ unusedMore: {
448
+ one: string;
449
+ other: string;
450
+ };
451
+ unusedFewer: string;
477
452
  dismissIssues: string;
478
453
  loadingChart: string;
479
454
  noChartData: string;
@@ -503,7 +478,7 @@ export declare const de: {
503
478
  toastUndone: string;
504
479
  toastRedone: string;
505
480
  toastReset: string;
506
- toastExported: string;
481
+ newEmpty: string;
507
482
  toastLoaded: string;
508
483
  toastExportFailed: string;
509
484
  steps: {
@@ -524,6 +499,7 @@ export declare const de: {
524
499
  swap: string;
525
500
  template: string;
526
501
  reset: string;
502
+ new: string;
527
503
  outside: string;
528
504
  viewLoaded: string;
529
505
  chartDisplay: string;
@@ -568,16 +544,6 @@ export declare const de: {
568
544
  };
569
545
  dismissTip: string;
570
546
  tipsTitle: string;
571
- shortcuts: {
572
- undo: string;
573
- redo: string;
574
- move: string;
575
- open: string;
576
- drag: string;
577
- close: string;
578
- fields: string;
579
- fieldMenu: string;
580
- };
581
547
  skipToToolbar: string;
582
548
  aboutField: string;
583
549
  learnMore: string;
@@ -600,13 +566,8 @@ export declare const de: {
600
566
  loadingMenu: string;
601
567
  menuFailed: string;
602
568
  tryAgain: string;
603
- chartDisplay: string;
604
569
  axisEvery: string;
605
570
  clearText: string;
606
- toastLinkCopied: string;
607
- toastJsonCopied: string;
608
- toastCopyFailed: string;
609
- toastLinkTooLong: string;
610
571
  toastViewLoaded: string;
611
572
  toastViewLoadedPartly: string;
612
573
  toastLinkOpened: string;
@@ -617,9 +578,6 @@ export declare const de: {
617
578
  loadCheckMissing: string;
618
579
  loadCheckChanged: string;
619
580
  linkCheckTitle: string;
620
- viewMissingFields: string;
621
- viewOtherIssue: string;
622
- viewOtherIssues: string;
623
581
  viewFailed: {
624
582
  empty: string;
625
583
  tooLarge: string;
@@ -629,7 +587,6 @@ export declare const de: {
629
587
  badLink: string;
630
588
  file: string;
631
589
  };
632
- filterIs: string;
633
590
  valueConditions: {
634
591
  compare: string;
635
592
  between: string;
@@ -641,26 +598,11 @@ export declare const de: {
641
598
  values: string;
642
599
  filters: string;
643
600
  };
644
- expandNothing: string;
645
- collapseNeedsRows: string;
646
- needsRowField: string;
647
- needsColField: string;
648
- needsRowFields: string;
649
- needsColFields: string;
650
601
  enlarge: string;
651
602
  reduce: string;
652
603
  fullScreen: string;
653
- collapseAllDone: string;
654
- groupsCollapsed: {
655
- one: string;
656
- other: string;
657
- };
658
- groupsExpanded: {
659
- one: string;
660
- other: string;
661
- };
662
604
  };
663
- /** @type {Readonly<{ en: typeof en, de: typeof en }>} the texts of the first load; the menus' are MENU_LABELS (menu-labels.js) */
605
+ /** @type {Readonly<{ en: typeof en, de: typeof en }>} the texts of the first load; the menus' are in menu-labels.js (English) and menu-labels-<lang>.js (menu-texts.js) */
664
606
  export declare const LABELS: Readonly<{
665
607
  en: typeof en;
666
608
  de: typeof en;
@@ -1,8 +1,20 @@
1
1
  import React from "react";
2
- /** The menus' panels, imported once; a failed import is forgotten, so the next call tries again. */
3
- export declare function loadMenus(): Promise<typeof import("./menus.js")>;
4
- /** The menus' module at once when it is loaded, else null. */
5
- export declare const menusNow: () => typeof import("./menus.js") | null;
2
+ /** Calls `listener` whenever a language's texts arrived or failed; returns the unsubscribe. */
3
+ export declare function onMenuTexts(listener: any): () => undefined;
4
+ /**
5
+ * The menus' panels, imported once, with the menus' texts of `lang` (added to menus.js's). A failed
6
+ * import of the panels is forgotten and rejects, so the next call tries again; texts that fail leave
7
+ * English standing in (the panels resolve), and the next call tries them again.
8
+ * @param {string} [lang] the report's language (labels.lang)
9
+ * @returns {Promise<typeof import("./menus.js")>}
10
+ */
11
+ export declare function loadMenus(lang?: string): Promise<typeof import("./menus.js")>;
12
+ /**
13
+ * The menus' module at once when it is loaded with the texts of `lang` (or they failed: English
14
+ * stands in), else null; without `lang` the module as soon as it is loaded.
15
+ * @param {string} [lang]
16
+ */
17
+ export declare const menusNow: (lang?: string) => typeof import("./menus.js") | null;
6
18
  /**
7
19
  * One panel of menus.js with its props.
8
20
  * @param {{ name: "AxisMenu" | "ValueMenu" | "ChartTypePanel" | "OptionsPanel" | "ViewsPanel" | "ExportPanel" | "LoadCheck" | "FilterPopover" | "DrillPanel", loadingText?: string, props: Record<string, any> }} props
@@ -0,0 +1,2 @@
1
+ /** @type {import("./menu-labels.js").MenuTexts} */
2
+ export declare const de: import("./menu-labels.js").MenuTexts;
@@ -18,6 +18,8 @@ export declare const en: {
18
18
  groupLabels: string;
19
19
  labelPosition: string;
20
20
  sharedView: string;
21
+ newReport: string;
22
+ valuesFilter: string;
21
23
  };
22
24
  moveLeft: string;
23
25
  moveRight: string;
@@ -26,6 +28,7 @@ export declare const en: {
26
28
  sharedViews: string;
27
29
  myViews: string;
28
30
  noViews: string;
31
+ noViewsStore: string;
29
32
  publishView: string;
30
33
  publishConfirm: string;
31
34
  publishAction: string;
@@ -48,6 +51,15 @@ export declare const en: {
48
51
  deleteAction: string;
49
52
  saveView: string;
50
53
  viewName: string;
54
+ thisView: string;
55
+ saveNamed: string;
56
+ saveAs: string;
57
+ saveSharedLocked: string;
58
+ saveNotInViews: string;
59
+ replaceConfirm: string;
60
+ replaceAction: string;
61
+ replaceSharedConfirm: string;
62
+ newAlready: string;
51
63
  save: string;
52
64
  cancel: string;
53
65
  expandAll: string;
@@ -109,12 +121,16 @@ export declare const en: {
109
121
  bin: string;
110
122
  };
111
123
  bins: string;
124
+ binsStart: string;
125
+ binsState: string;
112
126
  binSize: string;
113
127
  binStart: string;
114
128
  binStartFar: string;
115
129
  apply: string;
130
+ change: string;
116
131
  removeSetting: string;
117
132
  topN: string;
133
+ topStart: string;
118
134
  topCount: string;
119
135
  bottom: string;
120
136
  topBy: string;
@@ -133,6 +149,7 @@ export declare const en: {
133
149
  exportCsv: string;
134
150
  exportPng: string;
135
151
  exportPngNeedsChart: string;
152
+ exportNeedsField: string;
136
153
  copyTable: string;
137
154
  copyDataJson: string;
138
155
  toastTableCopied: string;
@@ -156,6 +173,9 @@ export declare const en: {
156
173
  showTips: string;
157
174
  showSettingInfo: string;
158
175
  resetTips: string;
176
+ resetSections: string;
177
+ resetSectionsDone: string;
178
+ sectionChanged: string;
159
179
  help: string;
160
180
  shortcutsTitle: string;
161
181
  keys: {
@@ -167,6 +187,16 @@ export declare const en: {
167
187
  Escape: string;
168
188
  F10: string;
169
189
  };
190
+ shortcuts: {
191
+ undo: string;
192
+ redo: string;
193
+ move: string;
194
+ open: string;
195
+ drag: string;
196
+ close: string;
197
+ fields: string;
198
+ fieldMenu: string;
199
+ };
170
200
  valueLabels: string;
171
201
  valueLabelNames: {
172
202
  auto: string;
@@ -220,6 +250,7 @@ export declare const en: {
220
250
  numberInvalid: string;
221
251
  countInvalid: string;
222
252
  sizeInvalid: string;
253
+ chooseValues: string;
223
254
  valueFilter: string;
224
255
  valueFilterBy: string;
225
256
  valueFilterOp: string;
@@ -236,19 +267,50 @@ export declare const en: {
236
267
  notBetween: string;
237
268
  };
238
269
  removeFilter: string;
239
- valuesFilterHint: string;
240
270
  moreFormats: string;
271
+ totals: string;
272
+ grandTotalRow: string;
273
+ grandTotalColumn: string;
274
+ rowSubtotals: string;
275
+ colSubtotals: string;
276
+ needsRowField: string;
277
+ needsColField: string;
278
+ needsRowFields: string;
279
+ needsColFields: string;
280
+ expandNothing: string;
281
+ collapseNeedsRows: string;
282
+ collapseAllDone: string;
283
+ groupsCollapsed: {
284
+ one: string;
285
+ other: string;
286
+ };
287
+ groupsExpanded: {
288
+ one: string;
289
+ other: string;
290
+ };
291
+ chartDisplay: string;
292
+ labelOps: {
293
+ equals: string;
294
+ notEquals: string;
295
+ contains: string;
296
+ notContains: string;
297
+ beginsWith: string;
298
+ endsWith: string;
299
+ };
300
+ filterIs: string;
301
+ toastExported: string;
302
+ toastLinkCopied: string;
303
+ toastJsonCopied: string;
304
+ toastCopyFailed: string;
305
+ toastLinkTooLong: string;
241
306
  };
242
- /** @type {MenuTexts} */
243
- export declare const de: MenuTexts;
244
- /** @type {Readonly<{ en: MenuTexts, de: MenuTexts }>} */
245
- export declare const MENU_LABELS: Readonly<{
246
- en: MenuTexts;
247
- de: MenuTexts;
248
- }>;
307
+ /** Adds the menus' texts of a language, once its chunk has loaded. */
308
+ export declare function addMenuTexts(lang: any, texts: any): void;
309
+ /** Whether the menus' texts of a language are here. */
310
+ export declare const hasMenuTexts: (lang: any) => boolean;
249
311
  /**
250
312
  * The report's labels with the menus' texts of their language (English for a language of a host's
251
- * own), a host's own texts for them applied.
313
+ * own, or while that language's texts still load), a host's own texts for them applied.
252
314
  * @param {import("./labels.js").UiLabels} labels
253
315
  * @returns {import("./labels.js").UiLabels}
254
316
  */
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Changes properties of the value at `index` (agg, format, label, showAs, conditional). A new
3
+ * aggregator drops the "show values as" calculation (a running total does not fit an average) and
4
+ * picks the format: one the patch names; else the user's own format (one that is not the host's
5
+ * default) while the result keeps its unit (average to median: still years); else the host's format
6
+ * for the field (fieldDefaults) when its aggregator has that unit; else none, the automatic one.
7
+ * @param {any} view
8
+ * @param {number} index
9
+ * @param {{ agg?: string, format?: string | null, label?: string | null, showAs?: object | null, conditional?: object | null }} patch
10
+ * @param {{ defaults?: { agg?: string, format?: string } }} [options] `defaults`: the host's
11
+ * settings for the value's field
12
+ */
13
+ export declare function updateValue(view: any, index: number, patch: {
14
+ agg?: string;
15
+ format?: string | null;
16
+ label?: string | null;
17
+ showAs?: object | null;
18
+ conditional?: object | null;
19
+ }, options?: {
20
+ defaults?: {
21
+ agg?: string;
22
+ format?: string;
23
+ };
24
+ }): any;
25
+ /**
26
+ * Why ranges of `size` from `start` cannot hold the numbers of `range`, or null when they can. A start
27
+ * so far from the values that a range's bounds can no longer be told apart in a double (1e17 for
28
+ * magnitudes of 2 to 9 in ranges of 0.5) would put every row into "(blank)": "far".
29
+ * @param {number} size
30
+ * @param {number} start
31
+ * @param {{ min: number, max: number } | null} range
32
+ * @returns {"far" | null}
33
+ */
34
+ export declare function binProblem(size: number, start: number, range: {
35
+ min: number;
36
+ max: number;
37
+ } | null): "far" | null;
38
+ /**
39
+ * The item filter of a field from the selected values: everything selected removes it; otherwise the
40
+ * values not selected are excluded, so values that appear in newer data are shown, as in Excel.
41
+ * @param {any} view
42
+ * @param {string} field
43
+ * @param {Array<unknown>} selected values (null is blank)
44
+ * @param {Array<unknown>} all every value of the field
45
+ */
46
+ export declare function setItemFilter(view: any, field: string, selected: Array<unknown>, all: Array<unknown>): any;
47
+ /** The label condition of a field ({ op, value }) or null to remove it. */
48
+ export declare function setLabelFilter(view: any, field: any, condition: any): any;
49
+ /**
50
+ * Top or bottom N items of a field by a value ({ count, bottom, by }), or null to remove it. `previous`
51
+ * is the top filter being edited (the view's own entry); without it the field's top filters are
52
+ * replaced. Another top filter of the field (a view may hold two) stays.
53
+ */
54
+ export declare function setTopFilter(view: any, field: any, top: any, previous: any): any;
55
+ /**
56
+ * A value condition on a field ({ by, op, value, value2 }, pivotkit-core's `value` filter: "Sum of
57
+ * Revenue greater than 1000"), or null to remove it. `previous` is the condition being edited (the
58
+ * view's own entry): only that one is replaced or removed; without it every value condition of the
59
+ * field is. The field keeps its other filters.
60
+ * @param {any} view
61
+ * @param {string} field
62
+ * @param {{ by: { field: string | null, agg: string }, op: string, value: number, value2?: number } | null} condition
63
+ * @param {object} [previous]
64
+ */
65
+ export declare function setValueFilter(view: any, field: string, condition: {
66
+ by: {
67
+ field: string | null;
68
+ agg: string;
69
+ };
70
+ op: string;
71
+ value: number;
72
+ value2?: number;
73
+ } | null, previous?: object): any;
74
+ /**
75
+ * The measures to choose from with `ref` among them: a sort, a top N or a condition may go by a
76
+ * measure the view no longer shows (its value was removed); it stays a choice, so applying the form
77
+ * again keeps it.
78
+ * @param {Array<{ field: string | null, agg: string }>} choices
79
+ * @param {{ field: string | null, agg: string } | null | undefined} ref
80
+ */
81
+ export declare function withMeasure(choices: Array<{
82
+ field: string | null;
83
+ agg: string;
84
+ }>, ref: {
85
+ field: string | null;
86
+ agg: string;
87
+ } | null | undefined): {
88
+ field: string | null;
89
+ agg: string;
90
+ }[];
91
+ /**
92
+ * The measures a field on an axis can be sorted, ranked and filtered by: each value of the view that
93
+ * gives a number, once per field and aggregator, in the view's order; the row count without one. The
94
+ * first one is the default, as pivotkit-core's.
95
+ * @param {any} view
96
+ * @param {(field: string) => string | undefined} typeOf the column type of a field
97
+ * @returns {Array<{ field: string | null, agg: string }>}
98
+ */
99
+ export declare function measureChoices(view: any, typeOf: (field: string) => string | undefined): Array<{
100
+ field: string | null;
101
+ agg: string;
102
+ }>;
103
+ /**
104
+ * Removes what the filter of a field keeps out: its item list, its text condition and a value
105
+ * condition; Top N has its own control and stays. A field in the Filters zone stays there, unfiltered.
106
+ */
107
+ export declare function removeFilters(view: any, field: any): any;
108
+ /** True when a field has an item, text or value filter that removes something (Top N is not counted). */
109
+ export declare function hasFilter(view: any, field: any): any;
110
+ /** The four totals of Options, in their order. */
111
+ export declare const TOTALS: readonly string[];
112
+ /**
113
+ * Why a total of Options would change nothing in this view, or null when it changes something: a
114
+ * grand total row needs a field in Rows (without one the only row is the total), a grand total column
115
+ * one in Columns, subtotals two or more fields on their axis. The key names the text (labels).
116
+ * @param {any} view
117
+ * @param {string} key one of TOTALS
118
+ * @returns {string | null}
119
+ */
120
+ export declare function totalNoEffect(view: any, key: string): string | null;
121
+ /**
122
+ * The condition on a field's labels its type offers: "text" for text, "number" for a number (on the
123
+ * label as shown), none for a date (or a grouping of one) and a yes/no field, whose items the list
124
+ * above chooses.
125
+ * @param {import("pivotkit-core").Encoded} encoded
126
+ * @param {any} view
127
+ * @param {string} field
128
+ * @returns {"text" | "number" | null}
129
+ */
130
+ export declare function conditionKind(encoded: import("pivotkit-core").Encoded, view: any, field: string): "text" | "number" | null;
131
+ /**
132
+ * What the filter of a field keeps, for its menu: "Filter: 15 of 45", "Filter: contains “abc”",
133
+ * "Filter: Sum of Revenue > 1,000"; null without a filter.
134
+ * @param {any} view
135
+ * @param {string} field
136
+ * @param {{ summary: { shown: number, total: number } | null } | null | undefined} state the chip's state (zones.jsx)
137
+ * @param {import("./labels.js").UiLabels} labels
138
+ * @param {string} locale
139
+ */
140
+ export declare function filterText(view: any, field: string, state: {
141
+ summary: {
142
+ shown: number;
143
+ total: number;
144
+ } | null;
145
+ } | null | undefined, labels: import("./labels.js").UiLabels, locale: string): string | null;
@@ -0,0 +1,2 @@
1
+ /** @type {Readonly<Record<string, () => Promise<import("./menu-labels.js").MenuTexts>>>} */
2
+ export declare const MENU_TEXTS_OF: Readonly<Record<string, () => Promise<import("./menu-labels.js").MenuTexts>>>;
package/types/menus.d.ts CHANGED
@@ -2,6 +2,6 @@ export { AxisMenu, ValueMenu } from "./chip-menus.jsx";
2
2
  export { ChartTypePanel, ExportPanel, LoadCheck, OptionsPanel, ViewsPanel } from "./toolbar-panels.jsx";
3
3
  export { FilterPopover } from "./filter.jsx";
4
4
  export { DrillPanel } from "./drill-panel.jsx";
5
- export { menuLabels } from "./menu-labels.js";
5
+ export { addMenuTexts, hasMenuTexts, menuLabels } from "./menu-labels.js";
6
6
  export { storedViews } from "./view-store.js";
7
7
  export { prepareExporters, runExport } from "./export-run.js";