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.
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +42 -35
- package/dist/components/ui/ag-grid-react/headers/header-search-input.d.ts +4 -1
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +217 -209
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.d.ts +5 -1
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +210 -204
- package/dist/components/ui/ag-grid-react/process-backend-columndefs.js +26 -11
- package/dist/components/ui/calendar.d.ts +2 -1
- package/dist/components/ui/calendar.js +272 -264
- package/dist/components/ui/date-picker/date-picker.js +59 -55
- package/dist/components/ui/date-picker/date-range-picker.js +76 -73
- package/dist/components/ui/date-picker/month-picker.js +67 -63
- package/dist/components/ui/date-picker/month-range-picker.js +62 -58
- package/dist/components/ui/date-picker/week-picker.js +51 -47
- package/dist/components/ui/date-picker/week-range-picker.js +55 -51
- package/dist/components/ui/types/ag-grid.types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Filter as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { Input as
|
|
7
|
-
import
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Cross as
|
|
10
|
-
import { useGridHeader as
|
|
11
|
-
import { getMultiFilterIndices as
|
|
12
|
-
import { deserializeDate as
|
|
13
|
-
const
|
|
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
|
-
},
|
|
28
|
-
column:
|
|
29
|
-
api:
|
|
30
|
-
onClose:
|
|
31
|
-
handleInlineSearch:
|
|
32
|
-
handleClearSearchInline:
|
|
33
|
-
onAdvanceSearchClick:
|
|
34
|
-
toggleAdvanceSearch:
|
|
35
|
-
advanceSearchEnabled:
|
|
36
|
-
selectOptions:
|
|
37
|
-
isMultiSelect:
|
|
38
|
-
onSelectScrollToBottom:
|
|
39
|
-
onSelectSearchChange:
|
|
40
|
-
onSelectOpen:
|
|
41
|
-
isLoadingSelect:
|
|
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
|
|
44
|
-
const t =
|
|
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 =
|
|
50
|
+
const l = b(a), r = l.text !== -1 ? l.text : l.number;
|
|
48
51
|
if (r !== -1) {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
52
|
+
const h = t.filterModels[r];
|
|
53
|
+
if (h) return q(o, h);
|
|
51
54
|
}
|
|
52
55
|
return "";
|
|
53
56
|
}
|
|
54
|
-
return
|
|
55
|
-
}), [
|
|
56
|
-
|
|
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 } =
|
|
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
|
|
64
|
-
if (r.filter) return
|
|
70
|
+
if (r.dateFrom) return v(r.dateFrom);
|
|
71
|
+
if (r.filter) return v(r.filter);
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
|
-
if (
|
|
69
|
-
if (t.dateFrom) return
|
|
70
|
-
if (t.filter) return
|
|
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
|
-
|
|
82
|
+
de(() => {
|
|
76
83
|
const e = () => {
|
|
77
|
-
const l =
|
|
84
|
+
const l = c.getFilterModel()[o];
|
|
78
85
|
let r = "";
|
|
79
86
|
if (l)
|
|
80
87
|
if (l.filterType === "multi" && l.filterModels) {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
r =
|
|
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
|
|
87
|
-
|
|
88
|
-
let
|
|
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:
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
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
|
|
97
|
-
|
|
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
|
|
100
|
-
|
|
106
|
+
return c.addEventListener("filterChanged", e), () => {
|
|
107
|
+
c.removeEventListener("filterChanged", e);
|
|
101
108
|
};
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
const r = { ...
|
|
105
|
-
const
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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(
|
|
128
|
+
} : isNaN(ae) ? null : { type: M, filter: ae, filterType: "number" };
|
|
121
129
|
}
|
|
122
130
|
return {
|
|
123
|
-
type:
|
|
124
|
-
filter:
|
|
125
|
-
filterTo:
|
|
131
|
+
type: M,
|
|
132
|
+
filter: m.value,
|
|
133
|
+
filterTo: m.valueTo,
|
|
126
134
|
filterType: "text"
|
|
127
135
|
};
|
|
128
136
|
};
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
131
|
-
|
|
137
|
+
let u = null;
|
|
138
|
+
if (p.conditions.length === 1)
|
|
139
|
+
u = T(p.conditions[0]);
|
|
132
140
|
else {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
filterType:
|
|
136
|
-
operator:
|
|
137
|
-
conditions:
|
|
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:",
|
|
148
|
+
return console.log("[HeaderSearchInput] Resulting Model:", u), u;
|
|
141
149
|
};
|
|
142
|
-
if (
|
|
143
|
-
const n =
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
let
|
|
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
|
-
|
|
157
|
+
T = { values: Array.isArray(e) ? e : [String(e)], filterType: "set" };
|
|
150
158
|
else if (t === "date") {
|
|
151
|
-
const
|
|
152
|
-
|
|
159
|
+
const u = e instanceof Date ? pe(e) : null;
|
|
160
|
+
T = u ? { type: "equals", dateFrom: u, filterType: "date" } : null;
|
|
153
161
|
} else {
|
|
154
|
-
const
|
|
155
|
-
|
|
162
|
+
const u = n.text !== -1 ? "text" : "number";
|
|
163
|
+
T = i(String(e), u);
|
|
156
164
|
}
|
|
157
|
-
|
|
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 ?
|
|
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 =
|
|
167
|
-
|
|
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
|
-
}),
|
|
173
|
-
},
|
|
174
|
-
if (
|
|
175
|
-
|
|
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
|
-
|
|
179
|
-
},
|
|
186
|
+
$(e, g ? "date" : "text");
|
|
187
|
+
}, ee = (e) => {
|
|
180
188
|
const t = e.target.value;
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
const e =
|
|
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 =
|
|
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
|
-
}, [
|
|
205
|
-
const e = w !== null ? w :
|
|
206
|
-
return
|
|
207
|
-
},
|
|
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]), !
|
|
210
|
-
|
|
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
|
-
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
if (
|
|
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 = []),
|
|
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 && (
|
|
231
|
+
w !== null && (I(w), S(null));
|
|
224
232
|
}
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
e.stopPropagation(),
|
|
229
|
-
}, children: /* @__PURE__ */
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
const l = t ===
|
|
234
|
-
return e !== null && l !==
|
|
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__ */
|
|
237
|
-
|
|
238
|
-
|
|
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:
|
|
241
|
-
value:
|
|
242
|
-
onChange:
|
|
243
|
-
isMulti:
|
|
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:
|
|
251
|
-
onMenuClose:
|
|
252
|
-
onMenuScrollToBottom:
|
|
253
|
-
onInputChange:
|
|
254
|
-
onClearAll:
|
|
255
|
-
isLoading:
|
|
256
|
-
onFocus: () =>
|
|
257
|
-
onBlur: () =>
|
|
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
|
-
) :
|
|
260
|
-
|
|
267
|
+
) : y === "date" && se ? /* @__PURE__ */ s(
|
|
268
|
+
ue,
|
|
261
269
|
{
|
|
262
|
-
value:
|
|
263
|
-
onChange: (e) =>
|
|
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: () =>
|
|
270
|
-
onBlur: () =>
|
|
277
|
+
onFocus: () => f(!0),
|
|
278
|
+
onBlur: () => f(!1)
|
|
271
279
|
}
|
|
272
|
-
) : /* @__PURE__ */
|
|
273
|
-
|
|
280
|
+
) : /* @__PURE__ */ s(
|
|
281
|
+
fe,
|
|
274
282
|
{
|
|
275
|
-
value:
|
|
276
|
-
onChange:
|
|
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:
|
|
282
|
-
onFocus: () =>
|
|
283
|
-
onBlur: () =>
|
|
284
|
-
suffix:
|
|
285
|
-
e.stopPropagation(),
|
|
286
|
-
}, className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6]", children: /* @__PURE__ */
|
|
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__ */
|
|
290
|
-
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
|
|
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__ */
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
|
|
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:
|
|
304
|
-
onChange:
|
|
311
|
+
value: k,
|
|
312
|
+
onChange: ee,
|
|
305
313
|
placeholder: "Search...",
|
|
306
314
|
className: "bg-white",
|
|
307
|
-
onFocus: () =>
|
|
308
|
-
onBlur: () =>
|
|
315
|
+
onFocus: () => f(!0),
|
|
316
|
+
onBlur: () => f(!1)
|
|
309
317
|
}
|
|
310
318
|
)
|
|
311
319
|
] }),
|
|
312
|
-
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
|
|
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:
|
|
318
|
-
value:
|
|
319
|
-
onChange:
|
|
320
|
-
isMulti:
|
|
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:
|
|
324
|
-
onFocus: () =>
|
|
325
|
-
onBlur: () =>
|
|
331
|
+
isLoading: Q,
|
|
332
|
+
onFocus: () => f(!0),
|
|
333
|
+
onBlur: () => f(!1)
|
|
326
334
|
}
|
|
327
335
|
)
|
|
328
336
|
] }),
|
|
329
|
-
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
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:
|
|
335
|
-
onChange: (e) =>
|
|
342
|
+
value: Z || void 0,
|
|
343
|
+
onChange: (e) => te(e || null),
|
|
336
344
|
className: "w-full bg-white",
|
|
337
|
-
onFocus: () =>
|
|
338
|
-
onBlur: () =>
|
|
345
|
+
onFocus: () => f(!0),
|
|
346
|
+
onBlur: () => f(!1)
|
|
339
347
|
}
|
|
340
348
|
)
|
|
341
349
|
] })
|
|
342
350
|
] })
|
|
343
351
|
] })
|
|
344
352
|
] }),
|
|
345
|
-
|
|
346
|
-
|
|
353
|
+
Ne(),
|
|
354
|
+
Ae()
|
|
347
355
|
] })
|
|
348
356
|
] });
|
|
349
357
|
};
|
|
350
358
|
export {
|
|
351
|
-
|
|
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.
|