@megha-ui/react 1.2.40 → 1.2.43
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 +2 -16
- package/dist/components/grid/types/grid.d.ts +1 -1
- package/dist/components/grid/utils/gridFilterDropdown.d.ts +1 -1
- package/dist/components/grid/utils/gridFilterDropdown.js +0 -1
- package/dist/components/grid/utils/gridHeader.d.ts +1 -1
- package/dist/components/grid/utils/gridHeader.js +0 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ const file_saver_1 = require("file-saver");
|
|
|
43
43
|
const pagination_1 = __importDefault(require("./utils/pagination"));
|
|
44
44
|
const gridRow_1 = __importDefault(require("./utils/gridRow"));
|
|
45
45
|
const pagination_2 = require("./utils/pagination");
|
|
46
|
-
const gridHeader_1 =
|
|
46
|
+
const gridHeader_1 = __importDefault(require("./utils/gridHeader"));
|
|
47
47
|
const useSort_1 = require("./hooks/useSort");
|
|
48
48
|
const usePagination_1 = require("./hooks/usePagination");
|
|
49
49
|
const useBulkSelect_1 = require("./hooks/useBulkSelect");
|
|
@@ -992,35 +992,21 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
992
992
|
};
|
|
993
993
|
const filterDetails = (0, react_1.useMemo)(() => {
|
|
994
994
|
const filterColumn = gridColumns.reduce((acc, column) => {
|
|
995
|
-
var _a, _b;
|
|
996
995
|
const query = searchQueries[column.key];
|
|
997
|
-
const uniqeValues = (0, gridHeader_1.getColumnData)(column.key, filteredData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
|
|
998
|
-
console.log(uniqeValues, uniqueSearch, column.key);
|
|
999
996
|
if (query &&
|
|
1000
997
|
(query.text !== "" || query.type !== defaultSearchOperation)) {
|
|
1001
998
|
acc[column.key] = query.text;
|
|
1002
999
|
}
|
|
1003
|
-
else if (uniqueSearch[column.key] &&
|
|
1004
|
-
uniqeValues.join("") !== ((_b = uniqueSearch[column.key]) === null || _b === void 0 ? void 0 : _b.join(""))) {
|
|
1005
|
-
acc[column.key] = uniqueSearch[column.key].join(",");
|
|
1006
|
-
}
|
|
1007
1000
|
return acc;
|
|
1008
1001
|
}, {});
|
|
1009
1002
|
const propFilterColumn = gridColumns.reduce((acc, column) => {
|
|
1010
|
-
var _a, _b;
|
|
1011
1003
|
if (filterData) {
|
|
1012
|
-
const { searchQueries
|
|
1004
|
+
const { searchQueries } = filterData;
|
|
1013
1005
|
const query = searchQueries[column.key];
|
|
1014
|
-
const uniqeValues = (0, gridHeader_1.getColumnData)(column.key, filteredData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
|
|
1015
1006
|
if (query &&
|
|
1016
1007
|
(query.text !== "" || query.type !== defaultSearchOperation)) {
|
|
1017
1008
|
acc[column.key] = query.text;
|
|
1018
1009
|
}
|
|
1019
|
-
else if (uniqueSearch[column.key] &&
|
|
1020
|
-
uniqeValues.join("") !==
|
|
1021
|
-
((_b = uniqueSearch[column.key]) === null || _b === void 0 ? void 0 : _b.join(""))) {
|
|
1022
|
-
acc[column.key] = uniqueSearch[column.key].join(",");
|
|
1023
|
-
}
|
|
1024
1010
|
}
|
|
1025
1011
|
return acc;
|
|
1026
1012
|
}, {});
|
|
@@ -39,7 +39,7 @@ export interface FilterData {
|
|
|
39
39
|
globalInputSearch: string;
|
|
40
40
|
searchQueries: Record<string, SearchQuery>;
|
|
41
41
|
uniqueSearch: {
|
|
42
|
-
[key: string]: string[];
|
|
42
|
+
[key: string]: (string | number)[];
|
|
43
43
|
};
|
|
44
44
|
globalSearchOp?: "or" | "and";
|
|
45
45
|
searchOp?: "or" | "and";
|
|
@@ -29,7 +29,6 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
29
29
|
if (typeof uniqueSearch[columnKey] === "undefined") {
|
|
30
30
|
setUniqueSearch((prev) => (Object.assign(Object.assign({}, prev), { [columnKey]: columnData })));
|
|
31
31
|
}
|
|
32
|
-
console.log({ columnData });
|
|
33
32
|
setFilterColumnData(columnData);
|
|
34
33
|
}, [columnData]);
|
|
35
34
|
(0, react_1.useEffect)(() => {
|
|
@@ -553,7 +553,6 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
553
553
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
554
554
|
if (!column.hidden) {
|
|
555
555
|
const columnData = (0, exports.getColumnData)(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
|
|
556
|
-
console.log({ columnData });
|
|
557
556
|
return ((0, jsx_runtime_1.jsx)("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", width: widthMode === "auto"
|
|
558
557
|
? "auto"
|
|
559
558
|
: column.width
|
package/package.json
CHANGED