@megha-ui/react 1.3.83 → 1.3.87

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,7 +4,6 @@ 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";
8
7
  import TextInput from "../../text-input";
9
8
  import Checkbox from "../../checkbox";
10
9
  import Dropdown from "../../dropdown";
@@ -314,12 +313,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
314
313
  const spaceBelow = Math.max(0, Math.floor(rawSpaceBelow));
315
314
  const spaceAbove = Math.max(0, Math.floor(rawSpaceAbove));
316
315
  const available = Math.max(spaceBelow, spaceAbove);
317
- // If there is no positive available space detected (e.g. due to
318
- // rounding or container calculations), fall back to the preferred
319
- // max height instead of collapsing the list to 0.
320
- const resolvedMax = available > 0
321
- ? Math.min(available, preferredMaxHeight)
322
- : preferredMaxHeight;
316
+ // Use all available space when positive; only fall back to a
317
+ // sensible default when the calculation yields no usable space.
318
+ const resolvedMax = available > 0 ? available : preferredMaxHeight;
323
319
  setActiveSearchMaxHeight(resolvedMax);
324
320
  };
325
321
  if (activeSearchColumn) {
@@ -337,7 +333,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
337
333
  width: "100%",
338
334
  height: "100%",
339
335
  }, children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) }) })), groupByKeys.map((_groupBy) => {
340
- 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;
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;
341
337
  return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
342
338
  ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.sortable)
343
339
  ? "sortable"
@@ -389,191 +385,266 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
389
385
  : "var(--row-header-text)",
390
386
  } }), dropdownVisible ===
391
387
  ((_m = headerColumns.find((column) => column.key === _groupBy)) === null || _m === void 0 ? void 0 : _m.key) &&
392
- (((_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 &&
393
- ((_s = headerColumns.find((column) => column.key === _groupBy)) === null || _s === void 0 ? void 0 : _s.search) && (_jsx("div", { style: {
394
- marginTop: "0.5rem",
395
- padding: "0.5rem",
396
- width: "100%",
397
- pointerEvents: search &&
398
- ((_t = headerColumns.find((column) => column.key === _groupBy)) === null || _t === void 0 ? void 0 : _t.search)
399
- ? "auto"
400
- : "none",
401
- cursor: search &&
402
- ((_u = headerColumns.find((column) => column.key === _groupBy)) === null || _u === void 0 ? void 0 : _u.search)
403
- ? "default"
404
- : "not-allowed",
405
- }, children: _jsx(TextInput, { onChange: (e) => {
406
- var _a, _b, _c;
407
- 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) ||
408
- defaultSearchOperation ||
409
- "contains";
410
- if (e.target.value.includes("to")) {
411
- searchType = "between";
412
- }
413
- else if (searchType === "between") {
414
- searchType = "contains";
415
- }
416
- onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
417
- }, placeholder: "Search", extraWrapperStyle: {
418
- background: ((_v = headerColumns.find((column) => column.key === _groupBy)) === null || _v === void 0 ? void 0 : _v.search)
419
- ? "var(--background)"
420
- : "var(--disabled-bg)",
421
- }, 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)" }) }))) ||
422
- 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) => {
423
- var _a, _b;
424
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
425
- ? numberTypeSearch.includes(item.value)
426
- : ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
427
- ? dateTypeSearch.includes(item.value)
428
- : textTypeSearch.includes(item.value);
429
- }), 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) => {
430
- var _a, _b, _c, _d, _e;
431
- 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) => {
432
- if (index === 0) {
433
- return value;
434
- }
435
- return item;
436
- }).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) ||
437
- defaultSearchOperation ||
438
- "contains");
439
- } }), _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) => {
440
- var _a, _b, _c, _d, _e;
441
- 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) => {
442
- if (index === 1) {
443
- return value;
444
- }
445
- return item;
446
- }).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) ||
447
- defaultSearchOperation ||
448
- "contains");
449
- } })] })) : (_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) => {
450
- var _a, _b, _c;
451
- 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) ||
452
- defaultSearchOperation ||
453
- "contains");
454
- } }))) : (_jsx(TextInput, { placeholder: `Filter ${(_13 = headerColumns.find((column) => column.key === _groupBy)) === null || _13 === void 0 ? void 0 : _13.label}`, onKeyDown: (e) => {
455
- var _a;
456
- if (e.key === "Enter") {
457
- toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
458
- }
459
- }, onChange: (e) => {
460
- var _a, _b, _c;
461
- 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) ||
462
- defaultSearchOperation ||
463
- "contains");
464
- }, 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: {
465
- visibility: ((_16 = headerColumns.find((column) => column.key === _groupBy)) === null || _16 === void 0 ? void 0 : _16.search)
466
- ? "visible"
467
- : "hidden",
468
- }, 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) ||
469
- defaultSearchOperation ||
470
- "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) => {
471
- var _a, _b;
472
- return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
473
- ? numberTypeSearch.includes(item.value)
474
- : ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "date"
475
- ? dateTypeSearch.includes(item.value)
476
- : textTypeSearch.includes(item.value);
477
- }), 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) => {
478
- var _a, _b, _c, _d, _e;
479
- 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) => {
480
- if (index === 0) {
481
- return value;
482
- }
483
- return item;
484
- }).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) ||
485
- defaultSearchOperation ||
486
- "contains");
487
- } }), _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) => {
488
- var _a, _b, _c, _d, _e;
489
- 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) => {
490
- if (index === 1) {
491
- return value;
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";
492
411
  }
493
- return item;
494
- }).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) ||
495
- defaultSearchOperation ||
496
- "contains");
497
- } }) })] })) : [
498
- "contains",
499
- "doesNotContain",
500
- "blank",
501
- "notBlank",
502
- ].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) ||
503
- defaultSearchOperation ||
504
- "contains") ? (_jsx(TextInput, { placeholder: `Filter ${(_30 = headerColumns.find((column) => column.key === _groupBy)) === null || _30 === void 0 ? void 0 : _30.label}`, onKeyDown: (e) => {
505
- var _a;
506
- if (e.key === "Enter") {
507
- toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
508
- }
509
- }, onChange: (e) => {
510
- var _a, _b, _c;
511
- 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) ||
512
- defaultSearchOperation ||
513
- "contains");
514
- }, 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: {
515
- visibility: ((_33 = headerColumns.find((column) => column.key === _groupBy)) === null || _33 === void 0 ? void 0 : _33.search)
516
- ? "visible"
517
- : "hidden",
518
- }, 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) => {
519
- var _a, _b, _c;
520
- 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) ||
521
- defaultSearchOperation ||
522
- "contains");
523
- } }))) : (_jsx(TextInput, { placeholder: `Filter ${(_37 = headerColumns.find((column) => column.key === _groupBy)) === null || _37 === void 0 ? void 0 : _37.label}`, onKeyDown: (e) => {
524
- var _a;
525
- if (e.key === "Enter") {
526
- toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
527
- }
528
- }, onChange: (e) => {
529
- var _a, _b, _c;
530
- 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) ||
531
- defaultSearchOperation ||
532
- "contains");
533
- }, 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: {
534
- visibility: ((_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.search)
535
- ? "visible"
536
- : "hidden",
537
- }, 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) ||
538
- defaultSearchOperation ||
539
- "contains", searchInput: (search &&
540
- ((_43 = headerColumns.find((column) => column.key === _groupBy)) === null || _43 === void 0 ? void 0 : _43.search) && (_jsx("div", { style: {
541
- marginTop: "0.5rem",
542
- padding: "0.5rem",
543
- width: "100%",
544
- pointerEvents: search &&
545
- ((_44 = headerColumns.find((column) => column.key === _groupBy)) === null || _44 === void 0 ? void 0 : _44.search)
546
- ? "auto"
547
- : "none",
548
- cursor: search &&
549
- ((_45 = headerColumns.find((column) => column.key === _groupBy)) === null || _45 === void 0 ? void 0 : _45.search)
550
- ? "default"
551
- : "not-allowed",
552
- }, children: _jsx(TextInput, { onChange: (e) => {
553
- var _a, _b, _c;
554
- 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) ||
555
- defaultSearchOperation ||
556
- "contains";
557
- if (e.target.value.includes("to")) {
558
- searchType = "between";
559
- }
560
- else if (searchType === "between") {
561
- searchType = "contains";
562
- }
563
- onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
564
- }, placeholder: "Search", extraWrapperStyle: {
565
- background: ((_46 = headerColumns.find((column) => column.key === _groupBy)) === null || _46 === void 0 ? void 0 : _46.search)
566
- ? "var(--background)"
567
- : "var(--disabled-bg)",
568
- }, 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" }) }))) ||
569
- null })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
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";
540
+ }
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: {
570
641
  marginTop: "0.5rem",
571
642
  pointerEvents: search &&
572
- ((_50 = headerColumns.find((column) => column.key === _groupBy)) === null || _50 === void 0 ? void 0 : _50.search)
643
+ ((_55 = headerColumns.find((column) => column.key === _groupBy)) === null || _55 === void 0 ? void 0 : _55.search)
573
644
  ? "auto"
574
645
  : "none",
575
646
  cursor: search &&
576
- ((_51 = headerColumns.find((column) => column.key === _groupBy)) === null || _51 === void 0 ? void 0 : _51.search)
647
+ ((_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.search)
577
648
  ? "default"
578
649
  : "not-allowed",
579
650
  }, children: _jsxs("div", { style: {
@@ -595,10 +666,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
595
666
  }
596
667
  onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
597
668
  }, placeholder: "Search", extraWrapperStyle: {
598
- background: ((_52 = headerColumns.find((column) => column.key === _groupBy)) === null || _52 === void 0 ? void 0 : _52.search)
669
+ background: ((_57 = headerColumns.find((column) => column.key === _groupBy)) === null || _57 === void 0 ? void 0 : _57.search)
599
670
  ? "var(--background)"
600
671
  : "var(--disabled-bg)",
601
- }, 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) => {
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) => {
602
673
  var _a, _b, _c;
603
674
  return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
604
675
  ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
@@ -607,10 +678,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
607
678
  ? dateTypeSearch.includes(item.value)
608
679
  : textTypeSearch.includes(item.value);
609
680
  }), selectedValues: [
610
- ((_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) ||
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) ||
611
682
  defaultSearchOperation ||
612
683
  "contains",
613
- ], selectedDisplay: (_60 = (_59 = searchOptions
684
+ ], selectedDisplay: (_65 = (_64 = searchOptions
614
685
  .filter((item) => {
615
686
  var _a, _b, _c;
616
687
  return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
@@ -626,13 +697,13 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
626
697
  (((_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) ||
627
698
  defaultSearchOperation ||
628
699
  "contains");
629
- })) === null || _59 === void 0 ? void 0 : _59.label) !== null && _60 !== void 0 ? _60 : "", withValue: true, onChange: (selected) => {
700
+ })) === null || _64 === void 0 ? void 0 : _64.label) !== null && _65 !== void 0 ? _65 : "", withValue: true, onChange: (selected) => {
630
701
  var _a, _b, _c;
631
702
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
632
703
  handleSearchOptionSelect((_c = (_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : "", value);
633
- }, 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 &&
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 &&
634
705
  activeSearchColumn ===
635
- (((_64 = headerColumns.find((column) => column.key === _groupBy)) === null || _64 === void 0 ? void 0 : _64.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
706
+ (((_69 = headerColumns.find((column) => column.key === _groupBy)) === null || _69 === void 0 ? void 0 : _69.key) || "") && (_jsx("div", { ref: activeSearchListRef, style: {
636
707
  position: "absolute",
637
708
  top: "calc(100% + 0.25rem)",
638
709
  left: 0,
@@ -645,24 +716,24 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
645
716
  borderRadius: "0.5rem",
646
717
  boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
647
718
  border: "1px solid var(--divider, #f5f5f5)",
648
- }, 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: {
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: {
649
720
  cursor: "pointer",
650
721
  display: "flex",
651
722
  alignItems: "center",
652
723
  }, onClick: () => {
653
724
  var _a, _b, _c, _d;
654
725
  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 : []));
655
- }, 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"
656
- ? ((_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 &&
657
- 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) => {
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) => {
658
729
  var _a;
659
730
  return uniqueSearch[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
660
731
  })
661
- : 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 &&
662
- 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) => {
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) => {
663
734
  var _a;
664
735
  return uniqueSearch[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""].includes(item);
665
- }), 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) => {
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) => {
666
737
  var _a, _b, _c, _d, _e, _f, _g;
667
738
  return (_jsxs("div", { style: {
668
739
  cursor: "pointer",
@@ -675,11 +746,11 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
675
746
  ? (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 &&
676
747
  ((_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))
677
748
  : 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));
678
- })] })) }))] }))] }, (_83 = headerColumns.find((column) => column.key === _groupBy)) === null || _83 === void 0 ? void 0 : _83.key)) }));
749
+ })] })) }))] }))] }, (_88 = headerColumns.find((column) => column.key === _groupBy)) === null || _88 === void 0 ? void 0 : _88.key)) }));
679
750
  }), headerColumns
680
751
  .filter((column) => !groupByKeys.includes(column.key))
681
752
  .map((column, colIndex) => {
682
- 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;
753
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
683
754
  if (!column.hidden) {
684
755
  const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
685
756
  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"
@@ -740,179 +811,185 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
740
811
  ? "#2377ba"
741
812
  : "var(--row-header-text)",
742
813
  } }), dropdownVisible === column.key &&
743
- (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" ||
744
- column.dataType === "currency"
745
- ? numberTypeSearch.includes(item.value)
746
- : column.dataType === "date"
747
- ? dateTypeSearch.includes(item.value)
748
- : 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"
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"
749
815
  ? !column.isArrayString
750
- : 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) ===
751
- "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) => {
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 === 0) {
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: (_e = searchQueries[column.key]) === null || _e === void 0 ? void 0 : _e.text.split("to")[1], placeholder: `To date`, onChange: (value) => {
762
- var _a, _b;
763
- return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
764
- if (index === 1) {
765
- return value;
766
- }
767
- return item;
768
- }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
769
- defaultSearchOperation ||
770
- "contains");
771
- } })] })) : (_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) => {
772
- var _a;
773
- return onSearch(column.key, value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
774
- defaultSearchOperation ||
775
- "contains");
776
- } }))) : (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
777
- if (e.key === "Enter") {
778
- toggleDropdown(column.key);
779
- }
780
- }, onChange: (e) => {
781
- var _a;
782
- return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
783
- defaultSearchOperation ||
784
- "contains");
785
- }, value: ((_g = searchQueries[column.key]) === null || _g === void 0 ? void 0 : _g.text) ||
786
- "", extraWrapperStyle: {
787
- visibility: column.search
788
- ? "visible"
789
- : "hidden",
790
- }, 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) ||
791
- defaultSearchOperation ||
792
- "contains", checkboxWrapper: checkboxWrapper, searchInput: search &&
793
- column.search && (_jsx("div", { style: {
794
- marginTop: "0.5rem",
795
- padding: "0.5rem",
796
- width: "100%",
797
- pointerEvents: search && column.search
798
- ? "auto"
799
- : "none",
800
- cursor: search && column.search
801
- ? "default"
802
- : "not-allowed",
803
- }, children: _jsx(TextInput, { onChange: (e) => {
804
- var _a;
805
- let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
806
- defaultSearchOperation ||
807
- "contains";
808
- if (e.target.value.includes("to")) {
809
- searchType = "between";
810
- }
811
- else if (searchType === "between") {
812
- searchType = "contains";
813
- }
814
- onSearch(column.key, e.target.value, searchType);
815
- }, extraWrapperStyle: {
816
- background: column.search
817
- ? "var(--background)"
818
- : "var(--disabled-bg)",
819
- }, placeholder: "Search", value: ((_j = searchQueries[column.key]) === null || _j === void 0 ? void 0 : _j.text) ||
820
- "", 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" ||
821
- column.dataType === "currency"
822
- ? numberTypeSearch.includes(item.value)
823
- : column.dataType === "date"
824
- ? dateTypeSearch.includes(item.value)
825
- : 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) ===
826
- "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) => {
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) => {
827
891
  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 === 0) {
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
- } }), _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) => {
837
- var _a, _b;
838
- return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
839
- if (index === 1) {
840
- return value;
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";
841
922
  }
842
- return item;
843
- }).join("to"), ((_b = searchQueries[column.key]) === null || _b === void 0 ? void 0 : _b.type) ||
844
- defaultSearchOperation ||
845
- "contains");
846
- } }) })] })) : [
847
- "contains",
848
- "doesNotContain",
849
- "blank",
850
- "notBlank",
851
- ].includes(((_o = searchQueries[column.key]) === null || _o === void 0 ? void 0 : _o.type) ||
852
- defaultSearchOperation ||
853
- "contains") ? (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
854
- if (e.key === "Enter") {
855
- toggleDropdown(column.key);
856
- }
857
- }, onChange: (e) => {
858
- var _a;
859
- return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
860
- defaultSearchOperation ||
861
- "contains");
862
- }, value: ((_p = searchQueries[column.key]) === null || _p === void 0 ? void 0 : _p.text) ||
863
- "", extraWrapperStyle: {
864
- visibility: column.search
865
- ? "visible"
866
- : "hidden",
867
- }, 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) => {
868
- var _a;
869
- return onSearch(column.key, value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
870
- defaultSearchOperation ||
871
- "contains");
872
- } }))) : (_jsx(TextInput, { placeholder: `Filter ${column.label}`, onKeyDown: (e) => {
873
- if (e.key === "Enter") {
874
- toggleDropdown(column.key);
875
- }
876
- }, onChange: (e) => {
877
- var _a;
878
- return onSearch(column.key, e.target.value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
879
- defaultSearchOperation ||
880
- "contains");
881
- }, value: ((_r = searchQueries[column.key]) === null || _r === void 0 ? void 0 : _r.text) ||
882
- "", extraWrapperStyle: {
883
- visibility: column.search
884
- ? "visible"
885
- : "hidden",
886
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((_s = searchQueries[column.key]) === null || _s === void 0 ? void 0 : _s.type) ||
887
- defaultSearchOperation ||
888
- "contains", searchInput: (search && column.search && (_jsx("div", { style: {
889
- padding: "0.5rem",
890
- width: "100%",
891
- pointerEvents: search && column.search
892
- ? "auto"
893
- : "none",
894
- cursor: search && column.search
895
- ? "default"
896
- : "not-allowed",
897
- }, children: _jsx(TextInput, { onChange: (e) => {
898
- var _a;
899
- let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
900
- defaultSearchOperation ||
901
- "contains";
902
- if (e.target.value.includes("to")) {
903
- searchType = "between";
904
- }
905
- else if (searchType === "between") {
906
- searchType = "contains";
907
- }
908
- onSearch(column.key, e.target.value, searchType);
909
- }, placeholder: "Search", extraWrapperStyle: {
910
- background: column.search
911
- ? "var(--background)"
912
- : "var(--disabled-bg)",
913
- }, value: ((_t = searchQueries[column.key]) === null || _t === void 0 ? void 0 : _t.text) ||
914
- "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))) ||
915
- null })))] })) })] }), search && columnSearchOutside && (_jsxs("div", { style: { position: "relative" }, className: "column-search-outside-wrapper", children: [_jsx("div", { style: {
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) => {
979
+ 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: {
916
993
  marginTop: "0.5rem",
917
994
  pointerEvents: search && column.search ? "auto" : "none",
918
995
  cursor: search && column.search
@@ -937,26 +1014,26 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
937
1014
  background: column.search
938
1015
  ? "var(--background)"
939
1016
  : "var(--disabled-bg)",
940
- }, 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" ||
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" ||
941
1018
  column.dataType === "currency"
942
1019
  ? numberTypeSearch.includes(item.value)
943
1020
  : column.dataType === "date"
944
1021
  ? dateTypeSearch.includes(item.value)
945
1022
  : textTypeSearch.includes(item.value)), selectedValues: [
946
- ((_v = searchQueries[column.key]) === null || _v === void 0 ? void 0 : _v.type) ||
1023
+ ((_q = searchQueries[column.key]) === null || _q === void 0 ? void 0 : _q.type) ||
947
1024
  defaultSearchOperation ||
948
1025
  "contains",
949
1026
  ], onChange: (selected) => {
950
1027
  var _a;
951
1028
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
952
1029
  handleSearchOptionSelect(column.key, value);
953
- }, selectedDisplay: (_x = (_w = colSearchOptions.find((item) => {
1030
+ }, selectedDisplay: (_s = (_r = colSearchOptions.find((item) => {
954
1031
  var _a, _b;
955
1032
  return item.value ===
956
1033
  (((_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) ||
957
1034
  defaultSearchOperation ||
958
1035
  "contains");
959
- })) === 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 &&
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 &&
960
1037
  activeSearchColumn === ((column === null || column === void 0 ? void 0 : column.key) || "") && (_jsxs("div", { ref: activeSearchListRef, style: {
961
1038
  position: "absolute",
962
1039
  top: "calc(100% + 0.25rem)",
@@ -976,9 +1053,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
976
1053
  alignItems: "center",
977
1054
  }, 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) || ""]) !==
978
1055
  "undefined"
979
- ? ((_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 &&
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 &&
980
1057
  columnData.every((item) => uniqueSearch[(column === null || column === void 0 ? void 0 : column.key) || ""].includes(item))
981
- : 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) >
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) >
982
1059
  0 &&
983
1060
  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) => {
984
1061
  var _a, _b;