@megha-ui/react 1.2.361 → 1.2.363

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.
@@ -7,6 +7,7 @@ import Block from "../block";
7
7
  import Text from "../text";
8
8
  import Button from "../button";
9
9
  import { HiChevronDown } from "react-icons/hi";
10
+ import { IoChevronDownCircleOutline } from "react-icons/io5";
10
11
  const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select...", isMultiple = false, isSelectAll = false, className, style, labelFontSize, labelFontWeight, labelMarginBottom, asteriskColor, label, disabled = false, width, searchEnabled = true, dropdownListWidth, marginBottom, marginTop, marginRight, marginLeft, required, dropdownListBG, searchBorderColor = "#2377ba", maxDropdownHeight = "12rem", border = "1px solid #dbdfe9", selectedCharLength = 0, menuFrom = "left", Tooltip, DropDownIcon, onMenuClose, isClear, ClearIcon, clearId, selectedDisplay, checkboxWrapper, isSort = true, onSelectChange, isLoading = false, onApplyChange, withTooltip = false, isCreatable = false, onCreate = () => { }, autoPosition = false, compactDisplay = false, ultraCompactDisplay = false, isGrouping = false, }) => {
11
12
  var _a, _b;
12
13
  const { density } = useDensity();
@@ -24,6 +25,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
24
25
  left: 0,
25
26
  top: "100%",
26
27
  });
28
+ const [collapsed, setCollapsed] = useState("");
27
29
  const calculateAutoPosition = () => {
28
30
  if (!wrapperRef.current)
29
31
  return;
@@ -364,10 +366,35 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
364
366
  display: "flex",
365
367
  alignItems: "start",
366
368
  width: "100%",
367
- }, children: _jsxs("span", { style: { marginLeft: "0.5rem" }, children: ["+ Create ", searchTerm] }) })] }, String(searchTerm))) : groupedOptions.length > 0 ? (groupedOptions.map((groupOption, gIndex) => (_jsxs("div", { children: [_jsx("div", { style: {
369
+ }, children: _jsxs("span", { style: { marginLeft: "0.5rem" }, children: ["+ Create ", searchTerm] }) })] }, String(searchTerm))) : groupedOptions.length > 0 ? (groupedOptions.map((groupOption, gIndex) => (_jsxs("div", { children: [_jsxs("div", { style: {
368
370
  padding: "0.25rem 0 0.25rem 1rem",
369
371
  backgroundColor: "var(--row-bg)",
370
- }, children: groupOption.groupedValue }), groupOption.options.map((option, index) => {
372
+ display: "flex",
373
+ alignItems: "center",
374
+ }, children: [_jsx("span", { children: groupOption.groupedValue }), _jsx("span", { children: collapsed === groupOption.groupedValue ? (_jsx(IoChevronDownCircleOutline, { style: {
375
+ transition: "transform 0.2s ease",
376
+ transform: "rotate(180deg)",
377
+ marginLeft: "auto",
378
+ cursor: "pointer",
379
+ }, onClick: () => {
380
+ if (collapsed === groupOption.groupedValue) {
381
+ setCollapsed("");
382
+ }
383
+ else {
384
+ setCollapsed(groupOption.groupedValue);
385
+ }
386
+ } })) : (_jsx(IoChevronDownCircleOutline, { style: {
387
+ transition: "transform 0.2s ease",
388
+ marginLeft: "auto",
389
+ cursor: "pointer",
390
+ }, onClick: () => {
391
+ if (collapsed === groupOption.groupedValue) {
392
+ setCollapsed("");
393
+ }
394
+ else {
395
+ setCollapsed(groupOption.groupedValue);
396
+ }
397
+ } })) })] }), groupOption.options.map((option, index) => {
371
398
  let prevOptions = groupedOptions.filter((item, index) => index < gIndex);
372
399
  prevOptions = [
373
400
  ...prevOptions.map((item) => item.options),
@@ -24,7 +24,7 @@ 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, 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) => {
27
+ }, defaultSort, noKeyEvents = true, customOperation, hasCustomOperation, globalSearch, headerDropdownIndex, draggable = false, resizable = false, updateGridData, widthUnits, checkboxWrapper, ignoreHugContent = false, isSummarise = false, 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
29
  }, locale, formatOptions, exportOptions, }) => {
30
30
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.361",
3
+ "version": "1.2.363",
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",