derive-dashboards 0.3.0 → 0.5.1
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/README.md +6 -3
- package/dist/cli/check.mjs +36 -1
- package/dist/cli/doctor.mjs +2 -2
- package/dist/core/document/display-entries.mjs +48 -0
- package/dist/core/document/display.d.mts +15 -3
- package/dist/core/document/display.mjs +35 -11
- package/dist/core/engine/filter.mjs +4 -2
- package/dist/core/engine/version.d.mts +1 -1
- package/dist/core/engine/version.mjs +1 -1
- package/dist/core/error/codes.d.mts +2 -0
- package/dist/core/error/codes.mjs +2 -0
- package/dist/core/index.d.mts +4 -3
- package/dist/core/index.mjs +8 -7
- package/dist/core/model/catalog/check.mjs +11 -5
- package/dist/core/model/member.mjs +6 -1
- package/dist/core/model/validate/members.mjs +31 -1
- package/dist/core/oracle/visibility.mjs +3 -1
- package/dist/core/query/drill/line.mjs +2 -2
- package/dist/core/query/to-wire.d.mts +7 -0
- package/dist/core/query/to-wire.mjs +18 -7
- package/dist/core/result/additive.d.mts +9 -0
- package/dist/core/result/additive.mjs +59 -0
- package/dist/core/result/columns.mjs +8 -2
- package/dist/core/result/types.d.mts +12 -0
- package/dist/core/schema/answer-parts.mjs +2 -1
- package/dist/core/schema/answers.d.mts +6 -0
- package/dist/core/types/api.d.mts +1 -1
- package/dist/core/types/api.mjs +1 -1
- package/dist/handler.mjs +10 -2
- package/dist/index.mjs +1 -1
- package/dist/llms.txt +1 -1
- package/dist/react/History.mjs +1 -1
- package/dist/react/Tile.mjs +18 -10
- package/dist/react/builder/FilterEditor.mjs +2 -7
- package/dist/react/builder/Preview.mjs +1 -1
- package/dist/react/columns.mjs +15 -0
- package/dist/react/context.d.mts +7 -0
- package/dist/react/context.mjs +3 -0
- package/dist/react/digits.mjs +46 -0
- package/dist/react/drill/Bars.mjs +2 -1
- package/dist/react/drill/Controls.mjs +2 -1
- package/dist/react/drill/Header.mjs +2 -1
- package/dist/react/drill/Items.mjs +6 -1
- package/dist/react/drill/Notes.mjs +2 -1
- package/dist/react/drill/item-parts.mjs +2 -1
- package/dist/react/english.mjs +4 -0
- package/dist/react/export/ExportButton.mjs +23 -0
- package/dist/react/export/csv.d.mts +9 -0
- package/dist/react/export/csv.mjs +42 -0
- package/dist/react/export/download.d.mts +5 -0
- package/dist/react/export/download.mjs +61 -0
- package/dist/react/format-time.d.mts +15 -0
- package/dist/react/format-time.mjs +71 -0
- package/dist/react/format.d.mts +6 -10
- package/dist/react/format.mjs +55 -87
- package/dist/react/index.d.mts +10 -4
- package/dist/react/index.mjs +10 -4
- package/dist/react/messages.d.mts +8 -0
- package/dist/react/renderers/entries.mjs +15 -0
- package/dist/react/renderers/exact.d.mts +6 -0
- package/dist/react/renderers/exact.mjs +68 -0
- package/dist/react/renderers/index.d.mts +5 -5
- package/dist/react/renderers/index.mjs +72 -83
- package/dist/react/renderers/list.mjs +5 -17
- package/dist/react/renderers/table-cells.mjs +130 -0
- package/dist/react/renderers/table-fit.mjs +52 -0
- package/dist/react/renderers/table-head.mjs +47 -0
- package/dist/react/renderers/table-measure.mjs +49 -0
- package/dist/react/renderers/table-row.mjs +61 -0
- package/dist/react/renderers/table-scale.mjs +70 -0
- package/dist/react/renderers/table-sort.mjs +99 -0
- package/dist/react/renderers/table.d.mts +3 -0
- package/dist/react/renderers/table.mjs +121 -0
- package/dist/react/series-points.d.mts +18 -0
- package/dist/react/series-points.mjs +19 -0
- package/dist/react/series.d.mts +7 -10
- package/dist/react/series.mjs +7 -10
- package/dist/react/theme-unlayered.css +3144 -0
- package/dist/react/theme-unlayered.css.d.ts +1 -0
- package/dist/react/theme.css +379 -8
- package/dist/recharts/axes.mjs +13 -10
- package/dist/recharts/axis.mjs +25 -1
- package/dist/recharts/bar.d.mts +2 -1
- package/dist/recharts/bar.mjs +29 -6
- package/dist/recharts/parts.mjs +1 -1
- package/dist/recharts/table.mjs +10 -8
- package/dist/skills/derive-dashboards/SKILL.md +13 -1
- package/package.json +42 -4
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/export/download.ts
|
|
2
|
+
/** The most characters of a title a file's name keeps: every file system takes a name this long. */
|
|
3
|
+
const NAME_ROOM = 120;
|
|
4
|
+
/** What no file system takes in a name: the marks a path is written with, and control characters. */
|
|
5
|
+
const REFUSED = /[\\/:*?"<>|\p{Cc}]+/gu;
|
|
6
|
+
/** The most bytes of a name before its ending: a file system that counts bytes takes 255 for the whole name. */
|
|
7
|
+
const NAME_BYTES = 240;
|
|
8
|
+
/** The names a file system keeps for its devices. It keeps them whatever follows a point after them ("nul.tar"). */
|
|
9
|
+
const DEVICE = /^(?:con|prn|aux|nul|conin\$|conout\$|(?:com|lpt)[\d¹²³])$/iu;
|
|
10
|
+
/** Whether a name is a device's: the part before its first point, less the spaces at its end. */
|
|
11
|
+
const isDevice = (name) => DEVICE.test((name.split(".")[0] ?? "").trimEnd());
|
|
12
|
+
/** A text as the characters a reader counts, so no letter is parted from its accent. */
|
|
13
|
+
function charactersOf(text) {
|
|
14
|
+
if (typeof Intl.Segmenter === "function") return [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(text)].map((part) => part.segment);
|
|
15
|
+
return [...text];
|
|
16
|
+
}
|
|
17
|
+
/** The start of a text: as many whole characters as fit `NAME_ROOM` characters and `NAME_BYTES` bytes. */
|
|
18
|
+
function startOf(text) {
|
|
19
|
+
const encoder = new TextEncoder();
|
|
20
|
+
let bytes = 0;
|
|
21
|
+
return charactersOf(text).slice(0, NAME_ROOM).filter((character) => {
|
|
22
|
+
bytes += encoder.encode(character).length;
|
|
23
|
+
return bytes <= NAME_BYTES;
|
|
24
|
+
}).join("");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A file's name from a tile's title, with the ending given: the title as it is written, less
|
|
28
|
+
* only what a file system refuses. It never begins with a point (such a file is hidden) nor
|
|
29
|
+
* ends with one, is not a device's name (a title of "CON" is saved as "_CON"), and is cut to
|
|
30
|
+
* a length every file system takes; "data" for a title that leaves nothing.
|
|
31
|
+
*/
|
|
32
|
+
function fileName(title, ending) {
|
|
33
|
+
const base = startOf(title.normalize("NFC").replaceAll(REFUSED, " ").replaceAll(/\s+/gu, " ").replace(/^[. ]+/u, "")).replace(/[. ]+$/u, "");
|
|
34
|
+
if (base === "") return `data.${ending}`;
|
|
35
|
+
return `${isDevice(base) ? "_" : ""}${base}.${ending}`;
|
|
36
|
+
}
|
|
37
|
+
/** The byte order mark: with it first, a spreadsheet reads the file as UTF-8. */
|
|
38
|
+
const BYTE_ORDER_MARK = "";
|
|
39
|
+
/** How long the browser is given to start a save before the file's address is let go. */
|
|
40
|
+
const SAVE_STARTS_MS = 1e3;
|
|
41
|
+
/** Saves a text as a file of a type, under a name. */
|
|
42
|
+
function download(name, text, type) {
|
|
43
|
+
const url = URL.createObjectURL(new Blob([BYTE_ORDER_MARK, text], { type }));
|
|
44
|
+
const link = document.createElement("a");
|
|
45
|
+
link.href = url;
|
|
46
|
+
link.download = name;
|
|
47
|
+
document.body.append(link);
|
|
48
|
+
link.click();
|
|
49
|
+
link.remove();
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
URL.revokeObjectURL(url);
|
|
52
|
+
}, SAVE_STARTS_MS);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Saves an answer as the CSV file a tile's button saves: named by a title, led by a byte
|
|
56
|
+
* order mark, of the CSV type. `text` is the answer as `csvOf` writes it.
|
|
57
|
+
*/
|
|
58
|
+
function downloadCsv(title, text) {
|
|
59
|
+
download(fileName(title, "csv"), text, "text/csv;charset=utf-8");
|
|
60
|
+
}
|
|
61
|
+
export { downloadCsv, fileName };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Grain } from "derive-dashboards/core";
|
|
2
|
+
/**
|
|
3
|
+
* A time bucket's label for a person: "Nov 2" for a day or week, "Jun 2026" for a month or
|
|
4
|
+
* the month a (possibly fiscal) quarter starts. The label names a calendar date, so it is formatted as that date,
|
|
5
|
+
* not as an instant in any zone. Hour labels stay as sent.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatBucket(label: string, grain: Grain, locale?: string): string;
|
|
8
|
+
/** An instant (text time to the microsecond) as a date and time, in a zone (the dashboard's) or the viewer's own. */
|
|
9
|
+
export declare function formatInstant(text: string, locale?: string, timeZone?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* The bucket an instant starts, named at its grain in a zone, as a chart names it: "Nov 9" for
|
|
12
|
+
* a day or week, "Jul 2026" for a month, and a date with its clock time for an hour. A text
|
|
13
|
+
* that is not a time is given back as it is, as `formatInstant` gives it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatInstantAt(text: string, grain: Grain, locale?: string, timeZone?: string): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/format-time.ts
|
|
2
|
+
/** Date formats by locale and style, made once: a table would make one for every cell of a time column. */
|
|
3
|
+
const FORMATS = /* @__PURE__ */ new Map();
|
|
4
|
+
/** The date format for a locale and a style, made once. */
|
|
5
|
+
function dateFormat(locale, style) {
|
|
6
|
+
const key = `${locale ?? ""}|${JSON.stringify(style)}`;
|
|
7
|
+
const made = FORMATS.get(key) ?? new Intl.DateTimeFormat(locale, style);
|
|
8
|
+
FORMATS.set(key, made);
|
|
9
|
+
return made;
|
|
10
|
+
}
|
|
11
|
+
const DATE_LABEL = /^\d{4}-\d{2}-\d{2}$/u;
|
|
12
|
+
const BUCKET_FORMATS = {
|
|
13
|
+
day: {
|
|
14
|
+
month: "short",
|
|
15
|
+
day: "numeric"
|
|
16
|
+
},
|
|
17
|
+
week: {
|
|
18
|
+
month: "short",
|
|
19
|
+
day: "numeric"
|
|
20
|
+
},
|
|
21
|
+
month: {
|
|
22
|
+
month: "short",
|
|
23
|
+
year: "numeric"
|
|
24
|
+
},
|
|
25
|
+
quarter: {
|
|
26
|
+
month: "short",
|
|
27
|
+
year: "numeric"
|
|
28
|
+
},
|
|
29
|
+
year: { year: "numeric" }
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A time bucket's label for a person: "Nov 2" for a day or week, "Jun 2026" for a month or
|
|
33
|
+
* the month a (possibly fiscal) quarter starts. The label names a calendar date, so it is formatted as that date,
|
|
34
|
+
* not as an instant in any zone. Hour labels stay as sent.
|
|
35
|
+
*/
|
|
36
|
+
function formatBucket(label, grain, locale) {
|
|
37
|
+
if (grain === "hour" || !DATE_LABEL.test(label)) return label;
|
|
38
|
+
const [year = 0, month = 1, day = 1] = label.split("-").map(Number);
|
|
39
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
40
|
+
return dateFormat(locale, {
|
|
41
|
+
...BUCKET_FORMATS[grain],
|
|
42
|
+
timeZone: "UTC"
|
|
43
|
+
}).format(date);
|
|
44
|
+
}
|
|
45
|
+
/** An instant (text time to the microsecond) as a date and time, in a zone (the dashboard's) or the viewer's own. */
|
|
46
|
+
function formatInstant(text, locale, timeZone) {
|
|
47
|
+
const date = new Date(text.replace(/(\.\d{3})\d+/u, "$1"));
|
|
48
|
+
if (Number.isNaN(date.getTime())) return text;
|
|
49
|
+
return dateFormat(locale, {
|
|
50
|
+
dateStyle: "medium",
|
|
51
|
+
timeStyle: "short",
|
|
52
|
+
...timeZone === void 0 ? {} : { timeZone }
|
|
53
|
+
}).format(date);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The bucket an instant starts, named at its grain in a zone, as a chart names it: "Nov 9" for
|
|
57
|
+
* a day or week, "Jul 2026" for a month, and a date with its clock time for an hour. A text
|
|
58
|
+
* that is not a time is given back as it is, as `formatInstant` gives it.
|
|
59
|
+
*/
|
|
60
|
+
function formatInstantAt(text, grain, locale, timeZone) {
|
|
61
|
+
const date = new Date(text.replace(/(\.\d{3})\d+/u, "$1"));
|
|
62
|
+
if (Number.isNaN(date.getTime())) return text;
|
|
63
|
+
return dateFormat(locale, {
|
|
64
|
+
...grain === "hour" ? {
|
|
65
|
+
dateStyle: "medium",
|
|
66
|
+
timeStyle: "short"
|
|
67
|
+
} : BUCKET_FORMATS[grain],
|
|
68
|
+
...timeZone === void 0 ? {} : { timeZone }
|
|
69
|
+
}).format(date);
|
|
70
|
+
}
|
|
71
|
+
export { formatBucket, formatInstant, formatInstantAt };
|
package/dist/react/format.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CellFormat } from "./messages.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { formatBucket, formatInstant, formatInstantAt } from "./format-time.mjs";
|
|
3
|
+
import { ResultCell, ResultColumn } from "derive-dashboards/core";
|
|
3
4
|
/**
|
|
4
5
|
* A number for drawing. Exact values stay strings everywhere else; a chart needs a number
|
|
5
6
|
* for the pixel position only, never for a label.
|
|
@@ -12,14 +13,9 @@ type Shape = Pick<ResultColumn, "type" | "grain" | "unit" | "format" | "signed"
|
|
|
12
13
|
* `format`: they carry both.
|
|
13
14
|
*/
|
|
14
15
|
export declare function formatCell(cell: ResultCell, column?: Partial<Shape>, format?: CellFormat): string;
|
|
15
|
-
/** A short axis label: 12K, $1.2M. */
|
|
16
|
-
export declare function formatTick(value: number, column?: ResultColumn, locale?: string): string;
|
|
17
16
|
/**
|
|
18
|
-
* A
|
|
19
|
-
*
|
|
20
|
-
* not as an instant in any zone. Hour labels stay as sent.
|
|
17
|
+
* A short axis label: 12K, $1.25M, 0.025. A tick is written in three figures, which hold
|
|
18
|
+
* every round step an axis takes, so no two ticks read alike and none reads off its line.
|
|
21
19
|
*/
|
|
22
|
-
export declare function
|
|
23
|
-
|
|
24
|
-
export declare function formatInstant(text: string, locale?: string, timeZone?: string): string;
|
|
25
|
-
export {};
|
|
20
|
+
export declare function formatTick(value: number, column?: ResultColumn, locale?: string): string;
|
|
21
|
+
export { formatBucket, formatInstant, formatInstantAt };
|
package/dist/react/format.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { digitsFor, fine, lost, percentDigits, tickDigits } from "./digits.mjs";
|
|
2
|
+
import { formatBucket, formatInstant, formatInstantAt } from "./format-time.mjs";
|
|
1
3
|
import { ENGLISH } from "./english.mjs";
|
|
4
|
+
import { plainOf, plainText } from "./renderers/exact.mjs";
|
|
2
5
|
import { isMark } from "derive-dashboards/core";
|
|
3
6
|
// src/format.ts
|
|
4
7
|
function currencyOf(unit) {
|
|
@@ -26,6 +29,15 @@ function formatCell(cell, column, format = {}) {
|
|
|
26
29
|
if (typeof cell === "boolean") return cell ? messages.drillYes : messages.drillNo;
|
|
27
30
|
return numberText(cell, column, locale);
|
|
28
31
|
}
|
|
32
|
+
/** Number formats by locale and style: making one costs fifty times a format, and a table or a chart would make one for every cell. */
|
|
33
|
+
const FORMATS = /* @__PURE__ */ new Map();
|
|
34
|
+
/** The number format for a locale and a style, made once. */
|
|
35
|
+
function numberFormat(locale, style) {
|
|
36
|
+
const key = `${locale ?? ""}|${JSON.stringify(style)}`;
|
|
37
|
+
const made = FORMATS.get(key) ?? new Intl.NumberFormat(locale, style);
|
|
38
|
+
FORMATS.set(key, made);
|
|
39
|
+
return made;
|
|
40
|
+
}
|
|
29
41
|
/** A number by its column's format: a percent, a duration, money or a plain number. */
|
|
30
42
|
function numberText(cell, column, locale) {
|
|
31
43
|
if (column?.format === "percent") return percentText(cell, {
|
|
@@ -38,8 +50,8 @@ function numberText(cell, column, locale) {
|
|
|
38
50
|
style: "currency",
|
|
39
51
|
currency
|
|
40
52
|
};
|
|
41
|
-
if (typeof cell === "number") return
|
|
42
|
-
|
|
53
|
+
if (typeof cell === "number") return numberFormat(locale, {
|
|
54
|
+
...digitsFor(cell, 2),
|
|
43
55
|
...style
|
|
44
56
|
}).format(cell);
|
|
45
57
|
return exactText(cell.v, currency, locale);
|
|
@@ -51,32 +63,42 @@ function numberText(cell, column, locale) {
|
|
|
51
63
|
function percentText(cell, how, locale) {
|
|
52
64
|
const { signed } = how;
|
|
53
65
|
const shift = how.fraction ? "" : "E-2";
|
|
54
|
-
const share = (typeof cell === "number" ? cell : Number(cell.v)) / (how.fraction ? 1 : 100);
|
|
55
|
-
const places = Math.abs(share) >= .1 || share === 0 ? 0 : 1;
|
|
56
66
|
const style = {
|
|
57
67
|
style: "percent",
|
|
58
|
-
|
|
59
|
-
maximumFractionDigits: places,
|
|
68
|
+
...percentDigits(weigh(cell), how.fraction ? 1 : 100),
|
|
60
69
|
signDisplay: signed ? "exceptZero" : "auto"
|
|
61
70
|
};
|
|
62
|
-
|
|
63
|
-
return
|
|
71
|
+
const digits = typeof cell === "number" ? floatText(cell) : plainText(cell.v) ?? cell.v;
|
|
72
|
+
return numberFormat(locale, style).format(`${digits}${shift}`);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A cell's value as a float, for choosing its digits only. An exact text too small for a
|
|
76
|
+
* float, yet not zero, weighs as the smallest float there is, so it is never taken for zero;
|
|
77
|
+
* the digits written are still the text's own.
|
|
78
|
+
*/
|
|
79
|
+
function weigh(cell) {
|
|
80
|
+
if (typeof cell === "number") return cell;
|
|
81
|
+
const value = Number(cell.v);
|
|
82
|
+
const digits = cell.v.split(/e/iu)[0] ?? "";
|
|
83
|
+
return value === 0 && /[1-9]/u.test(digits) ? Number.MIN_VALUE : value;
|
|
64
84
|
}
|
|
85
|
+
/** A float as text Intl reads: its plain decimal digits, or what it is called when it is not a finite number. */
|
|
86
|
+
const floatText = (value) => Number.isFinite(value) ? plainOf(value) : String(value);
|
|
65
87
|
const DURATION_UNITS = [
|
|
66
88
|
["day", 86400],
|
|
67
89
|
["hour", 3600],
|
|
68
90
|
["minute", 60],
|
|
69
91
|
["second", 1]
|
|
70
92
|
];
|
|
71
|
-
/** Seconds in the largest unit that keeps the value at one or more: 90 is "1.5 min". */
|
|
72
|
-
function durationText(seconds, locale) {
|
|
93
|
+
/** Seconds in the largest unit that keeps the value at one or more: 90 is "1.5 min". A tick keeps three figures (75 is "1.25 min"). */
|
|
94
|
+
function durationText(seconds, locale, tick = false) {
|
|
73
95
|
const size = Math.abs(seconds);
|
|
74
96
|
const [unit, per] = DURATION_UNITS.find(([, n]) => size >= n) ?? ["second", 1];
|
|
75
|
-
return
|
|
97
|
+
return numberFormat(locale, {
|
|
76
98
|
style: "unit",
|
|
77
99
|
unit,
|
|
78
100
|
unitDisplay: "short",
|
|
79
|
-
|
|
101
|
+
...tick ? tickDigits(seconds / per, 1) : digitsFor(seconds / per, 1)
|
|
80
102
|
}).format(seconds / per);
|
|
81
103
|
}
|
|
82
104
|
/** A text cell: a time bucket's label, an instant (in the dashboard's zone when given), or the text itself. */
|
|
@@ -92,91 +114,37 @@ function exactText(text, currency, locale) {
|
|
|
92
114
|
currency
|
|
93
115
|
};
|
|
94
116
|
const places = /^0*$/u.test(cents) ? 0 : currency === void 0 ? Math.min(cents.length, 2) : 2;
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
117
|
+
const size = Math.abs(weigh({ v: text }));
|
|
118
|
+
const written = numberFormat(locale, {
|
|
119
|
+
...lost(size, places) ? fine(size) : {
|
|
120
|
+
minimumFractionDigits: places,
|
|
121
|
+
maximumFractionDigits: places
|
|
122
|
+
},
|
|
101
123
|
...style
|
|
102
124
|
}).format(text);
|
|
125
|
+
return written.includes("∞") ? text : written;
|
|
103
126
|
}
|
|
104
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* A short axis label: 12K, $1.25M, 0.025. A tick is written in three figures, which hold
|
|
129
|
+
* every round step an axis takes, so no two ticks read alike and none reads off its line.
|
|
130
|
+
*/
|
|
105
131
|
function formatTick(value, column, locale) {
|
|
106
|
-
if (column?.format === "percent")
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
132
|
+
if (column?.format === "percent") {
|
|
133
|
+
const [whole, shift] = column.fraction === true ? [1, ""] : [100, "E-2"];
|
|
134
|
+
return numberFormat(locale, {
|
|
135
|
+
style: "percent",
|
|
136
|
+
...tickDigits(value, whole)
|
|
137
|
+
}).format(`${floatText(value)}${shift}`);
|
|
138
|
+
}
|
|
139
|
+
if (column?.format === "duration") return durationText(value, locale, true);
|
|
111
140
|
const currency = currencyOf(column?.unit);
|
|
112
141
|
const style = currency === void 0 ? {} : {
|
|
113
142
|
style: "currency",
|
|
114
143
|
currency
|
|
115
144
|
};
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
maximumFractionDigits: 1,
|
|
145
|
+
return numberFormat(locale, {
|
|
146
|
+
...tickDigits(value, 1),
|
|
119
147
|
...style
|
|
120
148
|
}).format(value);
|
|
121
149
|
}
|
|
122
|
-
const DATE_LABEL = /^\d{4}-\d{2}-\d{2}$/u;
|
|
123
|
-
const BUCKET_FORMATS = {
|
|
124
|
-
day: {
|
|
125
|
-
month: "short",
|
|
126
|
-
day: "numeric"
|
|
127
|
-
},
|
|
128
|
-
week: {
|
|
129
|
-
month: "short",
|
|
130
|
-
day: "numeric"
|
|
131
|
-
},
|
|
132
|
-
month: {
|
|
133
|
-
month: "short",
|
|
134
|
-
year: "numeric"
|
|
135
|
-
},
|
|
136
|
-
quarter: {
|
|
137
|
-
month: "short",
|
|
138
|
-
year: "numeric"
|
|
139
|
-
},
|
|
140
|
-
year: { year: "numeric" }
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* A time bucket's label for a person: "Nov 2" for a day or week, "Jun 2026" for a month or
|
|
144
|
-
* the month a (possibly fiscal) quarter starts. The label names a calendar date, so it is formatted as that date,
|
|
145
|
-
* not as an instant in any zone. Hour labels stay as sent.
|
|
146
|
-
*/
|
|
147
|
-
function formatBucket(label, grain, locale) {
|
|
148
|
-
if (grain === "hour" || !DATE_LABEL.test(label)) return label;
|
|
149
|
-
const [year = 0, month = 1, day = 1] = label.split("-").map(Number);
|
|
150
|
-
const date = new Date(Date.UTC(year, month - 1, day));
|
|
151
|
-
return new Intl.DateTimeFormat(locale, {
|
|
152
|
-
...BUCKET_FORMATS[grain],
|
|
153
|
-
timeZone: "UTC"
|
|
154
|
-
}).format(date);
|
|
155
|
-
}
|
|
156
|
-
/** An instant (text time to the microsecond) as a date and time, in a zone (the dashboard's) or the viewer's own. */
|
|
157
|
-
function formatInstant(text, locale, timeZone) {
|
|
158
|
-
const date = new Date(text.replace(/(\.\d{3})\d+/u, "$1"));
|
|
159
|
-
if (Number.isNaN(date.getTime())) return text;
|
|
160
|
-
return new Intl.DateTimeFormat(locale, {
|
|
161
|
-
dateStyle: "medium",
|
|
162
|
-
timeStyle: "short",
|
|
163
|
-
...timeZone === void 0 ? {} : { timeZone }
|
|
164
|
-
}).format(date);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* The bucket an instant starts, named at its grain in a zone, as the chart names it: a drill's
|
|
168
|
-
* time step ("Nov 9" for a day or week, "Jul 2026" for a month), never a clock time.
|
|
169
|
-
*/
|
|
170
|
-
function formatInstantAt(text, grain, locale, timeZone) {
|
|
171
|
-
const date = new Date(text.replace(/(\.\d{3})\d+/u, "$1"));
|
|
172
|
-
if (Number.isNaN(date.getTime())) return text;
|
|
173
|
-
const options = grain === "hour" ? {
|
|
174
|
-
dateStyle: "medium",
|
|
175
|
-
timeStyle: "short"
|
|
176
|
-
} : BUCKET_FORMATS[grain];
|
|
177
|
-
return new Intl.DateTimeFormat(locale, {
|
|
178
|
-
...options,
|
|
179
|
-
...timeZone === void 0 ? {} : { timeZone }
|
|
180
|
-
}).format(date);
|
|
181
|
-
}
|
|
182
150
|
export { formatBucket, formatCell, formatInstant, formatInstantAt, formatTick, plotValue };
|
package/dist/react/index.d.mts
CHANGED
|
@@ -19,6 +19,8 @@ import { DashboardDrillProps, DrillEvent } from "./drill/board.mjs";
|
|
|
19
19
|
import { DashboardTile, DashboardTileProps } from "./drill/DashboardTile.mjs";
|
|
20
20
|
import { DrillPanelProps } from "./drill/DrillPanel.mjs";
|
|
21
21
|
import { TileRenderer, TileRendererProps } from "./renderers/props.mjs";
|
|
22
|
+
import { exactDigits } from "./renderers/exact.mjs";
|
|
23
|
+
import { TableTile } from "./renderers/table.mjs";
|
|
22
24
|
import { ItemHelpers, ItemOptions } from "./drill/Items.mjs";
|
|
23
25
|
import { DrillPanel } from "./drill/lazy.mjs";
|
|
24
26
|
import { DrillMarkProps, TileDrill } from "./drill/props.mjs";
|
|
@@ -26,19 +28,23 @@ import { DrillChange, DrillHistory, drillFrom } from "./drill/state.mjs";
|
|
|
26
28
|
import { DrillController, DrillOptions, useDrill } from "./drill/useDrill.mjs";
|
|
27
29
|
import { DrillMessages, ENGLISH_DRILL } from "./drill/words.mjs";
|
|
28
30
|
import { EditBar } from "./EditBar.mjs";
|
|
31
|
+
import { csvOf, exportRows } from "./export/csv.mjs";
|
|
32
|
+
import { downloadCsv } from "./export/download.mjs";
|
|
29
33
|
import "./FilterBar.mjs";
|
|
30
|
-
import {
|
|
34
|
+
import { formatCell, formatTick, plotValue } from "./format.mjs";
|
|
31
35
|
import { HistoryPanel, VersionBar } from "./History.mjs";
|
|
32
36
|
import { CellFormat, Messages } from "./messages.mjs";
|
|
33
37
|
import { ChangeList, Panel } from "./Panel.mjs";
|
|
34
38
|
import { ReviewPanel } from "./ReviewPanel.mjs";
|
|
35
39
|
import { ClientSchemas } from "./read.mjs";
|
|
36
|
-
import { NumberTile
|
|
40
|
+
import { NumberTile } from "./renderers/index.mjs";
|
|
37
41
|
import { ListDisplay, ListTile } from "./renderers/list.mjs";
|
|
38
42
|
import { Moved, Review, useReview } from "./review.mjs";
|
|
43
|
+
import { formatBucket, formatInstant, formatInstantAt } from "./format-time.mjs";
|
|
39
44
|
import { ENGLISH_REVIEW, ReviewMessages } from "./review-words.mjs";
|
|
40
45
|
import { SeriesSlotsContext } from "./scope.mjs";
|
|
41
|
-
import { Drawn, OTHER_KEY, Point, Series, lastBucketOpen,
|
|
46
|
+
import { Drawn, OTHER_KEY, Point, Series, lastBucketOpen, toSeries } from "./series.mjs";
|
|
47
|
+
import { pointCell, pointText, rowAt } from "./series-points.mjs";
|
|
42
48
|
import { SeriesSlots, SplitSeries, chartColors, seriesSlots } from "./series-slots.mjs";
|
|
43
49
|
import { Tile } from "./Tile.mjs";
|
|
44
50
|
import { useBoard } from "./useBoard.mjs";
|
|
@@ -56,4 +62,4 @@ export interface Register {}
|
|
|
56
62
|
export type Item = Register extends {
|
|
57
63
|
server: infer S;
|
|
58
64
|
} ? ItemFor<S> : DrillItem;
|
|
59
|
-
export { type Attempt, type Builder, type CellFormat, ChangeList, type ClientOptions, type ClientSchemas, type Components, Dashboard, type DashboardDrillProps, DashboardList, type DashboardProps, DashboardTile, type DashboardTileProps, type DashboardsClient, DashboardsError, type DashboardsErrorCode, DashboardsProvider, type DashboardsProviderProps, type DashboardsServer, type DraftClosed, type DraftEditor, type DraftStatus, type Drawn, type DrillChange, type DrillController, type DrillEvent, type DrillHistory, type DrillMarkProps, type DrillMessages, type DrillOptions, DrillPanel, type DrillPanelProps, ENGLISH, ENGLISH_DRILL, ENGLISH_FILTERS, ENGLISH_REVIEW, EditBar, FilterBar, type FilterBarOptions, type FilterBarProps, type FilterIcon, type FilterWords, HistoryPanel, type ItemFor, type ItemHelpers, type ItemOptions, type LinkComponent, type LinkProps, type ListDisplay, ListTile, type Messages, type Moved, NumberTile, OTHER_KEY, Panel, type Point, Popover, type Review, type ReviewMessages, ReviewPanel, type Series, type SeriesSlots, SeriesSlotsContext, type SplitSeries, TableTile, Tile, type TileDrill, type TileRenderer, type TileRendererProps, type TypedCall, VersionBar, type ViewChange, WidgetBuilder, type WidgetBuilderProps, WidgetPreview, chartColors, createDashboardsClient, drillFrom, fieldOf, rules_d_exports as filterRules, formatBucket, formatCell, formatInstant, formatTick, lastBucketOpen, plotValue, rowAt, seriesSlots, toSeries, useBoard, useBuilder, useControlValues, useDashboard, useDashboards, useDraft, useDrill, useFilterFields, useReview, useTiles };
|
|
65
|
+
export { type Attempt, type Builder, type CellFormat, ChangeList, type ClientOptions, type ClientSchemas, type Components, Dashboard, type DashboardDrillProps, DashboardList, type DashboardProps, DashboardTile, type DashboardTileProps, type DashboardsClient, DashboardsError, type DashboardsErrorCode, DashboardsProvider, type DashboardsProviderProps, type DashboardsServer, type DraftClosed, type DraftEditor, type DraftStatus, type Drawn, type DrillChange, type DrillController, type DrillEvent, type DrillHistory, type DrillMarkProps, type DrillMessages, type DrillOptions, DrillPanel, type DrillPanelProps, ENGLISH, ENGLISH_DRILL, ENGLISH_FILTERS, ENGLISH_REVIEW, EditBar, FilterBar, type FilterBarOptions, type FilterBarProps, type FilterIcon, type FilterWords, HistoryPanel, type ItemFor, type ItemHelpers, type ItemOptions, type LinkComponent, type LinkProps, type ListDisplay, ListTile, type Messages, type Moved, NumberTile, OTHER_KEY, Panel, type Point, Popover, type Review, type ReviewMessages, ReviewPanel, type Series, type SeriesSlots, SeriesSlotsContext, type SplitSeries, TableTile, Tile, type TileDrill, type TileRenderer, type TileRendererProps, type TypedCall, VersionBar, type ViewChange, WidgetBuilder, type WidgetBuilderProps, WidgetPreview, chartColors, createDashboardsClient, csvOf, downloadCsv, drillFrom, exactDigits, exportRows, fieldOf, rules_d_exports as filterRules, formatBucket, formatCell, formatInstant, formatInstantAt, formatTick, lastBucketOpen, plotValue, pointCell, pointText, rowAt, seriesSlots, toSeries, useBoard, useBuilder, useControlValues, useDashboard, useDashboards, useDraft, useDrill, useFilterFields, useReview, useTiles };
|
package/dist/react/index.mjs
CHANGED
|
@@ -9,30 +9,36 @@ import { DashboardList } from "./DashboardList.mjs";
|
|
|
9
9
|
import { useDraft } from "./draft.mjs";
|
|
10
10
|
import { DashboardTile } from "./drill/DashboardTile.mjs";
|
|
11
11
|
import { DrillPanel } from "./drill/lazy.mjs";
|
|
12
|
+
import { formatBucket, formatInstant, formatInstantAt } from "./format-time.mjs";
|
|
13
|
+
import { exactDigits } from "./renderers/exact.mjs";
|
|
12
14
|
import { drillFrom } from "./drill/state.mjs";
|
|
13
15
|
import { useDrill } from "./drill/useDrill.mjs";
|
|
16
|
+
import { TableTile } from "./renderers/table.mjs";
|
|
14
17
|
import { ENGLISH_DRILL } from "./drill/words.mjs";
|
|
15
18
|
import { EditBar } from "./EditBar.mjs";
|
|
16
19
|
import { DashboardsError } from "./errors.mjs";
|
|
20
|
+
import { csvOf, exportRows } from "./export/csv.mjs";
|
|
21
|
+
import { downloadCsv } from "./export/download.mjs";
|
|
17
22
|
import { ENGLISH_FILTERS } from "./filters/words.mjs";
|
|
18
23
|
import { FilterBar } from "./filters/bar.mjs";
|
|
19
24
|
import { fieldOf, useControlValues, useFilterFields } from "./filters/hooks.mjs";
|
|
20
25
|
import { rules_exports } from "./filters/rules.mjs";
|
|
21
26
|
import { Popover } from "./filters/popover.mjs";
|
|
22
|
-
import {
|
|
27
|
+
import { formatCell, formatTick, plotValue } from "./format.mjs";
|
|
23
28
|
import { HistoryPanel, VersionBar } from "./History.mjs";
|
|
24
29
|
import { ENGLISH } from "./english.mjs";
|
|
25
30
|
import { ChangeList, Panel } from "./Panel.mjs";
|
|
26
31
|
import { ReviewPanel } from "./ReviewPanel.mjs";
|
|
27
|
-
import { NumberTile
|
|
32
|
+
import { NumberTile } from "./renderers/index.mjs";
|
|
28
33
|
import { ListTile } from "./renderers/list.mjs";
|
|
29
34
|
import { useReview } from "./review.mjs";
|
|
30
35
|
import { ENGLISH_REVIEW } from "./review-words.mjs";
|
|
31
36
|
import { SeriesSlotsContext } from "./scope.mjs";
|
|
32
|
-
import { OTHER_KEY, lastBucketOpen,
|
|
37
|
+
import { OTHER_KEY, lastBucketOpen, toSeries } from "./series.mjs";
|
|
38
|
+
import { pointCell, pointText, rowAt } from "./series-points.mjs";
|
|
33
39
|
import { chartColors, seriesSlots } from "./series-slots.mjs";
|
|
34
40
|
import { Tile } from "./Tile.mjs";
|
|
35
41
|
import { useBoard } from "./useBoard.mjs";
|
|
36
42
|
import { useDashboard } from "./useDashboard.mjs";
|
|
37
43
|
import { useTiles } from "./useTiles.mjs";
|
|
38
|
-
export { ChangeList, Dashboard, DashboardList, DashboardTile, DashboardsError, DashboardsProvider, DrillPanel, ENGLISH, ENGLISH_DRILL, ENGLISH_FILTERS, ENGLISH_REVIEW, EditBar, FilterBar, HistoryPanel, ListTile, NumberTile, OTHER_KEY, Panel, Popover, ReviewPanel, SeriesSlotsContext, TableTile, Tile, VersionBar, WidgetBuilder, WidgetPreview, chartColors, createDashboardsClient, drillFrom, fieldOf, rules_exports as filterRules, formatBucket, formatCell, formatInstant, formatTick, lastBucketOpen, plotValue, rowAt, seriesSlots, toSeries, useBoard, useBuilder, useControlValues, useDashboard, useDashboards, useDraft, useDrill, useFilterFields, useReview, useTiles };
|
|
44
|
+
export { ChangeList, Dashboard, DashboardList, DashboardTile, DashboardsError, DashboardsProvider, DrillPanel, ENGLISH, ENGLISH_DRILL, ENGLISH_FILTERS, ENGLISH_REVIEW, EditBar, FilterBar, HistoryPanel, ListTile, NumberTile, OTHER_KEY, Panel, Popover, ReviewPanel, SeriesSlotsContext, TableTile, Tile, VersionBar, WidgetBuilder, WidgetPreview, chartColors, createDashboardsClient, csvOf, downloadCsv, drillFrom, exactDigits, exportRows, fieldOf, rules_exports as filterRules, formatBucket, formatCell, formatInstant, formatInstantAt, formatTick, lastBucketOpen, plotValue, pointCell, pointText, rowAt, seriesSlots, toSeries, useBoard, useBuilder, useControlValues, useDashboard, useDashboards, useDraft, useDrill, useFilterFields, useReview, useTiles };
|
|
@@ -17,6 +17,10 @@ export type Messages = ReviewMessages & DrillMessages & BuilderMessages & {
|
|
|
17
17
|
empty: string;
|
|
18
18
|
/** A number with no value: null, or a division by zero. */
|
|
19
19
|
noValue: string;
|
|
20
|
+
/** On a table column's header, which sorts the rows by it: "Sort by Revenue". */
|
|
21
|
+
sortBy: (column: string) => string;
|
|
22
|
+
/** Under a long table that draws its first rows only: "Show 500 more of 5,000 rows". Both counts are already written for the reader. */
|
|
23
|
+
showMoreRows: (more: string, of: string) => string;
|
|
20
24
|
loading: string;
|
|
21
25
|
noAccess: string;
|
|
22
26
|
noData: string;
|
|
@@ -39,6 +43,10 @@ export type Messages = ReviewMessages & DrillMessages & BuilderMessages & {
|
|
|
39
43
|
/** The filter bar's words; any subset, the rest stay English. */
|
|
40
44
|
filterBar?: Partial<FilterWords>;
|
|
41
45
|
rowsBehind: (title: string) => string;
|
|
46
|
+
/** On a tile's button that saves its answer as a file. */
|
|
47
|
+
csv: string;
|
|
48
|
+
/** What that button does, for a screen reader: "Download Revenue by plan as CSV". */
|
|
49
|
+
csvLabel: (title: string) => string;
|
|
42
50
|
notFilteredBy: (controls: readonly string[]) => string;
|
|
43
51
|
firstRows: (count: number) => string;
|
|
44
52
|
/** A date-range preset: "Today", "Last 7 days", "This month", "Last month", "Previous 3 months". */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { entryAliases } from "derive-dashboards/core";
|
|
2
|
+
// src/renderers/entries.ts
|
|
3
|
+
/**
|
|
4
|
+
* How a widget's `display` names an entry of its query, as the id its column has in the answer.
|
|
5
|
+
* The answer names a query's entries by place (m1.. measures, d1.. groups, c1.. calcs), as the
|
|
6
|
+
* server runs it (core's `entryAliases` is that rule); `display` names them as the widget's
|
|
7
|
+
* query does. An id the query does not have is given back as it is, so a column's own id
|
|
8
|
+
* still names it.
|
|
9
|
+
*/
|
|
10
|
+
function answerIds(widget) {
|
|
11
|
+
const query = widget.queries?.main;
|
|
12
|
+
const ids = query === void 0 ? void 0 : entryAliases(query);
|
|
13
|
+
return (entry) => ids?.get(entry) ?? entry;
|
|
14
|
+
}
|
|
15
|
+
export { answerIds };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ResultCell } from "derive-dashboards/core";
|
|
2
|
+
/**
|
|
3
|
+
* A cell's exact digits ("12.50"), when it has them: exact cells written as plain decimals, and
|
|
4
|
+
* whole numbers a float holds exactly; undefined for any other float, whose digits are not exact.
|
|
5
|
+
*/
|
|
6
|
+
export declare const exactDigits: (cell: ResultCell | undefined) => string | undefined;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/renderers/exact.ts
|
|
2
|
+
const PLAIN_DECIMAL = /^-?\d+(\.\d+)?$/u;
|
|
3
|
+
/**
|
|
4
|
+
* A cell's exact digits ("12.50"), when it has them: exact cells written as plain decimals, and
|
|
5
|
+
* whole numbers a float holds exactly; undefined for any other float, whose digits are not exact.
|
|
6
|
+
*/
|
|
7
|
+
const exactDigits = (cell) => {
|
|
8
|
+
if (typeof cell === "number") return Number.isSafeInteger(cell) ? String(cell) : void 0;
|
|
9
|
+
if (cell !== null && typeof cell === "object" && "v" in cell && typeof cell.v === "string") return PLAIN_DECIMAL.test(cell.v) ? cell.v : void 0;
|
|
10
|
+
};
|
|
11
|
+
/** A decimal as an integer of `scale` fraction digits: "12.5" at scale 2 is 1250n. */
|
|
12
|
+
const unitsOf = (digits, scale) => {
|
|
13
|
+
const negative = digits.startsWith("-");
|
|
14
|
+
const [whole = "0", fraction = ""] = digits.replace("-", "").split(".");
|
|
15
|
+
return BigInt(`${negative ? "-" : ""}${whole}${fraction.padEnd(scale, "0")}`);
|
|
16
|
+
};
|
|
17
|
+
/** How many places after the point a decimal text has. */
|
|
18
|
+
const placesOf = (digits) => digits.split(".")[1]?.length ?? 0;
|
|
19
|
+
/** Which of two exact decimals is the larger: below zero when the first is smaller, zero when they are equal. */
|
|
20
|
+
function compareExact(a, b) {
|
|
21
|
+
const scale = Math.max(placesOf(a), placesOf(b));
|
|
22
|
+
const d = unitsOf(a, scale) - unitsOf(b, scale);
|
|
23
|
+
return d === 0n ? 0 : d > 0n ? 1 : -1;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A plain decimal with its point moved `by` places to the right (to the left when negative):
|
|
27
|
+
* "0.425" by 2 is "42.5". Only the point moves: every digit is kept, and no float is made.
|
|
28
|
+
*/
|
|
29
|
+
function moved(digits, by) {
|
|
30
|
+
const [whole = "0", part = ""] = digits.replace("-", "").split(".");
|
|
31
|
+
const all = `${whole}${part}`;
|
|
32
|
+
const at = whole.length + by;
|
|
33
|
+
const padded = at <= 0 ? `${"0".repeat(1 - at)}${all}` : all.padEnd(at, "0");
|
|
34
|
+
const cut = Math.max(at, 1);
|
|
35
|
+
const left = padded.slice(0, cut).replace(/^0+(?=\d)/u, "");
|
|
36
|
+
const right = padded.slice(cut);
|
|
37
|
+
return `${digits.startsWith("-") && /[1-9]/u.test(all) ? "-" : ""}${left}${right === "" ? "" : `.${right}`}`;
|
|
38
|
+
}
|
|
39
|
+
const EXPONENT = /^(?<digits>-?\d+(?:\.\d+)?)e(?<power>[+-]?\d+)$/iu;
|
|
40
|
+
/** The largest power of ten written out: past it a text is not taken for a number worth its zeros. */
|
|
41
|
+
const MOST_POWER = 400;
|
|
42
|
+
/**
|
|
43
|
+
* Decimal text as a plain decimal: itself when it is one, and with its exponent written out
|
|
44
|
+
* when it has one ("1e-7" is "0.0000001"). Undefined for a text that is no number.
|
|
45
|
+
*/
|
|
46
|
+
function plainText(text) {
|
|
47
|
+
if (PLAIN_DECIMAL.test(text)) return text;
|
|
48
|
+
const found = EXPONENT.exec(text)?.groups;
|
|
49
|
+
const power = Number(found?.["power"]);
|
|
50
|
+
if (found === void 0 || Math.abs(power) > MOST_POWER) return void 0;
|
|
51
|
+
return moved(found["digits"] ?? "0", power);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A finite number as plain decimal text: the digits JavaScript writes it in, with an exponent
|
|
55
|
+
* written out, so it reads as a number wherever it is pasted.
|
|
56
|
+
*/
|
|
57
|
+
const plainOf = (value) => plainText(String(value)) ?? String(value);
|
|
58
|
+
/**
|
|
59
|
+
* A number's cell as plain decimal text: an exact cell's digits (an exponent written out),
|
|
60
|
+
* the digits a float is written in, or a text that is a number's. Undefined for a cell that is
|
|
61
|
+
* not a finite number: a float that is not one, or a text that is no number.
|
|
62
|
+
*/
|
|
63
|
+
function digitsOf(cell) {
|
|
64
|
+
if (typeof cell === "number") return Number.isFinite(cell) ? plainOf(cell) : void 0;
|
|
65
|
+
if (typeof cell === "string") return plainText(cell.trim());
|
|
66
|
+
if (cell !== null && typeof cell === "object" && "v" in cell && typeof cell.v === "string") return plainText(cell.v);
|
|
67
|
+
}
|
|
68
|
+
export { compareExact, digitsOf, exactDigits, moved, plainOf, plainText, unitsOf };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TileRenderer, TileRendererProps } from "./props.mjs";
|
|
2
|
+
import { exactDigits } from "./exact.mjs";
|
|
3
|
+
import { TableTile } from "./table.mjs";
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
+
* One value, large, from the total row when there is one, else the first row; a change calc (a
|
|
6
|
+
* signed column) sits under it, then a second figure when the widget names one.
|
|
5
7
|
*/
|
|
6
8
|
export declare function NumberTile(props: TileRendererProps): import("react").JSX.Element;
|
|
7
|
-
|
|
8
|
-
export declare function TableTile(props: TileRendererProps): import("react").JSX.Element;
|
|
9
|
-
export type { TileRenderer, TileRendererProps };
|
|
9
|
+
export { TableTile, type TileRenderer, type TileRendererProps, exactDigits };
|