ehscan-react-table 0.0.55 → 0.0.56
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.
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { calcDateDiff, formatToDDMMYYYY } from '../tools/dateFunction';
|
|
3
3
|
import styles from '../elements/table.module.css';
|
|
4
|
-
export const TableCellDueDate = ({ content, id, col, small, clickRow }) => {
|
|
4
|
+
export const TableCellDueDate = ({ content, id, col, checked, small, clickRow }) => {
|
|
5
5
|
const DateContent = ({ value }) => {
|
|
6
6
|
const valDate = value;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
: _jsx("span", { className: `${styles.dateTag} ${styles[
|
|
7
|
+
switch (true) {
|
|
8
|
+
case valDate === '-' || !valDate: return '-';
|
|
9
|
+
case checked === true: return _jsx("span", { className: `${styles.dateTag} ${styles['irrelevant']}${small ? ` ${styles.dateTagSmall}` : ''}`, children: small ? '' : formatToDDMMYYYY(valDate) });
|
|
10
|
+
default: return _jsx("span", { className: `${styles.dateTag} ${styles[calcDateDiff(valDate)]}${small ? ` ${styles.dateTagSmall}` : ''}`, children: small ? '' : formatToDDMMYYYY(valDate) });
|
|
11
|
+
}
|
|
10
12
|
};
|
|
11
13
|
return (_jsx("div", { className: styles.dueDateColWrapper, onClick: (e) => clickRow({ id, col, type: 'duedate', e }), children: _jsx(DateContent, { value: content }) }));
|
|
12
14
|
};
|