@megha-ui/react 1.2.140 → 1.2.142
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/dist/components/grid/index.js +0 -1
- package/dist/components/grid/utils/SummariseDetails.js +2 -1
- package/dist/components/grid/utils/gridFilterDropdown.js +0 -2
- package/dist/components/grid/utils/gridHeader.js +4 -2
- package/dist/components/grid/utils/gridRow.js +2 -1
- package/dist/components/grid/utils/groupedRow.js +2 -1
- package/package.json +1 -1
|
@@ -751,7 +751,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
751
751
|
}
|
|
752
752
|
}, [filteredData, gridGroupBy, gridColumns]);
|
|
753
753
|
const handleSearch = (0, react_1.useCallback)((key, value, type) => {
|
|
754
|
-
console.log(value);
|
|
755
754
|
setSearchQueries((prev) => (Object.assign(Object.assign({}, prev), { [key]: { text: value, type, operation: "and" } })));
|
|
756
755
|
}, []);
|
|
757
756
|
(0, react_1.useEffect)(() => {
|
|
@@ -194,7 +194,8 @@ const SummariseDetails = ({ columns, rowIndex, groupBy, sortable, cellStyle, col
|
|
|
194
194
|
display: actionsKey.split(",").includes(column.key)
|
|
195
195
|
? "none"
|
|
196
196
|
: "flex",
|
|
197
|
-
}, onClick: (e) => handleCalculateClick(e, columnKey), children: "Summarise" })), calculateVisible === columnKey && ((0, jsx_runtime_1.jsx)(calculatedropdown_1.default, { rowIndex: rowIndex !== null && rowIndex !== void 0 ? rowIndex : -1, options: calculateOptions.filter((item) => column.dataType === "number"
|
|
197
|
+
}, onClick: (e) => handleCalculateClick(e, columnKey), children: "Summarise" })), calculateVisible === columnKey && ((0, jsx_runtime_1.jsx)(calculatedropdown_1.default, { rowIndex: rowIndex !== null && rowIndex !== void 0 ? rowIndex : -1, options: calculateOptions.filter((item) => column.dataType === "number" ||
|
|
198
|
+
column.dataType === "currency"
|
|
198
199
|
? numberTypeCalcOps.includes(item.value)
|
|
199
200
|
: column.dataType === "date"
|
|
200
201
|
? dateTypeCalcOps.includes(item.value)
|
|
@@ -45,7 +45,6 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
45
45
|
else {
|
|
46
46
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: columnData });
|
|
47
47
|
}
|
|
48
|
-
console.log(_uniqueSeach);
|
|
49
48
|
setUniqueSearch(_uniqueSeach);
|
|
50
49
|
}
|
|
51
50
|
else {
|
|
@@ -59,7 +58,6 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
59
58
|
}
|
|
60
59
|
onFilter(_uniqueSeach, columnKey);
|
|
61
60
|
};
|
|
62
|
-
console.log({ locale, formatOptions });
|
|
63
61
|
return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({ position: "absolute", top: "calc(100% + 5px)" }, (columnIndex > 1 ? { right: 0 } : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.35rem 0", width: "max-content", maxWidth: "500px", borderRadius: "0.5rem", margin: 0 }), ref: headerDropdown, onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput, sortingOps, (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
64
62
|
padding: "0.5rem 0.75rem",
|
|
65
63
|
cursor: "pointer",
|
|
@@ -604,7 +604,8 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
604
604
|
? "#2377ba"
|
|
605
605
|
: "#000",
|
|
606
606
|
} }), dropdownVisible === column.key &&
|
|
607
|
-
(column.uniqueDrop ? ((0, jsx_runtime_1.jsx)(gridFilterDropdown_1.default, { locale: locale, formatOptions: formatOptions, columnType: (_b = column.dataType) !== null && _b !== void 0 ? _b : "string", columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number"
|
|
607
|
+
(column.uniqueDrop ? ((0, jsx_runtime_1.jsx)(gridFilterDropdown_1.default, { locale: locale, formatOptions: formatOptions, columnType: (_b = column.dataType) !== null && _b !== void 0 ? _b : "string", columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
|
|
608
|
+
column.dataType === "currency"
|
|
608
609
|
? numberTypeSearch.includes(item.value)
|
|
609
610
|
: column.dataType === "date"
|
|
610
611
|
? dateTypeSearch.includes(item.value)
|
|
@@ -678,7 +679,8 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
678
679
|
? "var(--background)"
|
|
679
680
|
: "var(--disabled-bg)",
|
|
680
681
|
}, placeholder: "Search", value: ((_j = searchQueries[column.key]) === null || _j === void 0 ? void 0 : _j.text) ||
|
|
681
|
-
"", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) })) })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number"
|
|
682
|
+
"", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) })) })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
|
|
683
|
+
column.dataType === "currency"
|
|
682
684
|
? numberTypeSearch.includes(item.value)
|
|
683
685
|
: column.dataType === "date"
|
|
684
686
|
? dateTypeSearch.includes(item.value)
|
|
@@ -156,7 +156,8 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
|
|
|
156
156
|
width: "100%",
|
|
157
157
|
justifyContent: column.alignment
|
|
158
158
|
? column.alignment
|
|
159
|
-
: column.dataType === "number"
|
|
159
|
+
: column.dataType === "number" ||
|
|
160
|
+
column.dataType === "currency"
|
|
160
161
|
? "end"
|
|
161
162
|
: "start",
|
|
162
163
|
}, children: isUrl(cellUrl) ? ((0, jsx_runtime_1.jsx)("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) }))] }, `${column.key}-${(_c = (_b = item.id) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : index}`));
|
|
@@ -87,7 +87,8 @@ const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode,
|
|
|
87
87
|
width: "100%",
|
|
88
88
|
justifyContent: column.alignment
|
|
89
89
|
? column.alignment
|
|
90
|
-
: column.dataType === "number"
|
|
90
|
+
: column.dataType === "number" ||
|
|
91
|
+
column.dataType === "currency"
|
|
91
92
|
? "end"
|
|
92
93
|
: "start",
|
|
93
94
|
}, children: isUrl(cellUrl) ? ((0, jsx_runtime_1.jsx)("a", { href: cellUrl, target: "_blank", rel: "noopener noreferrer", children: cellValue })) : column.render ? (column.render(cellValue)) : (cellValue) })) }, `${column.key}-${(_b = (_a = item.id) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : index}`));
|
package/package.json
CHANGED