@ai-matrx/records-ui 0.116.13 → 0.116.15
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 +11 -1
- package/dist/{SaveToTable-QZCRFD5Q.js → SaveToTable-54FVMGKL.js} +3 -3
- package/dist/{chunk-NE72B4OK.js → chunk-E5HKO5LT.js} +14 -3
- package/dist/chunk-E5HKO5LT.js.map +1 -0
- package/dist/{chunk-RQL7QRGR.js → chunk-TF3JYYJN.js} +1 -1
- package/dist/chunk-TF3JYYJN.js.map +1 -0
- package/dist/{chunk-HUPBD4JF.js → chunk-YIGEIVU7.js} +2 -2
- package/dist/helpers.d.cts +9 -0
- package/dist/helpers.d.ts +9 -0
- package/dist/index.cjs +125 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +119 -19
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +13 -0
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-NE72B4OK.js.map +0 -1
- package/dist/chunk-RQL7QRGR.js.map +0 -1
- /package/dist/{SaveToTable-QZCRFD5Q.js.map → SaveToTable-54FVMGKL.js.map} +0 -0
- /package/dist/{chunk-HUPBD4JF.js.map → chunk-YIGEIVU7.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -18546,6 +18546,10 @@ function buttonPressWords(label, pressed) {
|
|
|
18546
18546
|
const status = pressed.status ?? "ran";
|
|
18547
18547
|
return [`${pressed.automation ?? label}: ${status}.`, pressed.says].filter(Boolean).join(" ");
|
|
18548
18548
|
}
|
|
18549
|
+
function addRowWords(label, table, document2) {
|
|
18550
|
+
const name = recordNameIn(table, document2, "");
|
|
18551
|
+
return name !== "" ? `${label}: added \u201C${name}\u201D and opened it.` : `${label}: added to ${tableName(table)} and opened it.`;
|
|
18552
|
+
}
|
|
18549
18553
|
var POLL_EVERY_MS = 1200;
|
|
18550
18554
|
var POLL_FOR_MS = 12e4;
|
|
18551
18555
|
var RUN_BOOKKEEPING = /* @__PURE__ */ new Set(["run_id", "conversation_id"]);
|
|
@@ -18627,6 +18631,12 @@ function ButtonValue({ field: field2, recordId, inCell }) {
|
|
|
18627
18631
|
here.open(pressed.record_id);
|
|
18628
18632
|
return setSaid({ kind: "ran", says: `${b.label}: a row was added and opened.` });
|
|
18629
18633
|
}
|
|
18634
|
+
if (host.openRecord && addsTo.data) {
|
|
18635
|
+
const made = addsTo.data;
|
|
18636
|
+
host.openRecord({ table: made, recordId: pressed.record_id });
|
|
18637
|
+
const read = await client.recordRead({ record_id: pressed.record_id });
|
|
18638
|
+
return setSaid({ kind: "ran", says: addRowWords(b.label, made, read.ok ? read.data.document : void 0) });
|
|
18639
|
+
}
|
|
18630
18640
|
const href = addsTo.data ? host.hrefForRecord?.({ table: addsTo.data, recordId: pressed.record_id }) : void 0;
|
|
18631
18641
|
if (href) {
|
|
18632
18642
|
setOpening(true);
|
|
@@ -43052,7 +43062,7 @@ function colorOfGroup(groups, colors) {
|
|
|
43052
43062
|
return colors[raw === null || raw === void 0 ? "" : String(raw)] ?? null;
|
|
43053
43063
|
}
|
|
43054
43064
|
var NO_GROUPS = { title: "", kind: "bar", group_by: [], rows: [] };
|
|
43055
|
-
function ChartBlock({ block, subject, tableName: tableName2, className, centerValue, centerTotal, legend = true, groupColors, variant = "card", source }) {
|
|
43065
|
+
function ChartBlock({ block, subject, tableName: tableName2, className, centerValue, centerTotal, dataLabels, legend = true, groupColors, variant = "card", source }) {
|
|
43056
43066
|
const bare = variant === "bare";
|
|
43057
43067
|
const host = useRecordsUi();
|
|
43058
43068
|
const kind2 = block.kind;
|
|
@@ -43165,7 +43175,8 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
43165
43175
|
config,
|
|
43166
43176
|
onDrill: drill,
|
|
43167
43177
|
goal,
|
|
43168
|
-
...centerValue ? { center: centerTotal !== void 0 ? centerTotal : points
|
|
43178
|
+
...centerValue ? { center: centerTotal !== void 0 ? centerTotal : centerOfGroups(points, primary, measures[0].op) } : {},
|
|
43179
|
+
...dataLabels ? { dataLabels } : {},
|
|
43169
43180
|
showLegend: legend
|
|
43170
43181
|
}
|
|
43171
43182
|
),
|
|
@@ -43181,7 +43192,7 @@ function BigNumber({
|
|
|
43181
43192
|
onDrill,
|
|
43182
43193
|
block
|
|
43183
43194
|
}) {
|
|
43184
|
-
const summed = points
|
|
43195
|
+
const summed = centerOfGroups(points, measure, String(block.measures?.[0]?.op ?? "count"));
|
|
43185
43196
|
const total = block.totals && typeof block.totals.current === "number" ? block.totals.current : summed;
|
|
43186
43197
|
const records = points.reduce((sum, p) => sum + p.n, 0);
|
|
43187
43198
|
const windows = block.compare ?? null;
|
|
@@ -43189,7 +43200,7 @@ function BigNumber({
|
|
|
43189
43200
|
const priorTotal = block.totals?.prior;
|
|
43190
43201
|
const body = /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
|
|
43191
43202
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("span", { className: "flex items-baseline gap-2", children: [
|
|
43192
|
-
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "text-2xl font-semibold tabular-nums", children: pretty(total) }),
|
|
43203
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "text-2xl font-semibold tabular-nums", children: total === null ? "\u2013" : pretty(total) }),
|
|
43193
43204
|
windows ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Trend, { pct: block.totals?.change_pct, aimingUp: !!target, className: "text-sm" }) : null
|
|
43194
43205
|
] }),
|
|
43195
43206
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "text-xs text-muted-foreground", children: windows && typeof priorTotal === "number" ? `${windowName(windows.window, windows.period)} \xB7 ${pretty(priorTotal)} in ${windowName(windows.prior_window, windows.period)}` : `from ${(0, import_format10.formatCount)(records)} ${records === 1 ? "record" : "records"}` })
|
|
@@ -43382,8 +43393,10 @@ function Drawing({
|
|
|
43382
43393
|
onDrill,
|
|
43383
43394
|
goal,
|
|
43384
43395
|
center,
|
|
43396
|
+
dataLabels,
|
|
43385
43397
|
showLegend = true
|
|
43386
43398
|
}) {
|
|
43399
|
+
const labelText = (v) => typeof v === "number" ? pretty(v).length > 7 ? compactTick(v) : pretty(v) : "";
|
|
43387
43400
|
const compared = series.length > 1;
|
|
43388
43401
|
const drawOrder = compared ? [series[1], series[0]] : series;
|
|
43389
43402
|
const goalLine = (horizontal2) => goal && typeof goal.value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
@@ -43423,8 +43436,9 @@ function Drawing({
|
|
|
43423
43436
|
data,
|
|
43424
43437
|
dataKey: series[0],
|
|
43425
43438
|
nameKey: "label",
|
|
43426
|
-
innerRadius: 44,
|
|
43427
|
-
outerRadius: 66,
|
|
43439
|
+
innerRadius: dataLabels ? DONUT_LABELLED.inner : 44,
|
|
43440
|
+
outerRadius: dataLabels ? DONUT_LABELLED.outer : 66,
|
|
43441
|
+
...dataLabels ? donutLabelProps(points.map((p) => p.values[series[0]] ?? 0), dataLabels === "value" ? (v) => labelText(v) : null) : {},
|
|
43428
43442
|
paddingAngle: donutGap(points.length),
|
|
43429
43443
|
isAnimationActive: false,
|
|
43430
43444
|
...click ? { onClick: click, className: "cursor-pointer" } : {},
|
|
@@ -43461,7 +43475,7 @@ function Drawing({
|
|
|
43461
43475
|
] });
|
|
43462
43476
|
}
|
|
43463
43477
|
if (kind2 === "line") {
|
|
43464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_recharts.LineChart, { width, height: HEIGHT, data, margin: { top: 6, right: 6, bottom: 0, left: 0 }, children: [
|
|
43478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_recharts.LineChart, { width, height: HEIGHT, data, margin: { top: dataLabels ? 16 : 6, right: dataLabels ? 14 : 6, bottom: 0, left: 0 }, children: [
|
|
43465
43479
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.CartesianGrid, { vertical: false }),
|
|
43466
43480
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.XAxis, { dataKey: "label", ...axis }),
|
|
43467
43481
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.YAxis, { width: 44, ...axis }),
|
|
@@ -43478,7 +43492,8 @@ function Drawing({
|
|
|
43478
43492
|
...key !== series[0] ? { strokeDasharray: "4 3" } : {},
|
|
43479
43493
|
dot: false,
|
|
43480
43494
|
isAnimationActive: false,
|
|
43481
|
-
...click ? { className: "cursor-pointer" } : {}
|
|
43495
|
+
...click ? { className: "cursor-pointer" } : {},
|
|
43496
|
+
children: dataLabels && key === series[0] ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.LabelList, { dataKey: key, content: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(SpacedLabel, { show: labelsThatFit(points.map((p) => labelText(p.values[key])), width - 50), text: labelText, placement: "above" }) }) : null
|
|
43482
43497
|
},
|
|
43483
43498
|
key
|
|
43484
43499
|
))
|
|
@@ -43492,7 +43507,7 @@ function Drawing({
|
|
|
43492
43507
|
height: HEIGHT,
|
|
43493
43508
|
data,
|
|
43494
43509
|
layout: horizontal ? "vertical" : "horizontal",
|
|
43495
|
-
margin: { top: 6, right: 6, bottom: 0, left: 0 },
|
|
43510
|
+
margin: { top: dataLabels && !horizontal ? 16 : 6, right: dataLabels && horizontal ? 40 : 6, bottom: 0, left: 0 },
|
|
43496
43511
|
children: [
|
|
43497
43512
|
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.CartesianGrid, { vertical: horizontal, horizontal: !horizontal }),
|
|
43498
43513
|
horizontal ? /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
|
|
@@ -43505,7 +43520,7 @@ function Drawing({
|
|
|
43505
43520
|
tooltip,
|
|
43506
43521
|
legend,
|
|
43507
43522
|
goalLine(horizontal),
|
|
43508
|
-
drawOrder.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime143.
|
|
43523
|
+
drawOrder.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
43509
43524
|
import_recharts.Bar,
|
|
43510
43525
|
{
|
|
43511
43526
|
dataKey: key,
|
|
@@ -43513,7 +43528,23 @@ function Drawing({
|
|
|
43513
43528
|
isAnimationActive: false,
|
|
43514
43529
|
fill: `var(--color-${key})`,
|
|
43515
43530
|
...click ? { onClick: click, className: "cursor-pointer" } : {},
|
|
43516
|
-
children:
|
|
43531
|
+
children: [
|
|
43532
|
+
series.length === 1 ? points.map((point, at) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_recharts.Cell, { fill: String(config[point.label]?.color ?? SERIES_COLORS[index]) }, `${at}:${point.label}`)) : null,
|
|
43533
|
+
dataLabels && key === series[0] ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
43534
|
+
import_recharts.LabelList,
|
|
43535
|
+
{
|
|
43536
|
+
dataKey: key,
|
|
43537
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
43538
|
+
SpacedLabel,
|
|
43539
|
+
{
|
|
43540
|
+
show: horizontal ? labelsThatFit(points.map(() => "0"), HEIGHT - 20, 11, true) : labelsThatFit(points.map((p) => labelText(p.values[key])), width - 50),
|
|
43541
|
+
text: labelText,
|
|
43542
|
+
placement: horizontal ? "end" : "above"
|
|
43543
|
+
}
|
|
43544
|
+
)
|
|
43545
|
+
}
|
|
43546
|
+
) : null
|
|
43547
|
+
]
|
|
43517
43548
|
},
|
|
43518
43549
|
key
|
|
43519
43550
|
))
|
|
@@ -43521,6 +43552,79 @@ function Drawing({
|
|
|
43521
43552
|
}
|
|
43522
43553
|
) });
|
|
43523
43554
|
}
|
|
43555
|
+
function centerOfGroups(points, key, op2) {
|
|
43556
|
+
const vals = points.map((p) => p.values[key]).filter((v) => typeof v === "number" && Number.isFinite(v));
|
|
43557
|
+
if (op2 === "count" || op2 === "sum" || op2 === "filled" || op2 === "empty") return vals.reduce((a, b) => a + b, 0);
|
|
43558
|
+
if (!vals.length) return null;
|
|
43559
|
+
if (op2 === "min") return Math.min(...vals);
|
|
43560
|
+
if (op2 === "max") return Math.max(...vals);
|
|
43561
|
+
return null;
|
|
43562
|
+
}
|
|
43563
|
+
var LABEL_CHAR_PX = 6;
|
|
43564
|
+
function labelsThatFit(texts, span, fixedPx, fixed = false, gap = 4) {
|
|
43565
|
+
const n = texts.length;
|
|
43566
|
+
if (!n) return [];
|
|
43567
|
+
const band = Math.max(1, span / n);
|
|
43568
|
+
const widest = fixed ? fixedPx ?? 11 : Math.max(...texts.map((t) => t.length * LABEL_CHAR_PX)) + gap;
|
|
43569
|
+
const step2 = Math.max(1, Math.ceil(widest / band));
|
|
43570
|
+
return texts.map((_t, i) => i % step2 === 0);
|
|
43571
|
+
}
|
|
43572
|
+
function SpacedLabel(props) {
|
|
43573
|
+
const { show, text, placement, value, index = 0 } = props;
|
|
43574
|
+
const x = Number(props.x ?? 0);
|
|
43575
|
+
const y = Number(props.y ?? 0);
|
|
43576
|
+
const w = Number(props.width ?? 0);
|
|
43577
|
+
const h = Number(props.height ?? 0);
|
|
43578
|
+
if (!show[index]) return null;
|
|
43579
|
+
const words2 = text(value);
|
|
43580
|
+
if (!words2) return null;
|
|
43581
|
+
return placement === "end" ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("text", { x: x + w + 4, y: y + h / 2, dominantBaseline: "central", fontSize: 10, className: "fill-muted-foreground tabular-nums", "data-records-chart-label": "", children: words2 }) : /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("text", { x: x + w / 2, y: y - 5, textAnchor: "middle", fontSize: 10, className: "fill-muted-foreground tabular-nums", "data-records-chart-label": "", children: words2 });
|
|
43582
|
+
}
|
|
43583
|
+
var DONUT_LABELLED = { inner: 30, outer: 46 };
|
|
43584
|
+
function donutLabelPlan(values, outer2 = DONUT_LABELLED.outer) {
|
|
43585
|
+
const total = values.reduce((a, b) => a + (b > 0 ? b : 0), 0);
|
|
43586
|
+
if (total <= 0) return values.map(() => "none");
|
|
43587
|
+
let acc = 0;
|
|
43588
|
+
const lastY = { left: null, right: null };
|
|
43589
|
+
return values.map((v) => {
|
|
43590
|
+
const share = v > 0 ? v / total : 0;
|
|
43591
|
+
const mid = (acc + share / 2) * 2 * Math.PI;
|
|
43592
|
+
acc += share;
|
|
43593
|
+
if (share >= 0.09) return "inside";
|
|
43594
|
+
if (share < 0.03) return "none";
|
|
43595
|
+
const y = -Math.sin(mid) * (outer2 + 10);
|
|
43596
|
+
const side = Math.cos(mid) >= 0 ? "right" : "left";
|
|
43597
|
+
const prev = lastY[side];
|
|
43598
|
+
if (prev !== null && Math.abs(prev - y) < 11) return "none";
|
|
43599
|
+
lastY[side] = y;
|
|
43600
|
+
return "outside";
|
|
43601
|
+
});
|
|
43602
|
+
}
|
|
43603
|
+
function donutLabelProps(values, asValue) {
|
|
43604
|
+
const plan = donutLabelPlan(values);
|
|
43605
|
+
const total = values.reduce((a, b) => a + (b > 0 ? b : 0), 0);
|
|
43606
|
+
const words2 = (i) => asValue ? asValue(values[i] ?? 0) : `${Math.round((values[i] ?? 0) / (total || 1) * 100)}%`;
|
|
43607
|
+
return {
|
|
43608
|
+
labelLine: (p) => {
|
|
43609
|
+
const at = p.index ?? 0;
|
|
43610
|
+
const pts = p.points ?? [];
|
|
43611
|
+
if (plan[at] !== "outside" || pts.length < 2) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("g", {});
|
|
43612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("polyline", { points: pts.map((q) => `${q.x},${q.y}`).join(" "), fill: "none", stroke: "currentColor", strokeOpacity: 0.4, strokeWidth: 1, "data-records-chart-leader": "" });
|
|
43613
|
+
},
|
|
43614
|
+
label: (p) => {
|
|
43615
|
+
const at = p.index ?? 0;
|
|
43616
|
+
const where = plan[at];
|
|
43617
|
+
if (!where || where === "none") return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("g", {});
|
|
43618
|
+
const rad = Math.PI / 180;
|
|
43619
|
+
const mid = p.midAngle ?? 0;
|
|
43620
|
+
if (where === "inside") {
|
|
43621
|
+
const r = ((p.innerRadius ?? 0) + (p.outerRadius ?? 0)) / 2;
|
|
43622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("text", { x: (p.cx ?? 0) + r * Math.cos(-mid * rad), y: (p.cy ?? 0) + r * Math.sin(-mid * rad), textAnchor: "middle", dominantBaseline: "central", fontSize: 9, className: "fill-background font-medium tabular-nums", "data-records-chart-label": "", children: words2(at) });
|
|
43623
|
+
}
|
|
43624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("text", { x: p.x ?? 0, y: p.y ?? 0, textAnchor: Math.cos(-mid * rad) >= 0 ? "start" : "end", dominantBaseline: "central", fontSize: 9, className: "fill-muted-foreground tabular-nums", "data-records-chart-label": "", children: words2(at) });
|
|
43625
|
+
}
|
|
43626
|
+
};
|
|
43627
|
+
}
|
|
43524
43628
|
function onlyWholeNumbers(rows) {
|
|
43525
43629
|
return rows.every(
|
|
43526
43630
|
(row) => Object.entries(row).every(([key, value]) => key === "label" || typeof value !== "number" || Number.isInteger(value))
|
|
@@ -43566,21 +43670,25 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
43566
43670
|
let cancelled = false;
|
|
43567
43671
|
const asked4 = JSON.parse(filterKey);
|
|
43568
43672
|
const question = JSON.parse(qKey);
|
|
43569
|
-
|
|
43673
|
+
const whole = question.kind === "donut" ? client.recordAggregate({ table_id: view.subject, groupBy: [], measures: [question.measure], ...Object.keys(asked4).length > 0 ? { filter: asked4 } : {} }) : Promise.resolve(null);
|
|
43674
|
+
void Promise.all([client.recordAggregate({
|
|
43570
43675
|
table_id: view.subject,
|
|
43571
43676
|
groupBy: question.groupBy,
|
|
43572
43677
|
...question.bucket ? { bucket: question.bucket } : {},
|
|
43573
43678
|
measures: [question.measure],
|
|
43574
43679
|
limit: 200,
|
|
43575
43680
|
...Object.keys(asked4).length > 0 ? { filter: asked4 } : {}
|
|
43576
|
-
}).then((answered) => {
|
|
43681
|
+
}), whole]).then(([answered, overall]) => {
|
|
43577
43682
|
if (cancelled) return;
|
|
43578
43683
|
if (!answered.ok) {
|
|
43579
43684
|
setState({ block: null, error: answered.error });
|
|
43580
43685
|
return;
|
|
43581
43686
|
}
|
|
43687
|
+
const wholeRow = overall && overall.ok ? (overall.data ?? [])[0] : void 0;
|
|
43688
|
+
const wholeValue = wholeRow ? wholeRow.measures[(0, import_records57.measureKey)(question.measure)] : void 0;
|
|
43582
43689
|
setState({
|
|
43583
43690
|
error: null,
|
|
43691
|
+
...question.kind === "donut" ? { total: typeof wholeValue === "number" ? wholeValue : null } : {},
|
|
43584
43692
|
block: {
|
|
43585
43693
|
title: view.name,
|
|
43586
43694
|
kind: question.kind,
|
|
@@ -43627,7 +43735,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
43627
43735
|
MEASURE_LABEL2[isChartMeasure(view.chartMeasure) ? view.chartMeasure : "count"],
|
|
43628
43736
|
" needs a number field \u2014 pick one above. Counting until then."
|
|
43629
43737
|
] }) : null,
|
|
43630
|
-
state2.error ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(RefusalNotice, { error: state2.error }) : state2.block ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ChartBlock, { block: state2.block, subject: view.subject, variant: "bare", centerValue: true }) : null
|
|
43738
|
+
state2.error ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(RefusalNotice, { error: state2.error }) : state2.block ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ChartBlock, { block: state2.block, subject: view.subject, variant: "bare", centerValue: true, ...state2.total !== void 0 ? { centerTotal: state2.total } : {} }) : null
|
|
43631
43739
|
] });
|
|
43632
43740
|
}
|
|
43633
43741
|
|
|
@@ -60387,7 +60495,8 @@ function blockOfAnswer(answer, base2, by) {
|
|
|
60387
60495
|
for (const [k, v] of Object.entries(r.measures ?? {})) measuresOut[k] = typeof v === "number" ? v : v === null ? null : Number(v);
|
|
60388
60496
|
return { groups, measures: measuresOut, row_count: Number(r.row_count) };
|
|
60389
60497
|
});
|
|
60390
|
-
|
|
60498
|
+
const totalValue = answer.data.total?.measures ? Object.values(answer.data.total.measures)[0] : void 0;
|
|
60499
|
+
return { ...base2, rows, center_total: typeof totalValue === "number" ? totalValue : totalValue === null || totalValue === void 0 ? null : Number(totalValue) };
|
|
60391
60500
|
}
|
|
60392
60501
|
function EntityChartBlock({ source, kind: kind2, by, measure, title, where, organization, centerValue, variant, className }) {
|
|
60393
60502
|
const client = (0, import_react339.useRecordsClient)();
|
|
@@ -60421,7 +60530,7 @@ function EntityChartBlock({ source, kind: kind2, by, measure, title, where, orga
|
|
|
60421
60530
|
block,
|
|
60422
60531
|
subject: source.token,
|
|
60423
60532
|
source,
|
|
60424
|
-
...centerValue ? { centerValue } : {},
|
|
60533
|
+
...centerValue ? { centerValue, ...block.center_total !== void 0 ? { centerTotal: block.center_total } : {} } : {},
|
|
60425
60534
|
...variant ? { variant } : {},
|
|
60426
60535
|
...className ? { className } : {}
|
|
60427
60536
|
}
|