@megha-ui/react 1.2.201 → 1.2.203

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.
@@ -12,6 +12,7 @@ interface RadioInputProps {
12
12
  label?: string;
13
13
  value?: string;
14
14
  disabled?: boolean;
15
+ id?: string;
15
16
  }
16
17
  declare const Checkbox: React.FC<RadioInputProps>;
17
18
  export default Checkbox;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from "react";
3
- const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, label, value, labelMargin, style, indeterminate, selected = false, }) => {
3
+ const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, label, value, labelMargin, style, indeterminate, selected = false, id }) => {
4
4
  const checkboxWrapper = useRef(null);
5
5
  useEffect(() => {
6
6
  let checkbox = null;
@@ -16,10 +16,10 @@ const Checkbox = ({ onChange, disabled, wrapperClass, name, width, noLabel, labe
16
16
  }, [indeterminate]);
17
17
  return (_jsx("div", { ref: checkboxWrapper, className: wrapperClass, style: style, children: _jsxs("label", { style: {
18
18
  width: width,
19
- display: "inline-flex",
19
+ display: "flex",
20
20
  alignItems: "center",
21
21
  margin: labelMargin,
22
- }, children: [_jsx("input", { type: "checkbox", id: "checkbox", name: name, value: value, checked: selected, disabled: disabled, onChange: (event) => onChange(event.target.checked) }), _jsx("span", { style: {
22
+ }, children: [_jsx("input", { type: "checkbox", className: "checkbox", id: id, name: name, value: value, checked: selected, disabled: disabled, onChange: (event) => onChange(event.target.checked) }), _jsx("span", { style: {
23
23
  marginRight: !noLabel ? "0.5rem" : "",
24
24
  display: "flex",
25
25
  alignItems: "center",
@@ -351,7 +351,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
351
351
  if (!option.disabled) {
352
352
  setHighlightIndex(index);
353
353
  }
354
- }, children: [isMultiple && (_jsx("div", { style: { marginLeft: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues.includes(option.value), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }) })), _jsxs("div", { style: {
354
+ }, children: [isMultiple && (_jsx("div", { style: { marginRight: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues.includes(option.value), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }) })), _jsxs("div", { style: {
355
355
  display: "flex",
356
356
  alignItems: "start",
357
357
  width: "100%",
@@ -47,7 +47,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
47
47
  }
48
48
  setDraggableIndex(_dragIndex);
49
49
  }, [columns]);
50
- return isExpandable &&
50
+ return isExpandable && item.id.value &&
51
51
  expandedRow === item.id.value &&
52
52
  item.expandedDetails ? (_jsxs("div", { children: [_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
53
53
  ? "var(--row-bg)"
@@ -109,7 +109,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
109
109
  }, 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}`));
110
110
  }
111
111
  return null;
112
- })] }), isExpandable &&
112
+ })] }), isExpandable && item.id.value &&
113
113
  expandedRow === item.id.value &&
114
114
  item.expandedDetails &&
115
115
  item.expandedDetails.html] }, String((_g = (_f = item.id) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : index))) : (_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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.201",
3
+ "version": "1.2.203",
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",