@bmsuisse/datagrid 0.24.0 → 0.24.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/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2213,24 +2213,28 @@ function DataGrid({
|
|
|
2213
2213
|
const sortable = isSortable(column);
|
|
2214
2214
|
const filterable = isFilterable(column) && column.filterDisplay !== "row";
|
|
2215
2215
|
const cellProps = leafHeaderCellPropsByColumn.get(column.id);
|
|
2216
|
+
const headerContent = column.renderHeader ? column.renderHeader(column) : column.header;
|
|
2216
2217
|
return /* @__PURE__ */ jsxs12("th", { rowSpan, style: cellProps?.style, className: cellProps?.className, children: [
|
|
2217
2218
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1", children: [
|
|
2218
|
-
/* @__PURE__ */ jsxs12(
|
|
2219
|
+
sortable ? /* @__PURE__ */ jsxs12(
|
|
2219
2220
|
"button",
|
|
2220
2221
|
{
|
|
2221
2222
|
type: "button",
|
|
2222
|
-
className:
|
|
2223
|
-
|
|
2224
|
-
sortable && "hover:bg-accent hover:text-accent-foreground"
|
|
2225
|
-
),
|
|
2226
|
-
disabled: !sortable,
|
|
2227
|
-
onClick: (event) => sortable && toggleSort(column.id, enableMultiSort && event.shiftKey, column.sortDescFirst === true),
|
|
2223
|
+
className: "flex items-center gap-1 rounded-sm px-1 hover:bg-accent hover:text-accent-foreground",
|
|
2224
|
+
onClick: (event) => toggleSort(column.id, enableMultiSort && event.shiftKey, column.sortDescFirst === true),
|
|
2228
2225
|
children: [
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2226
|
+
headerContent,
|
|
2227
|
+
sortEntry?.dir === "asc" && /* @__PURE__ */ jsx19(BarsArrowUpIcon, { className: "h-3 w-3", "aria-hidden": true }),
|
|
2228
|
+
sortEntry?.dir === "desc" && /* @__PURE__ */ jsx19(BarsArrowDownIcon, { className: "h-3 w-3", "aria-hidden": true })
|
|
2232
2229
|
]
|
|
2233
2230
|
}
|
|
2231
|
+
) : (
|
|
2232
|
+
// Not wrapped in a `<button>` (unlike the sortable branch above): a
|
|
2233
|
+
// disabled `<button>` swallows pointer events for its entire subtree,
|
|
2234
|
+
// silently breaking any interactive content a column's own `renderHeader`
|
|
2235
|
+
// embeds directly (bare filter inputs, "select/reject all" buttons) —
|
|
2236
|
+
// clicks never reach them at all, even though nothing looks wrong visually.
|
|
2237
|
+
/* @__PURE__ */ jsx19("div", { className: "flex items-center gap-1 px-1", children: headerContent })
|
|
2234
2238
|
),
|
|
2235
2239
|
filterable && /* @__PURE__ */ jsxs12(Popover, { children: [
|
|
2236
2240
|
/* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx19(Button, { variant: "ghost", size: "icon", "aria-label": `Filter ${column.header}`, children: /* @__PURE__ */ jsx19(
|