ehscan-react-table 0.0.11 → 0.0.12

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.
@@ -3,6 +3,7 @@ type TableColumn = {
3
3
  title?: string;
4
4
  type?: string;
5
5
  search?: boolean;
6
+ width?: number;
6
7
  };
7
8
  type SortOrder = {
8
9
  tag: string;
@@ -105,10 +105,10 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
105
105
  };
106
106
  const HeadCols = () => {
107
107
  return (_jsxs(_Fragment, { children: [columns.map((col, i) => {
108
- console.log(col);
109
- const { tag, type } = col;
108
+ const { tag, type, width } = col;
109
+ const thWidth = width !== undefined ? `${width}px` : "32px";
110
110
  if (type === "checkbox") {
111
- return (_jsx("th", { className: styles.thcheckhead, style: { "--custom-width": `32px` }, children: _jsx(TableCellSelectHeadCol, { checkHead: checkHead, checkAll: checkAll }) }, `checkbox-${tag !== null && tag !== void 0 ? tag : i}`));
111
+ return (_jsx("th", { className: styles.thcheckhead, style: { "--custom-width": thWidth }, children: _jsx(TableCellSelectHeadCol, { checkHead: checkHead, checkAll: checkAll }) }, `checkbox-${tag !== null && tag !== void 0 ? tag : i}`));
112
112
  }
113
113
  return _jsx(HeadColMain, { col: col }, tag !== null && tag !== void 0 ? tag : i);
114
114
  }), _jsx(EndHeadCol, {})] }));
@@ -130,5 +130,5 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
130
130
  return (_jsx("td", { children: _jsx("div", { className: styles.exttablediv, children: _jsx(CellComponent, { row: row, col: col.tag }) }) }, ci));
131
131
  }), _jsx(EndCol, {})] }, `row-${rowIndex}`))) }, 'ext-tbody'));
132
132
  };
133
- return (_jsx(_Fragment, { children: _jsxs("div", { className: `${styles.tablewrapper} ${styles['_tbl']}`, style: { height: `calc(100vh - ${wrapperBottom}px)` }, children: [_jsxs("table", { className: styles.exttable, children: [_jsx("thead", { children: _jsx("tr", { className: styles.trstickyhead, children: _jsx(HeadCols, {}) }) }), rows && rows.length > 0 && _jsx(TableBody, {})] }), rows && rows.length === 0 && fallback()] }) }));
133
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: `${styles.tablewrapper} ${styles['_tbl']}`, style: { height: `calc(100vh - ${wrapperBottom}px)` }, children: [_jsxs("table", { className: styles.exttable, children: [_jsx("thead", { ref: headerRef, children: _jsx("tr", { className: styles.trstickyhead, children: _jsx(HeadCols, {}) }) }), rows && rows.length > 0 && _jsx(TableBody, {})] }), rows && rows.length === 0 && fallback()] }) }));
134
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-table",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",