@megha-ui/react 1.2.216 → 1.2.218
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.
|
@@ -24,9 +24,9 @@ import { TbCopy, TbCopyOff } from "react-icons/tb";
|
|
|
24
24
|
import { formatValue } from "../../services/commonService";
|
|
25
25
|
const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable = true, paginate, rowsPerPageOptions = [10, 20, 50, 100], defaultRowsPerPage = 100, widthMode = "custom", bulkSelect = false, cellBorder = false, rowHeight = 38, onRowClick, rowCount = false, rowBorder = true, showMenu = false, search = false, defaultSearchOperation = "contains", gridBorder = false, isLoading = false, rowTopBorder, rowBottomBorder, rowLeftBorder, rowRightBorder, headerBackground = "var(--row-header-bg)", headerTopBorder = "none", headerBottomBorder = "none", SettingIcon, ExportIcon, ignoredExportItems = ["action", "actions"], borderColor = "#dbdfe9", updateColumns, showHideAvailable = false, columnSearchOutside = false, multiSorting = false, exportAvailable = false, exportableFileName = "", groupBy, updateGroupBy, rowKey = "id", hlBorderColor = "black", selectedRow, selectedRowStyle = {
|
|
26
26
|
borderLeft: "0.5rem solid #d9d9d9",
|
|
27
|
-
}, defaultSort, noKeyEvents = true, customOperation, hasCustomOperation, globalSearch, headerDropdownIndex, draggable = false, resizable = false, updateGridData, widthUnits, checkboxWrapper, ignoreHugContent = false, setRendered, isSummarise = true, fullScreenAvailable = true, defaultGroupOpen, alternateRowColor = true, activeCalculateColor = "#2377BA", calculatetextColor = "#fff", actionsKey = "actions", saveAsNewView = false, handleSaveAsView, saveAsViewIcon, filterData, chipColor = "#ccc", withAscii = false, propSummariseKeys, SummariseIcon, summarizeColor = "black", isExpandable = false, expandedRow, extraRow, selectedCheckBox, setSelectedCheckbox, ignoreRowSelect, setOpenedRows, openedRows, getLoadingState, globalSearchOpen = false, updateFixedFilterValues = (fixedFilterValues) => {
|
|
27
|
+
}, defaultSort, noKeyEvents = true, customOperation, hasCustomOperation, globalSearch, headerDropdownIndex, draggable = false, resizable = false, updateGridData, widthUnits, checkboxWrapper, ignoreHugContent = false, setRendered, isSummarise = true, isHideDups = false, fullScreenAvailable = true, defaultGroupOpen, alternateRowColor = true, activeCalculateColor = "#2377BA", calculatetextColor = "#fff", actionsKey = "actions", saveAsNewView = false, handleSaveAsView, saveAsViewIcon, filterData, chipColor = "#ccc", withAscii = false, propSummariseKeys, SummariseIcon, summarizeColor = "black", isExpandable = false, expandedRow, extraRow, selectedCheckBox, setSelectedCheckbox, ignoreRowSelect, setOpenedRows, openedRows, getLoadingState, globalSearchOpen = false, updateFixedFilterValues = (fixedFilterValues) => {
|
|
28
28
|
console.log("Update fixed filter values not implemented", fixedFilterValues);
|
|
29
|
-
}, locale, formatOptions, exportOptions }) => {
|
|
29
|
+
}, locale, formatOptions, exportOptions, }) => {
|
|
30
30
|
var _a, _b, _c, _d;
|
|
31
31
|
const [searchQueries, setSearchQueries] = useState({});
|
|
32
32
|
const [chips, setChips] = useState([]);
|
|
@@ -63,7 +63,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
63
63
|
const [summariseAvailable, setSummariseAvailable] = useState(false);
|
|
64
64
|
const [groupedKeys, setGroupedKeys] = useState([]);
|
|
65
65
|
// const [changed, setChanged] = useState<string[]>([]);
|
|
66
|
-
const prevData = useRef(data);
|
|
67
66
|
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
68
67
|
const [fullScreen, setFullScreen] = useState(false);
|
|
69
68
|
const [hideDuplicates, setHideDuplicates] = useState(false);
|
|
@@ -79,6 +78,9 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
79
78
|
useEffect(() => {
|
|
80
79
|
setSummariseAvailable(isSummarise);
|
|
81
80
|
}, [isSummarise]);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
setHideDuplicates(isHideDups);
|
|
83
|
+
}, [isHideDups]);
|
|
82
84
|
useEffect(() => {
|
|
83
85
|
setFullScreen(fullScreenAvailable);
|
|
84
86
|
}, [fullScreenAvailable]);
|
|
@@ -1271,7 +1273,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
1271
1273
|
}, children: _jsx(TbCalculatorOff, {}) }))] }), _jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [isSummarise && (_jsx("div", { onClick: () => setSummariseAvailable((prev) => !prev), style: {
|
|
1272
1274
|
cursor: "pointer",
|
|
1273
1275
|
marginLeft: 10,
|
|
1274
|
-
}, 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 ||
|
|
1276
|
+
}, 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 }) })), isHideDups && (_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 ||
|
|
1275
1277
|
sortDetails.sortUpdated ||
|
|
1276
1278
|
summarise.summariseUpdated ||
|
|
1277
1279
|
gridGroupBy !== (groupBy || "")) &&
|
|
@@ -27,7 +27,7 @@ const shimmer = keyframes `
|
|
|
27
27
|
`;
|
|
28
28
|
const Shimmer = styled.div `
|
|
29
29
|
display: inline-block;
|
|
30
|
-
width: ${(p) => p.width}px;
|
|
30
|
+
width: ${(p) => (typeof p.width === "number" ? `${p.width}px` : p.width)};
|
|
31
31
|
height: ${(p) => p.height}px;
|
|
32
32
|
border-radius: ${(p) => p.radius}px;
|
|
33
33
|
background: linear-gradient(
|
|
@@ -39,10 +39,13 @@ const Shimmer = styled.div `
|
|
|
39
39
|
background-size: 400% 100%;
|
|
40
40
|
animation: ${shimmer} 1.2s ease-in-out infinite;
|
|
41
41
|
`;
|
|
42
|
-
const Loader = ({ size
|
|
42
|
+
const Loader = ({ size, color = "var(--accent, #3498db)", className = "", variant = "spinner", }) => {
|
|
43
43
|
if (variant === "shimmer") {
|
|
44
|
-
|
|
44
|
+
const shimmerHeight = size !== null && size !== void 0 ? size : 16;
|
|
45
|
+
const shimmerWidth = size ? size * 4 : "100%";
|
|
46
|
+
return (_jsx(Shimmer, { width: shimmerWidth, height: shimmerHeight, radius: shimmerHeight / 2, className: className }));
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
const spinnerSize = size !== null && size !== void 0 ? size : 24;
|
|
49
|
+
return _jsx(Spinner, { size: spinnerSize, color: color, className: className });
|
|
47
50
|
};
|
|
48
51
|
export default Loader;
|
package/package.json
CHANGED