@megha-ui/react 1.2.445 → 1.2.446
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.
|
@@ -4,6 +4,7 @@ import Shimmer from "./shimmer";
|
|
|
4
4
|
import Checkbox from "../../checkbox";
|
|
5
5
|
import { formatValue } from "../../../services/commonService";
|
|
6
6
|
import { MdDragIndicator } from "react-icons/md";
|
|
7
|
+
import { Tooltip } from "react-tooltip";
|
|
7
8
|
const isUrl = (value) => {
|
|
8
9
|
if (value) {
|
|
9
10
|
const urlPattern = new RegExp("^(https?:\\/\\/)?" +
|
|
@@ -122,15 +123,9 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
|
|
|
122
123
|
? "var(--row-bg)"
|
|
123
124
|
: "var(--row-bg-even)" }), onClick: handleRowClick, children: [bulkSelect && (_jsx("div", { style: Object.assign(Object.assign({}, cellStyle), { textTransform: "uppercase", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis" }), children: _jsx(Checkbox, { noLabel: true, disabled: ignoreRowSelect &&
|
|
124
125
|
ignoreRowSelect.has((_p = item["id"].value) === null || _p === void 0 ? void 0 : _p.toString()), onChange: () => { var _a; return toggleRowSelection((_a = item["id"].value) === null || _a === void 0 ? void 0 : _a.toString()); }, selected: item["id"] && selectedRows.has(item["id"].value), wrapperClass: checkboxWrapper }) })), columns.map((column, colIndex) => {
|
|
125
|
-
var _a, _b, _c;
|
|
126
|
+
var _a, _b, _c, _d, _e;
|
|
126
127
|
const cellData = item[column.key];
|
|
127
|
-
const cellValue = cellData && Object.keys(cellData).includes("html")
|
|
128
|
-
? cellData === null || cellData === void 0 ? void 0 : cellData.html
|
|
129
|
-
: cellData && Object.keys(cellData).includes("value")
|
|
130
|
-
? formatValue(cellData === null || cellData === void 0 ? void 0 : cellData.value, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", locale, formatOptions)
|
|
131
|
-
: cellData
|
|
132
|
-
? cellData
|
|
133
|
-
: "";
|
|
128
|
+
const cellValue = cellData && cellData.isArrayString ? (_jsxs("div", { "data-tooltip-id": (_a = item.id.value.toString()) !== null && _a !== void 0 ? _a : colIndex.toString(), "data-tooltip-html": cellData.value.toString(), children: ["Multiple", _jsx(Tooltip, { className: "custom-tooltip", id: (_b = item.id.value.toString()) !== null && _b !== void 0 ? _b : colIndex.toString(), place: "top" })] })) : 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) : ("");
|
|
134
129
|
const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
|
|
135
130
|
const isHidden = column.overflowHidden;
|
|
136
131
|
if (!column.hidden && !groupByKeys.includes(column.key)) {
|
|
@@ -161,7 +156,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
|
|
|
161
156
|
column.dataType === "currency"
|
|
162
157
|
? "end"
|
|
163
158
|
: "start",
|
|
164
|
-
}, children: isUrl(cellUrl) ? (_jsx("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) }))] }, `${column.key}-${(
|
|
159
|
+
}, children: isUrl(cellUrl) ? (_jsx("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) }))] }, `${column.key}-${(_e = (_d = item.id) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : index}`));
|
|
165
160
|
}
|
|
166
161
|
return null;
|
|
167
162
|
})] }, String((_r = (_q = item.id) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : index)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megha-ui/react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.446",
|
|
4
4
|
"description": "A collection of reusable UI components for React applications, built with TypeScript.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"file-saver": "^2.0.5",
|
|
46
46
|
"react-icons": "^5.5.0",
|
|
47
|
+
"react-tooltip": "^5.30.0",
|
|
47
48
|
"styled-components": "^6.1.19",
|
|
48
49
|
"uuid": "^11.1.0",
|
|
49
50
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|