ehscan-react-table 0.0.27 → 0.0.29
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/elements/Table.d.ts +0 -1
- package/dist/elements/Table.js +4 -11
- package/package.json +1 -1
package/dist/elements/Table.d.ts
CHANGED
package/dist/elements/Table.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import
|
|
11
|
+
import { useEffect, useState, useRef } from "react";
|
|
12
12
|
import TableCellSelectHeadCol from "./TableCellSelectHeadCol";
|
|
13
13
|
import { debounce } from "./Debounce";
|
|
14
14
|
import styles from './table.module.css';
|
|
@@ -102,24 +102,17 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
|
|
|
102
102
|
const colRefs = useRef({});
|
|
103
103
|
const HeadColMainLit = {
|
|
104
104
|
def: (tag) => tag !== null && tag !== void 0 ? tag : "",
|
|
105
|
-
duedate: () =>
|
|
106
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
107
|
-
width: 24,
|
|
108
|
-
height: 24,
|
|
109
|
-
fill: "black",
|
|
110
|
-
viewBox: "0 0 24 24",
|
|
111
|
-
}, React.createElement("path", {
|
|
112
|
-
d: "M19.778 3.5H4.222C2.995 3.5 2 4.543 2 5.77v14.008C2 21.005 2.995 22 4.222 22h15.556A2.222 2.222 0 0 0 22 19.778V5.77c0-1.227-.995-2.27-2.222-2.27ZM7 5V2m10 3V2m5 7H2m5.5 4h-1m1 3h-1m1 3h-1m11-6h-1m1 3h-1m1 3h-1m-4-6h-1m1 3h-1m1 3h-1",
|
|
113
|
-
})),
|
|
105
|
+
duedate: () => (_jsxs("svg", { width: "40", height: "40", version: "1.1", viewBox: "0 -960 1600 1600", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { className: "table-header-icons", d: "m381.72-908.36c-112.37 0-203.83 90.835-203.83 202.42v157.03h-68.359c-31.606 1.731-56.094 24.21-56.094 51.328 0 27.118 24.487 49.407 56.094 51.484h68.359v577.03h-68.359c-32.304 1.1539-57.891 25.058-57.891 53.906 0 28.964 25.587 52.674 57.891 53.828h68.359v147.27a203.93 202.52 0 0 0 203.83 202.42h224.06l56.719-98.359h-288.28c-53.103 0-96.406-42.893-96.406-95.859v-155.47h58.047c31.723-1.9617 56.328-25.441 56.328-53.828 0-28.502-24.606-51.945-56.328-53.906h-58.047v-577.11h58.047c33.117 0 60.118-22.978 60.234-51.25 1e-4 -28.272-27.001-51.328-60.234-51.328h-57.969v-165.47a96.679 96.009 0 0 1 96.484-95.859v0.15624h977.58a96.795 96.124 0 0 1 96.406 95.781v921.72l100 166.88v-1080.4c-1e-4 -111.59-91.347-202.42-203.83-202.42h-962.81zm251.25 359.61c-30.444 1.5001-54.781 22.239-56.641 48.203a47.294 46.966 0 0 0 15 37.188 64.259 63.814 0 0 0 41.641 17.266h514.06v-0.07813c33.233 0 60.042-22.978 60.391-51.25 0-28.272-27.274-51.328-60.391-51.328h-514.06zm-2.8125 338.28c-29.849 0-53.906 24.057-53.906 53.906s24.057 53.828 53.906 53.828h318.59c29.849 1e-5 53.828-23.979 53.828-53.828s-23.979-53.906-53.828-53.906h-318.59zm0 343.36c-29.849 0-53.906 24.057-53.906 53.906 0 29.849 24.057 53.906 53.906 53.906h139.53c29.849 0 53.828-24.057 53.828-53.906 1e-5 -29.85-23.979-53.906-53.828-53.906h-139.53zm96.016 357.11-56.797 98.359h102.73l59.922-98.359h-105.86z" }), _jsx("path", { className: "table-header-icons-overdue", d: "m1134-177.42c-15.754 0-31.544 7.7956-40.547 23.438l-415.94 720.39c-18.005 31.284 4.5368 70.234 40.547 70.234h831.8c36.01 0 58.552-38.951 40.547-70.234l-415.94-720.39c-9.0026-15.642-24.714-23.438-40.469-23.438zm0 184.53c47.713 0 86.406 44.129 86.406 98.594 0 166.1-38.693 300.7-86.406 300.7-47.714 0-86.484-134.61-86.484-300.7 0-54.465 38.771-98.594 86.484-98.594zm0 451.95a60.542 60.542 0 0 1 60.547 60.547 60.542 60.542 0 0 1-60.547 60.547 60.542 60.542 0 0 1-60.547-60.547 60.542 60.542 0 0 1 60.547-60.547z", fill: "#999" })] })),
|
|
114
106
|
};
|
|
115
107
|
const HeadColMain = ({ col }) => {
|
|
108
|
+
var _a, _b;
|
|
116
109
|
const { tag, search, title, width } = col;
|
|
117
110
|
const shouldMeasure = ['duedate'].includes(tag);
|
|
118
111
|
const colTitle = title !== undefined ? title : tag;
|
|
119
112
|
const thWidth = width !== undefined ? `${width}px` : "30px";
|
|
120
113
|
return (_jsx("th", { ref: shouldMeasure ? (el) => { colRefs.current[tag] = el; } : undefined, style: { "--custom-width": thWidth }, children: _jsxs("div", { className: styles.headcolcell, children: [_jsx(HeadColSort, { tag: tag }), _jsx("div", { className: styles.headcolcellmain, children: search
|
|
121
114
|
? _jsx(HeadSearchBar, { content: colTitle, tag: tag })
|
|
122
|
-
: _jsx("div", { onClick: () => setOpenCol(tag), children: HeadColMainLit[colTitle] ? HeadColMainLit
|
|
115
|
+
: _jsx("div", { onClick: () => setOpenCol(tag), children: (_b = (_a = HeadColMainLit[colTitle]) === null || _a === void 0 ? void 0 : _a.call(HeadColMainLit, colTitle)) !== null && _b !== void 0 ? _b : colTitle }) })] }) }));
|
|
123
116
|
};
|
|
124
117
|
const HeadCols = () => {
|
|
125
118
|
return (_jsxs(_Fragment, { children: [columns.map((col, i) => {
|