pivotkit-react 0.0.0-stage → 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 (89) hide show
  1. package/CHANGELOG.md +442 -0
  2. package/LICENSE +21 -0
  3. package/README.md +77 -2
  4. package/dist/chunks/chunk-53ZMK4BH.js +177 -0
  5. package/dist/chunks/chunk-F6MVUAQD.js +741 -0
  6. package/dist/chunks/chunk-LQCWFJBS.js +310 -0
  7. package/dist/chunks/chunk-OYY4BKIL.js +93 -0
  8. package/dist/chunks/chunk-QBD4FOBB.js +254 -0
  9. package/dist/chunks/chunk-X7H7BAVT.js +1752 -0
  10. package/dist/chunks/unused-texts-YTNJCFFC.js +10 -0
  11. package/dist/chunks/unused-texts-de-SGOHV4N7.js +6 -0
  12. package/dist/echarts.js +347 -0
  13. package/dist/index.js +3482 -0
  14. package/dist/labels.js +21 -0
  15. package/dist/menu-texts-de.js +6 -0
  16. package/dist/menus.js +1681 -0
  17. package/dist/styles.css +2529 -0
  18. package/package.json +70 -4
  19. package/types/PivotReport.d.ts +20 -0
  20. package/types/all-labels.d.ts +5 -0
  21. package/types/chart-decorate.d.ts +16 -0
  22. package/types/chart-layout.d.ts +111 -0
  23. package/types/chart-options.d.ts +23 -0
  24. package/types/chart-summary.d.ts +12 -0
  25. package/types/chart-tooltip.d.ts +38 -0
  26. package/types/chart-types.d.ts +61 -0
  27. package/types/chart.d.ts +39 -0
  28. package/types/chip-menus.d.ts +32 -0
  29. package/types/clear-input.d.ts +20 -0
  30. package/types/dnd-moves.d.ts +45 -0
  31. package/types/dnd.d.ts +101 -0
  32. package/types/dom.d.ts +52 -0
  33. package/types/drill-export.d.ts +42 -0
  34. package/types/drill-panel.d.ts +22 -0
  35. package/types/drill-table.d.ts +71 -0
  36. package/types/drill.d.ts +26 -0
  37. package/types/echarts.d.ts +4 -0
  38. package/types/export-run.d.ts +59 -0
  39. package/types/field-info.d.ts +34 -0
  40. package/types/fields.d.ts +32 -0
  41. package/types/files.d.ts +27 -0
  42. package/types/filter.d.ts +21 -0
  43. package/types/help.d.ts +21 -0
  44. package/types/icons.d.ts +80 -0
  45. package/types/index.d.ts +536 -0
  46. package/types/info.d.ts +34 -0
  47. package/types/iso.d.ts +2 -0
  48. package/types/labels.d.ts +663 -0
  49. package/types/lazy-menus.d.ts +28 -0
  50. package/types/menu-labels-de.d.ts +2 -0
  51. package/types/menu-labels.d.ts +317 -0
  52. package/types/menu-ops.d.ts +145 -0
  53. package/types/menu-texts.d.ts +2 -0
  54. package/types/menus.d.ts +7 -0
  55. package/types/names.d.ts +80 -0
  56. package/types/numbers.d.ts +13 -0
  57. package/types/overflow.d.ts +62 -0
  58. package/types/place.d.ts +43 -0
  59. package/types/popover.d.ts +93 -0
  60. package/types/rove.d.ts +20 -0
  61. package/types/section.d.ts +25 -0
  62. package/types/sections.d.ts +2 -0
  63. package/types/share-actions.d.ts +99 -0
  64. package/types/share.d.ts +114 -0
  65. package/types/skeleton.d.ts +9 -0
  66. package/types/storage.d.ts +24 -0
  67. package/types/table.d.ts +29 -0
  68. package/types/templates.d.ts +46 -0
  69. package/types/theme.d.ts +24 -0
  70. package/types/tip-list.d.ts +20 -0
  71. package/types/tips.d.ts +300 -0
  72. package/types/toasts.d.ts +26 -0
  73. package/types/toolbar-panels.d.ts +93 -0
  74. package/types/toolbar.d.ts +5 -0
  75. package/types/unused-load.d.ts +23 -0
  76. package/types/unused-texts-de.d.ts +2 -0
  77. package/types/unused-texts.d.ts +130 -0
  78. package/types/unused.d.ts +22 -0
  79. package/types/use-big-result.d.ts +29 -0
  80. package/types/use-export.d.ts +7 -0
  81. package/types/use-theme.d.ts +11 -0
  82. package/types/use-view-history.d.ts +37 -0
  83. package/types/version.d.ts +2 -0
  84. package/types/view-history.d.ts +106 -0
  85. package/types/view-ops.d.ts +293 -0
  86. package/types/view-save.d.ts +76 -0
  87. package/types/view-store.d.ts +59 -0
  88. package/types/virtual.d.ts +44 -0
  89. package/types/zones.d.ts +42 -0
@@ -0,0 +1,317 @@
1
+ export type MenuTexts = typeof en;
2
+ /** @typedef {typeof en} MenuTexts */
3
+ export declare const en: {
4
+ aboutSetting: string;
5
+ settingInfo: {
6
+ grandTotalRow: string;
7
+ grandTotalColumn: string;
8
+ rowSubtotals: string;
9
+ colSubtotals: string;
10
+ along: string;
11
+ showAs: string;
12
+ exportXlsx: string;
13
+ exportCsv: string;
14
+ copyTable: string;
15
+ copyDataJson: string;
16
+ drillCopy: string;
17
+ drillJson: string;
18
+ groupLabels: string;
19
+ labelPosition: string;
20
+ sharedView: string;
21
+ newReport: string;
22
+ valuesFilter: string;
23
+ };
24
+ moveLeft: string;
25
+ moveRight: string;
26
+ remove: string;
27
+ chartAutoNow: string;
28
+ sharedViews: string;
29
+ myViews: string;
30
+ noViews: string;
31
+ noViewsStore: string;
32
+ publishView: string;
33
+ publishConfirm: string;
34
+ publishAction: string;
35
+ storeNote: string;
36
+ storeFull: string;
37
+ storeTooLarge: string;
38
+ storeRefused: string;
39
+ storeChanged: string;
40
+ toastSaved: string;
41
+ toastDeleted: string;
42
+ toastPublished: string;
43
+ toastSaveFailed: string;
44
+ toastDeleteFailed: string;
45
+ toastPublishFailed: string;
46
+ toastSaveRejected: string;
47
+ toastDeleteRejected: string;
48
+ toastPublishRejected: string;
49
+ deleteView: string;
50
+ deleteConfirm: string;
51
+ deleteAction: string;
52
+ saveView: string;
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;
63
+ save: string;
64
+ cancel: string;
65
+ expandAll: string;
66
+ collapseAll: string;
67
+ aggregation: string;
68
+ moreStatistics: string;
69
+ showAsNone: string;
70
+ moreCalculations: string;
71
+ showAsNames: {
72
+ percentOfGrandTotal: string;
73
+ percentOfRowTotal: string;
74
+ percentOfColumnTotal: string;
75
+ percentOfParentRow: string;
76
+ percentOfParentColumn: string;
77
+ differenceFromPrevious: string;
78
+ percentDifferenceFromPrevious: string;
79
+ runningTotal: string;
80
+ percentRunningTotal: string;
81
+ rankAscending: string;
82
+ rankDescending: string;
83
+ };
84
+ along: string;
85
+ format: string;
86
+ formatAuto: string;
87
+ formats: {
88
+ number: string;
89
+ "number:0": string;
90
+ "number:2": string;
91
+ integer: string;
92
+ currency: string;
93
+ percent: string;
94
+ compact: string;
95
+ bytes: string;
96
+ "duration:h": string;
97
+ "duration:s": string;
98
+ };
99
+ conditional: string;
100
+ conditionalNone: string;
101
+ colorScale: string;
102
+ dataBar: string;
103
+ rename: string;
104
+ sortOldest: string;
105
+ sortNewest: string;
106
+ groupBy: string;
107
+ groupNone: string;
108
+ groupTimeline: string;
109
+ groupCyclic: string;
110
+ unitHints: {
111
+ year: string;
112
+ yearQuarter: string;
113
+ yearMonth: string;
114
+ yearWeek: string;
115
+ day: string;
116
+ quarter: string;
117
+ month: string;
118
+ week: string;
119
+ weekday: string;
120
+ hour: string;
121
+ bin: string;
122
+ };
123
+ bins: string;
124
+ binsStart: string;
125
+ binsState: string;
126
+ binSize: string;
127
+ binStart: string;
128
+ binStartFar: string;
129
+ apply: string;
130
+ change: string;
131
+ removeSetting: string;
132
+ topN: string;
133
+ topStart: string;
134
+ topCount: string;
135
+ bottom: string;
136
+ topBy: string;
137
+ searchValues: string;
138
+ selectAll: string;
139
+ selectNone: string;
140
+ onlyThis: string;
141
+ valuesShown: string;
142
+ conditionNumber: string;
143
+ conditionNone: string;
144
+ conditionValue: string;
145
+ selected: string;
146
+ exportDownload: string;
147
+ exportCopy: string;
148
+ exportXlsx: string;
149
+ exportCsv: string;
150
+ exportPng: string;
151
+ exportPngNeedsChart: string;
152
+ exportNeedsField: string;
153
+ copyTable: string;
154
+ copyDataJson: string;
155
+ toastTableCopied: string;
156
+ toastDataCopied: string;
157
+ toastCopyBlocked: string;
158
+ drillTitle: string;
159
+ drillCount: {
160
+ one: string;
161
+ other: string;
162
+ };
163
+ drillShown: string;
164
+ drillCopy: string;
165
+ drillJson: string;
166
+ drillCsv: string;
167
+ drillXlsx: string;
168
+ drillPart: string;
169
+ drillCopied: string;
170
+ drillCopiedJson: string;
171
+ drillExported: string;
172
+ drillExportNote: string;
173
+ showTips: string;
174
+ showSettingInfo: string;
175
+ resetTips: string;
176
+ resetSections: string;
177
+ resetSectionsDone: string;
178
+ sectionChanged: string;
179
+ help: string;
180
+ shortcutsTitle: string;
181
+ keys: {
182
+ Mod: string;
183
+ Shift: string;
184
+ "Arrow keys": string;
185
+ Enter: string;
186
+ Space: string;
187
+ Escape: string;
188
+ F10: string;
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
+ };
200
+ valueLabels: string;
201
+ valueLabelNames: {
202
+ auto: string;
203
+ off: string;
204
+ value: string;
205
+ percent: string;
206
+ both: string;
207
+ };
208
+ legend: string;
209
+ legendNames: {
210
+ auto: string;
211
+ bottom: string;
212
+ right: string;
213
+ off: string;
214
+ };
215
+ chartTitle: string;
216
+ chartTitleNone: string;
217
+ smoothLines: string;
218
+ labelPosition: string;
219
+ labelPositionNames: {
220
+ outside: string;
221
+ inside: string;
222
+ };
223
+ axisLabels: string;
224
+ axisLabelNames: {
225
+ auto: string;
226
+ all: string;
227
+ nth: string;
228
+ };
229
+ groupLabels: string;
230
+ groupLabelNames: {
231
+ auto: string;
232
+ on: string;
233
+ off: string;
234
+ };
235
+ defaultName: string;
236
+ share: string;
237
+ copyLink: string;
238
+ copyJson: string;
239
+ downloadView: string;
240
+ sharePrivacy: string;
241
+ loadView: string;
242
+ loadViewHint: string;
243
+ loadViewText: string;
244
+ chooseFile: string;
245
+ load: string;
246
+ loadCheckTitle: string;
247
+ loadAnyway: string;
248
+ switchAndLoad: string;
249
+ switchStartsFresh: string;
250
+ numberInvalid: string;
251
+ countInvalid: string;
252
+ sizeInvalid: string;
253
+ chooseValues: string;
254
+ valueFilter: string;
255
+ valueFilterBy: string;
256
+ valueFilterOp: string;
257
+ valueFilterNumber: string;
258
+ valueFilterTo: string;
259
+ valueOps: {
260
+ "=": string;
261
+ "!=": string;
262
+ ">": string;
263
+ ">=": string;
264
+ "<": string;
265
+ "<=": string;
266
+ between: string;
267
+ notBetween: string;
268
+ };
269
+ removeFilter: string;
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;
306
+ };
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;
311
+ /**
312
+ * The report's labels with the menus' texts of their language (English for a language of a host's
313
+ * own, or while that language's texts still load), a host's own texts for them applied.
314
+ * @param {import("./labels.js").UiLabels} labels
315
+ * @returns {import("./labels.js").UiLabels}
316
+ */
317
+ export declare function menuLabels(labels: import("./labels.js").UiLabels): import("./labels.js").UiLabels;
@@ -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>>>;
@@ -0,0 +1,7 @@
1
+ export { AxisMenu, ValueMenu } from "./chip-menus.jsx";
2
+ export { ChartTypePanel, ExportPanel, LoadCheck, OptionsPanel, ViewsPanel } from "./toolbar-panels.jsx";
3
+ export { FilterPopover } from "./filter.jsx";
4
+ export { DrillPanel } from "./drill-panel.jsx";
5
+ export { addMenuTexts, hasMenuTexts, menuLabels } from "./menu-labels.js";
6
+ export { storedViews } from "./view-store.js";
7
+ export { prepareExporters, runExport } from "./export-run.js";
@@ -0,0 +1,80 @@
1
+ /** "Sum of Revenue", "% of grand total of Revenue", or the value's own name. */
2
+ export declare function valueLabel(spec: any, labels: any): any;
3
+ /**
4
+ * The name of a measure a sort, a top N or a value condition goes by ({ field, agg }): the name of the
5
+ * view's value for it ("Sum of Revenue", or the name the user gave it), without a "show as"
6
+ * calculation, since the raw result is what is compared.
7
+ * @param {any} view
8
+ * @param {{ field: string | null, agg: string } | null | undefined} ref
9
+ * @param {import("./labels.js").UiLabels} labels
10
+ */
11
+ export declare function refLabel(view: any, ref: {
12
+ field: string | null;
13
+ agg: string;
14
+ } | null | undefined, labels: import("./labels.js").UiLabels): any;
15
+ /**
16
+ * A sort in words: "Z to A", "Largest Sum of Revenue first", "Custom order".
17
+ * @param {any} view
18
+ * @param {{ by: string, order: string, value?: { field: string | null, agg: string } }} sort
19
+ * @param {import("./labels.js").UiLabels} labels
20
+ */
21
+ export declare function sortText(view: any, sort: {
22
+ by: string;
23
+ order: string;
24
+ value?: {
25
+ field: string | null;
26
+ agg: string;
27
+ };
28
+ }, labels: import("./labels.js").UiLabels): string;
29
+ /**
30
+ * A value condition in short: "Sum of Revenue > 1,000", "Sum of Revenue between 5 and 8".
31
+ * @param {any} view
32
+ * @param {{ by?: { field: string | null, agg: string }, op: string, value: number, value2?: number }} f a `value` filter
33
+ * @param {import("./labels.js").UiLabels} labels
34
+ * @param {string} locale
35
+ */
36
+ export declare function valueConditionText(view: any, f: {
37
+ by?: {
38
+ field: string | null;
39
+ agg: string;
40
+ };
41
+ op: string;
42
+ value: number;
43
+ value2?: number;
44
+ }, labels: import("./labels.js").UiLabels, locale: string): string;
45
+ /** The name of a derived field for a grouping, in the labels' language: "Date by month", "Amount (by 100)". */
46
+ export declare function groupingName(source: any, unit: any, labels: any, size: any): string;
47
+ /** The zone a click on a field of the field list puts it in: numbers to Values, the rest to Rows. */
48
+ export declare const quickZone: (type: any) => "rows" | "values";
49
+ /**
50
+ * What a click (or Enter) on a field of the field list does, from its type and the zones it is in:
51
+ * "add" it to its quick zone, "move" it there from Columns or Filters (a field is on one axis only),
52
+ * or nothing when it is in that zone already, as in Excel's field list: a number in Values is not
53
+ * added a second time by a click, only by "Add to Values again" in its menu. `name` is the button's
54
+ * accessible name (the field and where it is), `description` the action in words.
55
+ * @param {string} field
56
+ * @param {string} type
57
+ * @param {string[]} zones the zones the field is in
58
+ * @param {import("./labels.js").UiLabels} labels
59
+ * @returns {{ zone: string, kind: "add" | "move" | null, name: string, description: string }}
60
+ */
61
+ export declare function fieldAction(field: string, type: string, zones: string[], labels: import("./labels.js").UiLabels): {
62
+ zone: string;
63
+ kind: "add" | "move" | null;
64
+ name: string;
65
+ description: string;
66
+ };
67
+ /**
68
+ * The zones in one line, for the compact layout: "Rows: Team · Columns: Priority · Values: Count of
69
+ * Ticket"; zones without a field are left out.
70
+ * @param {Record<string, Array<{ text: string }>>} entries the chips of each zone (zoneEntries)
71
+ * @param {import("./labels.js").UiLabels} labels
72
+ * @returns {Array<{ zone: string, title: string, fields: string }>} empty when no field is placed
73
+ */
74
+ export declare function layoutSummary(entries: Record<string, Array<{
75
+ text: string;
76
+ }>>, labels: import("./labels.js").UiLabels): Array<{
77
+ zone: string;
78
+ title: string;
79
+ fields: string;
80
+ }>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A number typed in the report's locale, or null when the text is empty or not a number.
3
+ * @param {string} text
4
+ * @param {string} locale
5
+ * @returns {number | null}
6
+ */
7
+ export declare function parseNumber(text: string, locale: string): number | null;
8
+ /**
9
+ * A number as a form shows it for editing: the locale's decimal mark, no grouping, all its decimals.
10
+ * @param {number | null | undefined} n
11
+ * @param {string} locale
12
+ */
13
+ export declare function numberText(n: number | null | undefined, locale: string): string;
@@ -0,0 +1,62 @@
1
+ /**
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), so a click never
4
+ * moves it. Reset goes first: it is wider than "More", which takes its place. Views goes last: it is
5
+ * where a user saves the report, so it stays wherever one button besides Undo, Redo and Export fits
6
+ * (a report with its field list in a window 1280 px wide). Redo is not in the list: it stays next
7
+ * to Undo, which always stays. (New is in the Views menu, not in the toolbar.)
8
+ */
9
+ export declare const OVERFLOW_ORDER: readonly string[];
10
+ /**
11
+ * The room (em of the toolbar's font) each part of the toolbar takes with the longest text of the
12
+ * built-in languages, the gap after it included. How many buttons move into "More" follows from the
13
+ * toolbar's width and these numbers, not from the texts shown: at the same width the same buttons
14
+ * show in every language. (A host's own longer labels still fit: useOverflow measures as well.)
15
+ */
16
+ export declare const TOOLBAR_ROOM: Readonly<{
17
+ fields: 6.4;
18
+ display: 15.3;
19
+ chartType: 12.9;
20
+ sep: 1;
21
+ undo: 8.75;
22
+ redo: 9.15;
23
+ reset: 9.65;
24
+ layout: 8.4;
25
+ options: 8.75;
26
+ views: 9.1;
27
+ export: 7.5;
28
+ more: 7.2;
29
+ }>;
30
+ /**
31
+ * Every text each part of the toolbar can show, from several label sets (the built-in languages and
32
+ * the report's own): a list of texts per part; for `display` (Table | Chart) the pairs.
33
+ * @param {ReadonlyArray<any>} sets labels objects
34
+ * @returns {Record<string, string[]> & { display: string[][] }}
35
+ */
36
+ export declare function toolbarTexts(sets: ReadonlyArray<any>): Record<string, string[]> & {
37
+ display: string[][];
38
+ };
39
+ /**
40
+ * The room (px) each part takes with its widest text: what a button has around its text (`chrome`:
41
+ * a text button's, a menu button's, Table | Chart's; measured from those on screen) plus the widest
42
+ * text (`measure`, in the toolbar's font) plus the gap after it. `sep`: the separator with its margins.
43
+ * @param {ReturnType<typeof toolbarTexts>} texts
44
+ * @param {(text: string, kind: "button" | "display") => number} measure
45
+ * @param {{ text: number, menu: number, display: number, sep: number, gap: number }} chrome
46
+ * @returns {Record<string, number>}
47
+ */
48
+ export declare function toolbarRoom(texts: ReturnType<typeof toolbarTexts>, measure: (text: string, kind: "button" | "display") => number, chrome: {
49
+ text: number;
50
+ menu: number;
51
+ display: number;
52
+ sep: number;
53
+ gap: number;
54
+ }): Record<string, number>;
55
+ /**
56
+ * How many entries of OVERFLOW_ORDER go into "More" in a toolbar `width` wide: the fewest with
57
+ * which the rest fits.
58
+ * @param {number} width in the unit of `room` (em for TOOLBAR_ROOM, px for toolbarRoom)
59
+ * @param {boolean} narrow the report is narrow: the Fields button is there too
60
+ * @param {Readonly<Record<string, number>>} [room]
61
+ */
62
+ export declare function overflowLevel(width: number, narrow: boolean, room?: Readonly<Record<string, number>>): number;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @param {{ top: number, bottom: number, left: number, right: number }} anchor getBoundingClientRect()
3
+ * @param {{ width: number, height: number }} size the popover's size
4
+ * @param {{ width: number, height: number }} viewport
5
+ * @param {"start" | "end"} [align] which edge of the anchor the popover lines up with
6
+ * @param {{ fill?: boolean }} [options]
7
+ * @returns {{ top: number, left: number, maxHeight: number, side: "below" | "above" }}
8
+ */
9
+ export declare function placePopover(anchor: {
10
+ top: number;
11
+ bottom: number;
12
+ left: number;
13
+ right: number;
14
+ }, size: {
15
+ width: number;
16
+ height: number;
17
+ }, viewport: {
18
+ width: number;
19
+ height: number;
20
+ }, align?: "start" | "end", { fill }?: {
21
+ fill?: boolean;
22
+ }): {
23
+ top: number;
24
+ left: number;
25
+ maxHeight: number;
26
+ side: "below" | "above";
27
+ };
28
+ /**
29
+ * A place in viewport coordinates as the top and left of a fixed element whose containing block
30
+ * starts at `origin` (the viewport rect of a fixed probe at 0, 0: { top: 0, left: 0 } without a
31
+ * transformed ancestor).
32
+ * @template {{ top: number, left: number }} T
33
+ * @param {T} place
34
+ * @param {{ top: number, left: number }} origin
35
+ * @returns {T}
36
+ */
37
+ export declare function fromOrigin<T extends {
38
+ top: number;
39
+ left: number;
40
+ }>(place: T, origin: {
41
+ top: number;
42
+ left: number;
43
+ }): T;