@megha-ui/react 1.2.468 → 1.2.470
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.
|
@@ -131,7 +131,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
|
|
|
131
131
|
.toString()
|
|
132
132
|
.split(">>")
|
|
133
133
|
.map((item) => `<div>${item}</div>`)
|
|
134
|
-
.join("")}</div>`, children: cellData.value.toString().split(">>").length > 1 ? (_jsxs(_Fragment, { children: [
|
|
134
|
+
.join("")}</div>`, children: cellData.value.toString().split(">>").length > 1 ? (_jsxs(_Fragment, { children: [_jsxs("span", { children: ["Multiple ", `(${cellData.value.toString().split(">>").length})`] }), _jsx(Tooltip, { className: "custom-tooltip", id: (_b = item.id.value.toString()) !== null && _b !== void 0 ? _b : colIndex.toString(), place: "top" })] })) : (_jsx("span", { children: cellData.value })) })) : cellData && Object.keys(cellData).includes("html") ? (cellData === null || cellData === void 0 ? void 0 : cellData.html) : cellData && Object.keys(cellData).includes("value") ? (formatValue(cellData === null || cellData === void 0 ? void 0 : cellData.value, (_c = column.dataType) !== null && _c !== void 0 ? _c : "string", locale, formatOptions)) : cellData ? (cellData) : ("");
|
|
135
135
|
const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
|
|
136
136
|
const isHidden = column.overflowHidden;
|
|
137
137
|
if (!column.hidden && !groupByKeys.includes(column.key)) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback, useMemo } from "react";
|
|
3
3
|
import Shimmer from "./shimmer";
|
|
4
|
+
import { Tooltip } from "react-tooltip";
|
|
4
5
|
const isUrl = (value) => {
|
|
5
6
|
if (value) {
|
|
6
7
|
const urlPattern = new RegExp("^(https?:\\/\\/)?" +
|
|
@@ -54,15 +55,13 @@ const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode,
|
|
|
54
55
|
}), columns
|
|
55
56
|
.filter((column) => !groupByKeys.includes(column.key))
|
|
56
57
|
.map((column, colIndex) => {
|
|
57
|
-
var _a, _b;
|
|
58
|
+
var _a, _b, _c, _d;
|
|
58
59
|
const cellData = item[column.key];
|
|
59
|
-
const cellValue = cellData &&
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
: cellData
|
|
64
|
-
? cellData
|
|
65
|
-
: "";
|
|
60
|
+
const cellValue = cellData && cellData.isArrayString ? (_jsx("div", { "data-tooltip-id": (_a = item.id.value.toString()) !== null && _a !== void 0 ? _a : colIndex.toString(), "data-tooltip-html": `<div class="flex flex-col">${cellData.value
|
|
61
|
+
.toString()
|
|
62
|
+
.split(">>")
|
|
63
|
+
.map((item) => `<div>${item}</div>`)
|
|
64
|
+
.join("")}</div>`, children: cellData.value.toString().split(">>").length > 1 ? (_jsxs(_Fragment, { children: [_jsxs("span", { children: ["Multiple ", `(${cellData.value.toString().split(">>").length})`] }), _jsx(Tooltip, { className: "custom-tooltip", id: (_b = item.id.value.toString()) !== null && _b !== void 0 ? _b : colIndex.toString(), place: "top" })] })) : (_jsx("span", { children: cellData.value })) })) : cellData && Object.keys(cellData).includes("html") ? (cellData === null || cellData === void 0 ? void 0 : cellData.html) : cellData && Object.keys(cellData).includes("value") ? (cellData === null || cellData === void 0 ? void 0 : cellData.value) : cellData ? (cellData) : ("");
|
|
66
65
|
const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
|
|
67
66
|
const isHidden = column.overflowHidden;
|
|
68
67
|
if (!column.hidden) {
|
|
@@ -89,7 +88,7 @@ const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode,
|
|
|
89
88
|
column.dataType === "currency"
|
|
90
89
|
? "end"
|
|
91
90
|
: "start",
|
|
92
|
-
}, children: isUrl(cellUrl) ? (_jsx("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) })) }, `${column.key}-${(
|
|
91
|
+
}, children: isUrl(cellUrl) ? (_jsx("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) })) }, `${column.key}-${(_d = (_c = item.id) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : index}`));
|
|
93
92
|
}
|
|
94
93
|
return null;
|
|
95
94
|
})] }));
|
package/package.json
CHANGED