@megha-ui/react 1.2.490 → 1.2.491

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.
@@ -19,7 +19,7 @@ const isUrl = (value) => {
19
19
  }
20
20
  return false;
21
21
  };
22
- const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRows, toggleRowSelection, columns, widthMode, index, rowKey, hasVerticalScroll, onRowClick, loading, groupBy, rowIndex, columnIndex, hlBorderColor, handleDragStart, handleDragOver, handleDrop, draggable, checkboxWrapper, hugColumnWidths, hugColumnHeights, alternateRowColor, isExpandable, expandedRow, ignoreRowSelect, locale, formatOptions, actionsKey }) => {
22
+ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRows, toggleRowSelection, columns, widthMode, index, rowKey, hasVerticalScroll, onRowClick, loading, groupBy, rowIndex, columnIndex, hlBorderColor, handleDragStart, handleDragOver, handleDrop, draggable, checkboxWrapper, hugColumnWidths, hugColumnHeights, alternateRowColor, isExpandable, expandedRow, ignoreRowSelect, locale, formatOptions, actionsKey, }) => {
23
23
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
24
24
  const [itemsAlign, setItemsAlign] = useState("stretch");
25
25
  const [draggableIndex, setDraggableIndex] = useState(0);
@@ -125,16 +125,22 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
125
125
  ? "var(--row-bg)"
126
126
  : "var(--row-bg-even)" }), 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 &&
127
127
  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) => {
128
- var _a, _b, _c, _d, _e;
128
+ var _a, _b, _c, _d, _e, _f;
129
129
  const cellData = item[column.key];
130
- 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
131
- .toString()
132
- .split(">>")
133
- .map((item) => `<div>${item}</div>`)
134
- .join("")}</div>`, children: cellData.value.toString().split(">>").length > 1 ? (_jsx(_Fragment, { children: column.isArrayString ?
135
- _jsxs("div", { className: "flex items-center gap-2", children: [cellData.value.toString().split(">>").slice(0, 3).map(item => (_jsx("div", { className: "flex-grow-0 flex-shrink-0 rounded-lg", style: { background: "var(--brand)", color: "#fff", padding: "0.25rem 0.5rem" }, children: item }))), _jsxs("div", { className: "flex-grow-0 flex-shrink-0", children: ["+ ", cellData.value.toString().split(">>").slice(3).length, " more"] })] })
136
- :
137
- _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) : ("");
130
+ const cellValue = cellData && cellData.isArrayString ? (_jsx("div", { children: cellData.value.toString().split(">>").length > 1 ? (_jsx(_Fragment, { children: column.isArrayString ? (_jsxs("div", { className: "flex items-center gap-2", children: [cellData.value
131
+ .toString()
132
+ .split(">>")
133
+ .slice(0, 3)
134
+ .map((item, index) => (_jsx("div", { className: "flex-grow-0 flex-shrink-0 rounded-lg", style: {
135
+ background: "var(--brand)",
136
+ color: "#fff",
137
+ padding: "0.25rem 0.5rem",
138
+ opacity: index % 2 === 0 ? 0.5 : 1
139
+ }, children: item }))), _jsxs("div", { className: "flex-grow-0 flex-shrink-0", children: ["+", " ", cellData.value.toString().split(">>").slice(3).length, " ", "more"] }), _jsx(Tooltip, { className: "custom-tooltip", id: (_a = item.id.value.toString()) !== null && _a !== void 0 ? _a : colIndex.toString(), place: "top" })] })) : (_jsxs(_Fragment, { children: [_jsxs("span", { "data-tooltip-id": (_b = item.id.value.toString()) !== null && _b !== void 0 ? _b : colIndex.toString(), "data-tooltip-html": `<div class="flex flex-col">${cellData.value
140
+ .toString()
141
+ .split(">>")
142
+ .map((item) => `<div>${item}</div>`)
143
+ .join("")}</div>`, children: ["Multiple", " ", `(${cellData.value.toString().split(">>").length})`] }), _jsx(Tooltip, { className: "custom-tooltip", id: (_c = item.id.value.toString()) !== null && _c !== void 0 ? _c : 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, (_d = column.dataType) !== null && _d !== void 0 ? _d : "string", locale, formatOptions)) : cellData ? (cellData) : ("");
138
144
  const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
139
145
  const isHidden = column.overflowHidden;
140
146
  if (!column.hidden && !groupByKeys.includes(column.key)) {
@@ -165,7 +171,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
165
171
  column.dataType === "currency"
166
172
  ? "end"
167
173
  : "start",
168
- }, 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}`));
174
+ }, children: isUrl(cellUrl) ? (_jsx("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) }))] }, `${column.key}-${(_f = (_e = item.id) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : index}`));
169
175
  }
170
176
  return null;
171
177
  })] }, 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.490",
3
+ "version": "1.2.491",
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",