@cwellt_software/cwellt-reactjs-lib 1.0.6 → 1.0.7

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.js CHANGED
@@ -1286,12 +1286,12 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1286
1286
  console.warn("Missing row key for item", item);
1287
1287
  return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: classNameRow ?? "", children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
1288
1288
  ? "cwi-chevron-down"
1289
- : "cwi-chevron-right"}` }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : String(item[col.dataIndex]) }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1289
+ : "cwi-chevron-right"}` }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex]) : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1290
1290
  });
1291
1291
  };
1292
1292
  return (jsxRuntime.jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [jsxRuntime.jsx("div", { style: scrollContainerStyle, children: jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { style: stickyHeader
1293
1293
  ? { position: "sticky", top: 0, background: "white", zIndex: 2 }
1294
- : undefined, children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1294
+ : undefined, children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1295
1295
  ? sortConfig.direction
1296
1296
  : ""}`.trim(), style: {
1297
1297
  cursor: col.sortable ? "pointer" : "default",
package/dist/index.d.ts CHANGED
@@ -506,7 +506,7 @@ declare function CwAccordionContainer(CwelltAccordionContainerProps: React$1.Pro
506
506
 
507
507
  interface Column<T = any> {
508
508
  title: string;
509
- dataIndex: keyof T;
509
+ dataIndex?: keyof T;
510
510
  key: string;
511
511
  render?: (item: T) => React__default.ReactNode;
512
512
  className?: string;
package/dist/index.es.js CHANGED
@@ -1266,12 +1266,12 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1266
1266
  console.warn("Missing row key for item", item);
1267
1267
  return (jsxs(React__default.Fragment, { children: [jsxs("tr", { className: classNameRow ?? "", children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
1268
1268
  ? "cwi-chevron-down"
1269
- : "cwi-chevron-right"}` }) })), columns.map(col => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : String(item[col.dataIndex]) }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1269
+ : "cwi-chevron-right"}` }) })), columns.map(col => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex]) : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1270
1270
  });
1271
1271
  };
1272
1272
  return (jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [jsx("div", { style: scrollContainerStyle, children: jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { style: stickyHeader
1273
1273
  ? { position: "sticky", top: 0, background: "white", zIndex: 2 }
1274
- : undefined, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map(col => (jsxs("th", { onClick: () => col.sortable && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1274
+ : undefined, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map(col => (jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1275
1275
  ? sortConfig.direction
1276
1276
  : ""}`.trim(), style: {
1277
1277
  cursor: col.sortable ? "pointer" : "default",
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export interface Column<T = any> {
3
3
  title: string;
4
- dataIndex: keyof T;
4
+ dataIndex?: keyof T;
5
5
  key: string;
6
6
  render?: (item: T) => React.ReactNode;
7
7
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CwTable.d.ts","sourceRoot":"","sources":["../../../../../../src/components/display/data/table/CwTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CA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