@megha-ui/react 1.2.599 → 1.2.600
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 +111 -114
- package/package.json +1 -1
|
@@ -1354,121 +1354,118 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1354
1354
|
display: "flex",
|
|
1355
1355
|
alignItems: "center",
|
|
1356
1356
|
flexWrap: "wrap",
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
return (_jsx("div", { style: {
|
|
1405
|
-
position: "relative",
|
|
1406
|
-
width: "18rem",
|
|
1407
|
-
marginLeft: "0.75rem",
|
|
1408
|
-
}, children: _jsx(Dropdown, { options: options.map((option) => ({
|
|
1409
|
-
label: option,
|
|
1410
|
-
value: option,
|
|
1411
|
-
})), label: column.label, placeholder: "Select", selectedValues: selectedValues, onChange: (selected) => {
|
|
1412
|
-
if (column.fixedFilter !== "multi-select") {
|
|
1413
|
-
const values = selected
|
|
1414
|
-
.filter((item) => item)
|
|
1415
|
-
.map((item) => item.toString());
|
|
1416
|
-
const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
|
|
1417
|
-
setFixedFilterValues(updatedValues);
|
|
1418
|
-
updateFixedFilterValues &&
|
|
1419
|
-
updateFixedFilterValues(updatedValues);
|
|
1420
|
-
}
|
|
1421
|
-
}, onApplyChange: column.fixedFilter === "multi-select"
|
|
1422
|
-
? (selected) => {
|
|
1423
|
-
if (column.fixedFilter === "multi-select") {
|
|
1424
|
-
const values = selected
|
|
1425
|
-
.filter((item) => item)
|
|
1426
|
-
.map((item) => item.toString());
|
|
1427
|
-
const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
|
|
1428
|
-
setFixedFilterValues(updatedValues);
|
|
1429
|
-
updateFixedFilterValues &&
|
|
1430
|
-
updateFixedFilterValues(updatedValues);
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
: undefined, isSort: column.fixedFilterOrder ? false : undefined, isClear: true, searchEnabled: true, dropdownListWidth: "max-content", className: "h-8 mt-2", isMultiple: column.fixedFilter === "multi-select" }) }, column.key));
|
|
1434
|
-
}
|
|
1435
|
-
return null;
|
|
1436
|
-
})] }), _jsxs("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap" }, children: [isSummarise && (_jsx("div", { onClick: () => setSummariseAvailable((prev) => !prev), style: {
|
|
1437
|
-
cursor: "pointer",
|
|
1357
|
+
}, children: [globalSearch && (_jsx("div", { style: { width: expandedGI ? 300 : "fit-content" }, children: _jsx(GlobalSearchChiProps, { expanded: expandedGI, setExpanded: setExpandedGI, globalInputSearch: globalInputSearch, setGlobalInputSearch: setGlobalInputSearch, chips: chips, setChips: setChips, inputValue: inputValue, setInputValue: setInputValue, shouldClose: !globalSearchOpen }) })), filterDetails.hasFilters && (_jsx("div", { title: "Clear All Filters", onClick: () => clearAllFilter(), style: {
|
|
1358
|
+
cursor: "pointer",
|
|
1359
|
+
marginLeft: "0.75rem",
|
|
1360
|
+
color: "var(--clear-color)",
|
|
1361
|
+
}, children: _jsx(MdFilterAltOff, { size: 18 }) })), sortDetails.hasSort && (_jsx("div", { title: "Clear All Sorts", onClick: () => {
|
|
1362
|
+
// setChanged((prev) => [...prev, "sorts"]);
|
|
1363
|
+
setSortQueries({});
|
|
1364
|
+
}, style: {
|
|
1365
|
+
cursor: "pointer",
|
|
1366
|
+
marginLeft: "0.75rem",
|
|
1367
|
+
transform: "rotate(-90deg)",
|
|
1368
|
+
color: "var(--clear-color)",
|
|
1369
|
+
}, children: _jsx(TbAntennaBarsOff, { size: 18 }) })), summarise.hasSummarise && (_jsx("div", { title: "Clear All Sorts", onClick: () => {
|
|
1370
|
+
setSummariseKeys({});
|
|
1371
|
+
setSummariseDetails({});
|
|
1372
|
+
// setChanged((prev) => [...prev, "summary"]);
|
|
1373
|
+
}, style: {
|
|
1374
|
+
cursor: "pointer",
|
|
1375
|
+
marginLeft: "0.75rem",
|
|
1376
|
+
color: "var(--clear-color)",
|
|
1377
|
+
}, children: _jsx(TbCalculatorOff, {}) })), fixedColumns.map((column) => {
|
|
1378
|
+
const selectedValues = fixedFilterValues[column.key]
|
|
1379
|
+
? fixedFilterValues[column.key].map((item) => item.toString())
|
|
1380
|
+
: [];
|
|
1381
|
+
let options = [
|
|
1382
|
+
...data
|
|
1383
|
+
.filter((item) => item[column.key])
|
|
1384
|
+
.map((data) => {
|
|
1385
|
+
var _a;
|
|
1386
|
+
return data[column.key] && data[column.key].value
|
|
1387
|
+
? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
|
|
1388
|
+
: "";
|
|
1389
|
+
}),
|
|
1390
|
+
].sort((a, b) => {
|
|
1391
|
+
var _a, _b;
|
|
1392
|
+
return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
|
|
1393
|
+
});
|
|
1394
|
+
selectedValues.forEach((item) => {
|
|
1395
|
+
if (!options.includes(item)) {
|
|
1396
|
+
options.push(item);
|
|
1397
|
+
}
|
|
1398
|
+
});
|
|
1399
|
+
options = [...new Set(options)];
|
|
1400
|
+
if (!column.hidden) {
|
|
1401
|
+
return (_jsx("div", { style: {
|
|
1402
|
+
position: "relative",
|
|
1403
|
+
width: "18rem",
|
|
1438
1404
|
marginLeft: "0.75rem",
|
|
1439
|
-
}, children:
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1405
|
+
}, children: _jsx(Dropdown, { options: options.map((option) => ({
|
|
1406
|
+
label: option,
|
|
1407
|
+
value: option,
|
|
1408
|
+
})), label: column.label, placeholder: "Select", selectedValues: selectedValues, onChange: (selected) => {
|
|
1409
|
+
if (column.fixedFilter !== "multi-select") {
|
|
1410
|
+
const values = selected
|
|
1411
|
+
.filter((item) => item)
|
|
1412
|
+
.map((item) => item.toString());
|
|
1413
|
+
const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
|
|
1414
|
+
setFixedFilterValues(updatedValues);
|
|
1415
|
+
updateFixedFilterValues &&
|
|
1416
|
+
updateFixedFilterValues(updatedValues);
|
|
1417
|
+
}
|
|
1418
|
+
}, onApplyChange: column.fixedFilter === "multi-select"
|
|
1419
|
+
? (selected) => {
|
|
1420
|
+
if (column.fixedFilter === "multi-select") {
|
|
1421
|
+
const values = selected
|
|
1422
|
+
.filter((item) => item)
|
|
1423
|
+
.map((item) => item.toString());
|
|
1424
|
+
const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
|
|
1425
|
+
setFixedFilterValues(updatedValues);
|
|
1426
|
+
updateFixedFilterValues &&
|
|
1427
|
+
updateFixedFilterValues(updatedValues);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
: undefined, isSort: column.fixedFilterOrder ? false : undefined, isClear: true, searchEnabled: true, dropdownListWidth: "max-content", className: "h-8 mt-2", isMultiple: column.fixedFilter === "multi-select" }) }, column.key));
|
|
1431
|
+
}
|
|
1432
|
+
return null;
|
|
1433
|
+
}), isSummarise && (_jsx("div", { onClick: () => setSummariseAvailable((prev) => !prev), style: {
|
|
1434
|
+
cursor: "pointer",
|
|
1435
|
+
marginLeft: "0.75rem",
|
|
1436
|
+
}, children: SummariseIcon ? (SummariseIcon) : summariseAvailable ? (_jsx(TbCalculatorFilled, { color: summarizeColor, size: 18 })) : (_jsx(TbCalculator, { size: 18 })) })), showHideAvailable && (_jsx("div", { onClick: openSetting, style: { cursor: "pointer", marginLeft: "0.75rem" }, children: SettingIcon ? SettingIcon : _jsx(FiEye, { size: 18 }) })), exportAvailable && (_jsx("div", { onClick: handleExport, style: { cursor: "pointer", marginLeft: "0.75rem" }, children: ExportIcon ? ExportIcon : _jsx(FiShare, { size: 16 }) })), _jsx("div", { onClick: () => setHideDuplicates((prev) => !prev), style: { cursor: "pointer", marginLeft: "0.75rem" }, title: hideDuplicates ? "Show Duplicates" : "Hide Duplicates", children: hideDuplicates ? _jsx(TbCopyOff, { size: 18 }) : _jsx(TbCopy, { size: 18 }) }), fullScreen && (_jsx("div", { onClick: toggleFullScreen, style: { cursor: "pointer", marginLeft: "0.75rem" }, children: isFullScreen ? (_jsx(MdFullscreenExit, { size: 20 })) : (_jsx(MdFullscreen, { size: 20 })) })), freezeColumnsAvailable && (_jsx("div", { onClick: toggleCollapse, style: { cursor: "pointer", marginLeft: "0.75rem" }, children: isCollapsed ? (_jsx(FiChevronsRight, { size: 20 })) : (_jsx(FiChevronsLeft, { size: 20 })) })), (filterDetails.filtersUpdated ||
|
|
1437
|
+
sortDetails.sortUpdated ||
|
|
1438
|
+
summarise.summariseUpdated ||
|
|
1439
|
+
gridGroupBy !== (groupBy || "")) &&
|
|
1440
|
+
handleSaveAsView &&
|
|
1441
|
+
saveAsNewView && (_jsx("div", { onClick: () => handleSaveAsView({
|
|
1442
|
+
globalInputSearch,
|
|
1443
|
+
searchQueries,
|
|
1444
|
+
uniqueSearch,
|
|
1445
|
+
globalSearchOp,
|
|
1446
|
+
searchOp,
|
|
1447
|
+
groupBy: gridGroupBy,
|
|
1448
|
+
sortQueries: sortQueries,
|
|
1449
|
+
summariseKeys: summariseKeys,
|
|
1450
|
+
}), style: {
|
|
1451
|
+
marginLeft: 6,
|
|
1452
|
+
cursor: "pointer",
|
|
1453
|
+
}, title: "save", children: saveAsViewIcon ? saveAsViewIcon : _jsx(MdSave, {}) })), hasCustomOperation && customOperation
|
|
1454
|
+
? customOperation
|
|
1455
|
+
: hasCustomOperation &&
|
|
1456
|
+
resizable && (_jsx("button", { style: {
|
|
1457
|
+
color: "#FFFFFF",
|
|
1458
|
+
marginLeft: 6,
|
|
1459
|
+
backgroundColor: JSON.stringify(gridColumns) === JSON.stringify(columns)
|
|
1460
|
+
? "#D3D3D3"
|
|
1461
|
+
: "#2377BA",
|
|
1462
|
+
borderColor: "#2377BA",
|
|
1463
|
+
padding: "0.5rem 1rem",
|
|
1464
|
+
borderRadius: "0.5rem",
|
|
1465
|
+
cursor: JSON.stringify(gridColumns) === JSON.stringify(columns)
|
|
1466
|
+
? "not-allowed"
|
|
1467
|
+
: "",
|
|
1468
|
+
}, disabled: JSON.stringify(gridColumns) === JSON.stringify(columns), onClick: () => updateGridColumns && updateGridColumns(gridColumns), children: "Save preview" }))] }), gridGroupBy && (_jsxs("div", { style: {
|
|
1472
1469
|
width: "100%",
|
|
1473
1470
|
flexWrap: "wrap",
|
|
1474
1471
|
display: "flex",
|
package/package.json
CHANGED