@megha-ui/react 1.2.638 → 1.2.640

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.
@@ -126,13 +126,18 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
126
126
  _columns = _columns.map((col) => {
127
127
  var _a, _b;
128
128
  let isArrayString = false;
129
- if (isMultipleChips) {
130
- const columnRowData = data
131
- .map((row) => { var _a, _b; return (_b = (_a = row === null || row === void 0 ? void 0 : row[col.key]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; })
132
- .filter((item) => item);
133
- if (columnRowData.length > 0 &&
134
- columnRowData.some((item) => { var _a; return (_a = (item !== null && item !== void 0 ? item : "").toString()) === null || _a === void 0 ? void 0 : _a.includes(">>"); })) {
135
- isArrayString = true;
129
+ if (typeof col.isArrayString !== "undefined") {
130
+ isArrayString = col.isArrayString;
131
+ }
132
+ else {
133
+ if (isMultipleChips) {
134
+ const columnRowData = data
135
+ .map((row) => { var _a, _b; return (_b = (_a = row === null || row === void 0 ? void 0 : row[col.key]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; })
136
+ .filter((item) => item);
137
+ if (columnRowData.length > 0 &&
138
+ columnRowData.some((item) => { var _a; return (_a = (item !== null && item !== void 0 ? item : "").toString()) === null || _a === void 0 ? void 0 : _a.includes(">>"); })) {
139
+ isArrayString = true;
140
+ }
136
141
  }
137
142
  }
138
143
  return Object.assign(Object.assign({}, col), { isArrayString, dataType: (_b = (_a = col.dataType) !== null && _a !== void 0 ? _a : columnData === null || columnData === void 0 ? void 0 : columnData[col.key]) !== null && _b !== void 0 ? _b : "string" });
@@ -748,7 +753,6 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
748
753
  setHugLoading(false);
749
754
  }, 1000);
750
755
  }
751
- console.log({ columnWidths });
752
756
  }, [
753
757
  paginatedData,
754
758
  sortedData,
@@ -102,11 +102,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
102
102
  setSearchOpsPosition({ top, left });
103
103
  toggleDropdown(columnKey);
104
104
  };
105
- const menuOptions = [
106
- // { label: "Sort Ascending", action: onSort, order: "asc" },
107
- // { label: "Sort Descending", action: onSort, order: "dsc" },
108
- { label: "Group by", groupBy: setGroupBy },
109
- ];
105
+ const menuOptions = [{ label: "Group by", groupBy: setGroupBy }];
110
106
  const searchOptions = [
111
107
  { label: "Contains", value: "contains", action: handleSearchOptionSelect },
112
108
  {
@@ -235,7 +231,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
235
231
  position: "sticky",
236
232
  top: 0,
237
233
  zIndex: 1,
238
- fontWeight: 500
234
+ fontWeight: 500,
239
235
  }, id: "header", children: [bulkSelect && (_jsx("div", { style: Object.assign(Object.assign({}, cellStyle), { textTransform: "uppercase", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis" }), children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) })), groupByKeys.map((_groupBy) => {
240
236
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62;
241
237
  return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
@@ -572,7 +568,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
572
568
  ? numberTypeSearch.includes(item.value)
573
569
  : column.dataType === "date"
574
570
  ? dateTypeSearch.includes(item.value)
575
- : textTypeSearch.includes(item.value)), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: column.key, columnData: columnData, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), searchElement: _jsx("div", { id: "search-input", children: column.dataType === "date" ? (((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) ===
571
+ : textTypeSearch.includes(item.value)), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: column.key, columnData: columnData, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label === "Group by"
572
+ ? !column.isArrayString
573
+ : true), onClose: () => setDropdownVisible(null), column: column }), searchElement: _jsx("div", { id: "search-input", children: column.dataType === "date" ? (((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) ===
576
574
  "between" ? (_jsxs(_Fragment, { children: [_jsx(DateInput, { value: (_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.text.split("to")[0], placeholder: `From date`, onChange: (value) => {
577
575
  var _a, _b;
578
576
  return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.638",
3
+ "version": "1.2.640",
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",