@megha-ui/react 1.2.803 → 1.2.805
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.
|
@@ -1535,6 +1535,10 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1535
1535
|
? "minmax(max-content, 1fr)"
|
|
1536
1536
|
: "max-content")
|
|
1537
1537
|
.join(" "),
|
|
1538
|
+
height: `calc(100% - ${removalHeight})`,
|
|
1539
|
+
border: gridBorder ? "1px solid #f0f0f0" : "none",
|
|
1540
|
+
overflow: calculateVisible && gridGroupBy ? "visible" : "auto",
|
|
1541
|
+
position: "relative",
|
|
1538
1542
|
}, children: [_jsxs("div", { className: "hidden", children: [_jsx(GridHeader, { columns: gridColumns, headerRef: headerRef, resizable: resizable, sortable: sortable, search: search, combinedColumns: combinedColumns, defaultSearchOperation: defaultSearchOperation, showMenu: showMenu, sortQueries: sortQueries, onSort: handleSort, bulkSelect: bulkSelect, cellStyle: cellStyle, widthMode: widthMode, allRowsSelected: allRowsSelected, someRowsSelected: someRowsSelected, toggleSelectAll: () => toggleSelectAll(paginate ? paginatedData : sortedData, allRowsSelected), onSearch: handleSearch, searchQueries: searchQueries, headerBackground: headerBackground, headerTopBorder: headerTopBorder, headerBottomBorder: headerBottomBorder, groupBy: gridGroupBy, setGroupBy: (value) => {
|
|
1539
1543
|
let _gridGroupBy = gridGroupBy;
|
|
1540
1544
|
_gridGroupBy = _gridGroupBy.split(",").includes(value)
|
|
@@ -247,24 +247,18 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
247
247
|
setResizeIndex(-1);
|
|
248
248
|
};
|
|
249
249
|
return (_jsxs(_Fragment, { 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) => {
|
|
250
|
-
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
|
|
250
|
+
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;
|
|
251
251
|
return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
|
|
252
252
|
((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.sortable)
|
|
253
253
|
? "sortable"
|
|
254
254
|
: ""} ${((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.showMenu)
|
|
255
255
|
? "menu-true"
|
|
256
|
-
: "menu-false"} column index-${(_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis",
|
|
257
|
-
? "auto"
|
|
258
|
-
: ((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.width)
|
|
259
|
-
? `calc(${(_e = headerColumns.find((column) => column.key === _groupBy)) === null || _e === void 0 ? void 0 : _e.width} + 4rem)`
|
|
260
|
-
: (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.key}`])
|
|
261
|
-
? `calc(${hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_g = headerColumns.find((column) => column.key === _groupBy)) === null || _g === void 0 ? void 0 : _g.key}`]} + 4rem)`
|
|
262
|
-
: "fit-content", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: [_jsxs("div", { style: {
|
|
256
|
+
: "menu-false"} column index-${(_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: [_jsxs("div", { style: {
|
|
263
257
|
display: "flex",
|
|
264
258
|
alignItems: "center",
|
|
265
259
|
padding: "0 0.3rem",
|
|
266
260
|
justifyContent: "space-between",
|
|
267
|
-
cursor: ((
|
|
261
|
+
cursor: ((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.sortable)
|
|
268
262
|
? "pointer"
|
|
269
263
|
: "",
|
|
270
264
|
}, onClick: () => {
|
|
@@ -275,14 +269,14 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
275
269
|
}, children: [_jsxs("div", { style: {
|
|
276
270
|
display: "flex",
|
|
277
271
|
alignItems: "center",
|
|
278
|
-
}, children: [_jsx("span", { children: (
|
|
279
|
-
((
|
|
280
|
-
visibility: Object.keys(sortQueries).includes(((
|
|
272
|
+
}, children: [_jsx("span", { children: (_e = headerColumns.find((column) => column.key === _groupBy)) === null || _e === void 0 ? void 0 : _e.label }), sortable &&
|
|
273
|
+
((_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.sortable) && (_jsx("span", { style: {
|
|
274
|
+
visibility: Object.keys(sortQueries).includes(((_g = headerColumns.find((column) => column.key === _groupBy)) === null || _g === void 0 ? void 0 : _g.key) || "")
|
|
281
275
|
? "visible"
|
|
282
276
|
: "hidden",
|
|
283
|
-
}, children: sortQueries[((
|
|
277
|
+
}, children: sortQueries[((_h = headerColumns.find((column) => column.key === _groupBy)) === null || _h === void 0 ? void 0 : _h.key) || ""] === "asc"
|
|
284
278
|
? " ↑"
|
|
285
|
-
: " ↓" }))] }), _jsx("div", { style: { display: "flex", alignItems: "center" }, children: ((
|
|
279
|
+
: " ↓" }))] }), _jsx("div", { style: { display: "flex", alignItems: "center" }, children: ((_j = headerColumns.find((column) => column.key === _groupBy)) === null || _j === void 0 ? void 0 : _j.filter) && (_jsxs("div", { style: {
|
|
286
280
|
alignItems: "center",
|
|
287
281
|
marginLeft: 6,
|
|
288
282
|
position: "relative",
|
|
@@ -292,7 +286,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
292
286
|
e.preventDefault();
|
|
293
287
|
e.stopPropagation();
|
|
294
288
|
handleFilterIconClick(e, ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
|
|
295
|
-
}, children: [activeFilters[((
|
|
289
|
+
}, children: [activeFilters[((_k = headerColumns.find((column) => column.key === _groupBy)) === null || _k === void 0 ? void 0 : _k.key) || ""] && (_jsx("span", { style: {
|
|
296
290
|
backgroundColor: "#2377ba",
|
|
297
291
|
width: "0.5rem",
|
|
298
292
|
height: "0.5rem",
|
|
@@ -300,22 +294,22 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
300
294
|
right: 0,
|
|
301
295
|
display: "inline-block",
|
|
302
296
|
} })), _jsx(MdFilterList, { size: 18, style: {
|
|
303
|
-
color: activeFilters[((
|
|
297
|
+
color: activeFilters[((_l = headerColumns.find((column) => column.key === _groupBy)) === null || _l === void 0 ? void 0 : _l.key) || ""]
|
|
304
298
|
? "#2377ba"
|
|
305
299
|
: "var(--row-header-text)",
|
|
306
300
|
} }), dropdownVisible ===
|
|
307
|
-
((
|
|
308
|
-
(((
|
|
309
|
-
((
|
|
301
|
+
((_m = headerColumns.find((column) => column.key === _groupBy)) === null || _m === void 0 ? void 0 : _m.key) &&
|
|
302
|
+
(((_o = headerColumns.find((column) => column.key === _groupBy)) === null || _o === void 0 ? void 0 : _o.uniqueDrop) ? (_jsx(GridFilterDropdown, { locale: locale, formatOptions: formatOptions, columnType: (_q = (_p = headerColumns.find((column) => column.key === _groupBy)) === null || _p === void 0 ? void 0 : _p.dataType) !== null && _q !== void 0 ? _q : "string", columnIndex: -1, searchable: ((_r = headerColumns.find((column) => column.key === _groupBy)) === null || _r === void 0 ? void 0 : _r.search) || false, headerDropdownIndex: headerDropdownIndex, searchInput: (search &&
|
|
303
|
+
((_s = headerColumns.find((column) => column.key === _groupBy)) === null || _s === void 0 ? void 0 : _s.search) && (_jsx("div", { style: {
|
|
310
304
|
marginTop: "0.5rem",
|
|
311
305
|
padding: "0.5rem",
|
|
312
306
|
width: "100%",
|
|
313
307
|
pointerEvents: search &&
|
|
314
|
-
((
|
|
308
|
+
((_t = headerColumns.find((column) => column.key === _groupBy)) === null || _t === void 0 ? void 0 : _t.search)
|
|
315
309
|
? "auto"
|
|
316
310
|
: "none",
|
|
317
311
|
cursor: search &&
|
|
318
|
-
((
|
|
312
|
+
((_u = headerColumns.find((column) => column.key === _groupBy)) === null || _u === void 0 ? void 0 : _u.search)
|
|
319
313
|
? "default"
|
|
320
314
|
: "not-allowed",
|
|
321
315
|
}, children: _jsx(TextInput, { onChange: (e) => {
|
|
@@ -331,10 +325,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
331
325
|
}
|
|
332
326
|
onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
|
|
333
327
|
}, placeholder: "Search", extraWrapperStyle: {
|
|
334
|
-
background: ((
|
|
328
|
+
background: ((_v = headerColumns.find((column) => column.key === _groupBy)) === null || _v === void 0 ? void 0 : _v.search)
|
|
335
329
|
? "var(--background)"
|
|
336
330
|
: "var(--disabled-bg)",
|
|
337
|
-
}, value: ((
|
|
331
|
+
}, value: ((_x = searchQueries[((_w = headerColumns.find((column) => column.key === _groupBy)) === null || _w === void 0 ? void 0 : _w.key) || ""]) === null || _x === void 0 ? void 0 : _x.text) || "", disabled: !((_y = headerColumns.find((column) => column.key === _groupBy)) === null || _y === void 0 ? void 0 : _y.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))) ||
|
|
338
332
|
null, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOptions: searchOptions.filter((item) => {
|
|
339
333
|
var _a, _b;
|
|
340
334
|
return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
|
|
@@ -342,7 +336,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
342
336
|
: ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
|
|
343
337
|
? dateTypeSearch.includes(item.value)
|
|
344
338
|
: textTypeSearch.includes(item.value);
|
|
345
|
-
}), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: ((
|
|
339
|
+
}), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: ((_z = headerColumns.find((column) => column.key === _groupBy)) === null || _z === void 0 ? void 0 : _z.key) || "", columnData: getColumnData(((_0 = headerColumns.find((column) => column.key === _groupBy)) === null || _0 === void 0 ? void 0 : _0.key) || "", gridData, (_2 = (_1 = headerColumns.find((column) => column.key === _groupBy)) === null || _1 === void 0 ? void 0 : _1.dataType) !== null && _2 !== void 0 ? _2 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []), searchElement: _jsx("div", { id: "search-input", children: ((_3 = headerColumns.find((column) => column.key === _groupBy)) === null || _3 === void 0 ? void 0 : _3.dataType) === "date" ? (((_5 = searchQueries[((_4 = headerColumns.find((column) => column.key === _groupBy)) === null || _4 === void 0 ? void 0 : _4.key) || ""]) === null || _5 === void 0 ? void 0 : _5.type) === "between" ? (_jsxs(_Fragment, { children: [_jsx(DateInput, { value: (_7 = searchQueries[((_6 = headerColumns.find((column) => column.key === _groupBy)) === null || _6 === void 0 ? void 0 : _6.key) || ""]) === null || _7 === void 0 ? void 0 : _7.text.split("to")[0], placeholder: `From date`, onChange: (value) => {
|
|
346
340
|
var _a, _b, _c, _d, _e;
|
|
347
341
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", (_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.text.split("to").map((item, index) => {
|
|
348
342
|
if (index === 0) {
|
|
@@ -352,7 +346,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
352
346
|
}).join("to"), ((_e = searchQueries[((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.type) ||
|
|
353
347
|
defaultSearchOperation ||
|
|
354
348
|
"contains");
|
|
355
|
-
} }), _jsx(DateInput, { value: (
|
|
349
|
+
} }), _jsx(DateInput, { value: (_9 = searchQueries[((_8 = headerColumns.find((column) => column.key === _groupBy)) === null || _8 === void 0 ? void 0 : _8.key) || ""]) === null || _9 === void 0 ? void 0 : _9.text.split("to")[1], placeholder: `To date`, onChange: (value) => {
|
|
356
350
|
var _a, _b, _c, _d, _e;
|
|
357
351
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", (_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.text.split("to").map((item, index) => {
|
|
358
352
|
if (index === 1) {
|
|
@@ -362,12 +356,12 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
362
356
|
}).join("to"), ((_e = searchQueries[((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.type) ||
|
|
363
357
|
defaultSearchOperation ||
|
|
364
358
|
"contains");
|
|
365
|
-
} })] })) : (_jsx(DateInput, { value: (
|
|
359
|
+
} })] })) : (_jsx(DateInput, { value: (_11 = searchQueries[((_10 = headerColumns.find((column) => column.key === _groupBy)) === null || _10 === void 0 ? void 0 : _10.key) || ""]) === null || _11 === void 0 ? void 0 : _11.text.split("to")[0], placeholder: `asd Filter ${(_12 = headerColumns.find((column) => column.key === _groupBy)) === null || _12 === void 0 ? void 0 : _12.label}`, onChange: (value) => {
|
|
366
360
|
var _a, _b, _c;
|
|
367
361
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
368
362
|
defaultSearchOperation ||
|
|
369
363
|
"contains");
|
|
370
|
-
} }))) : (_jsx(TextInput, { placeholder: `Filter ${(
|
|
364
|
+
} }))) : (_jsx(TextInput, { placeholder: `Filter ${(_13 = headerColumns.find((column) => column.key === _groupBy)) === null || _13 === void 0 ? void 0 : _13.label}`, onKeyDown: (e) => {
|
|
371
365
|
var _a;
|
|
372
366
|
if (e.key === "Enter") {
|
|
373
367
|
toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
|
|
@@ -377,11 +371,11 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
377
371
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", e.target.value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
378
372
|
defaultSearchOperation ||
|
|
379
373
|
"contains");
|
|
380
|
-
}, value: ((
|
|
381
|
-
visibility: ((
|
|
374
|
+
}, value: ((_15 = searchQueries[((_14 = headerColumns.find((column) => column.key === _groupBy)) === null || _14 === void 0 ? void 0 : _14.key) || ""]) === null || _15 === void 0 ? void 0 : _15.text) || "", extraWrapperStyle: {
|
|
375
|
+
visibility: ((_16 = headerColumns.find((column) => column.key === _groupBy)) === null || _16 === void 0 ? void 0 : _16.search)
|
|
382
376
|
? "visible"
|
|
383
377
|
: "hidden",
|
|
384
|
-
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((
|
|
378
|
+
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_18 = searchQueries[((_17 = headerColumns.find((column) => column.key === _groupBy)) === null || _17 === void 0 ? void 0 : _17.key) || ""]) === null || _18 === void 0 ? void 0 : _18.type) ||
|
|
385
379
|
defaultSearchOperation ||
|
|
386
380
|
"contains", checkboxWrapper: checkboxWrapper })) : (_jsx(TextFilterDropdown, { columnIndex: -1, combined: false, headerDropdownIndex: headerDropdownIndex, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOptions: searchOptions.filter((item) => {
|
|
387
381
|
var _a, _b;
|
|
@@ -390,7 +384,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
390
384
|
: ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
|
|
391
385
|
? dateTypeSearch.includes(item.value)
|
|
392
386
|
: textTypeSearch.includes(item.value);
|
|
393
|
-
}), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: ((
|
|
387
|
+
}), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: ((_19 = headerColumns.find((column) => column.key === _groupBy)) === null || _19 === void 0 ? void 0 : _19.key) || "", searchable: ((_20 = headerColumns.find((column) => column.key === _groupBy)) === null || _20 === void 0 ? void 0 : _20.search) || false, searchElement: _jsx("div", { id: "search-input", children: ((_21 = headerColumns.find((column) => column.key === _groupBy)) === null || _21 === void 0 ? void 0 : _21.dataType) === "date" ? (((_23 = searchQueries[((_22 = headerColumns.find((column) => column.key === _groupBy)) === null || _22 === void 0 ? void 0 : _22.key) || ""]) === null || _23 === void 0 ? void 0 : _23.type) === "between" ? (_jsxs(_Fragment, { children: [_jsx(DateInput, { value: (_25 = searchQueries[((_24 = headerColumns.find((column) => column.key === _groupBy)) === null || _24 === void 0 ? void 0 : _24.key) || ""]) === null || _25 === void 0 ? void 0 : _25.text.split("to")[0], placeholder: `From date`, onChange: (value) => {
|
|
394
388
|
var _a, _b, _c, _d, _e;
|
|
395
389
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", (_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.text.split("to").map((item, index) => {
|
|
396
390
|
if (index === 0) {
|
|
@@ -400,7 +394,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
400
394
|
}).join("to"), ((_e = searchQueries[((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.type) ||
|
|
401
395
|
defaultSearchOperation ||
|
|
402
396
|
"contains");
|
|
403
|
-
} }), _jsx("div", { style: { marginTop: "0.5rem" }, children: _jsx(DateInput, { value: (
|
|
397
|
+
} }), _jsx("div", { style: { marginTop: "0.5rem" }, children: _jsx(DateInput, { value: (_27 = searchQueries[((_26 = headerColumns.find((column) => column.key === _groupBy)) === null || _26 === void 0 ? void 0 : _26.key) || ""]) === null || _27 === void 0 ? void 0 : _27.text.split("to")[1], placeholder: `To date`, onChange: (value) => {
|
|
404
398
|
var _a, _b, _c, _d, _e;
|
|
405
399
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", (_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.text.split("to").map((item, index) => {
|
|
406
400
|
if (index === 1) {
|
|
@@ -415,9 +409,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
415
409
|
"doesNotContain",
|
|
416
410
|
"blank",
|
|
417
411
|
"notBlank",
|
|
418
|
-
].includes(((
|
|
412
|
+
].includes(((_29 = searchQueries[((_28 = headerColumns.find((column) => column.key === _groupBy)) === null || _28 === void 0 ? void 0 : _28.key) || ""]) === null || _29 === void 0 ? void 0 : _29.type) ||
|
|
419
413
|
defaultSearchOperation ||
|
|
420
|
-
"contains") ? (_jsx(TextInput, { placeholder: `Filter ${(
|
|
414
|
+
"contains") ? (_jsx(TextInput, { placeholder: `Filter ${(_30 = headerColumns.find((column) => column.key === _groupBy)) === null || _30 === void 0 ? void 0 : _30.label}`, onKeyDown: (e) => {
|
|
421
415
|
var _a;
|
|
422
416
|
if (e.key === "Enter") {
|
|
423
417
|
toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
|
|
@@ -427,16 +421,16 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
427
421
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", e.target.value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
428
422
|
defaultSearchOperation ||
|
|
429
423
|
"contains");
|
|
430
|
-
}, value: ((
|
|
431
|
-
visibility: ((
|
|
424
|
+
}, value: ((_32 = searchQueries[((_31 = headerColumns.find((column) => column.key === _groupBy)) === null || _31 === void 0 ? void 0 : _31.key) || ""]) === null || _32 === void 0 ? void 0 : _32.text) || "", extraWrapperStyle: {
|
|
425
|
+
visibility: ((_33 = headerColumns.find((column) => column.key === _groupBy)) === null || _33 === void 0 ? void 0 : _33.search)
|
|
432
426
|
? "visible"
|
|
433
427
|
: "hidden",
|
|
434
|
-
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) : (_jsx(DateInput, { value: (
|
|
428
|
+
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) : (_jsx(DateInput, { value: (_35 = searchQueries[((_34 = headerColumns.find((column) => column.key === _groupBy)) === null || _34 === void 0 ? void 0 : _34.key) || ""]) === null || _35 === void 0 ? void 0 : _35.text.split("to")[0], placeholder: `asd Filter ${(_36 = headerColumns.find((column) => column.key === _groupBy)) === null || _36 === void 0 ? void 0 : _36.label}`, onChange: (value) => {
|
|
435
429
|
var _a, _b, _c;
|
|
436
430
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
437
431
|
defaultSearchOperation ||
|
|
438
432
|
"contains");
|
|
439
|
-
} }))) : (_jsx(TextInput, { placeholder: `Filter ${(
|
|
433
|
+
} }))) : (_jsx(TextInput, { placeholder: `Filter ${(_37 = headerColumns.find((column) => column.key === _groupBy)) === null || _37 === void 0 ? void 0 : _37.label}`, onKeyDown: (e) => {
|
|
440
434
|
var _a;
|
|
441
435
|
if (e.key === "Enter") {
|
|
442
436
|
toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
|
|
@@ -446,23 +440,23 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
446
440
|
return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", e.target.value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
447
441
|
defaultSearchOperation ||
|
|
448
442
|
"contains");
|
|
449
|
-
}, value: ((
|
|
450
|
-
visibility: ((
|
|
443
|
+
}, value: ((_39 = searchQueries[((_38 = headerColumns.find((column) => column.key === _groupBy)) === null || _38 === void 0 ? void 0 : _38.key) || ""]) === null || _39 === void 0 ? void 0 : _39.text) || "", extraWrapperStyle: {
|
|
444
|
+
visibility: ((_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.search)
|
|
451
445
|
? "visible"
|
|
452
446
|
: "hidden",
|
|
453
|
-
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((
|
|
447
|
+
}, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((_42 = searchQueries[((_41 = headerColumns.find((column) => column.key === _groupBy)) === null || _41 === void 0 ? void 0 : _41.key) || ""]) === null || _42 === void 0 ? void 0 : _42.type) ||
|
|
454
448
|
defaultSearchOperation ||
|
|
455
449
|
"contains", searchInput: (search &&
|
|
456
|
-
((
|
|
450
|
+
((_43 = headerColumns.find((column) => column.key === _groupBy)) === null || _43 === void 0 ? void 0 : _43.search) && (_jsx("div", { style: {
|
|
457
451
|
marginTop: "0.5rem",
|
|
458
452
|
padding: "0.5rem",
|
|
459
453
|
width: "100%",
|
|
460
454
|
pointerEvents: search &&
|
|
461
|
-
((
|
|
455
|
+
((_44 = headerColumns.find((column) => column.key === _groupBy)) === null || _44 === void 0 ? void 0 : _44.search)
|
|
462
456
|
? "auto"
|
|
463
457
|
: "none",
|
|
464
458
|
cursor: search &&
|
|
465
|
-
((
|
|
459
|
+
((_45 = headerColumns.find((column) => column.key === _groupBy)) === null || _45 === void 0 ? void 0 : _45.search)
|
|
466
460
|
? "default"
|
|
467
461
|
: "not-allowed",
|
|
468
462
|
}, children: _jsx(TextInput, { onChange: (e) => {
|
|
@@ -478,23 +472,23 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
478
472
|
}
|
|
479
473
|
onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
|
|
480
474
|
}, placeholder: "Search", extraWrapperStyle: {
|
|
481
|
-
background: ((
|
|
475
|
+
background: ((_46 = headerColumns.find((column) => column.key === _groupBy)) === null || _46 === void 0 ? void 0 : _46.search)
|
|
482
476
|
? "var(--background)"
|
|
483
477
|
: "var(--disabled-bg)",
|
|
484
|
-
}, value: ((
|
|
478
|
+
}, value: ((_48 = searchQueries[((_47 = headerColumns.find((column) => column.key === _groupBy)) === null || _47 === void 0 ? void 0 : _47.key) || ""]) === null || _48 === void 0 ? void 0 : _48.text) || "", disabled: !((_49 = headerColumns.find((column) => column.key === _groupBy)) === null || _49 === void 0 ? void 0 : _49.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) }))) ||
|
|
485
479
|
null })))] })) })] }), search && columnSearchOutside && (_jsx("div", { style: {
|
|
486
480
|
marginTop: "0.5rem",
|
|
487
|
-
width: (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(
|
|
481
|
+
width: (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_50 = headerColumns.find((column) => column.key === _groupBy)) === null || _50 === void 0 ? void 0 : _50.key}`]) ||
|
|
488
482
|
widthMode === "auto" ||
|
|
489
|
-
((
|
|
483
|
+
((_51 = headerColumns.find((column) => column.key === _groupBy)) === null || _51 === void 0 ? void 0 : _51.width)
|
|
490
484
|
? "100%"
|
|
491
485
|
: "100px",
|
|
492
486
|
pointerEvents: search &&
|
|
493
|
-
((
|
|
487
|
+
((_52 = headerColumns.find((column) => column.key === _groupBy)) === null || _52 === void 0 ? void 0 : _52.search)
|
|
494
488
|
? "auto"
|
|
495
489
|
: "none",
|
|
496
490
|
cursor: search &&
|
|
497
|
-
((
|
|
491
|
+
((_53 = headerColumns.find((column) => column.key === _groupBy)) === null || _53 === void 0 ? void 0 : _53.search)
|
|
498
492
|
? "default"
|
|
499
493
|
: "not-allowed",
|
|
500
494
|
}, children: _jsx(TextInput, { onKeyDown: (e) => {
|
|
@@ -514,24 +508,18 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
514
508
|
searchType = "contains";
|
|
515
509
|
}
|
|
516
510
|
onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
|
|
517
|
-
}, value: ((
|
|
518
|
-
background: ((
|
|
511
|
+
}, value: ((_55 = searchQueries[((_54 = headerColumns.find((column) => column.key === _groupBy)) === null || _54 === void 0 ? void 0 : _54.key) || ""]) === null || _55 === void 0 ? void 0 : _55.text) || "", disabled: !((_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.search), extraWrapperStyle: {
|
|
512
|
+
background: ((_57 = headerColumns.find((column) => column.key === _groupBy)) === null || _57 === void 0 ? void 0 : _57.search)
|
|
519
513
|
? "var(--background)"
|
|
520
514
|
: "var(--disabled-bg)",
|
|
521
|
-
}, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))] }, (
|
|
515
|
+
}, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))] }, (_58 = headerColumns.find((column) => column.key === _groupBy)) === null || _58 === void 0 ? void 0 : _58.key)) }));
|
|
522
516
|
}), headerColumns
|
|
523
517
|
.filter((column) => !groupByKeys.includes(column.key))
|
|
524
518
|
.map((column, colIndex) => {
|
|
525
519
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
526
520
|
if (!column.hidden) {
|
|
527
521
|
const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
|
|
528
|
-
return (_jsx("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis",
|
|
529
|
-
? "auto"
|
|
530
|
-
: column.width
|
|
531
|
-
? column.width
|
|
532
|
-
: (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${column.key}`])
|
|
533
|
-
? hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${column.key}`]
|
|
534
|
-
: "fit-content", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: !actionsKey.split(",").includes(column.key) && (_jsxs(_Fragment, { children: [resizable && (_jsx("div", { style: {
|
|
522
|
+
return (_jsx("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: !actionsKey.split(",").includes(column.key) && (_jsxs(_Fragment, { children: [resizable && (_jsx("div", { style: {
|
|
535
523
|
position: "absolute",
|
|
536
524
|
width: "1px",
|
|
537
525
|
height: "100%",
|
|
@@ -105,12 +105,7 @@ const GridRow = ({ item, rowStyle, cellStyle, rowHeight, bulkSelect, selectedRow
|
|
|
105
105
|
const cellUrl = cellData === null || cellData === void 0 ? void 0 : cellData.url;
|
|
106
106
|
const isHidden = column.overflowHidden;
|
|
107
107
|
if (!column.hidden && !groupByKeys.includes(column.key)) {
|
|
108
|
-
return (_jsxs("div", { id: `column-${index}-${colIndex}`, className: `column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { padding: "0.5rem", display: "flex", alignItems: "center", justifyContent: "flex-start", overflow: isHidden ? "hidden" : "visible", textOverflow: isHidden ? "ellipsis" : "clip", whiteSpace: isHidden ? "nowrap" : "normal", flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0, wordBreak: widthMode === "auto" ? "break-all" : "unset", boxSizing: "border-box",
|
|
109
|
-
// marginTop:
|
|
110
|
-
// rowIndex === index && rowIndex > -1 && rowIndex < 2
|
|
111
|
-
// ? rowHeight
|
|
112
|
-
// : "",
|
|
113
|
-
border: rowIndex === index && columnIndex === colIndex
|
|
108
|
+
return (_jsxs("div", { id: `column-${index}-${colIndex}`, className: `column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { padding: "0.5rem", display: "flex", alignItems: "center", justifyContent: "flex-start", overflow: isHidden ? "hidden" : "visible", textOverflow: isHidden ? "ellipsis" : "clip", whiteSpace: isHidden ? "nowrap" : "normal", flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0, wordBreak: widthMode === "auto" ? "break-all" : "unset", boxSizing: "border-box", border: rowIndex === index && columnIndex === colIndex
|
|
114
109
|
? `1px solid ${hlBorderColor}`
|
|
115
110
|
: "", backgroundColor: alternateRowColor && (index + 1) % 2 === 0
|
|
116
111
|
? "var(--row-bg)"
|
package/package.json
CHANGED