pivotkit-react 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +339 -1
- package/README.md +2 -2
- package/dist/chunks/{chunk-IOPAM4JD.js → chunk-2AT72SLA.js} +635 -980
- package/dist/chunks/chunk-3E4NB5RZ.js +215 -0
- package/dist/chunks/{chunk-32Z33U6S.js → chunk-3WUGQPWV.js} +106 -9
- package/dist/chunks/{chunk-7CC4JHDY.js → chunk-4RS72AAA.js} +27 -8
- package/dist/chunks/{chunk-EM23V5GH.js → chunk-E6M57YLL.js} +19 -8
- package/dist/chunks/{chunk-RWYHJRQO.js → chunk-JMRTIOX4.js} +17 -7
- package/dist/chunks/chunk-RIOSIYGC.js +665 -0
- package/dist/chunks/{chunk-APB4NW4O.js → chunk-U5Q5I2D5.js} +36 -10
- package/dist/chunks/report-run-BZBFOMPF.js +12 -0
- package/dist/chunks/{unused-texts-K3VFH65P.js → unused-texts-Y4R67XSN.js} +1 -1
- package/dist/chunks/{unused-texts-de-OW4TGIVX.js → unused-texts-de-6YVPTNVS.js} +1 -1
- package/dist/echarts.js +38 -156
- package/dist/import-ui.js +765 -0
- package/dist/import-worker.js +20 -0
- package/dist/index.js +683 -244
- package/dist/labels.js +14 -10
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +768 -299
- package/dist/styles.css +322 -100
- package/package.json +9 -4
- package/types/chart-decorate.d.ts +28 -4
- package/types/chart-types.d.ts +2 -4
- package/types/data-history.d.ts +85 -0
- package/types/data-keep.d.ts +51 -0
- package/types/data-menu.d.ts +11 -0
- package/types/dom.d.ts +40 -7
- package/types/echarts.d.ts +1 -1
- package/types/export-run.d.ts +37 -3
- package/types/field-info.d.ts +32 -0
- package/types/filter.d.ts +1 -1
- package/types/icons.d.ts +1 -0
- package/types/import-host.d.ts +53 -0
- package/types/import-labels.d.ts +401 -0
- package/types/import-limits.d.ts +6 -0
- package/types/import-module.d.ts +2 -0
- package/types/import-run.d.ts +73 -0
- package/types/import-source.d.ts +32 -0
- package/types/import-steps.d.ts +121 -0
- package/types/import-ui.d.ts +108 -0
- package/types/import-worker.d.ts +1 -0
- package/types/index.d.ts +81 -11
- package/types/labels.d.ts +224 -4
- package/types/lazy-import.d.ts +4 -0
- package/types/lazy-menus.d.ts +2 -2
- package/types/levels.d.ts +3 -2
- package/types/light-tokens.d.ts +16 -0
- package/types/menu-labels.d.ts +37 -17
- package/types/menu-ops.d.ts +161 -40
- package/types/menu-topics.d.ts +9 -8
- package/types/menus.d.ts +1 -0
- package/types/names.d.ts +47 -19
- package/types/overflow.d.ts +29 -17
- package/types/place.d.ts +24 -0
- package/types/popover.d.ts +47 -5
- package/types/print-frame.d.ts +24 -0
- package/types/report-run.d.ts +14 -0
- package/types/section.d.ts +2 -2
- package/types/share-actions.d.ts +3 -3
- package/types/share.d.ts +13 -17
- package/types/theme.d.ts +2 -16
- package/types/tips.d.ts +5 -0
- package/types/toasts.d.ts +1 -1
- package/types/toolbar-panels.d.ts +11 -9
- package/types/unused-keep.d.ts +20 -0
- package/types/unused-texts.d.ts +13 -3
- package/types/unused.d.ts +1 -0
- package/types/use-export.d.ts +2 -2
- package/types/use-view-history.d.ts +12 -4
- package/types/view-ops.d.ts +65 -6
- package/types/virtual.d.ts +15 -0
- package/types/chart-layout.d.ts +0 -111
package/types/menu-labels.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare const en: {
|
|
|
11
11
|
showAs: string;
|
|
12
12
|
exportXlsx: string;
|
|
13
13
|
exportCsv: string;
|
|
14
|
+
exportHtml: string;
|
|
15
|
+
exportPrint: string;
|
|
14
16
|
copyTable: string;
|
|
15
17
|
copyDataJson: string;
|
|
16
18
|
drillCopy: string;
|
|
@@ -18,7 +20,6 @@ export declare const en: {
|
|
|
18
20
|
groupLabels: string;
|
|
19
21
|
labelPosition: string;
|
|
20
22
|
sharedView: string;
|
|
21
|
-
newReport: string;
|
|
22
23
|
valuesFilter: string;
|
|
23
24
|
};
|
|
24
25
|
back: string;
|
|
@@ -125,31 +126,35 @@ export declare const en: {
|
|
|
125
126
|
quickTitle: string;
|
|
126
127
|
quickCount: {
|
|
127
128
|
year: string;
|
|
129
|
+
quarter: string;
|
|
128
130
|
month: string;
|
|
131
|
+
week: string;
|
|
129
132
|
day: string;
|
|
130
133
|
};
|
|
131
|
-
quickLast: {
|
|
132
|
-
year: {
|
|
133
|
-
one: string;
|
|
134
|
-
other: string;
|
|
135
|
-
};
|
|
136
|
-
month: {
|
|
137
|
-
one: string;
|
|
138
|
-
other: string;
|
|
139
|
-
};
|
|
140
|
-
day: {
|
|
141
|
-
one: string;
|
|
142
|
-
other: string;
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
134
|
quickRows: string;
|
|
146
135
|
quickHidden: {
|
|
147
136
|
one: string;
|
|
148
137
|
other: string;
|
|
149
138
|
};
|
|
139
|
+
quickCurrent: {
|
|
140
|
+
year: string;
|
|
141
|
+
quarter: string;
|
|
142
|
+
month: string;
|
|
143
|
+
week: string;
|
|
144
|
+
day: string;
|
|
145
|
+
};
|
|
146
|
+
quickMore: string;
|
|
147
|
+
quickRolling: string;
|
|
148
|
+
quickUnitOf: string;
|
|
149
|
+
quickThisUnit: string;
|
|
150
150
|
anchorLabel: string;
|
|
151
151
|
anchorToday: string;
|
|
152
152
|
anchorLatest: string;
|
|
153
|
+
anchorFirst: string;
|
|
154
|
+
anchorDate: string;
|
|
155
|
+
anchorDay: string;
|
|
156
|
+
anchorDayIncomplete: string;
|
|
157
|
+
anchorUseLatest: string;
|
|
153
158
|
quickLine: string;
|
|
154
159
|
changeAbove: string;
|
|
155
160
|
yearsCombined: string;
|
|
@@ -231,7 +236,12 @@ export declare const en: {
|
|
|
231
236
|
};
|
|
232
237
|
};
|
|
233
238
|
ruleWhose: string;
|
|
239
|
+
ruleFixed: string;
|
|
234
240
|
blanksOut: string;
|
|
241
|
+
rulesBlanks: {
|
|
242
|
+
one: string;
|
|
243
|
+
other: string;
|
|
244
|
+
};
|
|
235
245
|
ruleUnit: string;
|
|
236
246
|
moveLeft: string;
|
|
237
247
|
moveRight: string;
|
|
@@ -271,7 +281,6 @@ export declare const en: {
|
|
|
271
281
|
replaceConfirm: string;
|
|
272
282
|
replaceAction: string;
|
|
273
283
|
replaceSharedConfirm: string;
|
|
274
|
-
newAlready: string;
|
|
275
284
|
save: string;
|
|
276
285
|
cancel: string;
|
|
277
286
|
expandAll: string;
|
|
@@ -341,6 +350,12 @@ export declare const en: {
|
|
|
341
350
|
topCount: string;
|
|
342
351
|
bottom: string;
|
|
343
352
|
topBy: string;
|
|
353
|
+
topTies: string;
|
|
354
|
+
topShown: {
|
|
355
|
+
one: string;
|
|
356
|
+
other: string;
|
|
357
|
+
};
|
|
358
|
+
topTiesGroups: string;
|
|
344
359
|
searchValues: string;
|
|
345
360
|
selectAll: string;
|
|
346
361
|
selectNone: string;
|
|
@@ -355,6 +370,10 @@ export declare const en: {
|
|
|
355
370
|
exportXlsx: string;
|
|
356
371
|
exportCsv: string;
|
|
357
372
|
exportPng: string;
|
|
373
|
+
exportSvg: string;
|
|
374
|
+
exportHtml: string;
|
|
375
|
+
exportPrintGroup: string;
|
|
376
|
+
exportPrint: string;
|
|
358
377
|
exportPngNeedsChart: string;
|
|
359
378
|
exportNeedsField: string;
|
|
360
379
|
copyTable: string;
|
|
@@ -362,6 +381,7 @@ export declare const en: {
|
|
|
362
381
|
toastTableCopied: string;
|
|
363
382
|
toastDataCopied: string;
|
|
364
383
|
toastCopyBlocked: string;
|
|
384
|
+
toastPrintBlocked: string;
|
|
365
385
|
drillTitle: string;
|
|
366
386
|
drillCount: {
|
|
367
387
|
one: string;
|
|
@@ -439,7 +459,6 @@ export declare const en: {
|
|
|
439
459
|
};
|
|
440
460
|
defaultName: string;
|
|
441
461
|
shareThisView: string;
|
|
442
|
-
share: string;
|
|
443
462
|
copyLink: string;
|
|
444
463
|
copyJson: string;
|
|
445
464
|
downloadView: string;
|
|
@@ -481,6 +500,7 @@ export declare const en: {
|
|
|
481
500
|
needsColField: string;
|
|
482
501
|
needsRowFields: string;
|
|
483
502
|
needsColFields: string;
|
|
503
|
+
needsValue: string;
|
|
484
504
|
expandNothing: string;
|
|
485
505
|
collapseNeedsRows: string;
|
|
486
506
|
collapseAllDone: string;
|
package/types/menu-ops.d.ts
CHANGED
|
@@ -36,20 +36,64 @@ export declare function binProblem(size: number, start: number, range: {
|
|
|
36
36
|
max: number;
|
|
37
37
|
} | null): "far" | null;
|
|
38
38
|
/**
|
|
39
|
-
* The
|
|
40
|
-
* values not selected are
|
|
39
|
+
* The pick of a field from the selected values: everything selected removes it; otherwise the
|
|
40
|
+
* values not selected are dropped (pickFilter), so values that appear in newer data are shown, as in Excel.
|
|
41
41
|
* @param {any} view
|
|
42
42
|
* @param {string} field
|
|
43
43
|
* @param {Array<unknown>} selected values (null is blank)
|
|
44
44
|
* @param {Array<unknown>} all every value of the field
|
|
45
45
|
*/
|
|
46
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
47
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
48
|
+
* A rule on the name of a field's items: a text filter ({ op, value, on }, `op` a menu's operator of
|
|
49
|
+
* RULE_OPS.text, `on` textOn()), case and runs of whitespace ignored, or null to remove the field's
|
|
50
|
+
* text filters.
|
|
51
|
+
* @param {any} view
|
|
52
|
+
* @param {string} field
|
|
53
|
+
* @param {{ op: string, value: string, on: "value" | "label" } | null} condition
|
|
54
|
+
*/
|
|
55
|
+
export declare function setLabelFilter(view: any, field: string, condition: {
|
|
56
|
+
op: string;
|
|
57
|
+
value: string;
|
|
58
|
+
on: "value" | "label";
|
|
59
|
+
} | null): any;
|
|
60
|
+
/**
|
|
61
|
+
* A text filter of a menu's rule on the name: `op` a menu's operator, the text matched as people type
|
|
62
|
+
* it (MATCH_DEFAULTS: case and runs of whitespace, a no-break space among them, do not matter), the
|
|
63
|
+
* blanks dropped.
|
|
64
|
+
* @param {string} field
|
|
65
|
+
* @param {{ op: string, value: string, on: "value" | "label" }} condition
|
|
66
|
+
*/
|
|
67
|
+
export declare const textRule: (field: string, { op, value, on }: {
|
|
68
|
+
op: string;
|
|
69
|
+
value: string;
|
|
70
|
+
on: "value" | "label";
|
|
71
|
+
}) => {
|
|
72
|
+
op: string;
|
|
73
|
+
not: boolean;
|
|
74
|
+
field: string;
|
|
75
|
+
type: string;
|
|
76
|
+
value: string;
|
|
77
|
+
on: "label" | "value";
|
|
78
|
+
match: {
|
|
79
|
+
case: "insensitive";
|
|
80
|
+
whitespace: "collapse";
|
|
81
|
+
};
|
|
82
|
+
blanks: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* What a rule on the name compares: a text field's value, else the label the table shows (a number,
|
|
86
|
+
* a grouping's "Mar 2025").
|
|
87
|
+
* @param {import("pivotkit-core").Encoded} encoded
|
|
88
|
+
* @param {string} field
|
|
89
|
+
* @returns {"value" | "label"}
|
|
90
|
+
*/
|
|
91
|
+
export declare const textOn: (encoded: import("pivotkit-core").Encoded, field: string) => "value" | "label";
|
|
92
|
+
/**
|
|
93
|
+
* Top or bottom N items of a field by a value ({ count, bottom, by, ties }), or null to remove it.
|
|
94
|
+
* `ties` "all" keeps the items tied with the last one too; without it the previous filter's ties stay.
|
|
95
|
+
* `previous` is the top filter being edited (the view's own entry); without it the field's top filters
|
|
96
|
+
* are replaced. Another top filter of the field (a view may hold two) stays.
|
|
53
97
|
*/
|
|
54
98
|
export declare function setTopFilter(view: any, field: any, top: any, previous: any): any;
|
|
55
99
|
/**
|
|
@@ -85,6 +129,8 @@ export declare const RULES_MAX = 10;
|
|
|
85
129
|
* @param {object | null} entry
|
|
86
130
|
*/
|
|
87
131
|
export declare const setRule: (view: any, field: string, previous: object | null, entry: object | null) => any;
|
|
132
|
+
/** The units of a date's quick choices, finest first (hours are left to a view's own filters). */
|
|
133
|
+
export declare const QUICK_UNITS: readonly string[];
|
|
88
134
|
/**
|
|
89
135
|
* How the Filter level's rules compare a field's items. `item`: "number" (a number typed), "date" (a
|
|
90
136
|
* date field or a day grouping: a day chosen), "group" (another grouping: one of its items chosen),
|
|
@@ -93,11 +139,12 @@ export declare const setRule: (view: any, field: string, previous: object | null
|
|
|
93
139
|
* Years combined instead of the quick choices); `quick`: the quick choices are offered (a date along
|
|
94
140
|
* the time line); `months`: "Last N months" among them (not for a grouping by year or quarter);
|
|
95
141
|
* `days`: "Last N days" too (a date field or a day grouping). `unit`: the grouping's unit, for the
|
|
96
|
-
* noun of its items.
|
|
142
|
+
* noun of its items. `units`: the units the quick choices count in (QUICK_UNITS), none finer than the
|
|
143
|
+
* grouping (by month: months, quarters, years; a date itself or by day: days and weeks too).
|
|
97
144
|
* @param {import("pivotkit-core").Encoded} encoded
|
|
98
145
|
* @param {any} view
|
|
99
146
|
* @param {string} field
|
|
100
|
-
* @returns {{ item: "number" | "date" | "group" | null, dates: boolean, cyclic: boolean, quick: boolean, months: boolean, days: boolean, unit: string | null }}
|
|
147
|
+
* @returns {{ item: "number" | "date" | "group" | null, dates: boolean, cyclic: boolean, quick: boolean, months: boolean, days: boolean, unit: string | null, units: string[] }}
|
|
101
148
|
*/
|
|
102
149
|
export declare function ruleKind(encoded: import("pivotkit-core").Encoded, view: any, field: string): {
|
|
103
150
|
item: "number" | "date" | "group" | null;
|
|
@@ -107,6 +154,7 @@ export declare function ruleKind(encoded: import("pivotkit-core").Encoded, view:
|
|
|
107
154
|
months: boolean;
|
|
108
155
|
days: boolean;
|
|
109
156
|
unit: string | null;
|
|
157
|
+
units: string[];
|
|
110
158
|
};
|
|
111
159
|
/**
|
|
112
160
|
* A rule (RULE_TYPES) in short, as the chip and the Filter level say it: "last 5 years (2022–2026)",
|
|
@@ -125,44 +173,53 @@ export declare function ruleText(view: any, f: any, { labels, locale, timeZone,
|
|
|
125
173
|
min: number;
|
|
126
174
|
max: number;
|
|
127
175
|
} | null;
|
|
128
|
-
}):
|
|
176
|
+
}): any;
|
|
129
177
|
/**
|
|
130
|
-
* The quick choice of a date field's Filter level its filters match: "all" (no relative range),
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
178
|
+
* The quick choice of a date field's Filter level its filters match: "all" (no relative range), or the
|
|
179
|
+
* direction of the field's first relative range in a unit the choices offer (`fk.units`) that is not
|
|
180
|
+
* inverted and keeps no blanks alone: "this", "last", "next" or "before", with its unit, count,
|
|
181
|
+
* anchor, whether it goes by whole calendar periods (`calendar`) and takes the current one
|
|
182
|
+
* (`includeCurrent`), and the filter itself; the field's other ranges and its comparisons are rules.
|
|
183
|
+
* For a cyclic grouping "yearsCombined" with the years its whole-year comparisons keep (`years`,
|
|
184
|
+
* ascending, from `all`, the years of the data) and those filters, "all" without any.
|
|
136
185
|
* @param {any} view
|
|
137
186
|
* @param {string} field
|
|
138
|
-
* @param {{ cyclic: boolean,
|
|
187
|
+
* @param {{ cyclic: boolean, units?: string[] }} fk ruleKind()
|
|
139
188
|
* @param {number[]} [all] the years of the data, for a cyclic grouping
|
|
140
|
-
* @returns {{ id: "all" | "
|
|
189
|
+
* @returns {{ id: "all" | "this" | "last" | "next" | "before" | "yearsCombined", unit?: string, count?: number, anchor?: string, calendar?: boolean, includeCurrent?: boolean, years?: number[], filters: any[] }}
|
|
141
190
|
*/
|
|
142
191
|
export declare function quickChoice(view: any, field: string, fk: {
|
|
143
192
|
cyclic: boolean;
|
|
144
|
-
|
|
145
|
-
days: boolean;
|
|
193
|
+
units?: string[];
|
|
146
194
|
}, all?: number[]): {
|
|
147
|
-
id: "all" | "
|
|
195
|
+
id: "all" | "this" | "last" | "next" | "before" | "yearsCombined";
|
|
196
|
+
unit?: string;
|
|
148
197
|
count?: number;
|
|
149
198
|
anchor?: string;
|
|
199
|
+
calendar?: boolean;
|
|
200
|
+
includeCurrent?: boolean;
|
|
150
201
|
years?: number[];
|
|
151
202
|
filters: any[];
|
|
152
203
|
};
|
|
153
|
-
/** A comparison of whole years of days (Jan 1 to Dec 31), as Years combined writes them. */
|
|
204
|
+
/** A comparison of whole years of days (Jan 1 to Dec 31), as Years combined writes them (the blanks kept or not). */
|
|
154
205
|
export declare const isWholeYear: (f: any) => boolean;
|
|
155
|
-
/**
|
|
156
|
-
|
|
206
|
+
/**
|
|
207
|
+
* The whole-year comparisons that keep `years` of `all` (ascending): the span they cover, less each
|
|
208
|
+
* gap in it; `blanks` as the field's rules have them.
|
|
209
|
+
*/
|
|
210
|
+
export declare function yearRules(field: any, years: any, all: any, blanks?: string): {
|
|
157
211
|
field: any;
|
|
158
212
|
type: string;
|
|
159
|
-
op:
|
|
213
|
+
op: string;
|
|
160
214
|
value: string;
|
|
161
215
|
value2: string;
|
|
216
|
+
not: any;
|
|
217
|
+
blanks: string;
|
|
162
218
|
}[];
|
|
163
219
|
/**
|
|
164
220
|
* Years combined of a cyclic grouping: its whole-year comparisons are replaced by the ones that keep
|
|
165
|
-
* `years` (yearRules)
|
|
221
|
+
* `years` (yearRules), keeping the blanks as the field's rules do (keepsBlanks); all of the data's
|
|
222
|
+
* years keep none. Its other filters, its other comparisons
|
|
166
223
|
* (rules such as "is from Jun") among them, stay.
|
|
167
224
|
* @param {any} view
|
|
168
225
|
* @param {string} field
|
|
@@ -170,28 +227,80 @@ export declare function yearRules(field: any, years: any, all: any): {
|
|
|
170
227
|
* @param {number[]} all the years of the data
|
|
171
228
|
*/
|
|
172
229
|
export declare function setYearsCombined(view: any, field: string, years: number[], all: number[]): any;
|
|
230
|
+
export type QuickRange = {
|
|
231
|
+
direction?: string;
|
|
232
|
+
unit: string;
|
|
233
|
+
count?: number;
|
|
234
|
+
anchor?: string;
|
|
235
|
+
calendar?: boolean;
|
|
236
|
+
includeCurrent?: boolean;
|
|
237
|
+
blanks?: string;
|
|
238
|
+
};
|
|
173
239
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
240
|
+
* @typedef {{ direction?: string, unit: string, count?: number, anchor?: string, calendar?: boolean, includeCurrent?: boolean, blanks?: string }} QuickRange
|
|
241
|
+
* a relative range as the quick choices and the rules write it: `direction` "last" (the default),
|
|
242
|
+
* "this", "next" or "before"; `anchor` "today" (the default), "latest", "first" or a day
|
|
243
|
+
* ("2025-06-30"); `calendar` false for rolling periods; `includeCurrent` false to leave the current
|
|
244
|
+
* unit out; `blanks` "exclude" (the default) or "include"
|
|
245
|
+
*/
|
|
246
|
+
/**
|
|
247
|
+
* A quick choice applied: `previous`, the field's quick range (quickChoice().filters[0], null for
|
|
248
|
+
* none), is replaced by `range`, or removed for All (null); without `previous` (undefined) every
|
|
249
|
+
* relative range of the field is. Its other filters, the comparisons of the item among them, stay:
|
|
250
|
+
* picks, quick choice and rules apply together.
|
|
177
251
|
* @param {any} view
|
|
178
252
|
* @param {string} field
|
|
179
|
-
* @param {
|
|
253
|
+
* @param {QuickRange | null} range
|
|
254
|
+
* @param {object | null} [previous]
|
|
255
|
+
*/
|
|
256
|
+
export declare function setQuickRange(view: any, field: string, range: QuickRange | null, previous?: object | null): any;
|
|
257
|
+
/**
|
|
258
|
+
* A relative range as the quick choices and the rules write it (QuickRange): only what differs from
|
|
259
|
+
* the defaults, no count for "this", no `includeCurrent` for a rolling range (it counts from the
|
|
260
|
+
* moment itself), not inverted.
|
|
261
|
+
* @param {string} field
|
|
262
|
+
* @param {QuickRange} range
|
|
180
263
|
*/
|
|
181
|
-
export declare
|
|
264
|
+
export declare const relativeRule: (field: string, { direction, unit, count, anchor, calendar, includeCurrent, blanks }: QuickRange) => {
|
|
265
|
+
field: string;
|
|
266
|
+
type: string;
|
|
267
|
+
direction?: string | undefined;
|
|
182
268
|
unit: string;
|
|
183
|
-
count
|
|
184
|
-
|
|
185
|
-
|
|
269
|
+
count?: number | undefined;
|
|
270
|
+
calendar?: boolean | undefined;
|
|
271
|
+
includeCurrent?: boolean | undefined;
|
|
272
|
+
anchor?: string | undefined;
|
|
273
|
+
not: boolean;
|
|
274
|
+
blanks: string;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* What the field's relative ranges count from: "today" (not written), "latest" or "first", the data's
|
|
278
|
+
* latest or first record, or a day ("2025-06-30"). Every range of the field takes it; the view stays
|
|
279
|
+
* the same without one.
|
|
280
|
+
* @param {any} view
|
|
281
|
+
* @param {string} field
|
|
282
|
+
* @param {string} anchor
|
|
283
|
+
*/
|
|
284
|
+
export declare function setAnchor(view: any, field: string, anchor: string): any;
|
|
285
|
+
/** The filter types of a field's rules on its items, whose blanks "Also keep items without a value" decides. */
|
|
286
|
+
export declare const ITEM_RULE_TYPES: readonly string[];
|
|
186
287
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
288
|
+
* Whether a field's rules on its items (its quick choice among them) keep its blank items: each of
|
|
289
|
+
* them has `blanks: "include"`, and there is one.
|
|
189
290
|
* @param {any} view
|
|
190
291
|
* @param {string} field
|
|
191
|
-
* @param {"today" | "latest"} anchor
|
|
192
292
|
*/
|
|
193
|
-
export declare function
|
|
194
|
-
/**
|
|
293
|
+
export declare function keepsBlanks(view: any, field: string): any;
|
|
294
|
+
/**
|
|
295
|
+
* "Also keep items without a value": every rule of a field on its items (ITEM_RULE_TYPES, its quick
|
|
296
|
+
* choice among them) keeps the blank items, or none does. A rule on the total has no blanks of its
|
|
297
|
+
* own; only blanks stay possible through the picks ("(blank)" alone ticked).
|
|
298
|
+
* @param {any} view
|
|
299
|
+
* @param {string} field
|
|
300
|
+
* @param {boolean} keep
|
|
301
|
+
*/
|
|
302
|
+
export declare function setRuleBlanks(view: any, field: string, keep: boolean): any;
|
|
303
|
+
/** Takes the whole filter of a field off: its picks, its quick choice and its rules (a loaded view's blank filter too); Top N stays. */
|
|
195
304
|
export declare const resetFilter: (view: any, field: any) => any;
|
|
196
305
|
/**
|
|
197
306
|
* The totals a rule on the total compares, as the table's Grand Total shows them: one per item of
|
|
@@ -251,7 +360,8 @@ export declare const TOTALS: readonly string[];
|
|
|
251
360
|
/**
|
|
252
361
|
* Why a total of Options would change nothing in this view, or null when it changes something: a
|
|
253
362
|
* grand total row needs a field in Rows (without one the only row is the total), a grand total column
|
|
254
|
-
* one in Columns, subtotals two or more fields on their axis
|
|
363
|
+
* one in Columns, subtotals two or more fields on their axis, and every total a value (without one a
|
|
364
|
+
* total has no number, and the table draws none). The key names the text (labels).
|
|
255
365
|
* @param {any} view
|
|
256
366
|
* @param {string} key one of TOTALS
|
|
257
367
|
* @returns {string | null}
|
|
@@ -284,3 +394,14 @@ export declare function filterState(view: any, field: string, state: {
|
|
|
284
394
|
} | null;
|
|
285
395
|
rules?: string[];
|
|
286
396
|
} | null | undefined, labels: import("./labels.js").UiLabels, locale: string): string | null;
|
|
397
|
+
/**
|
|
398
|
+
* The rows of a date column in the dates of a relative range (pivotkit-core's relativeDateRange:
|
|
399
|
+
* both bounds included, a day or a minute, `from` null for "before"): what a quick choice keeps.
|
|
400
|
+
* @param {{ from: string | null, to: string }} range
|
|
401
|
+
* @param {ArrayLike<unknown>} dict the column's dictionary (dates as wall-clock ms)
|
|
402
|
+
* @param {ArrayLike<number>} counts rows per dictionary code
|
|
403
|
+
*/
|
|
404
|
+
export declare function rowsInRange(range: {
|
|
405
|
+
from: string | null;
|
|
406
|
+
to: string;
|
|
407
|
+
}, dict: ArrayLike<unknown>, counts: ArrayLike<number>): number;
|
package/types/menu-topics.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ export type Topic = {
|
|
|
36
36
|
changed?: boolean;
|
|
37
37
|
icon?: string;
|
|
38
38
|
titled?: boolean;
|
|
39
|
-
heading?: string;
|
|
40
39
|
info?: string;
|
|
41
40
|
hidden?: boolean;
|
|
42
41
|
levelTitle?: string;
|
|
@@ -48,12 +47,14 @@ export type Topic = {
|
|
|
48
47
|
text: string;
|
|
49
48
|
focus?: string;
|
|
50
49
|
choice?: Choice;
|
|
50
|
+
keywords?: string;
|
|
51
51
|
}>;
|
|
52
52
|
searchFor?: (query: string) => Array<{
|
|
53
53
|
id: string;
|
|
54
54
|
text: string;
|
|
55
55
|
focus?: string;
|
|
56
56
|
choice: Choice;
|
|
57
|
+
keywords?: string;
|
|
57
58
|
}>;
|
|
58
59
|
};
|
|
59
60
|
/**
|
|
@@ -73,13 +74,12 @@ export type Topic = {
|
|
|
73
74
|
* "panel" a row that opens a level with a form (the menu's component draws it, by the topic's id).
|
|
74
75
|
* `state` is what is set, in short, on the row's right; `changed` marks a setting that is not the
|
|
75
76
|
* default; `info` the id of an explanation next to the level's title. `hidden`: a level a choice
|
|
76
|
-
* opens, with no row of its own (`levelTitle` its title); `note`: a line under its choices
|
|
77
|
-
* `heading`: a group heading above a "menu" or "panel" row on the first level, as an inline topic's title.
|
|
77
|
+
* opens, with no row of its own (`levelTitle` its title); `note`: a line under its choices.
|
|
78
78
|
* @typedef {{ id: string, title: string, kind: "segmented" | "inline" | "menu" | "panel",
|
|
79
79
|
* groups?: Array<{ title?: string, choices: Choice[] }>, state?: string | null, changed?: boolean,
|
|
80
|
-
* icon?: string, titled?: boolean,
|
|
81
|
-
* keywords?: string, searchExtra?: Array<{ id: string, text: string, focus?: string, choice?: Choice }>,
|
|
82
|
-
* searchFor?: (query: string) => Array<{ id: string, text: string, focus?: string, choice: Choice }> }} Topic
|
|
80
|
+
* icon?: string, titled?: boolean, info?: string, hidden?: boolean, levelTitle?: string, note?: string | null, noteId?: string,
|
|
81
|
+
* keywords?: string, searchExtra?: Array<{ id: string, text: string, focus?: string, choice?: Choice, keywords?: string }>,
|
|
82
|
+
* searchFor?: (query: string) => Array<{ id: string, text: string, focus?: string, choice: Choice, keywords?: string }> }} Topic
|
|
83
83
|
* `keywords`: more words the search finds the topic's entries by (a choice's own `keywords` put it
|
|
84
84
|
* first among the hits for them); `searchExtra`: more entries of a panel topic (a part of its level,
|
|
85
85
|
* or a quick choice of it); `searchFor`: entries made from what is typed ("last 3 years", "from 2022").
|
|
@@ -178,7 +178,7 @@ export declare function valueTopics({ view, index, types, labels, locale, defaul
|
|
|
178
178
|
}): Topic[];
|
|
179
179
|
/**
|
|
180
180
|
* The topics of the Options menu: the totals (each a switch; one that would change nothing in this
|
|
181
|
-
* view is
|
|
181
|
+
* view is disabled and unticked, with the reason), Expand all and Collapse all (each only when it changes something,
|
|
182
182
|
* else with the reason), and help: Show tips, Show explanations, Show dismissed tips again, and the
|
|
183
183
|
* keyboard shortcuts (a level). What each does is the report's (`act`).
|
|
184
184
|
* @param {{ view: any, labels: any, folding: { canExpand: boolean, canCollapse: boolean, why: { expand?: string | null, collapse?: string | null } },
|
|
@@ -240,11 +240,12 @@ export type SearchEntry = {
|
|
|
240
240
|
topic: Topic;
|
|
241
241
|
choice?: Choice;
|
|
242
242
|
focus?: string;
|
|
243
|
+
keywords?: string;
|
|
243
244
|
};
|
|
244
245
|
/**
|
|
245
246
|
* One entry of a menu's search: a choice of a topic (with the path to it), or a topic's level
|
|
246
247
|
* (`focus`: the part of it to show and focus).
|
|
247
|
-
* @typedef {{ id: string, text: string, path: string, topic: Topic, choice?: Choice, focus?: string }} SearchEntry
|
|
248
|
+
* @typedef {{ id: string, text: string, path: string, topic: Topic, choice?: Choice, focus?: string, keywords?: string }} SearchEntry
|
|
248
249
|
*/
|
|
249
250
|
/**
|
|
250
251
|
* Every entry of a menu, for its search: each choice with the titles above it as its path ("Number
|
package/types/menus.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AxisMenu, FilterMenu, 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 { DataMenu } from "./data-menu.jsx";
|
|
5
6
|
export { addMenuTexts, hasMenuTexts, menuLabels } from "./menu-labels.js";
|
|
6
7
|
export { storedViews } from "./view-store.js";
|
|
7
8
|
export { prepareExporters, runExport } from "./export-run.js";
|
package/types/names.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare function valueConditionText(view: any, f: {
|
|
|
42
42
|
op: string;
|
|
43
43
|
value: number;
|
|
44
44
|
value2?: number;
|
|
45
|
-
}, labels: import("./labels.js").UiLabels, locale: string):
|
|
45
|
+
}, labels: import("./labels.js").UiLabels, locale: string): any;
|
|
46
46
|
/** A calendar day ("2022-03-01") as the locale writes a date. */
|
|
47
47
|
export declare const dayText: (iso: any, locale: any) => string;
|
|
48
48
|
/** A calendar day of wall-clock ms ("2022-03-01"), as a date column holds dates. */
|
|
@@ -51,24 +51,44 @@ export declare const isoDay: (ms: any) => string;
|
|
|
51
51
|
* The days a relative filter keeps, both included (pivotkit-core's relativeDateRange): counted back
|
|
52
52
|
* from today (`now`, default the current time) or, with `anchor: "latest"`, from the data's latest
|
|
53
53
|
* date (`latest`, wall-clock ms); null without one then, or for a range that leaves what a Date holds.
|
|
54
|
-
* @param {{ unit: string, count
|
|
54
|
+
* @param {{ unit: string, count?: number, anchor?: string, direction?: string, calendar?: boolean, includeCurrent?: boolean }} f a `relative` filter
|
|
55
55
|
* @param {string} timeZone the data's
|
|
56
56
|
* @param {Date | number | string} [now]
|
|
57
57
|
* @param {number | null} [latest]
|
|
58
|
-
* @
|
|
58
|
+
* @param {{ first?: number | null, weekStart?: number }} [more] the data's first date (anchor "first"), the view's first day of a week
|
|
59
|
+
* @returns {{ from: string, to: string } | null} null too for a range without a start ("before")
|
|
59
60
|
*/
|
|
60
|
-
export declare
|
|
61
|
+
export declare function relativeDays(f: {
|
|
61
62
|
unit: string;
|
|
62
|
-
count
|
|
63
|
+
count?: number;
|
|
63
64
|
anchor?: string;
|
|
64
|
-
|
|
65
|
+
direction?: string;
|
|
66
|
+
calendar?: boolean;
|
|
67
|
+
includeCurrent?: boolean;
|
|
68
|
+
}, timeZone: string, now?: Date | number | string, latest?: number | null, more?: {
|
|
69
|
+
first?: number | null;
|
|
70
|
+
weekStart?: number;
|
|
71
|
+
}): {
|
|
65
72
|
from: string;
|
|
66
73
|
to: string;
|
|
67
74
|
} | null;
|
|
68
75
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
76
|
+
* Whether a relative range is said in short with its periods ("last 3 months (Aug–Oct 2026)", "this
|
|
77
|
+
* quarter (Q4 2026)"): the last N or this day, week, month, quarter or year, in whole calendar
|
|
78
|
+
* periods, counted from today or from the latest record. The others are said with their dates.
|
|
79
|
+
* @param {{ unit: string, direction?: string, calendar?: boolean, includeCurrent?: boolean, anchor?: string }} f
|
|
80
|
+
*/
|
|
81
|
+
export declare const plainRange: (f: {
|
|
82
|
+
unit: string;
|
|
83
|
+
direction?: string;
|
|
84
|
+
calendar?: boolean;
|
|
85
|
+
includeCurrent?: boolean;
|
|
86
|
+
anchor?: string;
|
|
87
|
+
}) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* A range of days as the unit writes it: "2022–2026" for years, "Q4 2025–Q3 2026" for quarters, "Dec
|
|
90
|
+
* 2025–Nov 2026" for months, dates for weeks and days; one period alone ("2026").
|
|
91
|
+
* @param {{ from: string, to: string }} range ISO days, both included (a minute's day is read)
|
|
72
92
|
* @param {string} unit
|
|
73
93
|
* @param {string} locale
|
|
74
94
|
*/
|
|
@@ -120,21 +140,25 @@ export declare function rangeShare(range: {
|
|
|
120
140
|
* (2026)". With the data's span, the data's share of them: "last 2 years (2025; 2026 has no data)",
|
|
121
141
|
* "this year (2026 has no data)". Anchored at the data's latest date: "last 12 months to Dec 2025",
|
|
122
142
|
* its days only when the data do not cover them all.
|
|
123
|
-
* @param {{ unit: string, count
|
|
143
|
+
* @param {{ unit: string, count?: number, anchor?: string, direction?: string, calendar?: boolean, includeCurrent?: boolean }} f a `relative` filter
|
|
124
144
|
* @param {import("./labels.js").UiLabels} labels
|
|
125
145
|
* @param {string} locale
|
|
126
146
|
* @param {string} timeZone the data's
|
|
127
147
|
* @param {Date | number | string} [now] today, default the current time
|
|
128
148
|
* @param {{ min: number, max: number } | null} [span] the data's first and last date (wall-clock ms)
|
|
149
|
+
* @param {number} [weekStart] the view's first day of a week, 1 (Monday, the default) to 7
|
|
129
150
|
*/
|
|
130
151
|
export declare function relativeText(f: {
|
|
131
152
|
unit: string;
|
|
132
|
-
count
|
|
153
|
+
count?: number;
|
|
133
154
|
anchor?: string;
|
|
155
|
+
direction?: string;
|
|
156
|
+
calendar?: boolean;
|
|
157
|
+
includeCurrent?: boolean;
|
|
134
158
|
}, labels: import("./labels.js").UiLabels, locale: string, timeZone: string, now?: Date | number | string, span?: {
|
|
135
159
|
min: number;
|
|
136
160
|
max: number;
|
|
137
|
-
} | null):
|
|
161
|
+
} | null, weekStart?: number): any;
|
|
138
162
|
/**
|
|
139
163
|
* The years two calendar days bound as whole years (Jan 1 to Dec 31), or null: the days a comparison
|
|
140
164
|
* on a date grouping's source dates gets from Years combined.
|
|
@@ -144,7 +168,7 @@ export declare function wholeYears(from: any, to: any): [string, string] | null;
|
|
|
144
168
|
/**
|
|
145
169
|
* A comparison of the item itself in short: "from 2022", "2022 to 2024" for a date or a date
|
|
146
170
|
* grouping, "≥ 10" for a number. `labelOf` gives an item's label (a grouping's "Mar 2025").
|
|
147
|
-
* @param {{ op: string, value: number | string, value2?: number | string }} f a `compare` filter
|
|
171
|
+
* @param {{ op: string, value: number | string, value2?: number | string, precision?: string, not?: boolean }} f a `compare` filter
|
|
148
172
|
* @param {import("./labels.js").UiLabels} labels
|
|
149
173
|
* @param {string} locale
|
|
150
174
|
* @param {{ date: boolean, labelOf?: (value: number) => string | undefined }} kind
|
|
@@ -153,18 +177,20 @@ export declare function compareText(f: {
|
|
|
153
177
|
op: string;
|
|
154
178
|
value: number | string;
|
|
155
179
|
value2?: number | string;
|
|
180
|
+
precision?: string;
|
|
181
|
+
not?: boolean;
|
|
156
182
|
}, labels: import("./labels.js").UiLabels, locale: string, { date, labelOf }: {
|
|
157
183
|
date: boolean;
|
|
158
184
|
labelOf?: (value: number) => string | undefined;
|
|
159
|
-
}):
|
|
185
|
+
}): any;
|
|
160
186
|
/**
|
|
161
187
|
* A rule on a field's items in short, as its chip and its menu say it: "last 5 years (2022–2026)",
|
|
162
188
|
* "from 2022", "contains “an”".
|
|
163
|
-
* @param {{ type: string, op?: string, value?: any, value2?: any, unit?: string, count?: number }} f a `relative`, `compare` or `
|
|
189
|
+
* @param {{ type: string, op?: string, value?: any, value2?: any, unit?: string, count?: number, not?: boolean }} f a `relative`, `compare` or `text` filter
|
|
164
190
|
* @param {import("./labels.js").UiLabels} labels
|
|
165
191
|
* @param {string} locale
|
|
166
|
-
* @param {{ timeZone: string, date: boolean, labelOf?: (value: number) => string | undefined, span?: { min: number, max: number } | null }} kind
|
|
167
|
-
* `span`: the data's first and last date, for the data's share of a relative range
|
|
192
|
+
* @param {{ timeZone: string, date: boolean, labelOf?: (value: number) => string | undefined, span?: { min: number, max: number } | null, weekStart?: number }} kind
|
|
193
|
+
* `span`: the data's first and last date, for the data's share of a relative range; `weekStart`: the view's first day of a week
|
|
168
194
|
*/
|
|
169
195
|
export declare function itemRuleText(f: {
|
|
170
196
|
type: string;
|
|
@@ -173,7 +199,8 @@ export declare function itemRuleText(f: {
|
|
|
173
199
|
value2?: any;
|
|
174
200
|
unit?: string;
|
|
175
201
|
count?: number;
|
|
176
|
-
|
|
202
|
+
not?: boolean;
|
|
203
|
+
}, labels: import("./labels.js").UiLabels, locale: string, { timeZone, date, labelOf, span, weekStart }: {
|
|
177
204
|
timeZone: string;
|
|
178
205
|
date: boolean;
|
|
179
206
|
labelOf?: (value: number) => string | undefined;
|
|
@@ -181,7 +208,8 @@ export declare function itemRuleText(f: {
|
|
|
181
208
|
min: number;
|
|
182
209
|
max: number;
|
|
183
210
|
} | null;
|
|
184
|
-
|
|
211
|
+
weekStart?: number;
|
|
212
|
+
}): any;
|
|
185
213
|
/** The name of a derived field for a grouping, in the labels' language: "Date by month", "Amount (by 100)". */
|
|
186
214
|
export declare function groupingName(source: any, unit: any, labels: any, size: any): string;
|
|
187
215
|
/** The zone a click on a field of the field list puts it in: numbers to Values, the rest to Rows. */
|