@megha-ui/react 1.3.92 → 1.3.94

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.
@@ -4,6 +4,7 @@ import GridHeaderDropdown from "./gridHeaderDropdown";
4
4
  import { MdFilterList } from "react-icons/md";
5
5
  import GridFilterDropdown from "./gridFilterDropdown";
6
6
  import TextFilterDropdown from "./textFilterDropdown";
7
+ import DateInput from "../../date-input";
7
8
  import TextInput from "../../text-input";
8
9
  import Checkbox from "../../checkbox";
9
10
  import Dropdown from "../../dropdown";
@@ -333,7 +334,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
333
334
  width: "100%",
334
335
  height: "100%",
335
336
  }, children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) }) })), groupByKeys.map((_groupBy) => {
336
- 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, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88;
337
+ 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, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83;
337
338
  return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
338
339
  ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.sortable)
339
340
  ? "sortable"
@@ -385,266 +386,191 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
385
386
  : "var(--row-header-text)",
386
387
  } }), dropdownVisible ===
387
388
  ((_m = headerColumns.find((column) => column.key === _groupBy)) === null || _m === void 0 ? void 0 : _m.key) &&
388
- (((_o = headerColumns.find((column) => column.key === _groupBy)) === null || _o === void 0 ? void 0 : _o.uniqueDrop) ? (_jsx(GridFilterDropdown, { portalTarget: portalTarget, columnIndex: -1, headerDropdownIndex: headerDropdownIndex, searchOps: search && columnSearchOutside ? (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
389
- marginTop: "0.5rem",
390
- pointerEvents: search &&
391
- ((_p = headerColumns.find((column) => column.key === _groupBy)) === null || _p === void 0 ? void 0 : _p.search)
392
- ? "auto"
393
- : "none",
394
- cursor: search &&
395
- ((_q = headerColumns.find((column) => column.key === _groupBy)) === null || _q === void 0 ? void 0 : _q.search)
396
- ? "default"
397
- : "not-allowed",
398
- }, children: _jsxs("div", { style: {
399
- display: "flex",
400
- alignItems: "center",
401
- }, children: [_jsx(TextInput, { onFocus: () => {
402
- var _a;
403
- return setActiveSearchColumn(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
404
- }, onChange: (e) => {
405
- var _a, _b, _c;
406
- let searchType = ((_b = searchQueries[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""]) === null || _b === void 0 ? void 0 : _b.type) ||
407
- defaultSearchOperation ||
408
- "contains";
409
- if (e.target.value.includes("to")) {
410
- searchType = "between";
411
- }
412
- else if (searchType === "between") {
413
- searchType = "contains";
414
- }
415
- onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
416
- }, placeholder: "Search", extraWrapperStyle: {
417
- background: ((_r = headerColumns.find((column) => column.key === _groupBy)) === null || _r === void 0 ? void 0 : _r.search)
418
- ? "var(--background)"
419
- : "var(--disabled-bg)",
420
- }, value: ((_t = searchQueries[((_s = headerColumns.find((column) => column.key === _groupBy)) === null || _s === void 0 ? void 0 : _s.key) || ""]) === null || _t === void 0 ? void 0 : _t.text) || "", disabled: !((_u = headerColumns.find((column) => column.key === _groupBy)) === null || _u === void 0 ? void 0 : _u.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => {
421
- var _a, _b, _c;
422
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
423
- ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
424
- ? numberTypeSearch.includes(item.value)
425
- : ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
426
- ? dateTypeSearch.includes(item.value)
427
- : textTypeSearch.includes(item.value);
428
- }), selectedValues: [
429
- ((_x = searchQueries[(_w = (_v = headerColumns.find((column) => column.key === _groupBy)) === null || _v === void 0 ? void 0 : _v.key) !== null && _w !== void 0 ? _w : ""]) === null || _x === void 0 ? void 0 : _x.type) ||
430
- defaultSearchOperation ||
431
- "contains",
432
- ], selectedDisplay: (_z = (_y = searchOptions
433
- .filter((item) => {
434
- var _a, _b, _c;
435
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
436
- ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
437
- ? numberTypeSearch.includes(item.value)
438
- : ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
439
- ? dateTypeSearch.includes(item.value)
440
- : textTypeSearch.includes(item.value);
441
- })
442
- .find((item) => {
443
- var _a, _b, _c;
444
- return item.value ===
445
- (((_c = searchQueries[(_b = (_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : ""]) === null || _c === void 0 ? void 0 : _c.type) ||
446
- defaultSearchOperation ||
447
- "contains");
448
- })) === null || _y === void 0 ? void 0 : _y.label) !== null && _z !== void 0 ? _z : "", withValue: true, onChange: (selected) => {
449
- var _a, _b, _c;
450
- const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
451
- handleSearchOptionSelect((_c = (_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : "", value);
452
- }, dropdownListWidth: "max-content", searchEnabled: false, className: "flex-1", isIcon: true })] }) }), 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 : []).length > 0 &&
453
- activeSearchColumn ===
454
- (((_3 = headerColumns.find((column) => column.key === _groupBy)) === null || _3 === void 0 ? void 0 : _3.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
455
- position: "absolute",
456
- top: "calc(100% + 0.25rem)",
457
- left: 0,
458
- background: "var(--card-bg)",
459
- width: "max-content",
460
- maxWidth: "24rem",
461
- maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
462
- overflow: "auto",
463
- padding: "0.5rem 0.75rem",
464
- borderRadius: "0.5rem",
465
- boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
466
- border: "1px solid var(--divider, #f5f5f5)",
467
- }, children: getColumnData(((_4 = headerColumns.find((column) => column.key === _groupBy)) === null || _4 === void 0 ? void 0 : _4.key) || "", gridData, (_6 = (_5 = headerColumns.find((column) => column.key === _groupBy)) === null || _5 === void 0 ? void 0 : _5.dataType) !== null && _6 !== void 0 ? _6 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
468
- cursor: "pointer",
469
- display: "flex",
470
- alignItems: "center",
471
- }, onClick: () => {
472
- var _a, _b, _c, _d;
473
- return handleSelect("all", ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", getColumnData(((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || "", gridData, (_d = (_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []));
474
- }, children: [_jsx(Checkbox, { id: CSS.escape(((_7 = headerColumns.find((column) => column.key === _groupBy)) === null || _7 === void 0 ? void 0 : _7.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_8 = headerColumns.find((column) => column.key === _groupBy)) === null || _8 === void 0 ? void 0 : _8.key) || ""]) !== "undefined"
475
- ? ((_10 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_9 = headerColumns.find((column) => column.key ===
476
- _groupBy)) === null || _9 === void 0 ? void 0 : _9.key) || ""]) === null || _10 === void 0 ? void 0 : _10.length) > 0 &&
477
- getColumnData(((_11 = headerColumns.find((column) => column.key ===
478
- _groupBy)) === null || _11 === void 0 ? void 0 : _11.key) || "", gridData, (_13 = (_12 = headerColumns.find((column) => column.key ===
479
- _groupBy)) === null || _12 === void 0 ? void 0 : _12.dataType) !== null && _13 !== void 0 ? _13 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).every((item) => {
480
- var _a;
481
- return uniqueSearch[((_a = headerColumns.find((column) => column.key ===
482
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
483
- })
484
- : true, indeterminate: ((_15 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_14 = headerColumns.find((column) => column.key === _groupBy)) === null || _14 === void 0 ? void 0 : _14.key) || ""]) === null || _15 === void 0 ? void 0 : _15.length) > 0 &&
485
- getColumnData(((_16 = headerColumns.find((column) => column.key === _groupBy)) === null || _16 === void 0 ? void 0 : _16.key) || "", gridData, (_18 = (_17 = headerColumns.find((column) => column.key === _groupBy)) === null || _17 === void 0 ? void 0 : _17.dataType) !== null && _18 !== void 0 ? _18 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).some((item) => {
486
- var _a;
487
- return uniqueSearch[((_a = headerColumns.find((column) => column.key ===
488
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
489
- }), onChange: () => { }, style: {
490
- pointerEvents: "none",
491
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), getColumnData(((_19 = headerColumns.find((column) => column.key === _groupBy)) === null || _19 === void 0 ? void 0 : _19.key) || "", gridData, (_21 = (_20 = headerColumns.find((column) => column.key === _groupBy)) === null || _20 === void 0 ? void 0 : _20.dataType) !== null && _21 !== void 0 ? _21 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).map((item) => {
492
- var _a, _b, _c, _d, _e, _f, _g;
493
- return (_jsxs("div", { style: {
494
- cursor: "pointer",
495
- display: "flex",
496
- alignItems: "center",
497
- }, onClick: () => {
498
- var _a, _b, _c, _d;
499
- return handleSelect(item.toString(), ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", getColumnData(((_b = headerColumns.find((column) => column.key ===
500
- _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || "", gridData, (_d = (_c = headerColumns.find((column) => column.key ===
501
- _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []));
502
- }, children: [_jsx(Checkbox, { id: CSS.escape(`${((_a = headerColumns.find((column) => column.key ===
503
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""}-${item}`), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_b = headerColumns.find((column) => column.key ===
504
- _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) !== "undefined"
505
- ? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_c = headerColumns.find((column) => column.key ===
506
- _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || ""].length) > 0 &&
507
- ((_e = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_d = headerColumns.find((column) => column.key ===
508
- _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.includes(item))
509
- : true, onChange: () => { }, style: {
510
- pointerEvents: "none",
511
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
512
- marginLeft: "0.5rem",
513
- }, children: formatValue(item, (_g = (_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.dataType) !== null && _g !== void 0 ? _g : "", locale, formatOptions) })] }, item));
514
- })] })) }))] })) : null, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), position: searchOpsPosition || { top: 0, left: 0 } })) : (_jsx(TextFilterDropdown, { columnIndex: -1, headerDropdownIndex: headerDropdownIndex, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOps: search && columnSearchOutside ? (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
515
- marginTop: "0.5rem",
516
- pointerEvents: search &&
517
- ((_22 = headerColumns.find((column) => column.key === _groupBy)) === null || _22 === void 0 ? void 0 : _22.search)
518
- ? "auto"
519
- : "none",
520
- cursor: search &&
521
- ((_23 = headerColumns.find((column) => column.key === _groupBy)) === null || _23 === void 0 ? void 0 : _23.search)
522
- ? "default"
523
- : "not-allowed",
524
- }, children: _jsxs("div", { style: {
525
- display: "flex",
526
- alignItems: "center",
527
- }, children: [_jsx(TextInput, { onFocus: () => {
528
- var _a;
529
- return setActiveSearchColumn(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
530
- }, onChange: (e) => {
531
- var _a, _b, _c;
532
- let searchType = ((_b = searchQueries[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""]) === null || _b === void 0 ? void 0 : _b.type) ||
533
- defaultSearchOperation ||
534
- "contains";
535
- if (e.target.value.includes("to")) {
536
- searchType = "between";
537
- }
538
- else if (searchType === "between") {
539
- searchType = "contains";
389
+ (((_o = headerColumns.find((column) => column.key === _groupBy)) === null || _o === void 0 ? void 0 : _o.uniqueDrop) ? (_jsx(GridFilterDropdown, { portalTarget: portalTarget, 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 &&
390
+ ((_s = headerColumns.find((column) => column.key === _groupBy)) === null || _s === void 0 ? void 0 : _s.search) && (_jsx("div", { style: {
391
+ marginTop: "0.5rem",
392
+ padding: "0.5rem",
393
+ width: "100%",
394
+ pointerEvents: search &&
395
+ ((_t = headerColumns.find((column) => column.key === _groupBy)) === null || _t === void 0 ? void 0 : _t.search)
396
+ ? "auto"
397
+ : "none",
398
+ cursor: search &&
399
+ ((_u = headerColumns.find((column) => column.key === _groupBy)) === null || _u === void 0 ? void 0 : _u.search)
400
+ ? "default"
401
+ : "not-allowed",
402
+ }, children: _jsx(TextInput, { onChange: (e) => {
403
+ var _a, _b, _c;
404
+ let searchType = ((_b = searchQueries[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""]) === null || _b === void 0 ? void 0 : _b.type) ||
405
+ defaultSearchOperation ||
406
+ "contains";
407
+ if (e.target.value.includes("to")) {
408
+ searchType = "between";
409
+ }
410
+ else if (searchType === "between") {
411
+ searchType = "contains";
412
+ }
413
+ onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
414
+ }, placeholder: "Search", extraWrapperStyle: {
415
+ background: ((_v = headerColumns.find((column) => column.key === _groupBy)) === null || _v === void 0 ? void 0 : _v.search)
416
+ ? "var(--background)"
417
+ : "var(--disabled-bg)",
418
+ }, 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)" }) }))) ||
419
+ 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) => {
420
+ var _a, _b;
421
+ return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
422
+ ? numberTypeSearch.includes(item.value)
423
+ : ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
424
+ ? dateTypeSearch.includes(item.value)
425
+ : textTypeSearch.includes(item.value);
426
+ }), 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) => {
427
+ var _a, _b, _c, _d, _e;
428
+ 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) => {
429
+ if (index === 0) {
430
+ return value;
431
+ }
432
+ return item;
433
+ }).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) ||
434
+ defaultSearchOperation ||
435
+ "contains");
436
+ } }), _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) => {
437
+ var _a, _b, _c, _d, _e;
438
+ 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) => {
439
+ if (index === 1) {
440
+ return value;
441
+ }
442
+ return item;
443
+ }).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) ||
444
+ defaultSearchOperation ||
445
+ "contains");
446
+ } })] })) : (_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) => {
447
+ var _a, _b, _c;
448
+ 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) ||
449
+ defaultSearchOperation ||
450
+ "contains");
451
+ } }))) : (_jsx(TextInput, { placeholder: `Filter ${(_13 = headerColumns.find((column) => column.key === _groupBy)) === null || _13 === void 0 ? void 0 : _13.label}`, onKeyDown: (e) => {
452
+ var _a;
453
+ if (e.key === "Enter") {
454
+ toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
455
+ }
456
+ }, onChange: (e) => {
457
+ var _a, _b, _c;
458
+ 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) ||
459
+ defaultSearchOperation ||
460
+ "contains");
461
+ }, 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: {
462
+ visibility: ((_16 = headerColumns.find((column) => column.key === _groupBy)) === null || _16 === void 0 ? void 0 : _16.search)
463
+ ? "visible"
464
+ : "hidden",
465
+ }, 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) ||
466
+ defaultSearchOperation ||
467
+ "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) => {
468
+ var _a, _b;
469
+ return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
470
+ ? numberTypeSearch.includes(item.value)
471
+ : ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
472
+ ? dateTypeSearch.includes(item.value)
473
+ : textTypeSearch.includes(item.value);
474
+ }), 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) => {
475
+ var _a, _b, _c, _d, _e;
476
+ 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) => {
477
+ if (index === 0) {
478
+ return value;
479
+ }
480
+ return item;
481
+ }).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) ||
482
+ defaultSearchOperation ||
483
+ "contains");
484
+ } }), _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) => {
485
+ var _a, _b, _c, _d, _e;
486
+ 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) => {
487
+ if (index === 1) {
488
+ return value;
540
489
  }
541
- onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
542
- }, placeholder: "Search", extraWrapperStyle: {
543
- background: ((_24 = headerColumns.find((column) => column.key === _groupBy)) === null || _24 === void 0 ? void 0 : _24.search)
544
- ? "var(--background)"
545
- : "var(--disabled-bg)",
546
- }, value: ((_26 = searchQueries[((_25 = headerColumns.find((column) => column.key === _groupBy)) === null || _25 === void 0 ? void 0 : _25.key) || ""]) === null || _26 === void 0 ? void 0 : _26.text) || "", disabled: !((_27 = headerColumns.find((column) => column.key === _groupBy)) === null || _27 === void 0 ? void 0 : _27.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => {
547
- var _a, _b, _c;
548
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
549
- ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
550
- ? numberTypeSearch.includes(item.value)
551
- : ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
552
- ? dateTypeSearch.includes(item.value)
553
- : textTypeSearch.includes(item.value);
554
- }), selectedValues: [
555
- ((_30 = searchQueries[(_29 = (_28 = headerColumns.find((column) => column.key === _groupBy)) === null || _28 === void 0 ? void 0 : _28.key) !== null && _29 !== void 0 ? _29 : ""]) === null || _30 === void 0 ? void 0 : _30.type) ||
556
- defaultSearchOperation ||
557
- "contains",
558
- ], selectedDisplay: (_32 = (_31 = searchOptions
559
- .filter((item) => {
560
- var _a, _b, _c;
561
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
562
- ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
563
- ? numberTypeSearch.includes(item.value)
564
- : ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
565
- ? dateTypeSearch.includes(item.value)
566
- : textTypeSearch.includes(item.value);
567
- })
568
- .find((item) => {
569
- var _a, _b, _c;
570
- return item.value ===
571
- (((_c = searchQueries[(_b = (_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : ""]) === null || _c === void 0 ? void 0 : _c.type) ||
572
- defaultSearchOperation ||
573
- "contains");
574
- })) === null || _31 === void 0 ? void 0 : _31.label) !== null && _32 !== void 0 ? _32 : "", withValue: true, onChange: (selected) => {
575
- var _a, _b, _c;
576
- const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
577
- handleSearchOptionSelect((_c = (_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : "", value);
578
- }, dropdownListWidth: "max-content", searchEnabled: false, className: "flex-1", isIcon: true })] }) }), getColumnData(((_33 = headerColumns.find((column) => column.key === _groupBy)) === null || _33 === void 0 ? void 0 : _33.key) || "", gridData, (_35 = (_34 = headerColumns.find((column) => column.key === _groupBy)) === null || _34 === void 0 ? void 0 : _34.dataType) !== null && _35 !== void 0 ? _35 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 &&
579
- activeSearchColumn ===
580
- (((_36 = headerColumns.find((column) => column.key === _groupBy)) === null || _36 === void 0 ? void 0 : _36.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
581
- position: "absolute",
582
- top: "calc(100% + 0.25rem)",
583
- left: 0,
584
- background: "var(--card-bg)",
585
- width: "max-content",
586
- maxWidth: "24rem",
587
- maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
588
- overflow: "auto",
589
- padding: "0.5rem 0.75rem",
590
- borderRadius: "0.5rem",
591
- boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
592
- border: "1px solid var(--divider, #f5f5f5)",
593
- }, children: getColumnData(((_37 = headerColumns.find((column) => column.key === _groupBy)) === null || _37 === void 0 ? void 0 : _37.key) || "", gridData, (_39 = (_38 = headerColumns.find((column) => column.key === _groupBy)) === null || _38 === void 0 ? void 0 : _38.dataType) !== null && _39 !== void 0 ? _39 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
594
- cursor: "pointer",
595
- display: "flex",
596
- alignItems: "center",
597
- }, onClick: () => {
598
- var _a, _b, _c, _d;
599
- return handleSelect("all", ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", getColumnData(((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || "", gridData, (_d = (_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []));
600
- }, children: [_jsx(Checkbox, { id: CSS.escape(((_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_41 = headerColumns.find((column) => column.key === _groupBy)) === null || _41 === void 0 ? void 0 : _41.key) || ""]) !== "undefined"
601
- ? ((_43 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_42 = headerColumns.find((column) => column.key ===
602
- _groupBy)) === null || _42 === void 0 ? void 0 : _42.key) || ""]) === null || _43 === void 0 ? void 0 : _43.length) > 0 &&
603
- getColumnData(((_44 = headerColumns.find((column) => column.key ===
604
- _groupBy)) === null || _44 === void 0 ? void 0 : _44.key) || "", gridData, (_46 = (_45 = headerColumns.find((column) => column.key ===
605
- _groupBy)) === null || _45 === void 0 ? void 0 : _45.dataType) !== null && _46 !== void 0 ? _46 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).every((item) => {
606
- var _a;
607
- return uniqueSearch[((_a = headerColumns.find((column) => column.key ===
608
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
609
- })
610
- : true, indeterminate: ((_48 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_47 = headerColumns.find((column) => column.key === _groupBy)) === null || _47 === void 0 ? void 0 : _47.key) || ""]) === null || _48 === void 0 ? void 0 : _48.length) > 0 &&
611
- getColumnData(((_49 = headerColumns.find((column) => column.key === _groupBy)) === null || _49 === void 0 ? void 0 : _49.key) || "", gridData, (_51 = (_50 = headerColumns.find((column) => column.key === _groupBy)) === null || _50 === void 0 ? void 0 : _50.dataType) !== null && _51 !== void 0 ? _51 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).some((item) => {
612
- var _a;
613
- return uniqueSearch[((_a = headerColumns.find((column) => column.key ===
614
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
615
- }), onChange: () => { }, style: {
616
- pointerEvents: "none",
617
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), getColumnData(((_52 = headerColumns.find((column) => column.key === _groupBy)) === null || _52 === void 0 ? void 0 : _52.key) || "", gridData, (_54 = (_53 = headerColumns.find((column) => column.key === _groupBy)) === null || _53 === void 0 ? void 0 : _53.dataType) !== null && _54 !== void 0 ? _54 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).map((item) => {
618
- var _a, _b, _c, _d, _e, _f, _g;
619
- return (_jsxs("div", { style: {
620
- cursor: "pointer",
621
- display: "flex",
622
- alignItems: "center",
623
- }, onClick: () => {
624
- var _a, _b, _c, _d;
625
- return handleSelect(item.toString(), ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", getColumnData(((_b = headerColumns.find((column) => column.key ===
626
- _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || "", gridData, (_d = (_c = headerColumns.find((column) => column.key ===
627
- _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []));
628
- }, children: [_jsx(Checkbox, { id: CSS.escape(`${((_a = headerColumns.find((column) => column.key ===
629
- _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""}-${item}`), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_b = headerColumns.find((column) => column.key ===
630
- _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) !== "undefined"
631
- ? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_c = headerColumns.find((column) => column.key ===
632
- _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || ""].length) > 0 &&
633
- ((_e = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_d = headerColumns.find((column) => column.key ===
634
- _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.includes(item))
635
- : true, onChange: () => { }, style: {
636
- pointerEvents: "none",
637
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
638
- marginLeft: "0.5rem",
639
- }, children: formatValue(item, (_g = (_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.dataType) !== null && _g !== void 0 ? _g : "", locale, formatOptions) })] }, item));
640
- })] })) }))] })) : null })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
490
+ return item;
491
+ }).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) ||
492
+ defaultSearchOperation ||
493
+ "contains");
494
+ } }) })] })) : [
495
+ "contains",
496
+ "doesNotContain",
497
+ "blank",
498
+ "notBlank",
499
+ ].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) ||
500
+ defaultSearchOperation ||
501
+ "contains") ? (_jsx(TextInput, { placeholder: `Filter ${(_30 = headerColumns.find((column) => column.key === _groupBy)) === null || _30 === void 0 ? void 0 : _30.label}`, onKeyDown: (e) => {
502
+ var _a;
503
+ if (e.key === "Enter") {
504
+ toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
505
+ }
506
+ }, onChange: (e) => {
507
+ var _a, _b, _c;
508
+ 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) ||
509
+ defaultSearchOperation ||
510
+ "contains");
511
+ }, 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: {
512
+ visibility: ((_33 = headerColumns.find((column) => column.key === _groupBy)) === null || _33 === void 0 ? void 0 : _33.search)
513
+ ? "visible"
514
+ : "hidden",
515
+ }, 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) => {
516
+ var _a, _b, _c;
517
+ 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) ||
518
+ defaultSearchOperation ||
519
+ "contains");
520
+ } }))) : (_jsx(TextInput, { placeholder: `Filter ${(_37 = headerColumns.find((column) => column.key === _groupBy)) === null || _37 === void 0 ? void 0 : _37.label}`, onKeyDown: (e) => {
521
+ var _a;
522
+ if (e.key === "Enter") {
523
+ toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
524
+ }
525
+ }, onChange: (e) => {
526
+ var _a, _b, _c;
527
+ 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) ||
528
+ defaultSearchOperation ||
529
+ "contains");
530
+ }, 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: {
531
+ visibility: ((_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.search)
532
+ ? "visible"
533
+ : "hidden",
534
+ }, 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) ||
535
+ defaultSearchOperation ||
536
+ "contains", searchInput: (search &&
537
+ ((_43 = headerColumns.find((column) => column.key === _groupBy)) === null || _43 === void 0 ? void 0 : _43.search) && (_jsx("div", { style: {
538
+ marginTop: "0.5rem",
539
+ padding: "0.5rem",
540
+ width: "100%",
541
+ pointerEvents: search &&
542
+ ((_44 = headerColumns.find((column) => column.key === _groupBy)) === null || _44 === void 0 ? void 0 : _44.search)
543
+ ? "auto"
544
+ : "none",
545
+ cursor: search &&
546
+ ((_45 = headerColumns.find((column) => column.key === _groupBy)) === null || _45 === void 0 ? void 0 : _45.search)
547
+ ? "default"
548
+ : "not-allowed",
549
+ }, children: _jsx(TextInput, { onChange: (e) => {
550
+ var _a, _b, _c;
551
+ let searchType = ((_b = searchQueries[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""]) === null || _b === void 0 ? void 0 : _b.type) ||
552
+ defaultSearchOperation ||
553
+ "contains";
554
+ if (e.target.value.includes("to")) {
555
+ searchType = "between";
556
+ }
557
+ else if (searchType === "between") {
558
+ searchType = "contains";
559
+ }
560
+ onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
561
+ }, placeholder: "Search", extraWrapperStyle: {
562
+ background: ((_46 = headerColumns.find((column) => column.key === _groupBy)) === null || _46 === void 0 ? void 0 : _46.search)
563
+ ? "var(--background)"
564
+ : "var(--disabled-bg)",
565
+ }, 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" }) }))) ||
566
+ null })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
641
567
  marginTop: "0.5rem",
642
568
  pointerEvents: search &&
643
- ((_55 = headerColumns.find((column) => column.key === _groupBy)) === null || _55 === void 0 ? void 0 : _55.search)
569
+ ((_50 = headerColumns.find((column) => column.key === _groupBy)) === null || _50 === void 0 ? void 0 : _50.search)
644
570
  ? "auto"
645
571
  : "none",
646
572
  cursor: search &&
647
- ((_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.search)
573
+ ((_51 = headerColumns.find((column) => column.key === _groupBy)) === null || _51 === void 0 ? void 0 : _51.search)
648
574
  ? "default"
649
575
  : "not-allowed",
650
576
  }, children: _jsxs("div", { style: {
@@ -666,10 +592,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
666
592
  }
667
593
  onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
668
594
  }, placeholder: "Search", extraWrapperStyle: {
669
- background: ((_57 = headerColumns.find((column) => column.key === _groupBy)) === null || _57 === void 0 ? void 0 : _57.search)
595
+ background: ((_52 = headerColumns.find((column) => column.key === _groupBy)) === null || _52 === void 0 ? void 0 : _52.search)
670
596
  ? "var(--background)"
671
597
  : "var(--disabled-bg)",
672
- }, value: ((_59 = searchQueries[((_58 = headerColumns.find((column) => column.key === _groupBy)) === null || _58 === void 0 ? void 0 : _58.key) || ""]) === null || _59 === void 0 ? void 0 : _59.text) || "", disabled: !((_60 = headerColumns.find((column) => column.key === _groupBy)) === null || _60 === void 0 ? void 0 : _60.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => {
598
+ }, value: ((_54 = searchQueries[((_53 = headerColumns.find((column) => column.key === _groupBy)) === null || _53 === void 0 ? void 0 : _53.key) || ""]) === null || _54 === void 0 ? void 0 : _54.text) || "", disabled: !((_55 = headerColumns.find((column) => column.key === _groupBy)) === null || _55 === void 0 ? void 0 : _55.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => {
673
599
  var _a, _b, _c;
674
600
  return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
675
601
  ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
@@ -678,10 +604,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
678
604
  ? dateTypeSearch.includes(item.value)
679
605
  : textTypeSearch.includes(item.value);
680
606
  }), selectedValues: [
681
- ((_63 = searchQueries[(_62 = (_61 = headerColumns.find((column) => column.key === _groupBy)) === null || _61 === void 0 ? void 0 : _61.key) !== null && _62 !== void 0 ? _62 : ""]) === null || _63 === void 0 ? void 0 : _63.type) ||
607
+ ((_58 = searchQueries[(_57 = (_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.key) !== null && _57 !== void 0 ? _57 : ""]) === null || _58 === void 0 ? void 0 : _58.type) ||
682
608
  defaultSearchOperation ||
683
609
  "contains",
684
- ], selectedDisplay: (_65 = (_64 = searchOptions
610
+ ], selectedDisplay: (_60 = (_59 = searchOptions
685
611
  .filter((item) => {
686
612
  var _a, _b, _c;
687
613
  return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
@@ -697,13 +623,13 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
697
623
  (((_c = searchQueries[(_b = (_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : ""]) === null || _c === void 0 ? void 0 : _c.type) ||
698
624
  defaultSearchOperation ||
699
625
  "contains");
700
- })) === null || _64 === void 0 ? void 0 : _64.label) !== null && _65 !== void 0 ? _65 : "", withValue: true, onChange: (selected) => {
626
+ })) === null || _59 === void 0 ? void 0 : _59.label) !== null && _60 !== void 0 ? _60 : "", withValue: true, onChange: (selected) => {
701
627
  var _a, _b, _c;
702
628
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
703
629
  handleSearchOptionSelect((_c = (_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : "", value);
704
- }, dropdownListWidth: "max-content", searchEnabled: false, className: "flex-1", isIcon: true })] }) }), getColumnData(((_66 = headerColumns.find((column) => column.key === _groupBy)) === null || _66 === void 0 ? void 0 : _66.key) || "", gridData, (_68 = (_67 = headerColumns.find((column) => column.key === _groupBy)) === null || _67 === void 0 ? void 0 : _67.dataType) !== null && _68 !== void 0 ? _68 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 &&
630
+ }, dropdownListWidth: "max-content", searchEnabled: false, className: "flex-1", isIcon: true })] }) }), getColumnData(((_61 = headerColumns.find((column) => column.key === _groupBy)) === null || _61 === void 0 ? void 0 : _61.key) || "", gridData, (_63 = (_62 = headerColumns.find((column) => column.key === _groupBy)) === null || _62 === void 0 ? void 0 : _62.dataType) !== null && _63 !== void 0 ? _63 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 &&
705
631
  activeSearchColumn ===
706
- (((_69 = headerColumns.find((column) => column.key === _groupBy)) === null || _69 === void 0 ? void 0 : _69.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
632
+ (((_64 = headerColumns.find((column) => column.key === _groupBy)) === null || _64 === void 0 ? void 0 : _64.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
707
633
  position: "absolute",
708
634
  top: "calc(100% + 0.25rem)",
709
635
  left: 0,
@@ -716,24 +642,24 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
716
642
  borderRadius: "0.5rem",
717
643
  boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
718
644
  border: "1px solid var(--divider, #f5f5f5)",
719
- }, children: getColumnData(((_70 = headerColumns.find((column) => column.key === _groupBy)) === null || _70 === void 0 ? void 0 : _70.key) || "", gridData, (_72 = (_71 = headerColumns.find((column) => column.key === _groupBy)) === null || _71 === void 0 ? void 0 : _71.dataType) !== null && _72 !== void 0 ? _72 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
645
+ }, children: getColumnData(((_65 = headerColumns.find((column) => column.key === _groupBy)) === null || _65 === void 0 ? void 0 : _65.key) || "", gridData, (_67 = (_66 = headerColumns.find((column) => column.key === _groupBy)) === null || _66 === void 0 ? void 0 : _66.dataType) !== null && _67 !== void 0 ? _67 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
720
646
  cursor: "pointer",
721
647
  display: "flex",
722
648
  alignItems: "center",
723
649
  }, onClick: () => {
724
650
  var _a, _b, _c, _d;
725
651
  return handleSelect("all", ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", getColumnData(((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || "", gridData, (_d = (_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []));
726
- }, children: [_jsx(Checkbox, { id: CSS.escape(((_73 = headerColumns.find((column) => column.key === _groupBy)) === null || _73 === void 0 ? void 0 : _73.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_74 = headerColumns.find((column) => column.key === _groupBy)) === null || _74 === void 0 ? void 0 : _74.key) || ""]) !== "undefined"
727
- ? ((_76 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_75 = headerColumns.find((column) => column.key === _groupBy)) === null || _75 === void 0 ? void 0 : _75.key) || ""]) === null || _76 === void 0 ? void 0 : _76.length) > 0 &&
728
- getColumnData(((_77 = headerColumns.find((column) => column.key === _groupBy)) === null || _77 === void 0 ? void 0 : _77.key) || "", gridData, (_79 = (_78 = headerColumns.find((column) => column.key === _groupBy)) === null || _78 === void 0 ? void 0 : _78.dataType) !== null && _79 !== void 0 ? _79 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).every((item) => {
652
+ }, children: [_jsx(Checkbox, { id: CSS.escape(((_68 = headerColumns.find((column) => column.key === _groupBy)) === null || _68 === void 0 ? void 0 : _68.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_69 = headerColumns.find((column) => column.key === _groupBy)) === null || _69 === void 0 ? void 0 : _69.key) || ""]) !== "undefined"
653
+ ? ((_71 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_70 = headerColumns.find((column) => column.key === _groupBy)) === null || _70 === void 0 ? void 0 : _70.key) || ""]) === null || _71 === void 0 ? void 0 : _71.length) > 0 &&
654
+ getColumnData(((_72 = headerColumns.find((column) => column.key === _groupBy)) === null || _72 === void 0 ? void 0 : _72.key) || "", gridData, (_74 = (_73 = headerColumns.find((column) => column.key === _groupBy)) === null || _73 === void 0 ? void 0 : _73.dataType) !== null && _74 !== void 0 ? _74 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).every((item) => {
729
655
  var _a;
730
656
  return uniqueSearch[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
731
657
  })
732
- : true, indeterminate: ((_81 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_80 = headerColumns.find((column) => column.key === _groupBy)) === null || _80 === void 0 ? void 0 : _80.key) || ""]) === null || _81 === void 0 ? void 0 : _81.length) > 0 &&
733
- getColumnData(((_82 = headerColumns.find((column) => column.key === _groupBy)) === null || _82 === void 0 ? void 0 : _82.key) || "", gridData, (_84 = (_83 = headerColumns.find((column) => column.key === _groupBy)) === null || _83 === void 0 ? void 0 : _83.dataType) !== null && _84 !== void 0 ? _84 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).some((item) => {
658
+ : true, indeterminate: ((_76 = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_75 = headerColumns.find((column) => column.key === _groupBy)) === null || _75 === void 0 ? void 0 : _75.key) || ""]) === null || _76 === void 0 ? void 0 : _76.length) > 0 &&
659
+ getColumnData(((_77 = headerColumns.find((column) => column.key === _groupBy)) === null || _77 === void 0 ? void 0 : _77.key) || "", gridData, (_79 = (_78 = headerColumns.find((column) => column.key === _groupBy)) === null || _78 === void 0 ? void 0 : _78.dataType) !== null && _79 !== void 0 ? _79 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).some((item) => {
734
660
  var _a;
735
661
  return uniqueSearch[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
736
- }), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), getColumnData(((_85 = headerColumns.find((column) => column.key === _groupBy)) === null || _85 === void 0 ? void 0 : _85.key) || "", gridData, (_87 = (_86 = headerColumns.find((column) => column.key === _groupBy)) === null || _86 === void 0 ? void 0 : _86.dataType) !== null && _87 !== void 0 ? _87 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).map((item) => {
662
+ }), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), getColumnData(((_80 = headerColumns.find((column) => column.key === _groupBy)) === null || _80 === void 0 ? void 0 : _80.key) || "", gridData, (_82 = (_81 = headerColumns.find((column) => column.key === _groupBy)) === null || _81 === void 0 ? void 0 : _81.dataType) !== null && _82 !== void 0 ? _82 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).map((item) => {
737
663
  var _a, _b, _c, _d, _e, _f, _g;
738
664
  return (_jsxs("div", { style: {
739
665
  cursor: "pointer",
@@ -746,11 +672,11 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
746
672
  ? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || ""].length) > 0 &&
747
673
  ((_e = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.key) || ""]) === null || _e === void 0 ? void 0 : _e.includes(item))
748
674
  : true, onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: formatValue(item, (_g = (_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.dataType) !== null && _g !== void 0 ? _g : "", locale, formatOptions) })] }, item));
749
- })] })) }))] }))] }, (_88 = headerColumns.find((column) => column.key === _groupBy)) === null || _88 === void 0 ? void 0 : _88.key)) }));
675
+ })] })) }))] }))] }, (_83 = headerColumns.find((column) => column.key === _groupBy)) === null || _83 === void 0 ? void 0 : _83.key)) }));
750
676
  }), headerColumns
751
677
  .filter((column) => !groupByKeys.includes(column.key))
752
678
  .map((column, colIndex) => {
753
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
679
+ 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;
754
680
  if (!column.hidden) {
755
681
  const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
756
682
  const colSearchOptions = searchOptions.filter((item) => (column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency"
@@ -758,13 +684,6 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
758
684
  : (column === null || column === void 0 ? void 0 : column.dataType) === "date"
759
685
  ? dateTypeSearch.includes(item.value)
760
686
  : textTypeSearch.includes(item.value));
761
- console.log(colSearchOptions.find((item) => {
762
- var _a, _b;
763
- return item.value ===
764
- (((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
765
- defaultSearchOperation ||
766
- "contains");
767
- }));
768
687
  return (_jsx("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { 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, position: "sticky", top: 0, zIndex: 1 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: !actionsKey.split(",").includes(column.key) && (_jsxs(_Fragment, { children: [resizable && (_jsx("div", { style: {
769
688
  position: "absolute",
770
689
  width: "1px",
@@ -811,185 +730,179 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
811
730
  ? "#2377ba"
812
731
  : "var(--row-header-text)",
813
732
  } }), dropdownVisible === column.key &&
814
- (column.uniqueDrop ? (_jsx(GridFilterDropdown, { portalTarget: portalTarget, headerDropdownIndex: headerDropdownIndex, position: searchOpsPosition || { top: 0, left: 0 }, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label === "Group by"
733
+ (column.uniqueDrop ? (_jsx(GridFilterDropdown, { portalTarget: portalTarget, locale: locale, formatOptions: formatOptions, columnType: (_b = column.dataType) !== null && _b !== void 0 ? _b : "string", columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
734
+ column.dataType === "currency"
735
+ ? numberTypeSearch.includes(item.value)
736
+ : column.dataType === "date"
737
+ ? dateTypeSearch.includes(item.value)
738
+ : 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"
815
739
  ? !column.isArrayString
816
- : true), onClose: () => setDropdownVisible(null), column: column }), searchOps: search && !columnSearchOutside ? (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
817
- marginTop: "0.5rem",
818
- pointerEvents: search && column.search
819
- ? "auto"
820
- : "none",
821
- cursor: search && column.search
822
- ? "default"
823
- : "not-allowed",
824
- }, children: _jsxs("div", { style: {
825
- display: "flex",
826
- alignItems: "center",
827
- }, children: [_jsx(TextInput, { onFocus: () => setActiveSearchColumn(column.key), onChange: (e) => {
828
- var _a;
829
- let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
830
- defaultSearchOperation ||
831
- "contains";
832
- if (e.target.value.includes("to")) {
833
- searchType = "between";
834
- }
835
- else if (searchType === "between") {
836
- searchType = "contains";
837
- }
838
- onSearch(column.key, e.target.value, searchType);
839
- }, placeholder: "Search", extraWrapperStyle: {
840
- background: column.search
841
- ? "var(--background)"
842
- : "var(--disabled-bg)",
843
- }, value: ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.text) || "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => column.dataType ===
844
- "number" ||
845
- column.dataType === "currency"
846
- ? numberTypeSearch.includes(item.value)
847
- : column.dataType === "date"
848
- ? dateTypeSearch.includes(item.value)
849
- : textTypeSearch.includes(item.value)), selectedValues: [
850
- ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) ||
851
- defaultSearchOperation ||
852
- "contains",
853
- ], onChange: (selected) => {
854
- var _a;
855
- const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
856
- handleSearchOptionSelect(column.key, value);
857
- }, selectedDisplay: (_e = (_d = colSearchOptions.find((item) => {
858
- var _a, _b;
859
- return item.value ===
860
- (((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
861
- defaultSearchOperation ||
862
- "contains");
863
- })) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : "", withValue: true, searchEnabled: false, className: "flex-1", dropdownListWidth: "max-content", isIcon: true })] }) }), columnData.length > 0 &&
864
- activeSearchColumn ===
865
- ((column === null || column === void 0 ? void 0 : column.key) || "") && (_jsxs("div", { ref: activeSearchListRef, style: {
866
- position: "absolute",
867
- top: "calc(100% + 0.25rem)",
868
- left: 0,
869
- background: "var(--card-bg)",
870
- width: "max-content",
871
- maxWidth: "24rem",
872
- maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
873
- overflow: "auto",
874
- padding: "0.5rem 0.75rem",
875
- borderRadius: "0.5rem",
876
- boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
877
- border: "1px solid var(--divider, #f5f5f5)",
878
- }, children: [_jsxs("div", { style: {
879
- cursor: "pointer",
880
- display: "flex",
881
- alignItems: "center",
882
- }, onClick: () => handleSelect("all", (column === null || column === void 0 ? void 0 : column.key) || "", columnData), children: [_jsx(Checkbox, { id: CSS.escape((column === null || column === void 0 ? void 0 : column.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) !== "undefined"
883
- ? ((_f = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _f === void 0 ? void 0 : _f.length) > 0 &&
884
- columnData.every((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item))
885
- : true, indeterminate: ((_g = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _g === void 0 ? void 0 : _g.length) > 0 &&
886
- columnData.some((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item)), onChange: () => { }, style: {
887
- pointerEvents: "none",
888
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
889
- marginLeft: "0.5rem",
890
- }, children: "All" })] }), columnData.map((item) => {
740
+ : 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) ===
741
+ "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) => {
891
742
  var _a, _b;
892
- return (_jsxs("div", { style: {
893
- cursor: "pointer",
894
- display: "flex",
895
- alignItems: "center",
896
- }, onClick: () => handleSelect(item.toString(), (column === null || column === void 0 ? void 0 : column.key) || "", columnData), children: [_jsx(Checkbox, { id: CSS.escape(`${(column === null || column === void 0 ? void 0 : column.key) || ""}-${item}`), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) !== "undefined"
897
- ? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].length) > 0 &&
898
- ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _a === void 0 ? void 0 : _a.includes(item))
899
- : true, onChange: () => { }, style: {
900
- pointerEvents: "none",
901
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
902
- marginLeft: "0.5rem",
903
- }, children: formatValue(item, (_b = column === null || column === void 0 ? void 0 : column.dataType) !== null && _b !== void 0 ? _b : "", locale, formatOptions) })] }, item));
904
- })] }))] })) : null, columnIndex: colIndex })) : (_jsx(TextFilterDropdown, { columnIndex: colIndex, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), searchOps: search && !columnSearchOutside ? (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
905
- marginTop: "0.5rem",
906
- pointerEvents: search && column.search
907
- ? "auto"
908
- : "none",
909
- cursor: search && column.search
910
- ? "default"
911
- : "not-allowed",
912
- }, children: _jsxs("div", { style: {
913
- display: "flex",
914
- alignItems: "center",
915
- }, children: [_jsx(TextInput, { onFocus: () => setActiveSearchColumn(column.key), onChange: (e) => {
916
- var _a;
917
- let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
918
- defaultSearchOperation ||
919
- "contains";
920
- if (e.target.value.includes("to")) {
921
- searchType = "between";
922
- }
923
- else if (searchType === "between") {
924
- searchType = "contains";
925
- }
926
- onSearch(column.key, e.target.value, searchType);
927
- }, placeholder: "Search", extraWrapperStyle: {
928
- background: column.search
929
- ? "var(--background)"
930
- : "var(--disabled-bg)",
931
- }, value: ((_h = searchQueries[column.key]) === null || _h === void 0 ? void 0 : _h.text) || "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => column.dataType ===
932
- "number" ||
933
- column.dataType === "currency"
934
- ? numberTypeSearch.includes(item.value)
935
- : column.dataType === "date"
936
- ? dateTypeSearch.includes(item.value)
937
- : textTypeSearch.includes(item.value)), selectedValues: [
938
- ((_j = searchQueries[column.key]) === null || _j === void 0 ? void 0 : _j.type) ||
939
- defaultSearchOperation ||
940
- "contains",
941
- ], onChange: (selected) => {
942
- var _a;
943
- const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
944
- handleSearchOptionSelect(column.key, value);
945
- }, selectedDisplay: (_l = (_k = colSearchOptions.find((item) => {
946
- var _a, _b;
947
- return item.value ===
948
- (((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
949
- defaultSearchOperation ||
950
- "contains");
951
- })) === null || _k === void 0 ? void 0 : _k.label) !== null && _l !== void 0 ? _l : "", withValue: true, searchEnabled: false, className: "flex-1", dropdownListWidth: "max-content", isIcon: true })] }) }), columnData.length > 0 &&
952
- activeSearchColumn ===
953
- ((column === null || column === void 0 ? void 0 : column.key) || "") && (_jsxs("div", { ref: activeSearchListRef, style: {
954
- position: "absolute",
955
- top: "calc(100% + 0.25rem)",
956
- left: 0,
957
- background: "var(--card-bg)",
958
- width: "max-content",
959
- maxWidth: "24rem",
960
- maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
961
- overflow: "auto",
962
- padding: "0.5rem 0.75rem",
963
- borderRadius: "0.5rem",
964
- boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
965
- border: "1px solid var(--divider, #f5f5f5)",
966
- }, children: [_jsxs("div", { style: {
967
- cursor: "pointer",
968
- display: "flex",
969
- alignItems: "center",
970
- }, onClick: () => handleSelect("all", (column === null || column === void 0 ? void 0 : column.key) || "", columnData), children: [_jsx(Checkbox, { id: CSS.escape((column === null || column === void 0 ? void 0 : column.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) !== "undefined"
971
- ? ((_m = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _m === void 0 ? void 0 : _m.length) > 0 &&
972
- columnData.every((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item))
973
- : true, indeterminate: ((_o = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _o === void 0 ? void 0 : _o.length) > 0 &&
974
- columnData.some((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item)), onChange: () => { }, style: {
975
- pointerEvents: "none",
976
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
977
- marginLeft: "0.5rem",
978
- }, children: "All" })] }), columnData.map((item) => {
743
+ return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
744
+ if (index === 0) {
745
+ return value;
746
+ }
747
+ return item;
748
+ }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
749
+ defaultSearchOperation ||
750
+ "contains");
751
+ } }), _jsx(DateInput, { value: (_e = searchQueries[column.key]) === null || _e === void 0 ? void 0 : _e.text.split("to")[1], placeholder: `To date`, onChange: (value) => {
752
+ var _a, _b;
753
+ return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
754
+ if (index === 1) {
755
+ return value;
756
+ }
757
+ return item;
758
+ }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
759
+ defaultSearchOperation ||
760
+ "contains");
761
+ } })] })) : (_jsx(DateInput, { value: (_f = searchQueries[column.key]) === null || _f === void 0 ? void 0 : _f.text.split("to")[0], placeholder: `asd Filter ${column.label}`, onChange: (value) => {
762
+ var _a;
763
+ return onSearch(column.key, value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
764
+ defaultSearchOperation ||
765
+ "contains");
766
+ } }))) : (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
767
+ if (e.key === "Enter") {
768
+ toggleDropdown(column.key);
769
+ }
770
+ }, onChange: (e) => {
771
+ var _a;
772
+ return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
773
+ defaultSearchOperation ||
774
+ "contains");
775
+ }, value: ((_g = searchQueries[column.key]) === null || _g === void 0 ? void 0 : _g.text) ||
776
+ "", extraWrapperStyle: {
777
+ visibility: column.search
778
+ ? "visible"
779
+ : "hidden",
780
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_h = searchQueries[column.key]) === null || _h === void 0 ? void 0 : _h.type) ||
781
+ defaultSearchOperation ||
782
+ "contains", checkboxWrapper: checkboxWrapper, searchInput: search &&
783
+ column.search && (_jsx("div", { style: {
784
+ marginTop: "0.5rem",
785
+ padding: "0.5rem",
786
+ width: "100%",
787
+ pointerEvents: search && column.search
788
+ ? "auto"
789
+ : "none",
790
+ cursor: search && column.search
791
+ ? "default"
792
+ : "not-allowed",
793
+ }, children: _jsx(TextInput, { onChange: (e) => {
794
+ var _a;
795
+ let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
796
+ defaultSearchOperation ||
797
+ "contains";
798
+ if (e.target.value.includes("to")) {
799
+ searchType = "between";
800
+ }
801
+ else if (searchType === "between") {
802
+ searchType = "contains";
803
+ }
804
+ onSearch(column.key, e.target.value, searchType);
805
+ }, extraWrapperStyle: {
806
+ background: column.search
807
+ ? "var(--background)"
808
+ : "var(--disabled-bg)",
809
+ }, placeholder: "Search", value: ((_j = searchQueries[column.key]) === null || _j === void 0 ? void 0 : _j.text) ||
810
+ "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) })) })) : (_jsx(TextFilterDropdown, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
811
+ column.dataType === "currency"
812
+ ? numberTypeSearch.includes(item.value)
813
+ : column.dataType === "date"
814
+ ? dateTypeSearch.includes(item.value)
815
+ : textTypeSearch.includes(item.value)), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: column.key, searchElement: _jsx("div", { id: "search-input", children: column.dataType === "date" ? (((_k = searchQueries[column.key]) === null || _k === void 0 ? void 0 : _k.type) ===
816
+ "between" ? (_jsxs(_Fragment, { children: [_jsx(DateInput, { value: (_l = searchQueries[column.key]) === null || _l === void 0 ? void 0 : _l.text.split("to")[0], placeholder: `From date`, onChange: (value) => {
979
817
  var _a, _b;
980
- return (_jsxs("div", { style: {
981
- cursor: "pointer",
982
- display: "flex",
983
- alignItems: "center",
984
- }, onClick: () => handleSelect(item.toString(), (column === null || column === void 0 ? void 0 : column.key) || "", columnData), children: [_jsx(Checkbox, { id: CSS.escape(`${(column === null || column === void 0 ? void 0 : column.key) || ""}-${item}`), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) !== "undefined"
985
- ? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].length) > 0 &&
986
- ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _a === void 0 ? void 0 : _a.includes(item))
987
- : true, onChange: () => { }, style: {
988
- pointerEvents: "none",
989
- }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: {
990
- marginLeft: "0.5rem",
991
- }, children: formatValue(item, (_b = column === null || column === void 0 ? void 0 : column.dataType) !== null && _b !== void 0 ? _b : "", locale, formatOptions) })] }, item));
992
- })] }))] })) : null, headerDropdownIndex: headerDropdownIndex })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
818
+ return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
819
+ if (index === 0) {
820
+ return value;
821
+ }
822
+ return item;
823
+ }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
824
+ defaultSearchOperation ||
825
+ "contains");
826
+ } }), _jsx("div", { style: { marginTop: "0.5rem" }, children: _jsx(DateInput, { value: (_m = searchQueries[column.key]) === null || _m === void 0 ? void 0 : _m.text.split("to")[1], placeholder: `To date`, onChange: (value) => {
827
+ var _a, _b;
828
+ return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
829
+ if (index === 1) {
830
+ return value;
831
+ }
832
+ return item;
833
+ }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
834
+ defaultSearchOperation ||
835
+ "contains");
836
+ } }) })] })) : [
837
+ "contains",
838
+ "doesNotContain",
839
+ "blank",
840
+ "notBlank",
841
+ ].includes(((_o = searchQueries[column.key]) === null || _o === void 0 ? void 0 : _o.type) ||
842
+ defaultSearchOperation ||
843
+ "contains") ? (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
844
+ if (e.key === "Enter") {
845
+ toggleDropdown(column.key);
846
+ }
847
+ }, onChange: (e) => {
848
+ var _a;
849
+ return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
850
+ defaultSearchOperation ||
851
+ "contains");
852
+ }, value: ((_p = searchQueries[column.key]) === null || _p === void 0 ? void 0 : _p.text) ||
853
+ "", extraWrapperStyle: {
854
+ visibility: column.search
855
+ ? "visible"
856
+ : "hidden",
857
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) : (_jsx(DateInput, { value: (_q = searchQueries[column.key]) === null || _q === void 0 ? void 0 : _q.text.split("to")[0], placeholder: `asd Filter ${column.label}`, onChange: (value) => {
858
+ var _a;
859
+ return onSearch(column.key, value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
860
+ defaultSearchOperation ||
861
+ "contains");
862
+ } }))) : (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
863
+ if (e.key === "Enter") {
864
+ toggleDropdown(column.key);
865
+ }
866
+ }, onChange: (e) => {
867
+ var _a;
868
+ return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
869
+ defaultSearchOperation ||
870
+ "contains");
871
+ }, value: ((_r = searchQueries[column.key]) === null || _r === void 0 ? void 0 : _r.text) ||
872
+ "", extraWrapperStyle: {
873
+ visibility: column.search
874
+ ? "visible"
875
+ : "hidden",
876
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((_s = searchQueries[column.key]) === null || _s === void 0 ? void 0 : _s.type) ||
877
+ defaultSearchOperation ||
878
+ "contains", searchInput: (search && column.search && (_jsx("div", { style: {
879
+ padding: "0.5rem",
880
+ width: "100%",
881
+ pointerEvents: search && column.search
882
+ ? "auto"
883
+ : "none",
884
+ cursor: search && column.search
885
+ ? "default"
886
+ : "not-allowed",
887
+ }, children: _jsx(TextInput, { onChange: (e) => {
888
+ var _a;
889
+ let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
890
+ defaultSearchOperation ||
891
+ "contains";
892
+ if (e.target.value.includes("to")) {
893
+ searchType = "between";
894
+ }
895
+ else if (searchType === "between") {
896
+ searchType = "contains";
897
+ }
898
+ onSearch(column.key, e.target.value, searchType);
899
+ }, placeholder: "Search", extraWrapperStyle: {
900
+ background: column.search
901
+ ? "var(--background)"
902
+ : "var(--disabled-bg)",
903
+ }, value: ((_t = searchQueries[column.key]) === null || _t === void 0 ? void 0 : _t.text) ||
904
+ "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))) ||
905
+ null })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
993
906
  marginTop: "0.5rem",
994
907
  pointerEvents: search && column.search ? "auto" : "none",
995
908
  cursor: search && column.search
@@ -1014,26 +927,26 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
1014
927
  background: column.search
1015
928
  ? "var(--background)"
1016
929
  : "var(--disabled-bg)",
1017
- }, value: ((_p = searchQueries[column.key]) === null || _p === void 0 ? void 0 : _p.text) || "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => column.dataType === "number" ||
930
+ }, value: ((_u = searchQueries[column.key]) === null || _u === void 0 ? void 0 : _u.text) || "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => column.dataType === "number" ||
1018
931
  column.dataType === "currency"
1019
932
  ? numberTypeSearch.includes(item.value)
1020
933
  : column.dataType === "date"
1021
934
  ? dateTypeSearch.includes(item.value)
1022
935
  : textTypeSearch.includes(item.value)), selectedValues: [
1023
- ((_q = searchQueries[column.key]) === null || _q === void 0 ? void 0 : _q.type) ||
936
+ ((_v = searchQueries[column.key]) === null || _v === void 0 ? void 0 : _v.type) ||
1024
937
  defaultSearchOperation ||
1025
938
  "contains",
1026
939
  ], onChange: (selected) => {
1027
940
  var _a;
1028
941
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
1029
942
  handleSearchOptionSelect(column.key, value);
1030
- }, selectedDisplay: (_s = (_r = colSearchOptions.find((item) => {
943
+ }, selectedDisplay: (_x = (_w = colSearchOptions.find((item) => {
1031
944
  var _a, _b;
1032
945
  return item.value ===
1033
946
  (((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
1034
947
  defaultSearchOperation ||
1035
948
  "contains");
1036
- })) === null || _r === void 0 ? void 0 : _r.label) !== null && _s !== void 0 ? _s : "", withValue: true, searchEnabled: false, className: "flex-1", dropdownListWidth: "max-content", isIcon: true })] }) }), columnData.length > 0 &&
949
+ })) === null || _w === void 0 ? void 0 : _w.label) !== null && _x !== void 0 ? _x : "", withValue: true, searchEnabled: false, className: "flex-1", dropdownListWidth: "max-content", isIcon: true })] }) }), columnData.length > 0 &&
1037
950
  activeSearchColumn === ((column === null || column === void 0 ? void 0 : column.key) || "") && (_jsxs("div", { ref: activeSearchListRef, style: {
1038
951
  position: "absolute",
1039
952
  top: "calc(100% + 0.25rem)",
@@ -1053,9 +966,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
1053
966
  alignItems: "center",
1054
967
  }, onClick: () => handleSelect("all", (column === null || column === void 0 ? void 0 : column.key) || "", columnData), children: [_jsx(Checkbox, { id: CSS.escape((column === null || column === void 0 ? void 0 : column.key) || ""), selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) !==
1055
968
  "undefined"
1056
- ? ((_t = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _t === void 0 ? void 0 : _t.length) > 0 &&
969
+ ? ((_y = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _y === void 0 ? void 0 : _y.length) > 0 &&
1057
970
  columnData.every((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item))
1058
- : true, indeterminate: ((_u = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _u === void 0 ? void 0 : _u.length) >
971
+ : true, indeterminate: ((_z = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""]) === null || _z === void 0 ? void 0 : _z.length) >
1059
972
  0 &&
1060
973
  columnData.some((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item)), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), columnData.map((item) => {
1061
974
  var _a, _b;