impact-nova 1.7.2 → 1.7.4
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/headers/utils/filter-utils.js +58 -47
- package/dist/components/ui/ag-grid-react/index.js +86 -84
- package/dist/components/ui/ag-grid-react/theme.js +3 -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/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,5 +1,5 @@
|
|
|
1
|
-
import { getTodayStr as
|
|
2
|
-
const
|
|
1
|
+
import { getTodayStr as M, getYesterdayStr as F, getMonthRange as S, getYearRange as W } from "./date-utils.js";
|
|
2
|
+
const v = {
|
|
3
3
|
yes: !0,
|
|
4
4
|
true: !0,
|
|
5
5
|
"[x]": !0,
|
|
@@ -45,34 +45,34 @@ function w(a) {
|
|
|
45
45
|
date: t.findIndex((n) => (typeof n == "string" ? n : n.filter) === "agDateColumnFilter")
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function d(a) {
|
|
49
49
|
const t = a.toLowerCase().trim();
|
|
50
|
-
return t === "today" ?
|
|
50
|
+
return t === "today" ? M() : t === "yesterday" ? F() : a;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function q(a, t = !1, n = !1) {
|
|
53
53
|
const r = a.trim();
|
|
54
54
|
if (!r)
|
|
55
55
|
return { operator: "contains", value: "" };
|
|
56
56
|
if (r === '""') return { operator: "empty", value: "" };
|
|
57
57
|
if (r === '!""') return { operator: "notEmpty", value: "" };
|
|
58
58
|
if (r.startsWith("!="))
|
|
59
|
-
return { operator: "notEqual", value:
|
|
59
|
+
return { operator: "notEqual", value: d(r.slice(2)) };
|
|
60
60
|
if (r.startsWith("=="))
|
|
61
|
-
return { operator: "equals", value:
|
|
61
|
+
return { operator: "equals", value: d(r.slice(2)) };
|
|
62
62
|
if (r.startsWith("=")) {
|
|
63
63
|
const e = r.slice(1).trim(), l = e.toLowerCase();
|
|
64
|
-
return
|
|
64
|
+
return v[l] !== void 0 ? { operator: "equals", value: String(v[l]) } : { operator: "equals", value: d(e) };
|
|
65
65
|
}
|
|
66
66
|
if (r.startsWith("!"))
|
|
67
|
-
return { operator: "notContains", value:
|
|
67
|
+
return { operator: "notContains", value: d(r.slice(1)) };
|
|
68
68
|
if (r.startsWith(">="))
|
|
69
|
-
return { operator: "greaterThanOrEqual", value:
|
|
69
|
+
return { operator: "greaterThanOrEqual", value: d(r.slice(2)) };
|
|
70
70
|
if (r.startsWith(">"))
|
|
71
|
-
return { operator: "greaterThan", value:
|
|
71
|
+
return { operator: "greaterThan", value: d(r.slice(1)) };
|
|
72
72
|
if (r.startsWith("<="))
|
|
73
|
-
return { operator: "lessThanOrEqual", value:
|
|
73
|
+
return { operator: "lessThanOrEqual", value: d(r.slice(2)) };
|
|
74
74
|
if (r.startsWith("<"))
|
|
75
|
-
return { operator: "lessThan", value:
|
|
75
|
+
return { operator: "lessThan", value: d(r.slice(1)) };
|
|
76
76
|
if (r.startsWith("*") && r.length > 1 && !r.endsWith("*"))
|
|
77
77
|
return { operator: "endsWith", value: r.slice(1).trim() };
|
|
78
78
|
if (r.endsWith("*") && r.length > 1 && !r.startsWith("*"))
|
|
@@ -84,11 +84,11 @@ function v(a, t = !1, n = !1) {
|
|
|
84
84
|
if (f)
|
|
85
85
|
return { operator: "inRange", value: f[1], valueTo: f[2] };
|
|
86
86
|
const c = r.toLowerCase();
|
|
87
|
-
if (t &&
|
|
88
|
-
return { operator: "equals", value: String(
|
|
87
|
+
if (t && v[c] !== void 0)
|
|
88
|
+
return { operator: "equals", value: String(v[c]) };
|
|
89
89
|
if (n) {
|
|
90
|
-
if (c === "today") return { operator: "equals", value:
|
|
91
|
-
if (c === "yesterday") return { operator: "equals", value:
|
|
90
|
+
if (c === "today") return { operator: "equals", value: M() };
|
|
91
|
+
if (c === "yesterday") return { operator: "equals", value: F() };
|
|
92
92
|
if (/^\d{4}$/.test(r)) {
|
|
93
93
|
const l = W(Number(r));
|
|
94
94
|
return { operator: "inRange", value: l.from, valueTo: l.to };
|
|
@@ -112,18 +112,18 @@ function I(a, t = !1, n = !1, r = !1) {
|
|
|
112
112
|
return { conditions: [], logic: "OR", matchAll: !0 };
|
|
113
113
|
const f = i.includes("+") || i.includes("&"), c = i.includes(",") || i.includes(";");
|
|
114
114
|
if (f)
|
|
115
|
-
return { conditions: i.split(/\s*[+&]\s*/).filter((o) => !!o.trim()).map((o) =>
|
|
115
|
+
return { conditions: i.split(/\s*[+&]\s*/).filter((o) => !!o.trim()).map((o) => q(o, n, r)).filter((o) => !!o.value), logic: "AND" };
|
|
116
116
|
if (c)
|
|
117
|
-
return { conditions: i.split(/\s*[,;]\s*/).filter((o) => !!o.trim()).map((o) =>
|
|
117
|
+
return { conditions: i.split(/\s*[,;]\s*/).filter((o) => !!o.trim()).map((o) => q(o, n, r)).filter((o) => !!o.value), logic: "OR" };
|
|
118
118
|
if (t) {
|
|
119
119
|
const l = i.split(/\s+/).filter((u) => !!u.trim());
|
|
120
120
|
if (l.length > 1) {
|
|
121
|
-
const u = l.map((o) =>
|
|
121
|
+
const u = l.map((o) => q(o, n, r)).filter((o) => !!o.value);
|
|
122
122
|
if (u.length > 1)
|
|
123
123
|
return { conditions: u, logic: "OR" };
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
const e =
|
|
126
|
+
const e = q(i, n, r);
|
|
127
127
|
return !e.value && e.operator === "contains" ? { conditions: [], logic: "OR" } : { conditions: [e], logic: "OR" };
|
|
128
128
|
}
|
|
129
129
|
function m(a) {
|
|
@@ -174,7 +174,7 @@ function $(a) {
|
|
|
174
174
|
return t;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const b = {
|
|
178
178
|
contains: "contains",
|
|
179
179
|
notContains: "notContains",
|
|
180
180
|
equals: "equals",
|
|
@@ -196,21 +196,21 @@ const F = {
|
|
|
196
196
|
lt: "lessThan",
|
|
197
197
|
lte: "lessThanOrEqual"
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function O(a, t) {
|
|
200
200
|
if (!t) return "";
|
|
201
201
|
if ("filterType" in t && t.filterType === "multi" && t.filterModels)
|
|
202
|
-
return t.filterModels.map((r) =>
|
|
202
|
+
return t.filterModels.map((r) => O(a, r)).filter((r) => !!r).join(", ");
|
|
203
203
|
if ("filterType" in t && t.filterType === "set" && t.values) {
|
|
204
204
|
const i = t.values || [];
|
|
205
205
|
return i.length === 0 ? "" : i.length === 1 ? m(i[0]) : `${m(i[0])} (+${i.length - 1})`;
|
|
206
206
|
}
|
|
207
207
|
if ("conditions" in t && t.conditions && t.operator) {
|
|
208
208
|
const r = t.operator === "AND" ? " + " : ", ";
|
|
209
|
-
return t.conditions.map((i) =>
|
|
209
|
+
return t.conditions.map((i) => O(a, i)).filter((i) => !!i).join(r);
|
|
210
210
|
}
|
|
211
211
|
const n = t;
|
|
212
212
|
if ("type" in n && n.type) {
|
|
213
|
-
const r = n.type, i =
|
|
213
|
+
const r = n.type, i = b[r] || r, f = n.filter !== void 0 ? String(n.filter) : n.dateFrom !== void 0 ? String(n.dateFrom) : "", c = n.filterTo !== void 0 ? String(n.filterTo) : n.dateTo !== void 0 ? String(n.dateTo) : void 0;
|
|
214
214
|
return $({
|
|
215
215
|
operator: i,
|
|
216
216
|
value: f,
|
|
@@ -221,13 +221,13 @@ function A(a, t) {
|
|
|
221
221
|
}
|
|
222
222
|
return "";
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function A() {
|
|
225
225
|
return Math.random().toString(36).substring(2, 11);
|
|
226
226
|
}
|
|
227
227
|
function j(a = "", t) {
|
|
228
228
|
const n = t === "number" || t === "date" || t === "select" ? "equals" : "contains";
|
|
229
229
|
return {
|
|
230
|
-
id:
|
|
230
|
+
id: A(),
|
|
231
231
|
columnId: a,
|
|
232
232
|
operator: n,
|
|
233
233
|
value: "",
|
|
@@ -267,7 +267,7 @@ function h(a) {
|
|
|
267
267
|
return "contains";
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function R(a, t, n) {
|
|
271
271
|
return n === "number" ? "number" : n === "date" ? "date" : n === "select" || n === "set" || Array.isArray(t) ? a === "notEqual" || a === "notContains" ? "text" : "set" : typeof t == "string" && /^\d{4}-\d{2}-\d{2}/.test(t) ? "date" : ["greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange"].includes(a) && t && !x(t) && !isNaN(Number(t)) || typeof t == "string" && t && /^-?\d+(\.\d+)?$/.test(t.trim()) ? "number" : "text";
|
|
272
272
|
}
|
|
273
273
|
function x(a) {
|
|
@@ -285,11 +285,11 @@ function D(a) {
|
|
|
285
285
|
if (f[0].columnType === "multi") {
|
|
286
286
|
const e = (s) => s.operator !== "equals" ? !1 : !!(Array.isArray(s.value) || ["select", "multi"].includes(s.columnType)), l = f.filter(e), u = f.filter((s) => !e(s)), o = [null, null];
|
|
287
287
|
if (u.length > 0) {
|
|
288
|
-
const s =
|
|
288
|
+
const s = E(u, "text", a.logic);
|
|
289
289
|
s && (o[0] = s);
|
|
290
290
|
}
|
|
291
291
|
if (l.length > 0) {
|
|
292
|
-
const s =
|
|
292
|
+
const s = E(l, "set", a.logic);
|
|
293
293
|
s && (o[1] = s);
|
|
294
294
|
}
|
|
295
295
|
(o[0] || o[1]) && (t[i] = {
|
|
@@ -297,13 +297,13 @@ function D(a) {
|
|
|
297
297
|
filterModels: o
|
|
298
298
|
});
|
|
299
299
|
} else {
|
|
300
|
-
const e =
|
|
300
|
+
const e = E(f, f[0].columnType, a.logic);
|
|
301
301
|
e && (t[i] = e);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
return console.log("[AdvancedFilter] Converted AG Grid filter model:", t), t;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function E(a, t, n = "OR") {
|
|
307
307
|
if (a.length === 0) return null;
|
|
308
308
|
const r = [];
|
|
309
309
|
a.forEach((e) => {
|
|
@@ -311,7 +311,7 @@ function q(a, t, n = "OR") {
|
|
|
311
311
|
r.push({
|
|
312
312
|
...e,
|
|
313
313
|
value: l,
|
|
314
|
-
id:
|
|
314
|
+
id: A()
|
|
315
315
|
// Unique ID for each condition
|
|
316
316
|
});
|
|
317
317
|
}) : r.push(e);
|
|
@@ -328,14 +328,14 @@ function q(a, t, n = "OR") {
|
|
|
328
328
|
}
|
|
329
329
|
const c = r;
|
|
330
330
|
if (c.length === 1) {
|
|
331
|
-
const e = c[0], l =
|
|
331
|
+
const e = c[0], l = R(e.operator, e.value, e.columnType);
|
|
332
332
|
if (l === "date" && typeof e.value == "string") {
|
|
333
333
|
const o = (s) => {
|
|
334
334
|
if (!s || Array.isArray(s)) return null;
|
|
335
335
|
if (/^\d{4}-\d{2}-\d{2}$/.test(s)) return s;
|
|
336
336
|
try {
|
|
337
|
-
const
|
|
338
|
-
return `${y}-${g}-${
|
|
337
|
+
const p = new Date(s), y = p.getFullYear(), g = String(p.getMonth() + 1).padStart(2, "0"), T = String(p.getDate()).padStart(2, "0");
|
|
338
|
+
return `${y}-${g}-${T}`;
|
|
339
339
|
} catch {
|
|
340
340
|
return s;
|
|
341
341
|
}
|
|
@@ -354,7 +354,11 @@ function q(a, t, n = "OR") {
|
|
|
354
354
|
const u = (o) => {
|
|
355
355
|
if (Array.isArray(o)) return o;
|
|
356
356
|
const s = e.columnType === "number";
|
|
357
|
-
|
|
357
|
+
if (l === "number" || s) {
|
|
358
|
+
const p = parseFloat(o);
|
|
359
|
+
return isNaN(p) ? o : p;
|
|
360
|
+
}
|
|
361
|
+
return o;
|
|
358
362
|
};
|
|
359
363
|
return e.operator === "inRange" ? {
|
|
360
364
|
type: h(e.operator),
|
|
@@ -373,21 +377,28 @@ function q(a, t, n = "OR") {
|
|
|
373
377
|
} else {
|
|
374
378
|
let e = "text";
|
|
375
379
|
const l = a.map((u) => {
|
|
376
|
-
const o = h(u.operator), s =
|
|
380
|
+
const o = h(u.operator), s = R(u.operator, u.value, u.columnType);
|
|
377
381
|
e === "text" && s !== "text" && s !== "set" && (e = s);
|
|
378
|
-
const
|
|
382
|
+
const p = (g) => {
|
|
383
|
+
if (Array.isArray(g)) return g;
|
|
384
|
+
if (s === "number") {
|
|
385
|
+
const T = parseFloat(g);
|
|
386
|
+
return isNaN(T) ? g : T;
|
|
387
|
+
}
|
|
388
|
+
return g;
|
|
389
|
+
};
|
|
379
390
|
let y = o;
|
|
380
391
|
return s === "number" && (["contains", "startsWith", "endsWith"].includes(o) ? y = "equals" : o === "notContains" && (y = "notEqual")), u.operator === "inRange" ? {
|
|
381
392
|
type: o,
|
|
382
|
-
filter:
|
|
383
|
-
filterTo:
|
|
393
|
+
filter: p(u.value),
|
|
394
|
+
filterTo: p(u.valueTo || ""),
|
|
384
395
|
filterType: s
|
|
385
396
|
} : u.operator === "empty" || u.operator === "notEmpty" ? {
|
|
386
397
|
type: o,
|
|
387
398
|
filterType: "text"
|
|
388
399
|
} : {
|
|
389
400
|
type: y,
|
|
390
|
-
filter:
|
|
401
|
+
filter: p(u.value),
|
|
391
402
|
filterType: s
|
|
392
403
|
};
|
|
393
404
|
});
|
|
@@ -409,9 +420,9 @@ function k(a) {
|
|
|
409
420
|
return c.conditions.flatMap((s) => i(s));
|
|
410
421
|
if ("filterType" in c && c.filterType === "multi" && c.filterModels)
|
|
411
422
|
return c.filterModels.flatMap((s) => s ? i(s) : []);
|
|
412
|
-
const e = c, l = "type" in e ? e.type : "equals", u = e.filterType === "set" ? "equals" :
|
|
423
|
+
const e = c, l = "type" in e ? e.type : "equals", u = e.filterType === "set" ? "equals" : b[l] || "contains", o = e.filter !== void 0 ? String(e.filter) : e.dateFrom !== void 0 ? String(e.dateFrom) : e.values ? e.values : "";
|
|
413
424
|
return [{
|
|
414
|
-
id:
|
|
425
|
+
id: A(),
|
|
415
426
|
columnId: n,
|
|
416
427
|
operator: u,
|
|
417
428
|
value: o,
|
|
@@ -432,8 +443,8 @@ export {
|
|
|
432
443
|
D as convertToAgGridFilterModel,
|
|
433
444
|
j as createEmptyRule,
|
|
434
445
|
$ as formatRuleForDisplay,
|
|
435
|
-
|
|
436
|
-
|
|
446
|
+
A as generateFilterId,
|
|
447
|
+
O as getDisplayStringFromFilterModel,
|
|
437
448
|
w as getMultiFilterIndices,
|
|
438
449
|
h as mapOperatorToAgGrid,
|
|
439
450
|
I as parseInputPattern
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as V, useRef as
|
|
1
|
+
import { jsxs as U, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as V, useRef as D, useState as f, useCallback as F, useMemo as y, useEffect as W, Suspense as _ } from "react";
|
|
3
3
|
import { ModuleRegistry as $, AllCommunityModule as q, ValidationModule as K } from "ag-grid-community";
|
|
4
|
-
import { AllEnterpriseModule as
|
|
5
|
-
import { AgGridReact as
|
|
6
|
-
import { customAgGridTheme as
|
|
4
|
+
import { AllEnterpriseModule as z } from "ag-grid-enterprise";
|
|
5
|
+
import { AgGridReact as J } from "ag-grid-react";
|
|
6
|
+
import { customAgGridTheme as X } from "./theme.js";
|
|
7
7
|
import { CustomHeader as B } from "./headers/custom-header.js";
|
|
8
8
|
import { CustomHeaderGroup as Q } from "./headers/custom-header-group.js";
|
|
9
|
-
import { GridHeaderContext as
|
|
10
|
-
import { convertToAgGridFilterModel as
|
|
11
|
-
import { ColumnSettingsMenu as
|
|
12
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
9
|
+
import { GridHeaderContext as Y } from "./headers/context/grid-header-context.js";
|
|
10
|
+
import { convertToAgGridFilterModel as Z, getMultiFilterIndices as ee, convertFromAgGridFilterModel as te } from "./headers/utils/filter-utils.js";
|
|
11
|
+
import { ColumnSettingsMenu as re } from "./headers/column-menu/column-settings-menu.js";
|
|
12
|
+
import { AG_GRID_VALUE_FORMATTERS as ne } from "./value-formatters.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
const
|
|
15
|
-
$.registerModules([q,
|
|
16
|
-
function
|
|
14
|
+
const oe = V(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
|
|
15
|
+
$.registerModules([q, z, K]);
|
|
16
|
+
function ye({
|
|
17
17
|
children: c,
|
|
18
|
-
defaultColDef:
|
|
18
|
+
defaultColDef: o,
|
|
19
19
|
defaultColGroupDef: i,
|
|
20
|
-
columnDefs:
|
|
20
|
+
columnDefs: g,
|
|
21
21
|
valueFormatters: d,
|
|
22
22
|
onGridReady: m,
|
|
23
23
|
...u
|
|
24
24
|
}) {
|
|
25
|
-
const r =
|
|
25
|
+
const r = D(null), s = D(null), [h, M] = f(null), [G, C] = f(!1), [b, x] = f(null), [R, S] = f(!1), [A, k] = f(null), [N, E] = f(null), O = F((e) => {
|
|
26
26
|
if (!r.current) return;
|
|
27
|
-
const t =
|
|
27
|
+
const t = Z(e);
|
|
28
28
|
r.current.setFilterModel(t), r.current.onFilterChanged();
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), v = y(() => ({
|
|
30
30
|
openSearch: (e) => {
|
|
31
31
|
if (!r.current) return;
|
|
32
32
|
const t = r.current.getGridOption("context") || {};
|
|
@@ -38,76 +38,78 @@ function Fe({
|
|
|
38
38
|
r.current.setGridOption("context", { ...e, activeSearchColumnId: null }), r.current.refreshHeader();
|
|
39
39
|
},
|
|
40
40
|
openAdvancedFilter: (e) => {
|
|
41
|
-
x(e || null),
|
|
41
|
+
x(e || null), C(!0);
|
|
42
42
|
},
|
|
43
43
|
closeAdvancedFilter: () => {
|
|
44
|
-
|
|
44
|
+
C(!1), x(null);
|
|
45
45
|
},
|
|
46
46
|
applyAdvancedFilter: (e) => {
|
|
47
|
-
|
|
47
|
+
O(e);
|
|
48
48
|
},
|
|
49
49
|
openMenu: (e, t) => {
|
|
50
|
-
k(e),
|
|
50
|
+
k(e), E(t), S(!0);
|
|
51
51
|
},
|
|
52
52
|
closeMenu: () => {
|
|
53
|
-
S(!1), k(null),
|
|
53
|
+
S(!1), k(null), E(null);
|
|
54
54
|
},
|
|
55
|
-
activeMenuColumnId:
|
|
56
|
-
}), [
|
|
55
|
+
activeMenuColumnId: A
|
|
56
|
+
}), [O, A]), T = F((e) => {
|
|
57
57
|
r.current = e.api, M(e.api), e.api.setGridOption("context", { activeSearchColumnId: null }), m && m(e);
|
|
58
58
|
}, [m]);
|
|
59
59
|
W(() => {
|
|
60
60
|
const e = s.current;
|
|
61
61
|
if (!e) return;
|
|
62
|
-
const t = (
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
66
|
-
const
|
|
62
|
+
const t = (n) => {
|
|
63
|
+
if (n.key !== "Enter" && n.key !== " ") return;
|
|
64
|
+
const l = n.target;
|
|
65
|
+
if (!l.classList.contains("ag-cell") && !l.classList.contains("ag-header-cell")) return;
|
|
66
|
+
const p = l.querySelector(
|
|
67
67
|
'button, [role="checkbox"], [role="switch"], [role="combobox"], [role="button"], [role="link"], a, input, select, textarea, .cursor-pointer'
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
p && (n.preventDefault(), n.stopPropagation(), p.click(), p.focus());
|
|
70
70
|
};
|
|
71
71
|
return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
|
|
72
72
|
}, []);
|
|
73
|
-
const
|
|
73
|
+
const H = y(() => ({
|
|
74
74
|
headerComponent: B,
|
|
75
|
-
...
|
|
75
|
+
...o,
|
|
76
76
|
suppressHeaderKeyboardEvent: (e) => {
|
|
77
|
-
const { event: t } = e;
|
|
77
|
+
const { event: t } = e, n = t.target;
|
|
78
|
+
if (n.tagName === "INPUT" || n.tagName === "TEXTAREA")
|
|
79
|
+
return !(t.key === "Enter" || t.key === "Escape" || t.key === "Tab");
|
|
78
80
|
if (t.key === "Enter" || t.key === " ") {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return t.preventDefault(),
|
|
81
|
+
const p = n.closest(".ag-header-cell");
|
|
82
|
+
if (p) {
|
|
83
|
+
const I = p.querySelector('[role="checkbox"], button, [role="switch"], input');
|
|
84
|
+
if (I)
|
|
85
|
+
return t.preventDefault(), I.click(), !0;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
|
-
return
|
|
88
|
+
return o?.suppressHeaderKeyboardEvent?.(e) ?? !1;
|
|
87
89
|
},
|
|
88
90
|
headerComponentParams: {
|
|
89
|
-
...
|
|
91
|
+
...o?.headerComponentParams
|
|
90
92
|
}
|
|
91
|
-
}), [
|
|
93
|
+
}), [o]), j = y(() => ({
|
|
92
94
|
headerGroupComponent: Q,
|
|
93
95
|
...i,
|
|
94
96
|
headerGroupComponentParams: {
|
|
95
97
|
...i?.headerGroupComponentParams
|
|
96
98
|
}
|
|
97
|
-
}), [i]), L =
|
|
98
|
-
...
|
|
99
|
+
}), [i]), L = y(() => ({
|
|
100
|
+
...ne,
|
|
99
101
|
// Always available - value formatters
|
|
100
102
|
...u.components,
|
|
101
103
|
// User components override
|
|
102
104
|
...d
|
|
103
105
|
// Optional custom formatters override defaults
|
|
104
|
-
}), [d, u.components]),
|
|
106
|
+
}), [d, u.components]), P = F((e) => {
|
|
105
107
|
if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
|
|
106
|
-
const t = Object.entries(e.value).map(([
|
|
108
|
+
const t = Object.entries(e.value).map(([n, l]) => l && typeof l == "object" && "value" in l ? l.value : typeof l != "object" && typeof l < "u" ? l : null).filter((n) => n != null);
|
|
107
109
|
return t.length > 0 ? t.join(" ") : "";
|
|
108
110
|
}
|
|
109
111
|
return e.value;
|
|
110
|
-
}, []), w =
|
|
112
|
+
}, []), w = F((e) => {
|
|
111
113
|
if (typeof e.value == "string") {
|
|
112
114
|
const t = e.value.trim();
|
|
113
115
|
if (t.startsWith("{") || t.startsWith("["))
|
|
@@ -119,18 +121,18 @@ function Fe({
|
|
|
119
121
|
}
|
|
120
122
|
return e.value;
|
|
121
123
|
}, []);
|
|
122
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ U(Y.Provider, { value: v, children: [
|
|
123
125
|
/* @__PURE__ */ a("div", { ref: s, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ a(
|
|
124
|
-
|
|
126
|
+
J,
|
|
125
127
|
{
|
|
126
|
-
theme:
|
|
127
|
-
defaultColDef:
|
|
128
|
-
columnDefs:
|
|
128
|
+
theme: X,
|
|
129
|
+
defaultColDef: H,
|
|
130
|
+
columnDefs: g,
|
|
129
131
|
cellSelection: !0,
|
|
130
132
|
defaultColGroupDef: j,
|
|
131
|
-
onGridReady:
|
|
133
|
+
onGridReady: T,
|
|
132
134
|
components: L,
|
|
133
|
-
processCellForClipboard:
|
|
135
|
+
processCellForClipboard: P,
|
|
134
136
|
processCellFromClipboard: w,
|
|
135
137
|
ensureDomOrder: !0,
|
|
136
138
|
suppressHeaderFocus: !1,
|
|
@@ -163,73 +165,73 @@ function Fe({
|
|
|
163
165
|
) }),
|
|
164
166
|
c,
|
|
165
167
|
/* @__PURE__ */ a(
|
|
166
|
-
|
|
168
|
+
le,
|
|
167
169
|
{
|
|
168
170
|
isOpen: G,
|
|
169
|
-
columnId:
|
|
170
|
-
gridApi:
|
|
171
|
-
onClose:
|
|
172
|
-
onApply:
|
|
171
|
+
columnId: b,
|
|
172
|
+
gridApi: h,
|
|
173
|
+
onClose: v.closeAdvancedFilter,
|
|
174
|
+
onApply: v.applyAdvancedFilter
|
|
173
175
|
}
|
|
174
176
|
),
|
|
175
177
|
/* @__PURE__ */ a(
|
|
176
|
-
|
|
178
|
+
ie,
|
|
177
179
|
{
|
|
178
180
|
isOpen: R,
|
|
179
|
-
columnId:
|
|
180
|
-
gridApi:
|
|
181
|
-
anchor:
|
|
182
|
-
onClose:
|
|
181
|
+
columnId: A,
|
|
182
|
+
gridApi: h,
|
|
183
|
+
anchor: N,
|
|
184
|
+
onClose: v.closeMenu
|
|
183
185
|
}
|
|
184
186
|
)
|
|
185
187
|
] });
|
|
186
188
|
}
|
|
187
|
-
function
|
|
189
|
+
function le({
|
|
188
190
|
isOpen: c,
|
|
189
|
-
columnId:
|
|
191
|
+
columnId: o,
|
|
190
192
|
gridApi: i,
|
|
191
|
-
onClose:
|
|
193
|
+
onClose: g,
|
|
192
194
|
onApply: d
|
|
193
195
|
}) {
|
|
194
|
-
if (!c || !
|
|
195
|
-
const m = i.getColumn(
|
|
196
|
+
if (!c || !o || !i) return null;
|
|
197
|
+
const m = i.getColumn(o);
|
|
196
198
|
if (!m) return null;
|
|
197
|
-
const u = m.getColDef(), r = u.headerComponentParams, s =
|
|
199
|
+
const u = m.getColDef(), r = u.headerComponentParams, s = ee(u), h = s.text !== -1 || s.number !== -1 || s.date !== -1, M = s.set !== -1, C = u.filter === "agMultiColumnFilter" && (h || M) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || r?.selectOptions ? "select" : "text", b = te(i.getFilterModel());
|
|
198
200
|
return /* @__PURE__ */ a(_, { fallback: null, children: /* @__PURE__ */ a(
|
|
199
|
-
|
|
201
|
+
oe,
|
|
200
202
|
{
|
|
201
203
|
isOpen: c,
|
|
202
|
-
onClose:
|
|
204
|
+
onClose: g,
|
|
203
205
|
onApply: d,
|
|
204
|
-
columnId:
|
|
205
|
-
columnLabel: u.headerName ||
|
|
206
|
-
columnType:
|
|
206
|
+
columnId: o,
|
|
207
|
+
columnLabel: u.headerName || o,
|
|
208
|
+
columnType: C,
|
|
207
209
|
selectOptions: r?.selectOptions,
|
|
208
210
|
isMultiSelect: r?.isMultiSelect,
|
|
209
|
-
initialModel:
|
|
211
|
+
initialModel: b,
|
|
210
212
|
api: i
|
|
211
213
|
}
|
|
212
214
|
) });
|
|
213
215
|
}
|
|
214
|
-
function
|
|
216
|
+
function ie({
|
|
215
217
|
isOpen: c,
|
|
216
|
-
columnId:
|
|
218
|
+
columnId: o,
|
|
217
219
|
gridApi: i,
|
|
218
|
-
anchor:
|
|
220
|
+
anchor: g,
|
|
219
221
|
onClose: d
|
|
220
222
|
}) {
|
|
221
|
-
return !c || !
|
|
222
|
-
|
|
223
|
+
return !c || !o || !i ? null : /* @__PURE__ */ a(
|
|
224
|
+
re,
|
|
223
225
|
{
|
|
224
226
|
isOpen: c,
|
|
225
|
-
columnId:
|
|
227
|
+
columnId: o,
|
|
226
228
|
gridApi: i,
|
|
227
|
-
anchor:
|
|
229
|
+
anchor: g,
|
|
228
230
|
onClose: d
|
|
229
231
|
}
|
|
230
232
|
);
|
|
231
233
|
}
|
|
232
234
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
ye as AgGridWrapper,
|
|
236
|
+
ye as default
|
|
235
237
|
};
|
|
@@ -9,6 +9,9 @@ const d = e.withPart(r).withParams({
|
|
|
9
9
|
checkboxCheckedBackgroundColor: "#ECEEFD",
|
|
10
10
|
checkboxCheckedBorderColor: "#4259EE",
|
|
11
11
|
checkboxCheckedShapeColor: "#4259EE",
|
|
12
|
+
checkboxIndeterminateBackgroundColor: "transparent",
|
|
13
|
+
checkboxIndeterminateBorderColor: "#4259EE",
|
|
14
|
+
checkboxIndeterminateShapeColor: "#4259EE",
|
|
12
15
|
columnBorder: !0,
|
|
13
16
|
columnDropCellBorder: !0,
|
|
14
17
|
fontFamily: "inherit",
|