@megha-ui/react 1.3.33 → 1.3.35
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.
- package/README.md +5 -5
- package/dist/components/IconDropDown/index.js +1 -1
- package/dist/components/card/index.js +6 -1
- package/dist/components/chat/components/ChatDetails.js +27 -6
- package/dist/components/chat/components/ChatList.js +5 -1
- package/dist/components/chat/index.js +5 -1
- package/dist/components/dropdown/index.js +19 -22
- package/dist/components/grid/hooks/useBulkSelect.js +1 -1
- package/dist/components/grid/hooks/useSort.js +3 -1
- package/dist/components/grid/index.js +1 -1
- package/dist/components/grid/utils/globalSearchChips.js +11 -3
- package/dist/components/grid/utils/gridHeader.js +1 -1
- package/dist/components/grid/utils/groupedGridDetails.js +3 -1
- package/dist/components/grid/utils/groupedRow.js +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/texteditor/index.js +3 -1
- package/dist/context/DensityContext.js +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -88,11 +88,11 @@ A flexible grid component.
|
|
|
88
88
|
|
|
89
89
|
#### Props:
|
|
90
90
|
|
|
91
|
-
| Prop | Type | Default | Description
|
|
92
|
-
| --------- | --------------------------------------- | ------- |
|
|
93
|
-
| `data` | `Array<Object>` | `[]` | Array of data to display
|
|
94
|
-
| `columns` | `Array<{ key: string; label: string }>` | `[]` | Column configuration
|
|
95
|
-
| `rowKey` | `string` | `"id"`
|
|
91
|
+
| Prop | Type | Default | Description |
|
|
92
|
+
| --------- | --------------------------------------- | ------- | ---------------------------------- |
|
|
93
|
+
| `data` | `Array<Object>` | `[]` | Array of data to display |
|
|
94
|
+
| `columns` | `Array<{ key: string; label: string }>` | `[]` | Column configuration |
|
|
95
|
+
| `rowKey` | `string` | `"id"` | Field used for stable row identity |
|
|
96
96
|
|
|
97
97
|
Columns also accept a `freeze` property. When set to `true`, such columns remain visible when the grid is collapsed using the collapse icon.
|
|
98
98
|
|
|
@@ -169,7 +169,7 @@ const IconDropdown = ({ className, ClearIcon, clearId, closeOnSelect = true, dis
|
|
|
169
169
|
onChange([]);
|
|
170
170
|
};
|
|
171
171
|
const displayValue = selectedValues.length > 0
|
|
172
|
-
? (_b = (_a = options.find((option) => option.value === selectedValues[0])) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : ""
|
|
172
|
+
? ((_b = (_a = options.find((option) => option.value === selectedValues[0])) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "")
|
|
173
173
|
: searchTerm;
|
|
174
174
|
const labelStyle = {
|
|
175
175
|
fontSize: labelFontSize,
|
|
@@ -29,6 +29,11 @@ const Card = ({ header, content, footer, className, borderRadius = "0.5rem", wid
|
|
|
29
29
|
setRemovalHeight(`${_removalHeight}px`);
|
|
30
30
|
}
|
|
31
31
|
}, [header, footer]);
|
|
32
|
-
return (_jsxs("div", { ref: cardRef, className: `wk-card ${className}`, style: cardStyle, children: [header && (_jsx("div", { id: "header", className: "wk-card-header", children: header })), _jsx("div", { className: "wk-card-content", style: {
|
|
32
|
+
return (_jsxs("div", { ref: cardRef, className: `wk-card ${className}`, style: cardStyle, children: [header && (_jsx("div", { id: "header", className: "wk-card-header", children: header })), _jsx("div", { className: "wk-card-content", style: {
|
|
33
|
+
height: height === "max-content"
|
|
34
|
+
? "max-content"
|
|
35
|
+
: `calc(100% - ${removalHeight})`,
|
|
36
|
+
overflow: "auto",
|
|
37
|
+
}, children: content }), footer && (_jsx("div", { id: "footer", className: "wk-card-footer", children: footer }))] }));
|
|
33
38
|
};
|
|
34
39
|
export default Card;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect, useRef } from "react";
|
|
3
3
|
import { VscSend } from "react-icons/vsc";
|
|
4
4
|
import { FaUsers } from "react-icons/fa";
|
|
5
|
-
const ChatDetails = ({ selectedUser, currentUserId }) => {
|
|
5
|
+
const ChatDetails = ({ selectedUser, currentUserId, }) => {
|
|
6
6
|
const [messages, setMessages] = useState([]);
|
|
7
7
|
const [newMessage, setNewMessage] = useState("");
|
|
8
8
|
const endRef = useRef(null);
|
|
@@ -27,9 +27,14 @@ const ChatDetails = ({ selectedUser, currentUserId }) => {
|
|
|
27
27
|
setNewMessage("");
|
|
28
28
|
};
|
|
29
29
|
if (!selectedUser) {
|
|
30
|
-
return _jsx("div", { className: "wk-chat-placeholder", style: { flex: 1, padding: 16 }, children: "Select a chat" });
|
|
30
|
+
return (_jsx("div", { className: "wk-chat-placeholder", style: { flex: 1, padding: 16 }, children: "Select a chat" }));
|
|
31
31
|
}
|
|
32
|
-
return (_jsxs("div", { className: "wk-chat-details", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [_jsxs("div", { className: "wk-chat-header", style: {
|
|
32
|
+
return (_jsxs("div", { className: "wk-chat-details", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [_jsxs("div", { className: "wk-chat-header", style: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
padding: "8px",
|
|
36
|
+
borderBottom: "1px solid var(--divider, #f5f5f5)",
|
|
37
|
+
}, children: [_jsx("div", { className: "wk-chat-user-icon", style: {
|
|
33
38
|
width: 32,
|
|
34
39
|
height: 32,
|
|
35
40
|
borderRadius: "50%",
|
|
@@ -47,15 +52,31 @@ const ChatDetails = ({ selectedUser, currentUserId }) => {
|
|
|
47
52
|
display: "flex",
|
|
48
53
|
justifyContent: m.senderId === currentUserId ? "flex-end" : "flex-start",
|
|
49
54
|
}, children: _jsx("div", { style: {
|
|
50
|
-
background: m.senderId === currentUserId
|
|
55
|
+
background: m.senderId === currentUserId
|
|
56
|
+
? "var(--background)"
|
|
57
|
+
: "var(--background)",
|
|
51
58
|
padding: "6px 8px",
|
|
52
59
|
borderRadius: 4,
|
|
53
60
|
maxWidth: "70%",
|
|
54
|
-
}, children: m.text }) }, m.id))), _jsx("div", { ref: endRef })] }), _jsxs("div", { className: "wk-chat-input", style: {
|
|
61
|
+
}, children: m.text }) }, m.id))), _jsx("div", { ref: endRef })] }), _jsxs("div", { className: "wk-chat-input", style: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
padding: 8,
|
|
64
|
+
borderTop: "1px solid var(--divider, #f5f5f5)",
|
|
65
|
+
}, children: [_jsx("input", { type: "text", value: newMessage, onChange: (e) => setNewMessage(e.target.value), onKeyDown: (e) => {
|
|
55
66
|
if (e.key === "Enter") {
|
|
56
67
|
e.preventDefault();
|
|
57
68
|
handleSend();
|
|
58
69
|
}
|
|
59
|
-
}, style: {
|
|
70
|
+
}, style: {
|
|
71
|
+
flex: 1,
|
|
72
|
+
border: "1px solid var(--form-border-color, #dbdfe9)",
|
|
73
|
+
borderRadius: 4,
|
|
74
|
+
padding: "6px",
|
|
75
|
+
} }), _jsx("button", { onClick: handleSend, style: {
|
|
76
|
+
marginLeft: 8,
|
|
77
|
+
background: "transparent",
|
|
78
|
+
border: "none",
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
}, children: _jsx(VscSend, { size: 20 }) })] })] }));
|
|
60
81
|
};
|
|
61
82
|
export default ChatDetails;
|
|
@@ -52,7 +52,11 @@ const ChatList = ({ users, onSelectUser, selectedUserId, unreadCounts = {}, }) =
|
|
|
52
52
|
alignItems: "center",
|
|
53
53
|
justifyContent: "center",
|
|
54
54
|
fontSize: "0.75rem",
|
|
55
|
-
}, children: unreadCounts[user.id] })), _jsx("div", { style: {
|
|
55
|
+
}, children: unreadCounts[user.id] })), _jsx("div", { style: {
|
|
56
|
+
marginLeft: 8,
|
|
57
|
+
fontSize: "0.75rem",
|
|
58
|
+
color: "var(--foreground)",
|
|
59
|
+
}, children: formatTimestamp(user.latestMessageTimestamp) })] }, user.id));
|
|
56
60
|
})) : (_jsx("div", { style: { padding: 16, textAlign: "center" }, children: _jsx(Loader, { size: 24 }) })) }));
|
|
57
61
|
};
|
|
58
62
|
export default ChatList;
|
|
@@ -4,6 +4,10 @@ import ChatList from "./components/ChatList";
|
|
|
4
4
|
import ChatDetails from "./components/ChatDetails";
|
|
5
5
|
const Chat = ({ users, currentUserId }) => {
|
|
6
6
|
const [selectedUser, setSelectedUser] = useState(null);
|
|
7
|
-
return (_jsxs("div", { className: "wk-chat-container", style: {
|
|
7
|
+
return (_jsxs("div", { className: "wk-chat-container", style: {
|
|
8
|
+
display: "flex",
|
|
9
|
+
border: "1px solid var(--form-border-color, #dbdfe9)",
|
|
10
|
+
height: "400px",
|
|
11
|
+
}, children: [_jsx(ChatList, { users: users, onSelectUser: setSelectedUser, selectedUserId: selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id }), _jsx(ChatDetails, { selectedUser: selectedUser, currentUserId: currentUserId })] }));
|
|
8
12
|
};
|
|
9
13
|
export default Chat;
|
|
@@ -479,28 +479,25 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
479
479
|
}, children: [option.icon &&
|
|
480
480
|
option.isDelete &&
|
|
481
481
|
!option.isDelete && _jsx("span", { children: option.icon }), _jsx("span", { style: { margin: "0 0.5rem" }, children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value)));
|
|
482
|
-
}) }))] }, gIndex)))) : (filteredOptions.map((option, index) => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
?
|
|
492
|
-
:
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
width: "100%",
|
|
502
|
-
}, children: [option.icon && option.isDelete && !option.isDelete && (_jsx("span", { style: { margin: "0 0.5rem" }, children: option.icon })), _jsx("span", { children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value)));
|
|
503
|
-
})) }), onApplyChange && (_jsx("li", { style: {
|
|
482
|
+
}) }))] }, gIndex)))) : (filteredOptions.map((option, index) => (_jsxs("li", { ref: (el) => {
|
|
483
|
+
optionRefs.current[index] = el;
|
|
484
|
+
}, onClick: (e) => onSelectChange
|
|
485
|
+
? handleItemSelect(option, option.disabled || false)
|
|
486
|
+
: handleSelect(option.value, option.disabled || false), style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center" }), (index === highlightIndex ? listItemHoverStyle : {})), (option.disabled ? listItemDisabledStyle : {})), (index !== highlightIndex &&
|
|
487
|
+
!isMultiple &&
|
|
488
|
+
intermediateValues.includes(option.value)
|
|
489
|
+
? selectedItemStyle
|
|
490
|
+
: {})), { borderBottom: index === filteredOptions.length - 1
|
|
491
|
+
? "none"
|
|
492
|
+
: "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
|
|
493
|
+
if (!option.disabled) {
|
|
494
|
+
setHighlightIndex(index);
|
|
495
|
+
}
|
|
496
|
+
}, 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: {
|
|
497
|
+
display: "flex",
|
|
498
|
+
alignItems: "start",
|
|
499
|
+
width: "100%",
|
|
500
|
+
}, children: [option.icon && !option.isDelete ? (_jsx("span", { style: { margin: "0 0.5rem" }, children: option.icon })) : (_jsx("span", { children: "something" })), _jsx("span", { children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value))))) }), onApplyChange && (_jsx("li", { style: {
|
|
504
501
|
display: "flex",
|
|
505
502
|
alignItems: "center",
|
|
506
503
|
justifyContent: "end",
|
|
@@ -17,7 +17,7 @@ export const useBulkSelect = ({ data, selectedRows, setSelectedRows, idKey, }) =
|
|
|
17
17
|
setSelectedRows &&
|
|
18
18
|
setSelectedRows((prevSelectedRows) => {
|
|
19
19
|
const newSelectedRows = new Set(prevSelectedRows);
|
|
20
|
-
console.log(visibleData.map(item => item === null || item === void 0 ? void 0 : item[idKey]));
|
|
20
|
+
console.log(visibleData.map((item) => item === null || item === void 0 ? void 0 : item[idKey]));
|
|
21
21
|
if (allSelected) {
|
|
22
22
|
visibleData.forEach((item) => { var _a; return newSelectedRows.delete((_a = item === null || item === void 0 ? void 0 : item[idKey].value) === null || _a === void 0 ? void 0 : _a.toString()); });
|
|
23
23
|
}
|
|
@@ -52,7 +52,9 @@ export const useSort = (data, columns, uniqueSearch, multiSorting, withAscii, co
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
else if (key !== "id" &&
|
|
55
|
+
else if (key !== "id" &&
|
|
56
|
+
aValue.toString().includes("-") &&
|
|
57
|
+
bValue.toString().includes("-")) {
|
|
56
58
|
aValue = aValue.toString().split("-")[0];
|
|
57
59
|
bValue = bValue.toString().split("-")[0];
|
|
58
60
|
aValue = isNaN(parseFloat(aValue)) ? aValue : parseFloat(aValue);
|
|
@@ -550,7 +550,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
550
550
|
data: sortedData,
|
|
551
551
|
selectedRows: selectedCheckBox,
|
|
552
552
|
setSelectedRows: setSelectedCheckbox,
|
|
553
|
-
idKey: bulkId
|
|
553
|
+
idKey: bulkId,
|
|
554
554
|
});
|
|
555
555
|
const [hasVerticalScroll, setHasVerticalScroll] = useState(false);
|
|
556
556
|
const [rowOpened, setRowOpened] = useState([]);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import TextInput from "../../text-input";
|
|
4
4
|
import { FiSearch } from "react-icons/fi";
|
|
5
|
-
const GlobalSearchChiProps = ({ globalInputSearch, setGlobalInputSearch, chips, setChips, inputValue, setInputValue, expanded, setExpanded, shouldClose = true }) => {
|
|
5
|
+
const GlobalSearchChiProps = ({ globalInputSearch, setGlobalInputSearch, chips, setChips, inputValue, setInputValue, expanded, setExpanded, shouldClose = true, }) => {
|
|
6
6
|
const wrapperRef = useRef(null);
|
|
7
7
|
const inputDiv = useRef(null);
|
|
8
8
|
useEffect(() => {
|
|
@@ -36,14 +36,22 @@ const GlobalSearchChiProps = ({ globalInputSearch, setGlobalInputSearch, chips,
|
|
|
36
36
|
const handleClickOutside = (e) => {
|
|
37
37
|
if (wrapperRef.current &&
|
|
38
38
|
!wrapperRef.current.contains(e.target) &&
|
|
39
|
-
!globalInputSearch &&
|
|
39
|
+
!globalInputSearch &&
|
|
40
|
+
!inputValue &&
|
|
41
|
+
shouldClose) {
|
|
40
42
|
setExpanded(false);
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
45
|
document.addEventListener("mousedown", handleClickOutside);
|
|
44
46
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
45
47
|
}, [expanded, chips.length, globalInputSearch, inputValue, shouldClose]);
|
|
46
|
-
return (_jsxs("div", { style: {
|
|
48
|
+
return (_jsxs("div", { style: {
|
|
49
|
+
width: "100%",
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
border: expanded ? "1px solid var(--border)" : "none",
|
|
53
|
+
borderRadius: "0.25rem",
|
|
54
|
+
}, ref: wrapperRef, children: [_jsx("div", { onClick: () => setExpanded(true), style: { cursor: "pointer", paddingLeft: "0.5rem" }, children: _jsx(FiSearch, {}) }), _jsx("div", { ref: inputDiv, style: { flexGrow: 1 }, children: expanded && (_jsx(TextInput, { value: inputValue, placeholder: "Global search", extraInputStyle: { outline: "none" }, onChange: (e) => setInputValue(e.target.value), border: "none", onKeyDown: (e) => {
|
|
47
55
|
if (e.key === "Enter") {
|
|
48
56
|
setGlobalInputSearch([...new Set([...chips, e.currentTarget.value])].join(","));
|
|
49
57
|
setInputValue("");
|
|
@@ -68,7 +68,7 @@ export const getColumnData = (columnKey, gridData, type, combinedColumns) => {
|
|
|
68
68
|
return 0;
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resizable = false, defaultSearchOperation, sortQueries, onSort, bulkSelect, allRowsSelected, someRowsSelected, toggleSelectAll, cellStyle, widthMode, rowHeight, headerRef, showMenu, headerBackground, headerTopBorder, headerBottomBorder, groupBy, setGroupBy, updateGridColumns, setGridColumns, headerDropdownIndex, widthUnits, textFilterLabel = "Text Filter", gridData, checkboxWrapper, onFilter, setUniqueSearch, uniqueSearch, hugColumnWidths, menuVisible, setMenuVisible, dropdownVisible, setDropdownVisible, actionsKey = "actions", columnSearchOutside, locale, formatOptions, combinedColumns }) => {
|
|
71
|
+
const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resizable = false, defaultSearchOperation, sortQueries, onSort, bulkSelect, allRowsSelected, someRowsSelected, toggleSelectAll, cellStyle, widthMode, rowHeight, headerRef, showMenu, headerBackground, headerTopBorder, headerBottomBorder, groupBy, setGroupBy, updateGridColumns, setGridColumns, headerDropdownIndex, widthUnits, textFilterLabel = "Text Filter", gridData, checkboxWrapper, onFilter, setUniqueSearch, uniqueSearch, hugColumnWidths, menuVisible, setMenuVisible, dropdownVisible, setDropdownVisible, actionsKey = "actions", columnSearchOutside, locale, formatOptions, combinedColumns, }) => {
|
|
72
72
|
const [menuPosition, setMenuPosition] = useState(null);
|
|
73
73
|
const [searchOpsPosition, setSearchOpsPosition] = useState(null);
|
|
74
74
|
const [headerColumns, setHeaderColumns] = useState([]);
|
|
@@ -111,7 +111,9 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
111
111
|
alignItems: "center",
|
|
112
112
|
flexWrap: "wrap",
|
|
113
113
|
}, children: [_jsx("span", { style: { marginRight: "0.5rem" }, children: item.html ? _jsx(_Fragment, { children: item.html }) : item.value }), _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] })] }), isSummarise &&
|
|
114
|
-
parseInt(((_d = item === null || item === void 0 ? void 0 : item.count) === null || _d === void 0 ? void 0 : _d.toString()) || "0") > 0 && (_jsx(SummariseDetails, { rowIndex: gIndex, removedKeys: item.groupedKey.split(">"), columns: gridColumns, groupBy: gridGroupBy, sortable: sortable, cellStyle: cellStyle, columnWidths: columnWidths, widthMode: widthMode, summariseKeys: summariseKeys, summariseDetails: summariseDetails, activeCalculateColor: activeCalculateColor, gridRef: gridRef, setCalculatePosition: setCalculatePosition, calculatePosition: calculatePosition, calculatetextColor: calculatetextColor, setCalculateVisible: setCalculateVisible, calculateVisible: calculateVisible, summariseDisplay: summariseDisplay, recalculate: recalculate, groupedData: item.groupedValue, actionsKey: actionsKey }))] }, String((_e = item.groupedValue) !== null && _e !== void 0 ? _e : gIndex))) : (_jsx(GroupedRow, { item: item.rowData, index: gIndex, rowStyle: Object.assign(Object.assign({}, rowStyle), (selectedRow === ((_g = (_f = item.rowData) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.value)
|
|
114
|
+
parseInt(((_d = item === null || item === void 0 ? void 0 : item.count) === null || _d === void 0 ? void 0 : _d.toString()) || "0") > 0 && (_jsx(SummariseDetails, { rowIndex: gIndex, removedKeys: item.groupedKey.split(">"), columns: gridColumns, groupBy: gridGroupBy, sortable: sortable, cellStyle: cellStyle, columnWidths: columnWidths, widthMode: widthMode, summariseKeys: summariseKeys, summariseDetails: summariseDetails, activeCalculateColor: activeCalculateColor, gridRef: gridRef, setCalculatePosition: setCalculatePosition, calculatePosition: calculatePosition, calculatetextColor: calculatetextColor, setCalculateVisible: setCalculateVisible, calculateVisible: calculateVisible, summariseDisplay: summariseDisplay, recalculate: recalculate, groupedData: item.groupedValue, actionsKey: actionsKey }))] }, String((_e = item.groupedValue) !== null && _e !== void 0 ? _e : gIndex))) : (_jsx(GroupedRow, { item: item.rowData, index: gIndex, rowStyle: Object.assign(Object.assign({}, rowStyle), (selectedRow === ((_g = (_f = item.rowData) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.value)
|
|
115
|
+
? selectedRowStyle
|
|
116
|
+
: {})), cellStyle: cellStyle, rowHeight: rowHeight, alternateRowColor: alternateRowColor, bulkSelect: bulkSelect, columns: gridColumns, widthMode: widthMode, rowKey: rowKey, onRowClick: onRowClick, loading: isLoading, groupBy: gridGroupBy, selectedRows: selectedRows, toggleRowSelection: toggleRowSelection, hasVerticalScroll: hasVerticalScroll, hugColumnWidths: columnWidths, actionsKey: actionsKey, ignoreClickKeys: ignoreClickKeys }, String(((_j = (_h = item.rowData) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.value)
|
|
115
117
|
? `${item.groupedValue}-${(_l = (_k = item.rowData) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.value}`
|
|
116
118
|
: gIndex)));
|
|
117
119
|
}) }));
|
|
@@ -16,7 +16,7 @@ const isUrl = (value) => {
|
|
|
16
16
|
}
|
|
17
17
|
return false;
|
|
18
18
|
};
|
|
19
|
-
const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode, index, rowKey, onRowClick, loading, groupBy, hugColumnWidths, alternateRowColor, actionsKey, ignoreClickKeys }) => {
|
|
19
|
+
const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode, index, rowKey, onRowClick, loading, groupBy, hugColumnWidths, alternateRowColor, actionsKey, ignoreClickKeys, }) => {
|
|
20
20
|
const handleRowClick = useCallback((column) => {
|
|
21
21
|
if ((actionsKey === null || actionsKey === void 0 ? void 0 : actionsKey.split(",").includes(column.key)) ||
|
|
22
22
|
(ignoreClickKeys === null || ignoreClickKeys === void 0 ? void 0 : ignoreClickKeys.split(",").includes(column.key)))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
const Textarea = ({ value = "", onChange, onBlur = () => { }, placeholder = "", className = "", disabled = false, rows = 4, cols = 50, width = "100%", height, padding = "0.5rem", borderRadius = 4, fontSize = "0.85rem", resize = "none", labelFontSize, labelFontWeight, labelMarginBottom, asteriskColor, label, required, name }) => {
|
|
2
|
+
const Textarea = ({ value = "", onChange, onBlur = () => { }, placeholder = "", className = "", disabled = false, rows = 4, cols = 50, width = "100%", height, padding = "0.5rem", borderRadius = 4, fontSize = "0.85rem", resize = "none", labelFontSize, labelFontWeight, labelMarginBottom, asteriskColor, label, required, name, }) => {
|
|
3
3
|
const handleTextChange = (event) => {
|
|
4
4
|
onChange(event);
|
|
5
5
|
};
|
|
@@ -215,7 +215,9 @@ const TextEditor = ({ value, onChange, enabledTools = {
|
|
|
215
215
|
borderRadius: "0.25rem",
|
|
216
216
|
cursor: "pointer",
|
|
217
217
|
padding: "0.25rem",
|
|
218
|
-
}, children: collapsed
|
|
218
|
+
}, children: collapsed
|
|
219
|
+
? (toolbarToggleOn !== null && toolbarToggleOn !== void 0 ? toolbarToggleOn : _jsx(SiStyledcomponents, {}))
|
|
220
|
+
: (toolbarToggleOff !== null && toolbarToggleOff !== void 0 ? toolbarToggleOff : _jsx(SiStyledcomponents, {})) }) }), !collapsed && (_jsxs("div", { style: {
|
|
219
221
|
display: "flex",
|
|
220
222
|
gap: "0.65rem",
|
|
221
223
|
marginBottom: "0.65rem",
|
|
@@ -7,6 +7,6 @@ const DensityContext = createContext({
|
|
|
7
7
|
export const DensityProvider = ({ initialDensity = "normal", children }) => {
|
|
8
8
|
const [density, setDensity] = useState(initialDensity);
|
|
9
9
|
const value = useMemo(() => ({ density, setDensity }), [density]);
|
|
10
|
-
return _jsx(DensityContext.Provider, { value: value, children: children });
|
|
10
|
+
return (_jsx(DensityContext.Provider, { value: value, children: children }));
|
|
11
11
|
};
|
|
12
12
|
export const useDensity = () => useContext(DensityContext);
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megha-ui/react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.35",
|
|
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",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc",
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"format:check": "prettier --check .",
|
|
10
12
|
"prepublishOnly": "npm run build",
|
|
11
13
|
"publish:patch": "npm version patch && npm publish --access public",
|
|
12
14
|
"publish:minor": "npm version minor && npm publish --access public",
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
],
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"file-saver": "^2.0.5",
|
|
48
|
+
"prettier": "^3.8.1",
|
|
46
49
|
"react-icons": "^5.5.0",
|
|
47
50
|
"react-tooltip": "^5.30.0",
|
|
48
51
|
"styled-components": "^6.1.19",
|