impact-nova 1.7.30 → 1.7.31
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/advanced-filter/advanced-filter-dialog.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +69 -67
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +107 -71
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +277 -213
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +11 -1
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +34 -20
- package/dist/components/ui/ag-grid-react/index.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.d.ts +1 -0
- package/dist/components/ui/nested-list/components/SortableItem.js +37 -36
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +2 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +173 -160
- package/dist/components/ui/nested-list/nested-list.js +200 -196
- package/dist/components/ui/types/ag-grid.types.d.ts +2 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Filter as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { jsxs as M, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as he, useState as w, useEffect as pe, useCallback as Re } from "react";
|
|
3
|
+
import { Filter as je } from "lucide-react";
|
|
4
|
+
import { cn as Oe } from "../../../../lib/utils.js";
|
|
5
|
+
import { DatePicker as ge } from "../../date-picker/date-picker.js";
|
|
6
|
+
import { MonthPicker as ye } from "../../date-picker/month-picker.js";
|
|
7
|
+
import { Input as Fe } from "../../input.js";
|
|
8
|
+
import xe from "../../select/select.js";
|
|
9
|
+
import { Popover as We, PopoverTrigger as Ve, PopoverContent as Ge, PopoverHeader as Le, PopoverTitle as _e, PopoverBody as Je } from "../../popover.js";
|
|
10
|
+
import { Cross as Me } from "../../../../icons/index.js";
|
|
11
|
+
import { useGridHeader as Ke } from "./context/grid-header-context.js";
|
|
12
|
+
import { getMultiFilterIndices as v, getDisplayStringFromFilterModel as q, parseInputPattern as Qe } from "./utils/filter-utils.js";
|
|
13
|
+
import { deserializeDate as C, deserializeMonth as E, serializeMonth as ve, serializeDate as be } from "./utils/date-utils.js";
|
|
14
|
+
import { useImpactNovaI18n as Ue } from "../../../../i18n/ImpactNovaI18nContext.js";
|
|
15
|
+
const Xe = {
|
|
15
16
|
contains: "contains",
|
|
16
17
|
notContains: "notContains",
|
|
17
18
|
equals: "equals",
|
|
@@ -25,110 +26,138 @@ const Ge = {
|
|
|
25
26
|
inRange: "inRange",
|
|
26
27
|
empty: "blank",
|
|
27
28
|
notEmpty: "notBlank"
|
|
28
|
-
},
|
|
29
|
-
column:
|
|
30
|
-
api:
|
|
31
|
-
onClose:
|
|
32
|
-
handleInlineSearch:
|
|
33
|
-
handleClearSearchInline:
|
|
34
|
-
onAdvanceSearchClick:
|
|
35
|
-
toggleAdvanceSearch:
|
|
36
|
-
advanceSearchEnabled:
|
|
37
|
-
selectOptions:
|
|
38
|
-
isMultiSelect:
|
|
39
|
-
onSelectScrollToBottom:
|
|
40
|
-
onSelectSearchChange:
|
|
41
|
-
onSelectOpen:
|
|
42
|
-
isLoadingSelect:
|
|
43
|
-
enableSpaceSplitting:
|
|
44
|
-
enableBooleanParsing:
|
|
45
|
-
enableDateParsing:
|
|
29
|
+
}, ut = ({
|
|
30
|
+
column: I,
|
|
31
|
+
api: u,
|
|
32
|
+
onClose: J,
|
|
33
|
+
handleInlineSearch: K,
|
|
34
|
+
handleClearSearchInline: Q,
|
|
35
|
+
onAdvanceSearchClick: U,
|
|
36
|
+
toggleAdvanceSearch: X,
|
|
37
|
+
advanceSearchEnabled: Te = !1,
|
|
38
|
+
selectOptions: k,
|
|
39
|
+
isMultiSelect: D,
|
|
40
|
+
onSelectScrollToBottom: Ce,
|
|
41
|
+
onSelectSearchChange: De,
|
|
42
|
+
onSelectOpen: Y,
|
|
43
|
+
isLoadingSelect: Z,
|
|
44
|
+
enableSpaceSplitting: Ne = !1,
|
|
45
|
+
enableBooleanParsing: Pe = !1,
|
|
46
|
+
enableDateParsing: Ie = !1
|
|
46
47
|
}) => {
|
|
47
|
-
const { t: m } =
|
|
48
|
-
const t =
|
|
48
|
+
const { t: m } = Ue(), c = I.getColDef(), o = I.getColId(), R = c?.filter || "agTextColumnFilter", h = R === "agDateColumnFilter", j = R === "agSetColumnFilter" || k && k.length > 0 || c?.cellDataType === "boolean", Ae = c?.headerComponentParams?.datePickerVariant || "date", b = h && Ae === "month", $ = Ke(), O = he(null), ee = he(!1), [W, V] = w(() => {
|
|
49
|
+
const t = u.getFilterModel()[o];
|
|
49
50
|
if (!t) return "";
|
|
50
51
|
if (t.filterType === "multi" && t.filterModels) {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
52
|
+
const l = v(c), r = l.text !== -1 ? l.text : l.number;
|
|
53
|
+
if (r !== -1) {
|
|
54
|
+
const i = t.filterModels[r];
|
|
55
|
+
if (i) return q(o, i);
|
|
55
56
|
}
|
|
56
57
|
return "";
|
|
57
58
|
}
|
|
58
|
-
return
|
|
59
|
-
}), [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
const [
|
|
64
|
-
|
|
59
|
+
return h ? "" : q(o, t);
|
|
60
|
+
}), [te, f] = w(!1);
|
|
61
|
+
pe(() => {
|
|
62
|
+
ee.current = te;
|
|
63
|
+
}, [te]);
|
|
64
|
+
const [le, G] = w(() => {
|
|
65
|
+
if (b) return null;
|
|
66
|
+
const t = u.getFilterModel()[o];
|
|
65
67
|
if (t) {
|
|
66
68
|
if (t.filterType === "multi" && t.filterModels) {
|
|
67
|
-
const { date:
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
69
|
+
const { date: l } = v(c);
|
|
70
|
+
if (l !== -1) {
|
|
71
|
+
const r = t.filterModels[l];
|
|
72
|
+
if (r) {
|
|
73
|
+
if (r.dateFrom) return C(r.dateFrom);
|
|
74
|
+
if (r.filter) return C(r.filter);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
|
-
if (
|
|
77
|
-
if (t.dateFrom) return
|
|
78
|
-
if (t.filter) return
|
|
78
|
+
if (h) {
|
|
79
|
+
if (t.dateFrom) return C(t.dateFrom);
|
|
80
|
+
if (t.filter) return C(t.filter);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}), [re, L] = w(() => {
|
|
85
|
+
if (!b) return null;
|
|
86
|
+
const t = u.getFilterModel()[o];
|
|
87
|
+
if (t) {
|
|
88
|
+
if (t.filterType === "multi" && t.filterModels) {
|
|
89
|
+
const { date: l } = v(c);
|
|
90
|
+
if (l !== -1) {
|
|
91
|
+
const r = t.filterModels[l];
|
|
92
|
+
if (r?.dateFrom) return E(r.dateFrom);
|
|
93
|
+
}
|
|
79
94
|
}
|
|
95
|
+
if (h && t.dateFrom)
|
|
96
|
+
return E(t.dateFrom);
|
|
80
97
|
}
|
|
81
98
|
return null;
|
|
82
99
|
});
|
|
83
|
-
|
|
100
|
+
pe(() => {
|
|
84
101
|
const e = () => {
|
|
85
|
-
const
|
|
86
|
-
let
|
|
87
|
-
if (
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
|
|
102
|
+
const l = u.getFilterModel()[o];
|
|
103
|
+
let r = "";
|
|
104
|
+
if (l)
|
|
105
|
+
if (l.filterType === "multi" && l.filterModels) {
|
|
106
|
+
const i = v(c), d = i.text !== -1 ? i.text : i.number;
|
|
107
|
+
if (d !== -1) {
|
|
108
|
+
const n = l.filterModels[d];
|
|
109
|
+
r = n ? q(o, n) : "";
|
|
93
110
|
}
|
|
94
|
-
} else
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
} else h || (r = q(o, l));
|
|
112
|
+
if (ee.current || V((i) => i !== r ? r : i), b) {
|
|
113
|
+
let i = null;
|
|
114
|
+
if (l)
|
|
115
|
+
if (l.filterType === "multi" && l.filterModels) {
|
|
116
|
+
const { date: d } = v(c);
|
|
117
|
+
if (d !== -1) {
|
|
118
|
+
const n = l.filterModels[d];
|
|
119
|
+
n?.dateFrom && (i = E(n.dateFrom));
|
|
120
|
+
}
|
|
121
|
+
} else h && l.dateFrom && (i = E(l.dateFrom));
|
|
122
|
+
L((d) => d === null && i === null ? d : d?.month !== i?.month || d?.year !== i?.year ? i : d);
|
|
123
|
+
} else {
|
|
124
|
+
let i = null;
|
|
125
|
+
if (l)
|
|
126
|
+
if (l.filterType === "multi" && l.filterModels) {
|
|
127
|
+
const { date: d } = v(c);
|
|
128
|
+
if (d !== -1) {
|
|
129
|
+
const n = l.filterModels[d];
|
|
130
|
+
n && (i = n.dateFrom ? C(n.dateFrom) : n.filter ? C(n.filter) : null);
|
|
131
|
+
}
|
|
132
|
+
} else h && (i = l.dateFrom ? C(l.dateFrom) : l.filter ? C(l.filter) : null);
|
|
133
|
+
G((d) => d?.getTime() !== i?.getTime() ? i : d);
|
|
134
|
+
}
|
|
106
135
|
};
|
|
107
|
-
return
|
|
108
|
-
|
|
136
|
+
return u.addEventListener("filterChanged", e), () => {
|
|
137
|
+
u.removeEventListener("filterChanged", e);
|
|
109
138
|
};
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const g =
|
|
139
|
+
}, [u, o, h, b]);
|
|
140
|
+
const H = (e, t) => {
|
|
141
|
+
const r = { ...u.getFilterModel() }, i = (n) => n.replace(/[^0-9.\-+eE]/g, ""), d = (n, x) => {
|
|
142
|
+
const g = Qe(n, Ne, Pe, Ie);
|
|
114
143
|
if (console.log("[HeaderSearchInput] Pattern Debug:", {
|
|
115
144
|
input: n,
|
|
116
|
-
filterType:
|
|
145
|
+
filterType: x,
|
|
117
146
|
parsed: g
|
|
118
147
|
}), g.conditions.length === 0) return null;
|
|
119
|
-
const
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
return ["contains", "notContains", "startsWith", "endsWith"].includes(
|
|
124
|
-
type:
|
|
125
|
-
filter: parseFloat(
|
|
126
|
-
filterTo: parseFloat(
|
|
148
|
+
const P = (s) => {
|
|
149
|
+
let T = Xe[s.operator] || "contains";
|
|
150
|
+
if (x === "number") {
|
|
151
|
+
const me = parseFloat(i(s.value));
|
|
152
|
+
return ["contains", "notContains", "startsWith", "endsWith"].includes(T) && (T = T === "notContains" ? "notEqual" : "equals"), s.operator === "inRange" ? {
|
|
153
|
+
type: T,
|
|
154
|
+
filter: parseFloat(i(s.value)) || 0,
|
|
155
|
+
filterTo: parseFloat(i(s.valueTo || "")) || 0,
|
|
127
156
|
filterType: "number"
|
|
128
|
-
} : isNaN(
|
|
157
|
+
} : isNaN(me) ? null : { type: T, filter: me, filterType: "number" };
|
|
129
158
|
}
|
|
130
159
|
return {
|
|
131
|
-
type:
|
|
160
|
+
type: T,
|
|
132
161
|
filter: s.value,
|
|
133
162
|
filterTo: s.valueTo,
|
|
134
163
|
filterType: "text"
|
|
@@ -136,71 +165,83 @@ const Ge = {
|
|
|
136
165
|
};
|
|
137
166
|
let p = null;
|
|
138
167
|
if (g.conditions.length === 1)
|
|
139
|
-
p =
|
|
168
|
+
p = P(g.conditions[0]);
|
|
140
169
|
else {
|
|
141
|
-
const s = g.conditions.map(
|
|
170
|
+
const s = g.conditions.map(P).filter((T) => T !== null);
|
|
142
171
|
s.length === 0 ? p = null : s.length === 1 ? p = s[0] : p = {
|
|
143
|
-
filterType:
|
|
172
|
+
filterType: x,
|
|
144
173
|
operator: g.logic,
|
|
145
174
|
conditions: s
|
|
146
175
|
};
|
|
147
176
|
}
|
|
148
177
|
return console.log("[HeaderSearchInput] Resulting Model:", p), p;
|
|
149
178
|
};
|
|
150
|
-
if (
|
|
151
|
-
const n =
|
|
152
|
-
if (
|
|
153
|
-
const g =
|
|
179
|
+
if (c.filter === "agMultiColumnFilter") {
|
|
180
|
+
const n = v(c), x = t === "text" ? n.text !== -1 ? n.text : n.number : t === "set" ? n.set : n.date;
|
|
181
|
+
if (x === -1) return;
|
|
182
|
+
const g = u.getFilterModel()[o], P = g && g.filterType === "multi" ? [...g.filterModels || []] : Array(c.filterParams?.filters?.length || 1).fill(null);
|
|
154
183
|
let p = null;
|
|
155
184
|
if (e !== null && e !== "" && (!Array.isArray(e) || e.length > 0))
|
|
156
185
|
if (t === "set")
|
|
157
186
|
p = { values: Array.isArray(e) ? e : [String(e)], filterType: "set" };
|
|
158
|
-
else if (t === "date")
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
187
|
+
else if (t === "date")
|
|
188
|
+
if (b && e && typeof e == "object" && "month" in e && "year" in e) {
|
|
189
|
+
const s = ve(e);
|
|
190
|
+
p = { type: "inRange", dateFrom: s.dateFrom, dateTo: s.dateTo, filterType: "date" };
|
|
191
|
+
} else {
|
|
192
|
+
const s = e instanceof Date ? be(e) : null;
|
|
193
|
+
p = s ? { type: "equals", dateFrom: s, filterType: "date" } : null;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
162
196
|
const s = n.text !== -1 ? "text" : "number";
|
|
163
|
-
p =
|
|
197
|
+
p = d(String(e), s);
|
|
164
198
|
}
|
|
165
|
-
|
|
199
|
+
P[x] = p, P.every((s) => s === null) ? delete r[o] : r[o] = { filterType: "multi", filterModels: P };
|
|
166
200
|
} else if (e === null || e === "" || Array.isArray(e) && e.length === 0)
|
|
167
|
-
delete
|
|
168
|
-
else if (t === "date")
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
201
|
+
delete r[o];
|
|
202
|
+
else if (t === "date")
|
|
203
|
+
if (b && e && typeof e == "object" && "month" in e && "year" in e) {
|
|
204
|
+
const n = ve(e);
|
|
205
|
+
r[o] = { type: "inRange", dateFrom: n.dateFrom, dateTo: n.dateTo, filterType: "date" };
|
|
206
|
+
} else {
|
|
207
|
+
const n = e instanceof Date ? be(e) : null;
|
|
208
|
+
r[o] = n ? { type: "equals", dateFrom: n, filterType: "date" } : null;
|
|
209
|
+
}
|
|
210
|
+
else if (t === "set")
|
|
211
|
+
r[o] = { filterType: "set", values: Array.isArray(e) ? e : [String(e)] };
|
|
173
212
|
else {
|
|
174
|
-
const n =
|
|
175
|
-
|
|
213
|
+
const n = R === "agNumberColumnFilter" ? "number" : "text", x = d(String(e), n);
|
|
214
|
+
x ? r[o] = x : delete r[o];
|
|
176
215
|
}
|
|
177
216
|
console.log("[HeaderSearchInput] Final Model Applied:", {
|
|
178
217
|
column: o,
|
|
179
|
-
model:
|
|
180
|
-
}),
|
|
181
|
-
},
|
|
182
|
-
if (
|
|
183
|
-
|
|
218
|
+
model: r[o]
|
|
219
|
+
}), u.setFilterModel(r), u.onFilterChanged();
|
|
220
|
+
}, _ = (e) => {
|
|
221
|
+
if (K) {
|
|
222
|
+
K(Array.isArray(e) ? e.join(",") : e);
|
|
184
223
|
return;
|
|
185
224
|
}
|
|
186
|
-
|
|
187
|
-
},
|
|
225
|
+
H(e, h ? "date" : "text");
|
|
226
|
+
}, ne = (e) => {
|
|
188
227
|
const t = e.target.value;
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
|
|
228
|
+
V(t), _(t);
|
|
229
|
+
}, oe = (e) => {
|
|
230
|
+
G(e), _(e);
|
|
231
|
+
}, ie = (e) => {
|
|
232
|
+
L(e), H(e || null, "date");
|
|
233
|
+
}, we = () => {
|
|
234
|
+
V(""), G(null), L(null), _(""), Q && Q();
|
|
235
|
+
}, z = (e) => {
|
|
236
|
+
H(e, "set");
|
|
237
|
+
}, S = k || (c?.cellDataType === "boolean" ? [{ label: m("gridHeader.true"), value: "true" }, { label: m("gridHeader.false"), value: "false" }] : []), se = Re(() => {
|
|
238
|
+
const e = u.getFilterModel()[o];
|
|
198
239
|
if (!e) return [];
|
|
199
240
|
if ("filterType" in e && e.filterType === "multi" && e.filterModels) {
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
241
|
+
const l = v(I.getColDef()).set;
|
|
242
|
+
if (l !== -1) {
|
|
243
|
+
const r = e.filterModels[l];
|
|
244
|
+
if (r?.filterType === "set" && r.values) return r.values;
|
|
204
245
|
}
|
|
205
246
|
} else {
|
|
206
247
|
if (e.filterType === "set" && "values" in e)
|
|
@@ -209,66 +250,79 @@ const Ge = {
|
|
|
209
250
|
return [String(e.filter)];
|
|
210
251
|
}
|
|
211
252
|
return [];
|
|
212
|
-
}, [
|
|
213
|
-
const e =
|
|
214
|
-
return
|
|
215
|
-
},
|
|
253
|
+
}, [u, o, I]), [B, A] = w(null), ae = () => {
|
|
254
|
+
const e = B !== null ? B : se();
|
|
255
|
+
return D ? S.filter((t) => e.includes(t.value)) : S.find((t) => e.includes(t.value)) || null;
|
|
256
|
+
}, de = (e) => {
|
|
216
257
|
let t = [];
|
|
217
|
-
if (Array.isArray(e) ? t = e.map((
|
|
218
|
-
|
|
258
|
+
if (Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e && (t = [e.value]), !D) {
|
|
259
|
+
z(t), e && J();
|
|
219
260
|
return;
|
|
220
261
|
}
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
if (
|
|
262
|
+
A(t);
|
|
263
|
+
}, He = () => {
|
|
264
|
+
z([]), A([]);
|
|
265
|
+
}, ze = (e) => {
|
|
266
|
+
if (D) {
|
|
226
267
|
if (e !== void 0) {
|
|
227
268
|
let t = [];
|
|
228
|
-
Array.isArray(e) ? t = e.map((
|
|
269
|
+
Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e ? t = [e.value] : e === null && (t = []), z(t), A(null);
|
|
229
270
|
return;
|
|
230
271
|
}
|
|
231
|
-
|
|
272
|
+
B !== null && (z(B), A(null));
|
|
232
273
|
}
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
e.stopPropagation(),
|
|
237
|
-
}, children: /* @__PURE__ */
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
return e !== null &&
|
|
274
|
+
}, Se = () => {
|
|
275
|
+
A(se()), Y && Y();
|
|
276
|
+
}, Be = () => Te ? /* @__PURE__ */ a("svg", { className: "cursor-pointer text-navigation-muted hover:text-brand-variant-hover shrink-0", fill: "currentColor", focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", onClick: (e) => {
|
|
277
|
+
e.stopPropagation(), O.current && O.current.blur(), U ? U(I) : X ? X(o) : $ && $.openAdvancedFilter(o);
|
|
278
|
+
}, children: /* @__PURE__ */ a("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" }) }) : null, qe = () => /* @__PURE__ */ a("button", { onClick: J, className: "cursor-pointer shrink-0 text-brand hover:text-brand-strong", children: /* @__PURE__ */ a(Me, { size: "xs" }) }), N = c.filter === "agMultiColumnFilter", y = v(c);
|
|
279
|
+
let F = "text";
|
|
280
|
+
N ? F = y.set !== -1 ? "set" : y.date !== -1 ? "date" : "text" : j ? F = "set" : h && (F = "date");
|
|
281
|
+
const Ee = N ? y.text !== -1 || y.number !== -1 : !h && !j, ce = N ? y.set !== -1 : j, fe = N ? y.date !== -1 : h, ke = u.getFilterModel()[o], ue = N && ke?.filterModels?.some((e, t) => {
|
|
282
|
+
const l = t === y.text || t === y.number ? "text" : t === y.set ? "set" : "date";
|
|
283
|
+
return e !== null && l !== F;
|
|
243
284
|
});
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
|
|
246
|
-
|
|
285
|
+
return /* @__PURE__ */ M("div", { className: "ag-header-cell-label flex items-center gap-1 w-full bg-brand-tint px-1 py-2 ag-header-cell-search-active h-full", children: [
|
|
286
|
+
F === "set" && ce ? /* @__PURE__ */ a(
|
|
287
|
+
xe,
|
|
247
288
|
{
|
|
248
|
-
options:
|
|
249
|
-
value:
|
|
250
|
-
onChange:
|
|
251
|
-
isMulti:
|
|
289
|
+
options: S,
|
|
290
|
+
value: ae(),
|
|
291
|
+
onChange: de,
|
|
292
|
+
isMulti: D !== void 0 ? D : c?.cellDataType !== "boolean",
|
|
252
293
|
placeholder: m("filter.select"),
|
|
253
294
|
className: "w-full bg-canvas-elevated",
|
|
254
295
|
parentClassName: "flex-1 min-w-0",
|
|
255
296
|
menuWidth: "200px",
|
|
256
297
|
menuPortalTarget: document.body,
|
|
257
298
|
autoFocus: !0,
|
|
258
|
-
onMenuOpen:
|
|
259
|
-
onMenuClose:
|
|
260
|
-
onMenuScrollToBottom:
|
|
261
|
-
onInputChange:
|
|
262
|
-
onClearAll:
|
|
263
|
-
isLoading:
|
|
299
|
+
onMenuOpen: Se,
|
|
300
|
+
onMenuClose: ze,
|
|
301
|
+
onMenuScrollToBottom: Ce,
|
|
302
|
+
onInputChange: De,
|
|
303
|
+
onClearAll: He,
|
|
304
|
+
isLoading: Z,
|
|
305
|
+
onFocus: () => f(!0),
|
|
306
|
+
onBlur: () => f(!1)
|
|
307
|
+
}
|
|
308
|
+
) : F === "date" && fe ? b ? /* @__PURE__ */ a(
|
|
309
|
+
ye,
|
|
310
|
+
{
|
|
311
|
+
value: re || void 0,
|
|
312
|
+
onChange: (e) => ie(e || null),
|
|
313
|
+
placeholder: m("filter.selectMonth"),
|
|
314
|
+
minDate: /* @__PURE__ */ new Date("2000-01-01"),
|
|
315
|
+
maxDate: /* @__PURE__ */ new Date("2100-12-31"),
|
|
316
|
+
className: "w-full bg-canvas-elevated",
|
|
317
|
+
showFooter: !1,
|
|
264
318
|
onFocus: () => f(!0),
|
|
265
319
|
onBlur: () => f(!1)
|
|
266
320
|
}
|
|
267
|
-
) :
|
|
268
|
-
|
|
321
|
+
) : /* @__PURE__ */ a(
|
|
322
|
+
ge,
|
|
269
323
|
{
|
|
270
|
-
value:
|
|
271
|
-
onChange: (e) =>
|
|
324
|
+
value: le || void 0,
|
|
325
|
+
onChange: (e) => oe(e || null),
|
|
272
326
|
placeholder: m("filter.selectDate"),
|
|
273
327
|
format: "MM-dd-yyyy",
|
|
274
328
|
minDate: /* @__PURE__ */ new Date("2000-01-01"),
|
|
@@ -277,38 +331,38 @@ const Ge = {
|
|
|
277
331
|
onFocus: () => f(!0),
|
|
278
332
|
onBlur: () => f(!1)
|
|
279
333
|
}
|
|
280
|
-
) : /* @__PURE__ */
|
|
281
|
-
|
|
334
|
+
) : /* @__PURE__ */ a(
|
|
335
|
+
Fe,
|
|
282
336
|
{
|
|
283
|
-
value:
|
|
284
|
-
onChange:
|
|
337
|
+
value: W,
|
|
338
|
+
onChange: ne,
|
|
285
339
|
placeholder: m("filter.search"),
|
|
286
340
|
type: "text",
|
|
287
341
|
autoFocus: !0,
|
|
288
|
-
ref:
|
|
342
|
+
ref: O,
|
|
289
343
|
onFocus: () => f(!0),
|
|
290
344
|
onBlur: () => f(!1),
|
|
291
|
-
suffix:
|
|
292
|
-
e.stopPropagation(),
|
|
293
|
-
}, className: "cursor-pointer text-navigation-muted hover:text-brand-variant-hover", children: /* @__PURE__ */
|
|
345
|
+
suffix: W && /* @__PURE__ */ a("button", { onClick: (e) => {
|
|
346
|
+
e.stopPropagation(), we();
|
|
347
|
+
}, className: "cursor-pointer text-navigation-muted hover:text-brand-variant-hover", children: /* @__PURE__ */ a(Me, { size: "xs" }) })
|
|
294
348
|
}
|
|
295
349
|
),
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
|
|
350
|
+
/* @__PURE__ */ M("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
351
|
+
N && /* @__PURE__ */ M(We, { children: [
|
|
352
|
+
/* @__PURE__ */ a(Ve, { asChild: !0, children: /* @__PURE__ */ M("div", { className: "relative group p-1 hover:bg-brand-tint rounded-md transition-colors cursor-pointer", children: [
|
|
353
|
+
/* @__PURE__ */ a(je, { size: "md", className: Oe("text-content-tertiary group-hover:text-brand-variant-hover", ue && "text-brand-variant-hover") }),
|
|
354
|
+
ue && /* @__PURE__ */ a("span", { className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-brand border border-white shadow-sm" })
|
|
301
355
|
] }) }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
356
|
+
/* @__PURE__ */ M(Ge, { align: "end", className: "w-[300px]", children: [
|
|
357
|
+
/* @__PURE__ */ a(Le, { children: /* @__PURE__ */ a(_e, { children: m("gridHeader.activeFilters") }) }),
|
|
358
|
+
/* @__PURE__ */ M(Je, { className: "flex flex-col gap-4", children: [
|
|
359
|
+
F !== "text" && Ee && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
360
|
+
/* @__PURE__ */ a("span", { className: "text-xs font-semibold text-content-tertiary", children: m("gridHeader.textSearch") }),
|
|
361
|
+
/* @__PURE__ */ a(
|
|
362
|
+
Fe,
|
|
309
363
|
{
|
|
310
|
-
value:
|
|
311
|
-
onChange:
|
|
364
|
+
value: W,
|
|
365
|
+
onChange: ne,
|
|
312
366
|
placeholder: m("filter.searchPlaceholder"),
|
|
313
367
|
className: "bg-canvas-elevated",
|
|
314
368
|
onFocus: () => f(!0),
|
|
@@ -316,30 +370,40 @@ const Ge = {
|
|
|
316
370
|
}
|
|
317
371
|
)
|
|
318
372
|
] }),
|
|
319
|
-
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
373
|
+
F !== "set" && ce && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
374
|
+
/* @__PURE__ */ a("span", { className: "text-xs font-semibold text-content-tertiary", children: m("gridHeader.selectionFilter") }),
|
|
375
|
+
/* @__PURE__ */ a(
|
|
376
|
+
xe,
|
|
323
377
|
{
|
|
324
|
-
options:
|
|
325
|
-
value:
|
|
326
|
-
onChange:
|
|
327
|
-
isMulti:
|
|
378
|
+
options: S,
|
|
379
|
+
value: ae(),
|
|
380
|
+
onChange: de,
|
|
381
|
+
isMulti: D !== void 0 ? D : c?.cellDataType !== "boolean",
|
|
328
382
|
placeholder: m("filter.select"),
|
|
329
383
|
className: "w-full bg-canvas-elevated",
|
|
330
|
-
isLoading:
|
|
384
|
+
isLoading: Z,
|
|
331
385
|
onFocus: () => f(!0),
|
|
332
386
|
onBlur: () => f(!1)
|
|
333
387
|
}
|
|
334
388
|
)
|
|
335
389
|
] }),
|
|
336
|
-
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
|
|
390
|
+
F !== "date" && fe && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
391
|
+
/* @__PURE__ */ a("span", { className: "text-xs font-semibold text-content-tertiary", children: m("gridHeader.dateFilter") }),
|
|
392
|
+
b ? /* @__PURE__ */ a(
|
|
393
|
+
ye,
|
|
394
|
+
{
|
|
395
|
+
value: re || void 0,
|
|
396
|
+
onChange: (e) => ie(e || null),
|
|
397
|
+
className: "w-full bg-canvas-elevated",
|
|
398
|
+
showFooter: !1,
|
|
399
|
+
onFocus: () => f(!0),
|
|
400
|
+
onBlur: () => f(!1)
|
|
401
|
+
}
|
|
402
|
+
) : /* @__PURE__ */ a(
|
|
403
|
+
ge,
|
|
340
404
|
{
|
|
341
|
-
value:
|
|
342
|
-
onChange: (e) =>
|
|
405
|
+
value: le || void 0,
|
|
406
|
+
onChange: (e) => oe(e || null),
|
|
343
407
|
className: "w-full bg-canvas-elevated",
|
|
344
408
|
onFocus: () => f(!0),
|
|
345
409
|
onBlur: () => f(!1)
|
|
@@ -349,11 +413,11 @@ const Ge = {
|
|
|
349
413
|
] })
|
|
350
414
|
] })
|
|
351
415
|
] }),
|
|
352
|
-
|
|
353
|
-
|
|
416
|
+
Be(),
|
|
417
|
+
qe()
|
|
354
418
|
] })
|
|
355
419
|
] });
|
|
356
420
|
};
|
|
357
421
|
export {
|
|
358
|
-
|
|
422
|
+
ut as HeaderSearchInput
|
|
359
423
|
};
|