ehscan-react-table 0.0.41 → 0.0.43

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.
@@ -147,9 +147,8 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
147
147
  .filter(col => !displayImportant || col.important)
148
148
  .map((col, i) => {
149
149
  const { tag, type, width } = col;
150
- const thWidth = width !== undefined ? `${width}px` : "8px";
151
150
  if (type === "checkbox") {
152
- return (_jsx("th", { className: styles.thcheckhead, style: { "--custom-width": thWidth, padding: "5px" }, children: _jsx(TableCellSelectHeadCol, { checkHead: checkHead, checkAll: checkAll }) }, `checkbox-${tag !== null && tag !== void 0 ? tag : i}`));
151
+ return (_jsx("th", { className: styles.thcheckhead, style: { width: `${width}px`, padding: '5px' }, children: _jsx(TableCellSelectHeadCol, { checkHead: checkHead, checkAll: checkAll }) }, `checkbox-${tag !== null && tag !== void 0 ? tag : i}`));
153
152
  }
154
153
  return _jsx(HeadColMain, { col: col }, tag !== null && tag !== void 0 ? tag : i);
155
154
  }), _jsx(EndHeadCol, {})] }));
@@ -5,6 +5,6 @@ const TableCellSelectHeadCol = ({ checkHead, checkAll }) => {
5
5
  event.stopPropagation();
6
6
  if (checkAll !== undefined)
7
7
  checkHead(checkAll);
8
- }, children: _jsx(ChecklistItemSquare, { checked: checkAll }) }));
8
+ }, children: _jsx(ChecklistItemSquare, { checked: checkAll, head: true }) }));
9
9
  };
10
10
  export default TableCellSelectHeadCol;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
3
  checked: boolean;
4
+ head?: boolean;
4
5
  };
5
6
  declare const TableChecklistItem: React.FC<Props>;
6
7
  export default TableChecklistItem;
@@ -11,14 +11,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  import { useRef } from 'react';
12
12
  import PaginationRipple from './PaginationRipple';
13
13
  import styles from './table.module.css';
14
- const TableChecklistItem = ({ checked }) => {
14
+ const TableChecklistItem = ({ checked, head = false }) => {
15
15
  const buttonRef = useRef(null);
16
16
  const handleRipple = PaginationRipple();
17
17
  const toggleCheck = (event) => __awaiter(void 0, void 0, void 0, function* () {
18
18
  handleRipple(event, buttonRef);
19
19
  });
20
20
  const CheckBoxItemSquare = ({ selected }) => {
21
- return (_jsx(_Fragment, { children: _jsxs("svg", { width: "60", height: "60", version: "1.1", viewBox: "0 -960 2400 2400", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { className: styles.cbcircle, d: "m1200-692.58c-767.96 0-932.58 164.63-932.58 932.58 0 767.98 164.63 932.58 932.58 932.58 767.98 0 932.58-164.63 932.58-932.58 0-767.96-164.63-932.58-932.58-932.58z", fill: "white" }), selected && _jsx("path", { className: styles.cbpath, d: "m1566.4-147.66c-33.43-0.026-66.888 12.734-92.524 38.331l-421.88 421.25-125.8-126.04c-51.193-51.272-133.7-51.348-184.97-0.1555-51.272 51.193-51.348 133.7-0.15551 184.97l218.09 218.48c38.437 38.497 94.554 48.106 141.82 28.846 15.829-6.3918 30.738-15.985 43.618-28.846l514.09-513.39c51.272-51.193 51.348-133.7 0.1554-184.97-25.596-25.636-59.014-38.46-92.446-38.486z", fill: "#666" })] }) }));
21
+ return (_jsx(_Fragment, { children: _jsxs("svg", { width: "60", height: "60", version: "1.1", viewBox: "0 -960 2400 2400", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { className: head ? styles.cbheadcircle : styles.cbcircle, d: "m1200-692.58c-767.96 0-932.58 164.63-932.58 932.58 0 767.98 164.63 932.58 932.58 932.58 767.98 0 932.58-164.63 932.58-932.58 0-767.96-164.63-932.58-932.58-932.58z", fill: "white" }), selected && _jsx("path", { className: styles.cbpath, d: "m1566.4-147.66c-33.43-0.026-66.888 12.734-92.524 38.331l-421.88 421.25-125.8-126.04c-51.193-51.272-133.7-51.348-184.97-0.1555-51.272 51.193-51.348 133.7-0.15551 184.97l218.09 218.48c38.437 38.497 94.554 48.106 141.82 28.846 15.829-6.3918 30.738-15.985 43.618-28.846l514.09-513.39c51.272-51.193 51.348-133.7 0.1554-184.97-25.596-25.636-59.014-38.46-92.446-38.486z", fill: "#666" })] }) }));
22
22
  };
23
23
  return (_jsx(_Fragment, { children: _jsx("div", { ref: buttonRef, className: styles.checkboxtable, onClick: (e) => toggleCheck(e), children: _jsx(CheckBoxItemSquare, { selected: checked }) }) }));
24
24
  };
@@ -371,6 +371,10 @@ Resizable column wrapper
371
371
  fill: var(--ext-table-cb-corpus-fill, red)
372
372
  }
373
373
 
374
+ .cbheadcircle {
375
+ fill: var(--ext-table-cb-corpus-head-fill, red)
376
+ }
377
+
374
378
  .cbpath {
375
379
  fill: var(--ext-table-cb-path-fill, white)
376
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-table",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",