derive-dashboards 0.11.1 → 0.11.2
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# derive-dashboards
|
|
2
2
|
|
|
3
|
+
## 0.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3273fbe: - A tile's CSV writes a dimension shown as another (an id shown as its name) by its name, as the tile shows it.
|
|
8
|
+
- The date control says no "All time" beside a pick such as "Last 7 days": tiles that read every date are not the pick's.
|
|
9
|
+
|
|
3
10
|
## 0.11.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -17,6 +17,8 @@ function headingOf(column) {
|
|
|
17
17
|
* no value is put through a float on the way.
|
|
18
18
|
*/
|
|
19
19
|
const written = (digits, column) => column.format === "percent" ? `${column.fraction === true ? movePoint(digits, 2) : digits}%` : digits;
|
|
20
|
+
/** A dimension shown as another (an id shown as its name) is written as it is shown. */
|
|
21
|
+
const shownAs = (cell, column) => typeof cell === "string" ? column.labels?.[cell] : void 0;
|
|
20
22
|
/**
|
|
21
23
|
* One cell: nothing for no value, the fold's word for a mark, true or false, a number's own
|
|
22
24
|
* digits as a plain decimal, and any other text guarded. A text is a number only in a column
|
|
@@ -28,6 +30,8 @@ function cellText(cell, column, words) {
|
|
|
28
30
|
if (cell === null) return "";
|
|
29
31
|
if (isMark(cell)) return guarded(cell.mark === "all" ? words.total : words.other);
|
|
30
32
|
if (typeof cell === "boolean") return String(cell);
|
|
33
|
+
const label = shownAs(cell, column);
|
|
34
|
+
if (label !== void 0) return guarded(label);
|
|
31
35
|
const digits = typeof cell === "string" && !isNumeric(column) ? void 0 : cellDigits(cell);
|
|
32
36
|
if (digits !== void 0) return written(digits, column);
|
|
33
37
|
return guarded(typeof cell === "object" ? cell.v : String(cell));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDashboards } from "../context.mjs";
|
|
1
2
|
import { rangeOf, useBar, useWords } from "./context.mjs";
|
|
2
3
|
// src/filters/dates-said.ts
|
|
3
4
|
/** In place of dates not known yet, to the eye: the tiles' answers are on their way. */
|
|
@@ -48,6 +49,7 @@ function unpicked(at, words) {
|
|
|
48
49
|
function useDates(control, said) {
|
|
49
50
|
const { picks, span, period } = useBar();
|
|
50
51
|
const words = useWords();
|
|
52
|
+
const { messages } = useDashboards();
|
|
51
53
|
if (control.kind !== "date_range") return {
|
|
52
54
|
text: said,
|
|
53
55
|
beside: void 0,
|
|
@@ -59,7 +61,7 @@ function useDates(control, said) {
|
|
|
59
61
|
}, words);
|
|
60
62
|
const dates = datesOf(span, words.datesLoading);
|
|
61
63
|
const range = rangeOf(picks, control.id);
|
|
62
|
-
if (range === void 0 || !("last" in range) || dates.seen === void 0) return {
|
|
64
|
+
if (range === void 0 || !("last" in range) || dates.seen === void 0 || span === messages.tileAllTime) return {
|
|
63
65
|
text: said,
|
|
64
66
|
beside: void 0,
|
|
65
67
|
spoken: said,
|
package/package.json
CHANGED