@ai-matrx/design-system 0.49.48 → 0.49.50
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 +16 -0
- package/README.md +10 -0
- package/dist/data-table/drill-chart.cjs +10 -1
- package/dist/data-table/drill-chart.cjs.map +1 -1
- package/dist/data-table/drill-chart.js +10 -1
- package/dist/data-table/drill-chart.js.map +1 -1
- package/dist/data-table/index.cjs +30 -19
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +30 -19
- package/dist/data-table/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -43814,6 +43814,27 @@ function MatrxTableGroupHeaderRow({
|
|
|
43814
43814
|
onToggle,
|
|
43815
43815
|
dataAttributes
|
|
43816
43816
|
}) {
|
|
43817
|
+
const startSpacerColumns = spacers && spacers.start > 0 ? 1 : 0;
|
|
43818
|
+
const desktopLabelSpan = leadingCols + 1 + startSpacerColumns;
|
|
43819
|
+
const mobileAggregateIndex = labelMobileHidden ? cells.findIndex((cell) => !cell.mobileHidden) : -1;
|
|
43820
|
+
const mobileAggregate = mobileAggregateIndex >= 0 ? cells[mobileAggregateIndex] : void 0;
|
|
43821
|
+
const mobileUsesActions = Boolean(labelMobileHidden && !mobileAggregate && showActionsCol);
|
|
43822
|
+
const mobileLabelSpan = Math.max(1, leadingCols + startSpacerColumns + (mobileAggregate ? 1 : 0) + (mobileUsesActions ? 1 : 0));
|
|
43823
|
+
const labelContent = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex min-w-0 items-center gap-1.5", style: depth > 0 ? { paddingLeft: `${depth * 1.25}rem` } : void 0, children: [
|
|
43824
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
43825
|
+
"button",
|
|
43826
|
+
{
|
|
43827
|
+
type: "button",
|
|
43828
|
+
onClick: onToggle,
|
|
43829
|
+
"aria-expanded": !collapsed,
|
|
43830
|
+
"aria-label": `${collapsed ? "Show" : "Hide"} ${label}`,
|
|
43831
|
+
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
43832
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
43833
|
+
}
|
|
43834
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { "aria-hidden": "true", className: "inline-block h-5 w-5 shrink-0" }),
|
|
43835
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labelSlot ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-semibold text-foreground", children: label }) }),
|
|
43836
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: summary })
|
|
43837
|
+
] });
|
|
43817
43838
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
43818
43839
|
"tr",
|
|
43819
43840
|
{
|
|
@@ -43822,30 +43843,20 @@ function MatrxTableGroupHeaderRow({
|
|
|
43822
43843
|
...dataAttributes ?? {},
|
|
43823
43844
|
className: cn("border-y border-border", depth === 0 ? "bg-muted/40" : "bg-muted/20"),
|
|
43824
43845
|
children: [
|
|
43825
|
-
Array.from({ length: leadingCols }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "px-2 py-1.5" }, `group-lead-${i}`)),
|
|
43826
|
-
spacers && spacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${spacers.start}px` } }) : null,
|
|
43827
43846
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
43828
43847
|
"td",
|
|
43829
43848
|
{
|
|
43849
|
+
colSpan: desktopLabelSpan,
|
|
43830
43850
|
className: cn("px-2 py-1.5 align-middle", labelMobileHidden && "max-sm:hidden"),
|
|
43831
|
-
children:
|
|
43832
|
-
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
43833
|
-
"button",
|
|
43834
|
-
{
|
|
43835
|
-
type: "button",
|
|
43836
|
-
onClick: onToggle,
|
|
43837
|
-
"aria-expanded": !collapsed,
|
|
43838
|
-
"aria-label": `${collapsed ? "Show" : "Hide"} ${label}`,
|
|
43839
|
-
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
43840
|
-
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
43841
|
-
}
|
|
43842
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { "aria-hidden": "true", className: "inline-block h-5 w-5 shrink-0" }),
|
|
43843
|
-
labelSlot ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "truncate text-sm font-semibold text-foreground", children: label }),
|
|
43844
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: summary })
|
|
43845
|
-
] })
|
|
43851
|
+
children: labelContent
|
|
43846
43852
|
},
|
|
43847
43853
|
labelColumnId ?? "group-label"
|
|
43848
43854
|
),
|
|
43855
|
+
labelMobileHidden ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { colSpan: mobileLabelSpan, className: "px-2 py-1.5 align-middle sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
43856
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "min-w-0 flex-1", children: labelContent }),
|
|
43857
|
+
mobileAggregate?.content !== void 0 && mobileAggregate?.content !== null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { ...mobileAggregate.aggregate ? { "data-matrx-table-group-aggregate": mobileAggregate.id } : {}, className: cn("whitespace-nowrap text-xs font-medium text-muted-foreground", mobileAggregate.align === "right" && "text-right"), children: mobileAggregate.content }) : null,
|
|
43858
|
+
mobileUsesActions ? actions ?? null : null
|
|
43859
|
+
] }) }) : null,
|
|
43849
43860
|
cells.map((cell) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
43850
43861
|
"td",
|
|
43851
43862
|
{
|
|
@@ -43855,7 +43866,7 @@ function MatrxTableGroupHeaderRow({
|
|
|
43855
43866
|
// right-aligned money column it reads as a different column's value.
|
|
43856
43867
|
cell.align === "center" && "text-center",
|
|
43857
43868
|
cell.align === "right" && "text-right",
|
|
43858
|
-
cell.mobileHidden && "max-sm:hidden"
|
|
43869
|
+
(cell.mobileHidden || labelMobileHidden && cell === mobileAggregate) && "max-sm:hidden"
|
|
43859
43870
|
),
|
|
43860
43871
|
children: cell.content !== void 0 && cell.content !== null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
43861
43872
|
"span",
|
|
@@ -43869,7 +43880,7 @@ function MatrxTableGroupHeaderRow({
|
|
|
43869
43880
|
cell.id
|
|
43870
43881
|
)),
|
|
43871
43882
|
spacers && spacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${spacers.end}px` } }) : null,
|
|
43872
|
-
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "px-2 py-1.5 text-right", children: actions ?? null }) : null
|
|
43883
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: cn("px-2 py-1.5 text-right", mobileUsesActions && "max-sm:hidden"), children: actions ?? null }) : null
|
|
43873
43884
|
]
|
|
43874
43885
|
}
|
|
43875
43886
|
);
|