@stereopt/data-table 0.1.6 → 0.1.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 CHANGED
@@ -122,8 +122,21 @@ function DataTable({ columns, data }) {
122
122
  columns,
123
123
  getCoreRowModel: (0, import_react_table.getCoreRowModel)()
124
124
  });
125
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "rounded-md border overflow-hidden bg-red-500", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Table, { children: [
126
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHead, { children: "Head" }) }) }),
125
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Table, { children: [
126
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
127
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
128
+ TableHead,
129
+ {
130
+ colSpan: header.colSpan,
131
+ style: { width: header.getSize() },
132
+ children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
133
+ header.column.columnDef.header,
134
+ header.getContext()
135
+ )
136
+ },
137
+ header.id
138
+ );
139
+ }) }, headerGroup.id)) }),
127
140
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableBody, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { children: "Cell" }) }) })
128
141
  ] }) }) });
129
142
  }
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/dataTable/DataTable.tsx
2
2
  import {
3
+ flexRender,
3
4
  getCoreRowModel,
4
5
  useReactTable
5
6
  } from "@tanstack/react-table";
@@ -98,8 +99,21 @@ function DataTable({ columns, data }) {
98
99
  columns,
99
100
  getCoreRowModel: getCoreRowModel()
100
101
  });
101
- return /* @__PURE__ */ jsx2("div", { className: "w-full", children: /* @__PURE__ */ jsx2("div", { className: "rounded-md border overflow-hidden bg-red-500", children: /* @__PURE__ */ jsxs(Table, { children: [
102
- /* @__PURE__ */ jsx2(TableHeader, { children: /* @__PURE__ */ jsx2(TableRow, { children: /* @__PURE__ */ jsx2(TableHead, { children: "Head" }) }) }),
102
+ return /* @__PURE__ */ jsx2("div", { className: "w-full", children: /* @__PURE__ */ jsx2("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ jsxs(Table, { children: [
103
+ /* @__PURE__ */ jsx2(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx2(TableRow, { children: headerGroup.headers.map((header) => {
104
+ return /* @__PURE__ */ jsx2(
105
+ TableHead,
106
+ {
107
+ colSpan: header.colSpan,
108
+ style: { width: header.getSize() },
109
+ children: header.isPlaceholder ? null : flexRender(
110
+ header.column.columnDef.header,
111
+ header.getContext()
112
+ )
113
+ },
114
+ header.id
115
+ );
116
+ }) }, headerGroup.id)) }),
103
117
  /* @__PURE__ */ jsx2(TableBody, { children: /* @__PURE__ */ jsx2(TableRow, { children: /* @__PURE__ */ jsx2(TableCell, { children: "Cell" }) }) })
104
118
  ] }) }) });
105
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stereopt/data-table",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Simple reusable React data table component",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",