@megha-ui/react 1.2.594 → 1.2.595

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.
@@ -1376,7 +1376,62 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
1376
1376
  cursor: "pointer",
1377
1377
  marginLeft: 10,
1378
1378
  color: "var(--clear-color)",
1379
- }, children: _jsx(TbCalculatorOff, {}) }))] }), _jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [isSummarise && (_jsx("div", { onClick: () => setSummariseAvailable((prev) => !prev), style: {
1379
+ }, children: _jsx(TbCalculatorOff, {}) })), fixedColumns.map((column) => {
1380
+ const selectedValues = fixedFilterValues[column.key]
1381
+ ? fixedFilterValues[column.key].map((item) => item.toString())
1382
+ : [];
1383
+ let options = [
1384
+ ...data
1385
+ .filter((item) => item[column.key])
1386
+ .map((data) => {
1387
+ var _a;
1388
+ return data[column.key] && data[column.key].value
1389
+ ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1390
+ : "";
1391
+ }),
1392
+ ].sort((a, b) => {
1393
+ var _a, _b;
1394
+ return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
1395
+ });
1396
+ selectedValues.forEach((item) => {
1397
+ if (!options.includes(item)) {
1398
+ options.push(item);
1399
+ }
1400
+ });
1401
+ options = [...new Set(options)];
1402
+ if (!column.hidden) {
1403
+ return (_jsx("div", { style: {
1404
+ position: "relative",
1405
+ width: "18rem",
1406
+ }, children: _jsx(Dropdown, { options: options.map((option) => ({
1407
+ label: option,
1408
+ value: option,
1409
+ })), label: column.label, placeholder: "Select", selectedValues: selectedValues, onChange: (selected) => {
1410
+ if (column.fixedFilter !== "multi-select") {
1411
+ const values = selected
1412
+ .filter((item) => item)
1413
+ .map((item) => item.toString());
1414
+ const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
1415
+ setFixedFilterValues(updatedValues);
1416
+ updateFixedFilterValues &&
1417
+ updateFixedFilterValues(updatedValues);
1418
+ }
1419
+ }, onApplyChange: column.fixedFilter === "multi-select"
1420
+ ? (selected) => {
1421
+ if (column.fixedFilter === "multi-select") {
1422
+ const values = selected
1423
+ .filter((item) => item)
1424
+ .map((item) => item.toString());
1425
+ const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
1426
+ setFixedFilterValues(updatedValues);
1427
+ updateFixedFilterValues &&
1428
+ updateFixedFilterValues(updatedValues);
1429
+ }
1430
+ }
1431
+ : 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));
1432
+ }
1433
+ return null;
1434
+ })] }), _jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [isSummarise && (_jsx("div", { onClick: () => setSummariseAvailable((prev) => !prev), style: {
1380
1435
  cursor: "pointer",
1381
1436
  marginLeft: 10,
1382
1437
  }, children: SummariseIcon ? (SummariseIcon) : summariseAvailable ? (_jsx(TbCalculatorFilled, { color: summarizeColor, size: 18 })) : (_jsx(TbCalculator, { size: 18 })) })), showHideAvailable && (_jsx("div", { onClick: openSetting, style: { cursor: "pointer", marginLeft: 10 }, children: SettingIcon ? SettingIcon : _jsx(FiEye, { size: 18 }) })), exportAvailable && (_jsx("div", { onClick: handleExport, style: { cursor: "pointer", marginLeft: 10 }, children: ExportIcon ? ExportIcon : _jsx(FiShare, { size: 16 }) })), _jsx("div", { onClick: () => setHideDuplicates((prev) => !prev), style: { cursor: "pointer", marginLeft: 10 }, 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: 10 }, children: isFullScreen ? (_jsx(MdFullscreenExit, { size: 20 })) : (_jsx(MdFullscreen, { size: 20 })) })), freezeColumnsAvailable && (_jsx("div", { onClick: toggleCollapse, style: { cursor: "pointer", marginLeft: 10 }, children: isCollapsed ? (_jsx(FiChevronsRight, { size: 20 })) : (_jsx(FiChevronsLeft, { size: 20 })) })), (filterDetails.filtersUpdated ||
@@ -1435,67 +1490,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
1435
1490
  }, onClick: () => setGridGroupBy((prev) => prev
1436
1491
  .split(",")
1437
1492
  .filter((item) => item !== chip)
1438
- .join(",")), children: "\u00D7" })] }, chip)))] }))] }), _jsx("div", { id: "fixed-filters", style: {
1439
- display: "flex",
1440
- alignItems: "center",
1441
- gap: "0.5rem",
1442
- padding: "0.25rem 0.5rem",
1443
- }, children: fixedColumns.map((column) => {
1444
- const selectedValues = fixedFilterValues[column.key]
1445
- ? fixedFilterValues[column.key].map((item) => item.toString())
1446
- : [];
1447
- let options = [
1448
- ...data
1449
- .filter((item) => item[column.key])
1450
- .map((data) => {
1451
- var _a;
1452
- return data[column.key] && data[column.key].value
1453
- ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1454
- : "";
1455
- }),
1456
- ].sort((a, b) => {
1457
- var _a, _b;
1458
- return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
1459
- });
1460
- selectedValues.forEach((item) => {
1461
- if (!options.includes(item)) {
1462
- options.push(item);
1463
- }
1464
- });
1465
- options = [...new Set(options)];
1466
- if (!column.hidden) {
1467
- return (_jsx("div", { style: {
1468
- position: "relative",
1469
- width: "18rem",
1470
- }, children: _jsx(Dropdown, { options: options.map((option) => ({
1471
- label: option,
1472
- value: option,
1473
- })), label: column.label, placeholder: "Select", selectedValues: selectedValues, onChange: (selected) => {
1474
- if (column.fixedFilter !== "multi-select") {
1475
- const values = selected
1476
- .filter((item) => item)
1477
- .map((item) => item.toString());
1478
- const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
1479
- setFixedFilterValues(updatedValues);
1480
- updateFixedFilterValues &&
1481
- updateFixedFilterValues(updatedValues);
1482
- }
1483
- }, onApplyChange: column.fixedFilter === "multi-select"
1484
- ? (selected) => {
1485
- if (column.fixedFilter === "multi-select") {
1486
- const values = selected
1487
- .filter((item) => item)
1488
- .map((item) => item.toString());
1489
- const updatedValues = Object.assign(Object.assign({}, fixedFilterValues), { [column.key]: values });
1490
- setFixedFilterValues(updatedValues);
1491
- updateFixedFilterValues &&
1492
- updateFixedFilterValues(updatedValues);
1493
- }
1494
- }
1495
- : 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));
1496
- }
1497
- return null;
1498
- }) }), _jsxs("div", { id: `grid-content`, style: {
1493
+ .join(",")), children: "\u00D7" })] }, chip)))] }))] }), _jsxs("div", { id: `grid-content`, style: {
1499
1494
  display: "block",
1500
1495
  border: gridBorder ? "1px solid #f0f0f0" : "none",
1501
1496
  overflow: calculateVisible && gridGroupBy ? "visible" : "auto",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.594",
3
+ "version": "1.2.595",
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",