pivotkit-react 0.4.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 +219 -1
- package/README.md +2 -2
- package/dist/chunks/{chunk-YITKWZ4L.js → chunk-2AT72SLA.js} +604 -505
- package/dist/chunks/{chunk-ZYEYZSYL.js → chunk-3E4NB5RZ.js} +30 -2
- package/dist/chunks/{chunk-6MDAL3IO.js → chunk-3WUGQPWV.js} +78 -6
- package/dist/chunks/{chunk-WB4GKWFQ.js → chunk-4RS72AAA.js} +26 -4
- 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-XN55BQ4M.js → chunk-RIOSIYGC.js} +54 -7
- package/dist/chunks/{chunk-LEN5RPBM.js → chunk-U5Q5I2D5.js} +34 -5
- 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 +8 -12
- package/dist/index.js +97 -82
- package/dist/labels.js +6 -6
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +650 -245
- package/dist/styles.css +207 -93
- package/package.json +8 -4
- package/types/chart-decorate.d.ts +28 -4
- package/types/chart-types.d.ts +2 -4
- package/types/echarts.d.ts +1 -1
- package/types/export-run.d.ts +37 -3
- package/types/filter.d.ts +1 -1
- package/types/icons.d.ts +1 -0
- package/types/import-labels.d.ts +41 -0
- package/types/import-limits.d.ts +6 -0
- package/types/index.d.ts +25 -7
- package/types/labels.d.ts +198 -2
- package/types/light-tokens.d.ts +16 -0
- package/types/menu-labels.d.ts +37 -14
- package/types/menu-ops.d.ts +161 -40
- package/types/menu-topics.d.ts +7 -4
- package/types/names.d.ts +47 -19
- package/types/place.d.ts +24 -0
- package/types/print-frame.d.ts +24 -0
- package/types/report-run.d.ts +14 -0
- 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/toolbar-panels.d.ts +5 -4
- package/types/unused-texts.d.ts +13 -3
- package/types/use-export.d.ts +2 -2
- package/types/view-ops.d.ts +65 -6
- 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;
|
|
@@ -124,31 +126,35 @@ export declare const en: {
|
|
|
124
126
|
quickTitle: string;
|
|
125
127
|
quickCount: {
|
|
126
128
|
year: string;
|
|
129
|
+
quarter: string;
|
|
127
130
|
month: string;
|
|
131
|
+
week: string;
|
|
128
132
|
day: string;
|
|
129
133
|
};
|
|
130
|
-
quickLast: {
|
|
131
|
-
year: {
|
|
132
|
-
one: string;
|
|
133
|
-
other: string;
|
|
134
|
-
};
|
|
135
|
-
month: {
|
|
136
|
-
one: string;
|
|
137
|
-
other: string;
|
|
138
|
-
};
|
|
139
|
-
day: {
|
|
140
|
-
one: string;
|
|
141
|
-
other: string;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
134
|
quickRows: string;
|
|
145
135
|
quickHidden: {
|
|
146
136
|
one: string;
|
|
147
137
|
other: string;
|
|
148
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;
|
|
149
150
|
anchorLabel: string;
|
|
150
151
|
anchorToday: string;
|
|
151
152
|
anchorLatest: string;
|
|
153
|
+
anchorFirst: string;
|
|
154
|
+
anchorDate: string;
|
|
155
|
+
anchorDay: string;
|
|
156
|
+
anchorDayIncomplete: string;
|
|
157
|
+
anchorUseLatest: string;
|
|
152
158
|
quickLine: string;
|
|
153
159
|
changeAbove: string;
|
|
154
160
|
yearsCombined: string;
|
|
@@ -230,7 +236,12 @@ export declare const en: {
|
|
|
230
236
|
};
|
|
231
237
|
};
|
|
232
238
|
ruleWhose: string;
|
|
239
|
+
ruleFixed: string;
|
|
233
240
|
blanksOut: string;
|
|
241
|
+
rulesBlanks: {
|
|
242
|
+
one: string;
|
|
243
|
+
other: string;
|
|
244
|
+
};
|
|
234
245
|
ruleUnit: string;
|
|
235
246
|
moveLeft: string;
|
|
236
247
|
moveRight: string;
|
|
@@ -339,6 +350,12 @@ export declare const en: {
|
|
|
339
350
|
topCount: string;
|
|
340
351
|
bottom: string;
|
|
341
352
|
topBy: string;
|
|
353
|
+
topTies: string;
|
|
354
|
+
topShown: {
|
|
355
|
+
one: string;
|
|
356
|
+
other: string;
|
|
357
|
+
};
|
|
358
|
+
topTiesGroups: string;
|
|
342
359
|
searchValues: string;
|
|
343
360
|
selectAll: string;
|
|
344
361
|
selectNone: string;
|
|
@@ -353,6 +370,10 @@ export declare const en: {
|
|
|
353
370
|
exportXlsx: string;
|
|
354
371
|
exportCsv: string;
|
|
355
372
|
exportPng: string;
|
|
373
|
+
exportSvg: string;
|
|
374
|
+
exportHtml: string;
|
|
375
|
+
exportPrintGroup: string;
|
|
376
|
+
exportPrint: string;
|
|
356
377
|
exportPngNeedsChart: string;
|
|
357
378
|
exportNeedsField: string;
|
|
358
379
|
copyTable: string;
|
|
@@ -360,6 +381,7 @@ export declare const en: {
|
|
|
360
381
|
toastTableCopied: string;
|
|
361
382
|
toastDataCopied: string;
|
|
362
383
|
toastCopyBlocked: string;
|
|
384
|
+
toastPrintBlocked: string;
|
|
363
385
|
drillTitle: string;
|
|
364
386
|
drillCount: {
|
|
365
387
|
one: string;
|
|
@@ -478,6 +500,7 @@ export declare const en: {
|
|
|
478
500
|
needsColField: string;
|
|
479
501
|
needsRowFields: string;
|
|
480
502
|
needsColFields: string;
|
|
503
|
+
needsValue: string;
|
|
481
504
|
expandNothing: string;
|
|
482
505
|
collapseNeedsRows: string;
|
|
483
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
|
@@ -47,12 +47,14 @@ export type Topic = {
|
|
|
47
47
|
text: string;
|
|
48
48
|
focus?: string;
|
|
49
49
|
choice?: Choice;
|
|
50
|
+
keywords?: string;
|
|
50
51
|
}>;
|
|
51
52
|
searchFor?: (query: string) => Array<{
|
|
52
53
|
id: string;
|
|
53
54
|
text: string;
|
|
54
55
|
focus?: string;
|
|
55
56
|
choice: Choice;
|
|
57
|
+
keywords?: string;
|
|
56
58
|
}>;
|
|
57
59
|
};
|
|
58
60
|
/**
|
|
@@ -76,8 +78,8 @@ export type Topic = {
|
|
|
76
78
|
* @typedef {{ id: string, title: string, kind: "segmented" | "inline" | "menu" | "panel",
|
|
77
79
|
* groups?: Array<{ title?: string, choices: Choice[] }>, state?: string | null, changed?: boolean,
|
|
78
80
|
* icon?: string, titled?: boolean, info?: string, hidden?: boolean, levelTitle?: string, note?: string | null, noteId?: string,
|
|
79
|
-
* keywords?: string, searchExtra?: Array<{ id: string, text: string, focus?: string, choice?: Choice }>,
|
|
80
|
-
* searchFor?: (query: string) => Array<{ id: string, text: string, focus?: string, choice: Choice }> }} Topic
|
|
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
|
|
81
83
|
* `keywords`: more words the search finds the topic's entries by (a choice's own `keywords` put it
|
|
82
84
|
* first among the hits for them); `searchExtra`: more entries of a panel topic (a part of its level,
|
|
83
85
|
* or a quick choice of it); `searchFor`: entries made from what is typed ("last 3 years", "from 2022").
|
|
@@ -176,7 +178,7 @@ export declare function valueTopics({ view, index, types, labels, locale, defaul
|
|
|
176
178
|
}): Topic[];
|
|
177
179
|
/**
|
|
178
180
|
* The topics of the Options menu: the totals (each a switch; one that would change nothing in this
|
|
179
|
-
* view is
|
|
181
|
+
* view is disabled and unticked, with the reason), Expand all and Collapse all (each only when it changes something,
|
|
180
182
|
* else with the reason), and help: Show tips, Show explanations, Show dismissed tips again, and the
|
|
181
183
|
* keyboard shortcuts (a level). What each does is the report's (`act`).
|
|
182
184
|
* @param {{ view: any, labels: any, folding: { canExpand: boolean, canCollapse: boolean, why: { expand?: string | null, collapse?: string | null } },
|
|
@@ -238,11 +240,12 @@ export type SearchEntry = {
|
|
|
238
240
|
topic: Topic;
|
|
239
241
|
choice?: Choice;
|
|
240
242
|
focus?: string;
|
|
243
|
+
keywords?: string;
|
|
241
244
|
};
|
|
242
245
|
/**
|
|
243
246
|
* One entry of a menu's search: a choice of a topic (with the path to it), or a topic's level
|
|
244
247
|
* (`focus`: the part of it to show and focus).
|
|
245
|
-
* @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
|
|
246
249
|
*/
|
|
247
250
|
/**
|
|
248
251
|
* Every entry of a menu, for its search: each choice with the titles above it as its path ("Number
|
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. */
|
package/types/place.d.ts
CHANGED
|
@@ -85,3 +85,27 @@ export declare function fromOrigin<T extends {
|
|
|
85
85
|
top: number;
|
|
86
86
|
left: number;
|
|
87
87
|
}): T;
|
|
88
|
+
/**
|
|
89
|
+
* Whether a point is on the way from an anchor to its popover: inside the smallest convex shape that
|
|
90
|
+
* holds both boxes (their convex hull). A pointer moving in a straight line from anywhere on the one
|
|
91
|
+
* to anywhere on the other stays inside it, also where the popover is moved aside to stay in the
|
|
92
|
+
* window and the way runs beside the anchor first, and in the gap between them. A hover tip stays
|
|
93
|
+
* while the pointer is there (info.jsx), whatever time the move takes.
|
|
94
|
+
* @param {{ top: number, bottom: number, left: number, right: number }} anchor getBoundingClientRect()
|
|
95
|
+
* @param {{ top: number, bottom: number, left: number, right: number }} popover getBoundingClientRect()
|
|
96
|
+
* @param {{ x: number, y: number } | null} point client coordinates
|
|
97
|
+
*/
|
|
98
|
+
export declare function onTheWay(anchor: {
|
|
99
|
+
top: number;
|
|
100
|
+
bottom: number;
|
|
101
|
+
left: number;
|
|
102
|
+
right: number;
|
|
103
|
+
}, popover: {
|
|
104
|
+
top: number;
|
|
105
|
+
bottom: number;
|
|
106
|
+
left: number;
|
|
107
|
+
right: number;
|
|
108
|
+
}, point: {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
} | null): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** How long the frame may take to load before printing is given up as blocked (ms). */
|
|
2
|
+
export declare const PRINT_LOAD_TIMEOUT = 5000;
|
|
3
|
+
/**
|
|
4
|
+
* The parts of a report's HTML for the frame: its stylesheet, language, title and body nodes. The
|
|
5
|
+
* stylesheet is cut out of the text before it is parsed (a <style> parsed on a page with a strict
|
|
6
|
+
* policy is reported as a violation, also in a document of DOMParser); meta elements and scripts are
|
|
7
|
+
* left out (the frame is filled as DOM).
|
|
8
|
+
* @param {string} html
|
|
9
|
+
* @param {DOMParser} parser
|
|
10
|
+
*/
|
|
11
|
+
export declare function printParts(html: string, parser: DOMParser): {
|
|
12
|
+
css: string;
|
|
13
|
+
lang: string;
|
|
14
|
+
dir: string;
|
|
15
|
+
title: string;
|
|
16
|
+
body: HTMLElement;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Prints the report's HTML from a hidden frame in `container`.
|
|
20
|
+
* @param {string} html pivotkit-report's HTML (format "html", chartEmbed "inline")
|
|
21
|
+
* @param {HTMLElement} container the report's root
|
|
22
|
+
* @returns {Promise<boolean>} false when the frame could not be used (blocked by the page)
|
|
23
|
+
*/
|
|
24
|
+
export declare function printHtml(html: string, container: HTMLElement): Promise<boolean>;
|