@megha-ui/react 1.2.86 → 1.2.88

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.
@@ -25,6 +25,7 @@ const isUrl = (value) => {
25
25
  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, }) => {
26
26
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
27
27
  const [itemsAlign, setItemsAlign] = (0, react_1.useState)("stretch");
28
+ const [draggableIndex, setDraggableIndex] = (0, react_1.useState)(0);
28
29
  const handleRowClick = (0, react_1.useCallback)(() => {
29
30
  onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(item);
30
31
  }, [onRowClick, item]);
@@ -41,6 +42,13 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
41
42
  ? "start"
42
43
  : "stretch");
43
44
  }, [item]);
45
+ (0, react_1.useEffect)(() => {
46
+ if (draggable && columns.length > 0) {
47
+ if (columns[0].key === "actions") {
48
+ setDraggableIndex(1);
49
+ }
50
+ }
51
+ }, [columns]);
44
52
  return isExpandable &&
45
53
  expandedRow === item.id.value &&
46
54
  item.expandedDetails ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { id: `${index}`, draggable: draggable, onDragStart: (e) => handleDragStart && handleDragStart(e, index), onDragOver: (e) => handleDragOver && handleDragOver(e), onDrop: (e) => handleDrop && handleDrop(e, index), className: getRowClassNames(), style: Object.assign(Object.assign({}, rowStyle), { position: "relative", display: "flex", alignItems: itemsAlign, fontSize: "inherit", minHeight: rowHeight, height: "max-content", boxSizing: "border-box", backgroundColor: alternateRowColor && (index + 1) % 2 === 0
@@ -69,8 +77,6 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
69
77
  : cellData
70
78
  ? cellData
71
79
  : "";
72
- const draggableIndex = column.key === "actions" && colIndex === 0 ? 1 : 0;
73
- console.log(column, colIndex, draggableIndex);
74
80
  const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
75
81
  const isHidden = column.overflowHidden;
76
82
  if (!column.hidden && groupBy !== column.key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.86",
3
+ "version": "1.2.88",
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.mjs",