@megha-ui/react 1.2.139 → 1.2.141
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/hooks/useSort.js +4 -4
- package/dist/components/grid/utils/SummariseDetails.js +2 -1
- 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
|
@@ -12,19 +12,19 @@ const useSort = (data, columns, uniqueSearch, multiSorting, withAscii) => {
|
|
|
12
12
|
const column = columns.find((col) => col.key === key);
|
|
13
13
|
const order = orders[i] === "asc" ? 1 : -1;
|
|
14
14
|
const aValue = ((_a = a[key]) === null || _a === void 0 ? void 0 : _a.value)
|
|
15
|
-
? (column === null || column === void 0 ? void 0 : column.dataType) && (column === null || column === void 0 ? void 0 : column.dataType) === "number"
|
|
15
|
+
? (column === null || column === void 0 ? void 0 : column.dataType) && ((column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency")
|
|
16
16
|
? parseFloat((_c = (_b = a[key]) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.toString())
|
|
17
17
|
: withAscii
|
|
18
18
|
? (_e = (_d = a[key]) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.toString()
|
|
19
19
|
: (_g = (_f = a[key]) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.toString().toUpperCase()
|
|
20
|
-
: (column === null || column === void 0 ? void 0 : column.dataType) === "number" ? 0 : "";
|
|
20
|
+
: ((column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency") ? 0 : "";
|
|
21
21
|
const bValue = ((_h = b[key]) === null || _h === void 0 ? void 0 : _h.value)
|
|
22
|
-
? (column === null || column === void 0 ? void 0 : column.dataType) && (column === null || column === void 0 ? void 0 : column.dataType) === "number"
|
|
22
|
+
? (column === null || column === void 0 ? void 0 : column.dataType) && ((column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency")
|
|
23
23
|
? parseFloat((_k = (_j = b[key]) === null || _j === void 0 ? void 0 : _j.value) === null || _k === void 0 ? void 0 : _k.toString())
|
|
24
24
|
: withAscii
|
|
25
25
|
? (_m = (_l = b[key]) === null || _l === void 0 ? void 0 : _l.value) === null || _m === void 0 ? void 0 : _m.toString()
|
|
26
26
|
: (_p = (_o = b[key]) === null || _o === void 0 ? void 0 : _o.value) === null || _p === void 0 ? void 0 : _p.toString().toUpperCase()
|
|
27
|
-
: (column === null || column === void 0 ? void 0 : column.dataType) === "number" ? 0 : "";
|
|
27
|
+
: ((column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency") ? 0 : "";
|
|
28
28
|
if (aValue < bValue)
|
|
29
29
|
return -1 * order;
|
|
30
30
|
if (aValue > bValue)
|
|
@@ -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)
|
|
@@ -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