@ai-matrx/records-ui 0.115.27 → 0.115.29
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 +12 -0
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.115.29
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.115.28..npm/records-ui/v0.115.29 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.115.28
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/records-ui/v0.115.27..npm/records-ui/v0.115.28 -- apps/shared/records-ui`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.115.27
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -35403,10 +35403,14 @@ var NUMBER_TYPES = /* @__PURE__ */ new Set(["number", "integer", "decimal", "mon
|
|
|
35403
35403
|
var DATE_TYPES = /* @__PURE__ */ new Set(["date", "datetime", "timestamp"]);
|
|
35404
35404
|
var isChartKind = (v) => v === "bar" || v === "line" || v === "donut";
|
|
35405
35405
|
var isChartMeasure = (v) => v === "count" || v === "sum" || v === "avg";
|
|
35406
|
+
function defaultChartGroup(fields) {
|
|
35407
|
+
return fields.find((f) => f.type === "list")?.key ?? null;
|
|
35408
|
+
}
|
|
35406
35409
|
function chartQuestion(view, fields) {
|
|
35407
35410
|
const kind = isChartKind(view.chartKind) ? view.chartKind : "bar";
|
|
35408
35411
|
const asked3 = isChartMeasure(view.chartMeasure) ? view.chartMeasure : "count";
|
|
35409
|
-
const
|
|
35412
|
+
const groupKey = view.groupField ?? defaultChartGroup(fields);
|
|
35413
|
+
const group = groupKey ? fields.find((f) => f.key === groupKey) : void 0;
|
|
35410
35414
|
const measureField = view.measure ? fields.find((f) => f.key === view.measure) : void 0;
|
|
35411
35415
|
const needsField = asked3 !== "count";
|
|
35412
35416
|
const fellBack = needsField && !measureField;
|
|
@@ -35461,7 +35465,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
35461
35465
|
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex min-h-0 flex-col gap-2", "data-records-chart-layout": "", "data-records-chart-measure": pickMeasure, children: [
|
|
35462
35466
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: [
|
|
35463
35467
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "text-muted-foreground", children: "Group by" }),
|
|
35464
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_design_system101.Select, { value: view.groupField ?? "__none", onValueChange: (next) => onChange({ groupField: next === "__none" ? null : next }), children: [
|
|
35468
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_design_system101.Select, { value: view.groupField ?? defaultChartGroup(fields) ?? "__none", onValueChange: (next) => onChange({ groupField: next === "__none" ? null : next }), children: [
|
|
35465
35469
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_design_system101.SelectTrigger, { size: "sm", className: "h-7 w-auto min-w-[8rem] text-xs", "aria-label": "Chart group by", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_design_system101.SelectValue, {}) }),
|
|
35466
35470
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_design_system101.SelectContent, { children: [
|
|
35467
35471
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_design_system101.SelectItem, { value: "__none", children: "Everything together" }),
|