mig-schema-table 3.0.78 → 3.0.80
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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { SELECT_ALL_COLUMN_NAME } from "../constants";
|
|
4
4
|
import { localeFormatInTimeZone, timeZone } from "../../inc/date";
|
|
5
|
-
import { DEFAULT_DATE_TIME_FORMAT
|
|
5
|
+
import { DEFAULT_DATE_TIME_FORMAT } from "../../inc/constant";
|
|
6
6
|
import { t } from "../../inc/string";
|
|
7
7
|
function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema, rowHeight, rowIndex, sortedRenderData, style, }) {
|
|
8
8
|
const onTdClick = React.useCallback((e) => {
|
|
@@ -56,7 +56,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
56
56
|
return propConfig.title;
|
|
57
57
|
}
|
|
58
58
|
if ((schema === null || schema === void 0 ? void 0 : schema.format) &&
|
|
59
|
-
schema.format
|
|
59
|
+
schema.format === "date-time" &&
|
|
60
60
|
(propConfig === null || propConfig === void 0 ? void 0 : propConfig.showTimezones) !== false) {
|
|
61
61
|
return `${uncamel(propName)} (${t(timeZone)})`;
|
|
62
62
|
}
|
|
@@ -68,8 +68,9 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
68
68
|
textAlign: "center",
|
|
69
69
|
}, title: `${numberOfSelectedRows || 0} selected` }, { children: _jsx("input", { type: "checkbox", checked: isAllChecked, onChange: onSelectAllIndexesHandler }) })) })));
|
|
70
70
|
}
|
|
71
|
+
const title = typeof labelBody === "string" ? labelBody : undefined;
|
|
71
72
|
if (!schema && !(propConfig === null || propConfig === void 0 ? void 0 : propConfig.renderData) && !(propConfig === null || propConfig === void 0 ? void 0 : propConfig.renderCell)) {
|
|
72
|
-
return _jsx("div", { style: style, className: classNames.join(" ") });
|
|
73
|
+
return _jsx("div", { style: style, className: classNames.join(" "), title: title });
|
|
73
74
|
}
|
|
74
75
|
switch (schema === null || schema === void 0 ? void 0 : schema.type) {
|
|
75
76
|
case "boolean":
|
|
@@ -84,6 +85,6 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
|
|
|
84
85
|
classNames.push(`text-${propConfig.align}`);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" ") }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick }, { children: [_jsx("span", Object.assign({ className: "schema-table__th__label-body-text" }, { children: labelBody })), sortAsc === undefined ? null : (_jsx("span", Object.assign({ className: "schema-table__th__sort-icon" }, { children: sortAsc ? "↓" : "↑" })))] })), isSortable || columnFilterStatus !== EColumnFilterStatus.UNAVAILABLE ? (_jsx("button", Object.assign({ className: "schema-table__th__trigger-el", onClick: onTriggerClick }, { children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#404040", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })) }))) : null] })));
|
|
88
|
+
return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" "), title: title }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick }, { children: [_jsx("span", Object.assign({ className: "schema-table__th__label-body-text" }, { children: labelBody })), sortAsc === undefined ? null : (_jsx("span", Object.assign({ className: "schema-table__th__sort-icon" }, { children: sortAsc ? "↓" : "↑" })))] })), isSortable || columnFilterStatus !== EColumnFilterStatus.UNAVAILABLE ? (_jsx("button", Object.assign({ className: "schema-table__th__trigger-el", onClick: onTriggerClick }, { children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#404040", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })) }))) : null] })));
|
|
88
89
|
};
|
|
89
90
|
export default React.memo(Th);
|
package/dist/index.css
CHANGED
|
@@ -98,6 +98,11 @@
|
|
|
98
98
|
font-size: 14px;
|
|
99
99
|
align-items: center;
|
|
100
100
|
}
|
|
101
|
+
.schema-table__th__label-body-text {
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
}
|
|
101
106
|
.schema-table__th__trigger-el {
|
|
102
107
|
display: none;
|
|
103
108
|
position: absolute;
|