impact-nova 0.1.12 → 0.1.13

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.
@@ -1,16 +1,16 @@
1
- import { jsxs as y, jsx as i } from "react/jsx-runtime";
2
- import { useRef as Ce, useState as I, useEffect as Te, useCallback as be } from "react";
3
- import { Filter as De } from "lucide-react";
4
- import { cn as Ne } from "../../../../lib/utils.js";
5
- import { DatePicker as oe } from "../../date-picker/date-picker.js";
6
- import { Input as ie } from "../../input.js";
7
- import se from "../../select/select.js";
8
- import { Popover as Ae, PopoverTrigger as Se, PopoverContent as we, PopoverHeader as Ie, PopoverTitle as Pe, PopoverBody as qe } from "../../popover.js";
9
- import { Cross as ae } from "../../../../icons/index.js";
10
- import { useGridHeader as ze } from "./context/grid-header-context.js";
11
- import { getMultiFilterIndices as C, getDisplayStringFromFilterModel as P, parseInputPattern as Be } from "./utils/filter-utils.js";
12
- import { deserializeDate as M, serializeDate as ce } from "./utils/date-utils.js";
13
- const Ee = {
1
+ import { jsxs as F, jsx as s } from "react/jsx-runtime";
2
+ import { useRef as ce, useState as z, useEffect as de, useCallback as Pe } from "react";
3
+ import { Filter as we } from "lucide-react";
4
+ import { cn as ze } from "../../../../lib/utils.js";
5
+ import { DatePicker as ue } from "../../date-picker/date-picker.js";
6
+ import { Input as fe } from "../../input.js";
7
+ import he from "../../select/select.js";
8
+ import { Popover as qe, PopoverTrigger as Ee, PopoverContent as Be, PopoverHeader as He, PopoverTitle as Re, PopoverBody as ke } from "../../popover.js";
9
+ import { Cross as me } from "../../../../icons/index.js";
10
+ import { useGridHeader as Oe } from "./context/grid-header-context.js";
11
+ import { getMultiFilterIndices as b, getDisplayStringFromFilterModel as q, parseInputPattern as We } from "./utils/filter-utils.js";
12
+ import { deserializeDate as v, serializeDate as pe } from "./utils/date-utils.js";
13
+ const je = {
14
14
  contains: "contains",
15
15
  notContains: "notContains",
16
16
  equals: "equals",
@@ -24,172 +24,180 @@ const Ee = {
24
24
  inRange: "inRange",
25
25
  empty: "blank",
26
26
  notEmpty: "notBlank"
27
- }, Ue = ({
28
- column: D,
29
- api: d,
30
- onClose: W,
31
- handleInlineSearch: j,
32
- handleClearSearchInline: G,
33
- onAdvanceSearchClick: L,
34
- toggleAdvanceSearch: _,
35
- advanceSearchEnabled: de = !1,
36
- selectOptions: q,
37
- isMultiSelect: v,
38
- onSelectScrollToBottom: fe,
39
- onSelectSearchChange: ue,
40
- onSelectOpen: V,
41
- isLoadingSelect: J
27
+ }, tt = ({
28
+ column: A,
29
+ api: c,
30
+ onClose: G,
31
+ handleInlineSearch: L,
32
+ handleClearSearchInline: _,
33
+ onAdvanceSearchClick: V,
34
+ toggleAdvanceSearch: J,
35
+ advanceSearchEnabled: ge = !1,
36
+ selectOptions: E,
37
+ isMultiSelect: C,
38
+ onSelectScrollToBottom: xe,
39
+ onSelectSearchChange: ye,
40
+ onSelectOpen: K,
41
+ isLoadingSelect: Q,
42
+ enableSpaceSplitting: Fe = !1,
43
+ enableBooleanParsing: Me = !1,
44
+ enableDateParsing: ve = !1
42
45
  }) => {
43
- const c = D.getColDef(), o = D.getColId(), z = c?.filter || "agTextColumnFilter", p = z === "agDateColumnFilter", B = z === "agSetColumnFilter" || q && q.length > 0 || c?.cellDataType === "boolean", K = ze(), E = Ce(null), [H, k] = I(() => {
44
- const t = d.getFilterModel()[o];
46
+ const a = A.getColDef(), o = A.getColId(), B = a?.filter || "agTextColumnFilter", g = B === "agDateColumnFilter", H = B === "agSetColumnFilter" || E && E.length > 0 || a?.cellDataType === "boolean", U = Oe(), R = ce(null), X = ce(!1), [k, O] = z(() => {
47
+ const t = c.getFilterModel()[o];
45
48
  if (!t) return "";
46
49
  if (t.filterType === "multi" && t.filterModels) {
47
- const l = C(c), r = l.text !== -1 ? l.text : l.number;
50
+ const l = b(a), r = l.text !== -1 ? l.text : l.number;
48
51
  if (r !== -1) {
49
- const m = t.filterModels[r];
50
- if (m) return P(o, m);
52
+ const h = t.filterModels[r];
53
+ if (h) return q(o, h);
51
54
  }
52
55
  return "";
53
56
  }
54
- return p ? "" : P(o, t);
55
- }), [he, u] = I(!1), [Q, R] = I(() => {
56
- const t = d.getFilterModel()[o];
57
+ return g ? "" : q(o, t);
58
+ }), [Y, f] = z(!1);
59
+ de(() => {
60
+ X.current = Y;
61
+ }, [Y]);
62
+ const [Z, W] = z(() => {
63
+ const t = c.getFilterModel()[o];
57
64
  if (t) {
58
65
  if (t.filterType === "multi" && t.filterModels) {
59
- const { date: l } = C(c);
66
+ const { date: l } = b(a);
60
67
  if (l !== -1) {
61
68
  const r = t.filterModels[l];
62
69
  if (r) {
63
- if (r.dateFrom) return M(r.dateFrom);
64
- if (r.filter) return M(r.filter);
70
+ if (r.dateFrom) return v(r.dateFrom);
71
+ if (r.filter) return v(r.filter);
65
72
  }
66
73
  }
67
74
  }
68
- if (p) {
69
- if (t.dateFrom) return M(t.dateFrom);
70
- if (t.filter) return M(t.filter);
75
+ if (g) {
76
+ if (t.dateFrom) return v(t.dateFrom);
77
+ if (t.filter) return v(t.filter);
71
78
  }
72
79
  }
73
80
  return null;
74
81
  });
75
- Te(() => {
82
+ de(() => {
76
83
  const e = () => {
77
- const l = d.getFilterModel()[o];
84
+ const l = c.getFilterModel()[o];
78
85
  let r = "";
79
86
  if (l)
80
87
  if (l.filterType === "multi" && l.filterModels) {
81
- const n = C(c), a = n.text !== -1 ? n.text : n.number;
82
- if (a !== -1) {
83
- const f = l.filterModels[a];
84
- r = f ? P(o, f) : "";
88
+ const i = b(a), n = i.text !== -1 ? i.text : i.number;
89
+ if (n !== -1) {
90
+ const d = l.filterModels[n];
91
+ r = d ? q(o, d) : "";
85
92
  }
86
- } else p || (r = P(o, l));
87
- he || k((n) => n !== r ? r : n);
88
- let m = null;
93
+ } else g || (r = q(o, l));
94
+ X.current || O((i) => i !== r ? r : i);
95
+ let h = null;
89
96
  if (l)
90
97
  if (l.filterType === "multi" && l.filterModels) {
91
- const { date: n } = C(c);
92
- if (n !== -1) {
93
- const a = l.filterModels[n];
94
- a && (m = a.dateFrom ? M(a.dateFrom) : a.filter ? M(a.filter) : null);
98
+ const { date: i } = b(a);
99
+ if (i !== -1) {
100
+ const n = l.filterModels[i];
101
+ n && (h = n.dateFrom ? v(n.dateFrom) : n.filter ? v(n.filter) : null);
95
102
  }
96
- } else p && (m = l.dateFrom ? M(l.dateFrom) : l.filter ? M(l.filter) : null);
97
- R((n) => n?.getTime() !== m?.getTime() ? m : n);
103
+ } else g && (h = l.dateFrom ? v(l.dateFrom) : l.filter ? v(l.filter) : null);
104
+ W((i) => i?.getTime() !== h?.getTime() ? h : i);
98
105
  };
99
- return d.addEventListener("filterChanged", e), () => {
100
- d.removeEventListener("filterChanged", e);
106
+ return c.addEventListener("filterChanged", e), () => {
107
+ c.removeEventListener("filterChanged", e);
101
108
  };
102
- }, [d, o, p]);
103
- const U = (e, t) => {
104
- const r = { ...d.getFilterModel() }, m = (n, a) => {
105
- const f = Be(n);
109
+ }, [c, o, g]);
110
+ const $ = (e, t) => {
111
+ const r = { ...c.getFilterModel() }, h = (n) => n.replace(/[^0-9.\-+eE]/g, ""), i = (n, d) => {
112
+ const N = d === "number" ? h(n) : n, p = We(N, Fe, Me, ve);
106
113
  if (console.log("[HeaderSearchInput] Pattern Debug:", {
107
114
  input: n,
108
- filterType: a,
109
- parsed: f
110
- }), f.conditions.length === 0) return null;
111
- const b = (s) => {
112
- let F = Ee[s.operator] || "contains";
113
- if (a === "number") {
114
- const ne = parseFloat(s.value);
115
- return ["contains", "notContains", "startsWith", "endsWith"].includes(F) && (F = F === "notContains" ? "notEqual" : "equals"), s.operator === "inRange" ? {
116
- type: F,
117
- filter: parseFloat(s.value) || 0,
118
- filterTo: parseFloat(s.valueTo || "") || 0,
115
+ sanitizedInput: N,
116
+ filterType: d,
117
+ parsed: p
118
+ }), p.conditions.length === 0) return null;
119
+ const T = (m) => {
120
+ let M = je[m.operator] || "contains";
121
+ if (d === "number") {
122
+ const ae = parseFloat(h(m.value));
123
+ return ["contains", "notContains", "startsWith", "endsWith"].includes(M) && (M = M === "notContains" ? "notEqual" : "equals"), m.operator === "inRange" ? {
124
+ type: M,
125
+ filter: parseFloat(h(m.value)) || 0,
126
+ filterTo: parseFloat(h(m.valueTo || "")) || 0,
119
127
  filterType: "number"
120
- } : isNaN(ne) ? null : { type: F, filter: ne, filterType: "number" };
128
+ } : isNaN(ae) ? null : { type: M, filter: ae, filterType: "number" };
121
129
  }
122
130
  return {
123
- type: F,
124
- filter: s.value,
125
- filterTo: s.valueTo,
131
+ type: M,
132
+ filter: m.value,
133
+ filterTo: m.valueTo,
126
134
  filterType: "text"
127
135
  };
128
136
  };
129
- let h = null;
130
- if (f.conditions.length === 1)
131
- h = b(f.conditions[0]);
137
+ let u = null;
138
+ if (p.conditions.length === 1)
139
+ u = T(p.conditions[0]);
132
140
  else {
133
- const s = f.conditions.map(b).filter((F) => F !== null);
134
- s.length === 0 ? h = null : s.length === 1 ? h = s[0] : h = {
135
- filterType: a,
136
- operator: f.logic,
137
- conditions: s
141
+ const m = p.conditions.map(T).filter((M) => M !== null);
142
+ m.length === 0 ? u = null : m.length === 1 ? u = m[0] : u = {
143
+ filterType: d,
144
+ operator: p.logic,
145
+ conditions: m
138
146
  };
139
147
  }
140
- return console.log("[HeaderSearchInput] Resulting Model:", h), h;
148
+ return console.log("[HeaderSearchInput] Resulting Model:", u), u;
141
149
  };
142
- if (c.filter === "agMultiColumnFilter") {
143
- const n = C(c), a = t === "text" ? n.text !== -1 ? n.text : n.number : t === "set" ? n.set : n.date;
144
- if (a === -1) return;
145
- const f = d.getFilterModel()[o], b = f && f.filterType === "multi" ? [...f.filterModels || []] : Array(c.filterParams?.filters?.length || 1).fill(null);
146
- let h = null;
150
+ if (a.filter === "agMultiColumnFilter") {
151
+ const n = b(a), d = t === "text" ? n.text !== -1 ? n.text : n.number : t === "set" ? n.set : n.date;
152
+ if (d === -1) return;
153
+ const N = c.getFilterModel()[o], p = N && N.filterType === "multi" ? [...N.filterModels || []] : Array(a.filterParams?.filters?.length || 1).fill(null);
154
+ let T = null;
147
155
  if (e !== null && e !== "" && (!Array.isArray(e) || e.length > 0))
148
156
  if (t === "set")
149
- h = { values: Array.isArray(e) ? e : [String(e)], filterType: "set" };
157
+ T = { values: Array.isArray(e) ? e : [String(e)], filterType: "set" };
150
158
  else if (t === "date") {
151
- const s = e instanceof Date ? ce(e) : null;
152
- h = s ? { type: "equals", dateFrom: s, filterType: "date" } : null;
159
+ const u = e instanceof Date ? pe(e) : null;
160
+ T = u ? { type: "equals", dateFrom: u, filterType: "date" } : null;
153
161
  } else {
154
- const s = n.text !== -1 ? "text" : "number";
155
- h = m(String(e), s);
162
+ const u = n.text !== -1 ? "text" : "number";
163
+ T = i(String(e), u);
156
164
  }
157
- b[a] = h, b.every((s) => s === null) ? delete r[o] : r[o] = { filterType: "multi", filterModels: b };
165
+ p[d] = T, p.every((u) => u === null) ? delete r[o] : r[o] = { filterType: "multi", filterModels: p };
158
166
  } else if (e === null || e === "" || Array.isArray(e) && e.length === 0)
159
167
  delete r[o];
160
168
  else if (t === "date") {
161
- const n = e instanceof Date ? ce(e) : null;
169
+ const n = e instanceof Date ? pe(e) : null;
162
170
  r[o] = n ? { type: "equals", dateFrom: n, filterType: "date" } : null;
163
171
  } else if (t === "set")
164
172
  r[o] = { filterType: "set", values: Array.isArray(e) ? e : [String(e)] };
165
173
  else {
166
- const n = z === "agNumberColumnFilter" ? "number" : "text", a = m(String(e), n);
167
- a ? r[o] = a : delete r[o];
174
+ const n = B === "agNumberColumnFilter" ? "number" : "text", d = i(String(e), n);
175
+ d ? r[o] = d : delete r[o];
168
176
  }
169
177
  console.log("[HeaderSearchInput] Final Model Applied:", {
170
178
  column: o,
171
179
  model: r[o]
172
- }), d.setFilterModel(r), d.onFilterChanged();
173
- }, O = (e) => {
174
- if (j) {
175
- j(Array.isArray(e) ? e.join(",") : e);
180
+ }), c.setFilterModel(r), c.onFilterChanged();
181
+ }, j = (e) => {
182
+ if (L) {
183
+ L(Array.isArray(e) ? e.join(",") : e);
176
184
  return;
177
185
  }
178
- U(e, p ? "date" : "text");
179
- }, X = (e) => {
186
+ $(e, g ? "date" : "text");
187
+ }, ee = (e) => {
180
188
  const t = e.target.value;
181
- k(t), O(t);
182
- }, Y = (e) => {
183
- R(e), O(e);
184
- }, me = () => {
185
- k(""), R(null), O(""), G && G();
186
- }, A = (e) => {
187
- U(e, "set");
188
- }, S = q || (c?.cellDataType === "boolean" ? [{ label: "True", value: "true" }, { label: "False", value: "false" }] : []), Z = be(() => {
189
- const e = d.getFilterModel()[o];
189
+ O(t), j(t);
190
+ }, te = (e) => {
191
+ W(e), j(e);
192
+ }, Ce = () => {
193
+ O(""), W(null), j(""), _ && _();
194
+ }, I = (e) => {
195
+ $(e, "set");
196
+ }, P = E || (a?.cellDataType === "boolean" ? [{ label: "True", value: "true" }, { label: "False", value: "false" }] : []), le = Pe(() => {
197
+ const e = c.getFilterModel()[o];
190
198
  if (!e) return [];
191
199
  if ("filterType" in e && e.filterType === "multi" && e.filterModels) {
192
- const l = C(D.getColDef()).set;
200
+ const l = b(A.getColDef()).set;
193
201
  if (l !== -1) {
194
202
  const r = e.filterModels[l];
195
203
  if (r?.filterType === "set" && r.values) return r.values;
@@ -201,152 +209,152 @@ const Ee = {
201
209
  return [String(e.filter)];
202
210
  }
203
211
  return [];
204
- }, [d, o, D]), [w, N] = I(null), $ = () => {
205
- const e = w !== null ? w : Z();
206
- return v ? S.filter((t) => e.includes(t.value)) : S.find((t) => e.includes(t.value)) || null;
207
- }, ee = (e) => {
212
+ }, [c, o, A]), [w, S] = z(null), re = () => {
213
+ const e = w !== null ? w : le();
214
+ return C ? P.filter((t) => e.includes(t.value)) : P.find((t) => e.includes(t.value)) || null;
215
+ }, ne = (e) => {
208
216
  let t = [];
209
- if (Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e && (t = [e.value]), !v) {
210
- A(t), e && W();
217
+ if (Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e && (t = [e.value]), !C) {
218
+ I(t), e && G();
211
219
  return;
212
220
  }
213
- N(t);
214
- }, pe = () => {
215
- A([]), N([]);
216
- }, ge = (e) => {
217
- if (v) {
221
+ S(t);
222
+ }, Te = () => {
223
+ I([]), S([]);
224
+ }, be = (e) => {
225
+ if (C) {
218
226
  if (e !== void 0) {
219
227
  let t = [];
220
- Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e ? t = [e.value] : e === null && (t = []), A(t), N(null);
228
+ Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e ? t = [e.value] : e === null && (t = []), I(t), S(null);
221
229
  return;
222
230
  }
223
- w !== null && (A(w), N(null));
231
+ w !== null && (I(w), S(null));
224
232
  }
225
- }, xe = () => {
226
- N(Z()), V && V();
227
- }, ye = () => de ? /* @__PURE__ */ i("svg", { className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6] shrink-0", fill: "currentColor", focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", onClick: (e) => {
228
- e.stopPropagation(), E.current && E.current.blur(), L ? L(D) : _ ? _(o) : K && K.openAdvancedFilter(o);
229
- }, children: /* @__PURE__ */ i("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" }) }) : null, Fe = () => /* @__PURE__ */ i("button", { onClick: W, className: "cursor-pointer shrink-0 text-[#4259ee] hover:text-[#0f1c76]", children: /* @__PURE__ */ i(ae, { size: 12 }) }), T = c.filter === "agMultiColumnFilter", g = C(c);
230
- let x = "text";
231
- T ? x = g.set !== -1 ? "set" : g.date !== -1 ? "date" : "text" : B ? x = "set" : p && (x = "date");
232
- const Me = T ? g.text !== -1 || g.number !== -1 : !p && !B, te = T ? g.set !== -1 : B, le = T ? g.date !== -1 : p, ve = d.getFilterModel()[o], re = T && ve?.filterModels?.some((e, t) => {
233
- const l = t === g.text || t === g.number ? "text" : t === g.set ? "set" : "date";
234
- return e !== null && l !== x;
233
+ }, De = () => {
234
+ S(le()), K && K();
235
+ }, Ne = () => ge ? /* @__PURE__ */ s("svg", { className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6] shrink-0", fill: "currentColor", focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", onClick: (e) => {
236
+ e.stopPropagation(), R.current && R.current.blur(), V ? V(A) : J ? J(o) : U && U.openAdvancedFilter(o);
237
+ }, children: /* @__PURE__ */ s("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" }) }) : null, Ae = () => /* @__PURE__ */ s("button", { onClick: G, className: "cursor-pointer shrink-0 text-[#4259ee] hover:text-[#0f1c76]", children: /* @__PURE__ */ s(me, { size: 12 }) }), D = a.filter === "agMultiColumnFilter", x = b(a);
238
+ let y = "text";
239
+ D ? y = x.set !== -1 ? "set" : x.date !== -1 ? "date" : "text" : H ? y = "set" : g && (y = "date");
240
+ const Se = D ? x.text !== -1 || x.number !== -1 : !g && !H, oe = D ? x.set !== -1 : H, se = D ? x.date !== -1 : g, Ie = c.getFilterModel()[o], ie = D && Ie?.filterModels?.some((e, t) => {
241
+ const l = t === x.text || t === x.number ? "text" : t === x.set ? "set" : "date";
242
+ return e !== null && l !== y;
235
243
  });
236
- return /* @__PURE__ */ y("div", { className: "ag-header-cell-label flex items-center gap-1 w-full bg-[#eceefd] px-1 py-2 ag-header-cell-search-active h-full", children: [
237
- x === "set" && te ? /* @__PURE__ */ i(
238
- se,
244
+ return /* @__PURE__ */ F("div", { className: "ag-header-cell-label flex items-center gap-1 w-full bg-[#eceefd] px-1 py-2 ag-header-cell-search-active h-full", children: [
245
+ y === "set" && oe ? /* @__PURE__ */ s(
246
+ he,
239
247
  {
240
- options: S,
241
- value: $(),
242
- onChange: ee,
243
- isMulti: v !== void 0 ? v : c?.cellDataType !== "boolean",
248
+ options: P,
249
+ value: re(),
250
+ onChange: ne,
251
+ isMulti: C !== void 0 ? C : a?.cellDataType !== "boolean",
244
252
  placeholder: "Select...",
245
253
  className: "w-full bg-white",
246
254
  parentClassName: "flex-1 min-w-0",
247
255
  menuWidth: "200px",
248
256
  menuPortalTarget: document.body,
249
257
  autoFocus: !0,
250
- onMenuOpen: xe,
251
- onMenuClose: ge,
252
- onMenuScrollToBottom: fe,
253
- onInputChange: ue,
254
- onClearAll: pe,
255
- isLoading: J,
256
- onFocus: () => u(!0),
257
- onBlur: () => u(!1)
258
+ onMenuOpen: De,
259
+ onMenuClose: be,
260
+ onMenuScrollToBottom: xe,
261
+ onInputChange: ye,
262
+ onClearAll: Te,
263
+ isLoading: Q,
264
+ onFocus: () => f(!0),
265
+ onBlur: () => f(!1)
258
266
  }
259
- ) : x === "date" && le ? /* @__PURE__ */ i(
260
- oe,
267
+ ) : y === "date" && se ? /* @__PURE__ */ s(
268
+ ue,
261
269
  {
262
- value: Q || void 0,
263
- onChange: (e) => Y(e || null),
270
+ value: Z || void 0,
271
+ onChange: (e) => te(e || null),
264
272
  placeholder: "Select Date",
265
273
  format: "MM-dd-yyyy",
266
274
  minDate: /* @__PURE__ */ new Date("2000-01-01"),
267
275
  maxDate: /* @__PURE__ */ new Date("2100-12-31"),
268
276
  className: "w-full bg-white",
269
- onFocus: () => u(!0),
270
- onBlur: () => u(!1)
277
+ onFocus: () => f(!0),
278
+ onBlur: () => f(!1)
271
279
  }
272
- ) : /* @__PURE__ */ i(
273
- ie,
280
+ ) : /* @__PURE__ */ s(
281
+ fe,
274
282
  {
275
- value: H,
276
- onChange: X,
283
+ value: k,
284
+ onChange: ee,
277
285
  placeholder: "Search",
278
286
  type: "text",
279
287
  className: "flex-1 bg-white",
280
288
  autoFocus: !0,
281
- ref: E,
282
- onFocus: () => u(!0),
283
- onBlur: () => u(!1),
284
- suffix: H && /* @__PURE__ */ i("button", { onClick: (e) => {
285
- e.stopPropagation(), me();
286
- }, className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6]", children: /* @__PURE__ */ i(ae, { size: 10 }) })
289
+ ref: R,
290
+ onFocus: () => f(!0),
291
+ onBlur: () => f(!1),
292
+ suffix: k && /* @__PURE__ */ s("button", { onClick: (e) => {
293
+ e.stopPropagation(), Ce();
294
+ }, className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6]", children: /* @__PURE__ */ s(me, { size: 10 }) })
287
295
  }
288
296
  ),
289
- /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5 shrink-0", children: [
290
- T && /* @__PURE__ */ y(Ae, { children: [
291
- /* @__PURE__ */ i(Se, { asChild: !0, children: /* @__PURE__ */ y("div", { className: "relative group p-1 hover:bg-[#dbe0fb] rounded-md transition-colors cursor-pointer", children: [
292
- /* @__PURE__ */ i(De, { size: 16, className: Ne("text-[#60697D] group-hover:text-[#3649C6]", re && "text-[#3649C6]") }),
293
- re && /* @__PURE__ */ i("span", { className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-[#4259ee] border border-white shadow-sm" })
297
+ /* @__PURE__ */ F("div", { className: "flex items-center gap-1.5 shrink-0", children: [
298
+ D && /* @__PURE__ */ F(qe, { children: [
299
+ /* @__PURE__ */ s(Ee, { asChild: !0, children: /* @__PURE__ */ F("div", { className: "relative group p-1 hover:bg-[#dbe0fb] rounded-md transition-colors cursor-pointer", children: [
300
+ /* @__PURE__ */ s(we, { size: 16, className: ze("text-[#60697D] group-hover:text-[#3649C6]", ie && "text-[#3649C6]") }),
301
+ ie && /* @__PURE__ */ s("span", { className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-[#4259ee] border border-white shadow-sm" })
294
302
  ] }) }),
295
- /* @__PURE__ */ y(we, { align: "end", className: "w-[300px]", children: [
296
- /* @__PURE__ */ i(Ie, { children: /* @__PURE__ */ i(Pe, { children: "Active Filters" }) }),
297
- /* @__PURE__ */ y(qe, { className: "flex flex-col gap-4", children: [
298
- x !== "text" && Me && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
299
- /* @__PURE__ */ i("span", { className: "text-xs font-semibold text-[#60697D]", children: "Text Search" }),
300
- /* @__PURE__ */ i(
301
- ie,
303
+ /* @__PURE__ */ F(Be, { align: "end", className: "w-[300px]", children: [
304
+ /* @__PURE__ */ s(He, { children: /* @__PURE__ */ s(Re, { children: "Active Filters" }) }),
305
+ /* @__PURE__ */ F(ke, { className: "flex flex-col gap-4", children: [
306
+ y !== "text" && Se && /* @__PURE__ */ F("div", { className: "flex flex-col gap-1.5", children: [
307
+ /* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "Text Search" }),
308
+ /* @__PURE__ */ s(
309
+ fe,
302
310
  {
303
- value: H,
304
- onChange: X,
311
+ value: k,
312
+ onChange: ee,
305
313
  placeholder: "Search...",
306
314
  className: "bg-white",
307
- onFocus: () => u(!0),
308
- onBlur: () => u(!1)
315
+ onFocus: () => f(!0),
316
+ onBlur: () => f(!1)
309
317
  }
310
318
  )
311
319
  ] }),
312
- x !== "set" && te && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
313
- /* @__PURE__ */ i("span", { className: "text-xs font-semibold text-[#60697D]", children: "Selection Filter" }),
314
- /* @__PURE__ */ i(
315
- se,
320
+ y !== "set" && oe && /* @__PURE__ */ F("div", { className: "flex flex-col gap-1.5", children: [
321
+ /* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "Selection Filter" }),
322
+ /* @__PURE__ */ s(
323
+ he,
316
324
  {
317
- options: S,
318
- value: $(),
319
- onChange: ee,
320
- isMulti: v !== void 0 ? v : c?.cellDataType !== "boolean",
325
+ options: P,
326
+ value: re(),
327
+ onChange: ne,
328
+ isMulti: C !== void 0 ? C : a?.cellDataType !== "boolean",
321
329
  placeholder: "Select...",
322
330
  className: "w-full bg-white",
323
- isLoading: J,
324
- onFocus: () => u(!0),
325
- onBlur: () => u(!1)
331
+ isLoading: Q,
332
+ onFocus: () => f(!0),
333
+ onBlur: () => f(!1)
326
334
  }
327
335
  )
328
336
  ] }),
329
- x !== "date" && le && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
330
- /* @__PURE__ */ i("span", { className: "text-xs font-semibold text-[#60697D]", children: "Date Filter" }),
331
- /* @__PURE__ */ i(
332
- oe,
337
+ y !== "date" && se && /* @__PURE__ */ F("div", { className: "flex flex-col gap-1.5", children: [
338
+ /* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "Date Filter" }),
339
+ /* @__PURE__ */ s(
340
+ ue,
333
341
  {
334
- value: Q || void 0,
335
- onChange: (e) => Y(e || null),
342
+ value: Z || void 0,
343
+ onChange: (e) => te(e || null),
336
344
  className: "w-full bg-white",
337
- onFocus: () => u(!0),
338
- onBlur: () => u(!1)
345
+ onFocus: () => f(!0),
346
+ onBlur: () => f(!1)
339
347
  }
340
348
  )
341
349
  ] })
342
350
  ] })
343
351
  ] })
344
352
  ] }),
345
- ye(),
346
- Fe()
353
+ Ne(),
354
+ Ae()
347
355
  ] })
348
356
  ] });
349
357
  };
350
358
  export {
351
- Ue as HeaderSearchInput
359
+ tt as HeaderSearchInput
352
360
  };
@@ -42,9 +42,13 @@ export declare function getMultiFilterIndices(colDef: ColDef | undefined): {
42
42
  * - Multiple patterns with AND: `fo+ au` or `fo +au` (plus separated)
43
43
  * - Match all: `*` alone
44
44
  *
45
+ * @param input - The search input string
46
+ * @param enableSpaceSplitting - If true, spaces split terms into multiple OR conditions. If false (default), preserves phrases like "Pratik Kumar"
47
+ * @param enableBooleanParsing - If true, boolean keywords parsed globally (e.g., "yes" → true). If false (default), only with '=' prefix (e.g., "=yes" → true)
48
+ * @param enableDateParsing - If true, standalone date heuristics are enabled (e.g., "2024" → year range, "Jan 2024" → month range, "today"/"yesterday"). If false (default), 4-digit numbers like "1000" are treated as plain values, not year ranges.
45
49
  * @returns ParsedInput with conditions array and logic
46
50
  */
47
- export declare function parseInputPattern(input: string): ParsedInput;
51
+ export declare function parseInputPattern(input: string, enableSpaceSplitting?: boolean, enableBooleanParsing?: boolean, enableDateParsing?: boolean): ParsedInput;
48
52
  /**
49
53
  * Convert ParsedInput to AdvancedFilterRule array for a specific column.
50
54
  * Used to sync inline search input with the advanced filter modal.