@zvndev/yable-react 0.5.1 → 0.6.0

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.cjs CHANGED
@@ -2274,8 +2274,42 @@ function TableCell({
2274
2274
  } else {
2275
2275
  content = overrideValue !== void 0 ? overrideValue : cell.renderValue();
2276
2276
  }
2277
+ const isGroupRow = cell.row.getIsGrouped();
2278
+ if (isGroupRow) {
2279
+ if (column.id === cell.row.groupingColumnId) {
2280
+ const expanded = cell.row.getIsExpanded();
2281
+ content = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "yable-group-cell", style: { paddingLeft: cell.row.depth * 16 }, children: [
2282
+ /* @__PURE__ */ jsxRuntime.jsx(
2283
+ "button",
2284
+ {
2285
+ type: "button",
2286
+ className: "yable-group-toggle",
2287
+ "aria-label": expanded ? "Collapse group" : "Expand group",
2288
+ "aria-expanded": expanded,
2289
+ onClick: cell.row.getToggleExpandedHandler(),
2290
+ children: expanded ? "\u25BE" : "\u25B8"
2291
+ }
2292
+ ),
2293
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "yable-group-value", children: String(cell.row.groupingValue ?? "") }),
2294
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "yable-group-count", children: [
2295
+ "(",
2296
+ cell.row.getLeafRows().length,
2297
+ ")"
2298
+ ] })
2299
+ ] });
2300
+ } else {
2301
+ const aggDef = column.columnDef.aggregatedCell;
2302
+ if (typeof aggDef === "function") {
2303
+ content = aggDef(cell.getContext());
2304
+ } else {
2305
+ const aggVal = cell.getValue();
2306
+ content = aggVal == null ? null : aggVal;
2307
+ }
2308
+ }
2309
+ }
2277
2310
  const handleClick = React4.useCallback(
2278
2311
  (e) => {
2312
+ if (cell.row.getIsGrouped()) return;
2279
2313
  table.events.emit("cell:click", {
2280
2314
  cell,
2281
2315
  row: cell.row,
@@ -2341,7 +2375,7 @@ function TableCell({
2341
2375
  const cellStyleDef = column.columnDef.cellStyle;
2342
2376
  const userStyle = typeof cellStyleDef === "function" ? cellStyleDef(cell.getContext()) : cellStyleDef;
2343
2377
  const mergedStyle = userStyle ? { ...style, ...userStyle } : style;
2344
- const showFillHandle = isFocused && Boolean(table.options.enableFillHandle) && onFillHandleMouseDown != null;
2378
+ const showFillHandle = isFocused && Boolean(table.options.enableFillHandle) && onFillHandleMouseDown != null && !isGroupRow;
2345
2379
  const classNames = [
2346
2380
  "yable-td",
2347
2381
  isFocused && "yable-cell--focused",
@@ -2362,6 +2396,7 @@ function TableCell({
2362
2396
  "data-pinned": pinned || void 0,
2363
2397
  "data-cell-status": cellStatus !== "idle" ? cellStatus : void 0,
2364
2398
  "data-column-id": column.id,
2399
+ "data-grouped": isGroupRow || void 0,
2365
2400
  "data-row-index": rowIndex,
2366
2401
  "data-column-index": columnIndex,
2367
2402
  "data-cell-selected": isCellSelected || void 0,