ehscan-react-table 0.0.15 → 0.0.18

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.
@@ -6,7 +6,7 @@ export const TableCellDueDate = ({ content, id, col, clickRow }) => {
6
6
  const valDate = value;
7
7
  return valDate === '-' || !valDate
8
8
  ? '-'
9
- : _jsx("span", { className: `${styles.dateTag} ${calcDateDiff(valDate)}`, children: formatToDDMMYYYY(valDate) });
9
+ : _jsx("span", { className: `${styles.dateTag} ${styles[calcDateDiff(valDate)]}`, children: formatToDDMMYYYY(valDate) });
10
10
  };
11
11
  return (_jsx("div", { onClick: () => clickRow({ id, col, type: 'default' }), children: _jsx(DateContent, { value: content }) }));
12
12
  };
@@ -99,16 +99,17 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
99
99
  return (_jsx(_Fragment, { children: _jsxs("div", { className: "sort-col", onClick: () => setSortOrder({ tag, dir: sortOrder.dir === 'desc' ? 'asc' : 'desc' }), children: [sortOrder.tag === tag && _jsx(SortButton, {}), openCol === tag && sortOrder.tag !== tag && _jsx(EmptySort, {})] }) }));
100
100
  };
101
101
  const HeadColMain = ({ col }) => {
102
- const { tag, search, title } = col;
102
+ const { tag, search, title, width } = col;
103
103
  const colTitle = title !== undefined ? title : tag;
104
- return (_jsx("th", { children: _jsxs("div", { className: styles.headcolcell, children: [_jsx(HeadColSort, { tag: tag }), _jsx("div", { className: styles.headcolcellmain, children: search ? _jsx(HeadSearchBar, { content: colTitle, tag: tag }) : _jsx("div", { children: colTitle }) })] }) }));
104
+ const thWidth = width !== undefined ? `${width}px` : "30px";
105
+ return (_jsx("th", { style: { "--custom-width": thWidth }, children: _jsxs("div", { className: styles.headcolcell, children: [_jsx(HeadColSort, { tag: tag }), _jsx("div", { className: styles.headcolcellmain, children: search ? _jsx(HeadSearchBar, { content: colTitle, tag: tag }) : _jsx("div", { children: colTitle }) })] }) }));
105
106
  };
106
107
  const HeadCols = () => {
107
108
  return (_jsxs(_Fragment, { children: [columns.map((col, i) => {
108
109
  const { tag, type, width } = col;
109
- const thWidth = width !== undefined ? `${width}px` : "32px";
110
+ const thWidth = width !== undefined ? `${width}px` : "8px";
110
111
  if (type === "checkbox") {
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
+ 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}`));
112
113
  }
113
114
  return _jsx(HeadColMain, { col: col }, tag !== null && tag !== void 0 ? tag : i);
114
115
  }), _jsx(EndHeadCol, {})] }));
@@ -496,14 +496,14 @@ RIPPLE
496
496
  position: relative;
497
497
  color: var(--ext-table-date-tag-clr, black);
498
498
  padding: 3px 6px;
499
- border-radius: 12px;
499
+ border-radius: 4px;
500
500
  font-size: 0.65rem;
501
501
  font-weight: 600;
502
502
  display: inline-block;
503
503
  text-align: center;
504
504
  text-overflow: ellipsis;
505
505
  white-space: nowrap;
506
- width: -webkit-fill-available;
506
+ width: fit-content;
507
507
  z-index: 0;
508
508
  }
509
509
  .dateTag::before {
@@ -513,7 +513,7 @@ RIPPLE
513
513
  background-color: var(--ext-table-date-tag-bck-clr, darkgrey);
514
514
  opacity: 0.7;
515
515
  /* dim background */
516
- border-radius: 12px;
516
+ border-radius: 4px;
517
517
  z-index: -1;
518
518
  }
519
519
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-table",
3
- "version": "0.0.15",
3
+ "version": "0.0.18",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",