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