@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.
@@ -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
- justifyContent: globalSearch || filterDetails.hasFilters || sortDetails.hasSort
1358
- ? "space-between"
1359
- : "end",
1360
- }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap" }, 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: {
1361
- cursor: "pointer",
1362
- marginLeft: "0.75rem",
1363
- color: "var(--clear-color)",
1364
- }, children: _jsx(MdFilterAltOff, { size: 18 }) })), sortDetails.hasSort && (_jsx("div", { title: "Clear All Sorts", onClick: () => {
1365
- // setChanged((prev) => [...prev, "sorts"]);
1366
- setSortQueries({});
1367
- }, style: {
1368
- cursor: "pointer",
1369
- marginLeft: "0.75rem",
1370
- transform: "rotate(-90deg)",
1371
- color: "var(--clear-color)",
1372
- }, children: _jsx(TbAntennaBarsOff, { size: 18 }) })), summarise.hasSummarise && (_jsx("div", { title: "Clear All Sorts", onClick: () => {
1373
- setSummariseKeys({});
1374
- setSummariseDetails({});
1375
- // setChanged((prev) => [...prev, "summary"]);
1376
- }, style: {
1377
- cursor: "pointer",
1378
- marginLeft: "0.75rem",
1379
- color: "var(--clear-color)",
1380
- }, children: _jsx(TbCalculatorOff, {}) })), fixedColumns.map((column) => {
1381
- const selectedValues = fixedFilterValues[column.key]
1382
- ? fixedFilterValues[column.key].map((item) => item.toString())
1383
- : [];
1384
- let options = [
1385
- ...data
1386
- .filter((item) => item[column.key])
1387
- .map((data) => {
1388
- var _a;
1389
- return data[column.key] && data[column.key].value
1390
- ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1391
- : "";
1392
- }),
1393
- ].sort((a, b) => {
1394
- var _a, _b;
1395
- return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
1396
- });
1397
- selectedValues.forEach((item) => {
1398
- if (!options.includes(item)) {
1399
- options.push(item);
1400
- }
1401
- });
1402
- options = [...new Set(options)];
1403
- if (!column.hidden) {
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: 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 ||
1440
- sortDetails.sortUpdated ||
1441
- summarise.summariseUpdated ||
1442
- gridGroupBy !== (groupBy || "")) &&
1443
- handleSaveAsView &&
1444
- saveAsNewView && (_jsx("div", { onClick: () => handleSaveAsView({
1445
- globalInputSearch,
1446
- searchQueries,
1447
- uniqueSearch,
1448
- globalSearchOp,
1449
- searchOp,
1450
- groupBy: gridGroupBy,
1451
- sortQueries: sortQueries,
1452
- summariseKeys: summariseKeys,
1453
- }), style: {
1454
- marginLeft: 6,
1455
- cursor: "pointer",
1456
- }, title: "save", children: saveAsViewIcon ? saveAsViewIcon : _jsx(MdSave, {}) })), hasCustomOperation && customOperation
1457
- ? customOperation
1458
- : hasCustomOperation &&
1459
- resizable && (_jsx("button", { style: {
1460
- color: "#FFFFFF",
1461
- marginLeft: 6,
1462
- backgroundColor: JSON.stringify(gridColumns) === JSON.stringify(columns)
1463
- ? "#D3D3D3"
1464
- : "#2377BA",
1465
- borderColor: "#2377BA",
1466
- padding: "0.5rem 1rem",
1467
- borderRadius: "0.5rem",
1468
- cursor: JSON.stringify(gridColumns) === JSON.stringify(columns)
1469
- ? "not-allowed"
1470
- : "",
1471
- }, disabled: JSON.stringify(gridColumns) === JSON.stringify(columns), onClick: () => updateGridColumns && updateGridColumns(gridColumns), children: "Save preview" }))] })] }), gridGroupBy && (_jsxs("div", { style: {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.599",
3
+ "version": "1.2.600",
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",