@agilant/toga-blox 1.0.169 → 1.0.170

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.
@@ -7,8 +7,19 @@ const TableCell = ({ cell, isLastCell, hasInfiniteScroll, expanded, onToggle, li
7
7
  const isLong = isString && fullText.length > MAX_CHARS;
8
8
  const hasToggle = hasInfiniteScroll && isLong;
9
9
  const truncated = fullText.slice(0, MAX_CHARS);
10
+ /* stop row click when toggling */
11
+ const handleToggle = (e) => {
12
+ e.stopPropagation(); // ← prevents bubbling to the <tr>
13
+ onToggle();
14
+ };
10
15
  const baseTd = "relative overflow-hidden font-light text-sm text-left px-5";
11
16
  const wrapper = "min-h-[40px] flex select-none" + (hasToggle ? " cursor-pointer" : "");
12
- return (_jsx("td", { ...cell.getCellProps(), className: isLastCell ? "" : baseTd, children: _jsx("div", { ...(hasToggle ? { onClick: onToggle } : {}), className: wrapper, children: hasToggle ? (!expanded ? (_jsx("div", { className: "flex items-center group", children: _jsxs("span", { children: [truncated, "\u2026", _jsx("span", { className: `hidden group-hover:inline ${linkText}`, children: "Show more" })] }) })) : (_jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: fullText }), _jsx("span", { className: linkText, children: "Show less" })] }))) : (cell.render("Cell")) }) }));
17
+ return (_jsx("td", { ...cell.getCellProps(), className: isLastCell ? "" : baseTd, children: _jsx("div", { ...(hasToggle ? { onClick: handleToggle } : {}), className: wrapper, children: hasToggle ? (!expanded ? (
18
+ /* collapsed view */
19
+ _jsx("div", { className: "flex items-center group", children: _jsxs("span", { children: [truncated, "\u2026", _jsx("span", { className: `hidden group-hover:inline ${linkText}`, children: "Show more" })] }) })) : (
20
+ /* expanded view */
21
+ _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: fullText }), _jsx("span", { className: linkText, children: "Show less" })] }))) : (
22
+ /* no toggle required */
23
+ cell.render("Cell")) }) }));
13
24
  };
14
25
  export default TableCell;
@@ -10,7 +10,7 @@ const sampleData = {
10
10
  export default {
11
11
  title: "Table/TableCell",
12
12
  component: TableCell,
13
- tags: ["autodocs"], // 👈 enables automatic Docs tab
13
+ tags: ["autodocs"],
14
14
  argTypes: {
15
15
  hasInfiniteScroll: {
16
16
  control: "boolean",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilant/toga-blox",
3
3
  "private": false,
4
- "version": "1.0.169",
4
+ "version": "1.0.170",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",