impact-nova 1.7.38 → 1.7.40
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/cell-renderers/editors/date-cell-editor.js +58 -48
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +0 -2
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +212 -218
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -2
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +97 -127
- package/dist/components/ui/ag-grid-react/headers/components/date-filter-picker.d.ts +39 -0
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +433 -299
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +33 -1
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +60 -26
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.d.ts +11 -10
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +284 -260
- package/dist/components/ui/ag-grid-react/index.js +24 -25
- package/dist/components/ui/create-item-flow/create-item-flow.js +1 -1
- package/dist/components/ui/data-table/column-indicator.d.ts +17 -0
- package/dist/components/ui/data-table/column-indicator.js +30 -0
- package/dist/components/ui/data-table/data-table-column-list.js +210 -154
- package/dist/components/ui/data-table/data-table.js +60 -59
- package/dist/components/ui/data-table/index.d.ts +3 -0
- package/dist/components/ui/data-table/index.js +34 -28
- package/dist/components/ui/data-table/indicator-legend.d.ts +8 -0
- package/dist/components/ui/data-table/indicator-legend.js +20 -0
- package/dist/components/ui/data-table/pin-switch.d.ts +30 -0
- package/dist/components/ui/data-table/pin-switch.js +75 -0
- package/dist/components/ui/date-picker/date-picker.js +65 -63
- package/dist/components/ui/date-picker/date-range-picker.js +77 -75
- package/dist/components/ui/nested-list/components/NestedListContent.js +7 -7
- package/dist/components/ui/nested-list/components/SortableItem.d.ts +10 -0
- package/dist/components/ui/nested-list/components/SortableItem.js +91 -83
- package/dist/components/ui/nested-list/nested-list.js +184 -178
- package/dist/components/ui/types/ag-grid.types.d.ts +16 -2
- package/dist/components/ui/types/date-picker.types.d.ts +4 -0
- package/dist/components/ui/types/nested-list.types.d.ts +12 -0
- package/dist/i18n/defaultMessages.d.ts +10 -0
- package/dist/i18n/defaultMessages.js +16 -8
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/kn.js +8 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +180 -174
- package/package.json +1 -1
- package/tailwind.config.js +16 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Calendar as
|
|
4
|
-
const
|
|
5
|
-
if (!(
|
|
1
|
+
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as O, useState as E, useImperativeHandle as $, useRef as M, useCallback as l, useEffect as L } from "react";
|
|
3
|
+
import { Calendar as F } from "../../../calendar.js";
|
|
4
|
+
const m = (n) => {
|
|
5
|
+
if (!(n == null || n === ""))
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
8
|
-
return isNaN(
|
|
7
|
+
const s = n instanceof Date ? n : new Date(String(n));
|
|
8
|
+
return isNaN(s.getTime()) ? void 0 : s;
|
|
9
9
|
} catch {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, H = O((n, s) => {
|
|
13
13
|
const {
|
|
14
|
-
value:
|
|
15
|
-
min:
|
|
16
|
-
max:
|
|
17
|
-
node:
|
|
18
|
-
column:
|
|
19
|
-
stopEditing:
|
|
20
|
-
} =
|
|
21
|
-
|
|
14
|
+
value: r,
|
|
15
|
+
min: f,
|
|
16
|
+
max: g,
|
|
17
|
+
node: u,
|
|
18
|
+
column: v,
|
|
19
|
+
stopEditing: h
|
|
20
|
+
} = n, c = r && typeof r == "object" && "value" in r, p = c ? r.cellMetadata : void 0, x = c ? r.value : r, b = m(x), [A, S] = E(b), [y, V] = E(b || /* @__PURE__ */ new Date());
|
|
21
|
+
$(s, () => ({
|
|
22
22
|
getValue() {
|
|
23
|
-
return
|
|
23
|
+
return r;
|
|
24
24
|
},
|
|
25
25
|
isCancelBeforeStart() {
|
|
26
26
|
return !1;
|
|
@@ -31,45 +31,55 @@ const p = (o) => {
|
|
|
31
31
|
isPopup() {
|
|
32
32
|
return !0;
|
|
33
33
|
}
|
|
34
|
-
}))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
}));
|
|
35
|
+
const C = M(null), w = M(!1), i = l(() => {
|
|
36
|
+
w.current || (w.current = !0, h());
|
|
37
|
+
}, [h]);
|
|
38
|
+
L(() => {
|
|
39
|
+
const e = "ag-custom-component-popup", a = (o) => {
|
|
40
|
+
o instanceof HTMLElement && o.hasAttribute("data-radix-popper-content-wrapper") && o.classList.add(e);
|
|
41
|
+
}, t = new MutationObserver((o) => {
|
|
42
|
+
for (const I of o)
|
|
43
|
+
I.addedNodes.forEach(a);
|
|
40
44
|
});
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
}), () =>
|
|
44
|
-
}, [])
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
return t.observe(document.body, { childList: !0, subtree: !0 }), document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach((o) => {
|
|
46
|
+
o.classList.add(e);
|
|
47
|
+
}), () => t.disconnect();
|
|
48
|
+
}, []), L(() => {
|
|
49
|
+
const e = (a) => {
|
|
50
|
+
const t = a.target;
|
|
51
|
+
t && (C.current?.contains(t) || t.closest("[data-radix-popper-content-wrapper]") || t.closest(".ag-custom-component-popup") || i());
|
|
52
|
+
};
|
|
53
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
54
|
+
}, [i]);
|
|
55
|
+
const d = l((e) => {
|
|
56
|
+
const a = v?.getColId();
|
|
57
|
+
if (a && u) {
|
|
58
|
+
const t = e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : null, o = c ? { value: t, ...p !== void 0 && { cellMetadata: p } } : t;
|
|
59
|
+
u.setDataValue(a, o);
|
|
50
60
|
}
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
61
|
+
i();
|
|
62
|
+
}, [v, u, i, c, p]), N = l((e) => {
|
|
63
|
+
S(e), d(e);
|
|
64
|
+
}, [d]), P = l(() => {
|
|
65
|
+
S(void 0), d(void 0);
|
|
66
|
+
}, [d]), R = f ? m(f) : void 0, j = g ? m(g) : void 0;
|
|
67
|
+
return /* @__PURE__ */ D("div", { ref: C, className: "ag-custom-component-popup bg-canvas-elevated border border-field rounded-md shadow-lg", children: /* @__PURE__ */ D(
|
|
68
|
+
F,
|
|
59
69
|
{
|
|
60
70
|
mode: "single",
|
|
61
|
-
selected:
|
|
62
|
-
onSelect:
|
|
63
|
-
month:
|
|
64
|
-
onMonthChange:
|
|
65
|
-
disabled: { before:
|
|
71
|
+
selected: A,
|
|
72
|
+
onSelect: N,
|
|
73
|
+
month: y,
|
|
74
|
+
onMonthChange: V,
|
|
75
|
+
disabled: { before: R, after: j },
|
|
66
76
|
showFooter: !1,
|
|
67
|
-
onClear:
|
|
77
|
+
onClear: P,
|
|
68
78
|
captionLayout: "dropdown"
|
|
69
79
|
}
|
|
70
80
|
) });
|
|
71
81
|
});
|
|
72
|
-
|
|
82
|
+
H.displayName = "DateCellEditor";
|
|
73
83
|
export {
|
|
74
|
-
|
|
84
|
+
H as DateCellEditor
|
|
75
85
|
};
|
package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ interface AdvancedFilterDialogProps {
|
|
|
13
13
|
value: string;
|
|
14
14
|
}>;
|
|
15
15
|
isMultiSelect?: boolean;
|
|
16
|
-
/** Which picker to render for date columns. Default: 'date' */
|
|
17
|
-
datePickerVariant?: 'date' | 'month';
|
|
18
16
|
initialModel?: AdvancedFilterModel | null;
|
|
19
17
|
api?: GridApi;
|
|
20
18
|
}
|
|
@@ -1,249 +1,243 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Dialog as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w } from "react";
|
|
3
|
+
import { Dialog as I, DialogContent as ee, DialogHeader as te, DialogTitle as le, DialogClose as oe, DialogBody as ne, DialogFooter as re } from "../../../dialog.js";
|
|
4
4
|
import { Button as v } from "../../../button.js";
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import { Cross as
|
|
7
|
-
import { ColumnFilterSection as
|
|
8
|
-
import { createEmptyRule as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
import { Tooltip as ae, TooltipTrigger as ie, TooltipContent as se } from "../../../tooltip.js";
|
|
6
|
+
import { Cross as ce } from "../../../../../icons/index.js";
|
|
7
|
+
import { ColumnFilterSection as $ } from "./column-filter-section.js";
|
|
8
|
+
import { generateFilterId as F, createEmptyRule as O } from "../utils/filter-utils.js";
|
|
9
|
+
import { DEFAULT_DATE_DISPLAY_FORMAT as j } from "../utils/date-utils.js";
|
|
10
|
+
import { useImpactNovaI18n as ue } from "../../../../../i18n/ImpactNovaI18nContext.js";
|
|
11
|
+
const M = (L) => {
|
|
12
|
+
const m = {};
|
|
13
|
+
return L.forEach((p) => {
|
|
14
|
+
p.columnId && (m[p.columnId] || (m[p.columnId] = []), m[p.columnId].push(p));
|
|
15
|
+
}), m;
|
|
16
|
+
}, Fe = ({
|
|
17
|
+
isOpen: L,
|
|
18
|
+
onClose: m,
|
|
19
|
+
onApply: p,
|
|
19
20
|
columnId: a,
|
|
20
|
-
columnLabel:
|
|
21
|
-
columnType:
|
|
22
|
-
selectOptions:
|
|
23
|
-
isMultiSelect:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
api: p
|
|
21
|
+
columnLabel: G,
|
|
22
|
+
columnType: y,
|
|
23
|
+
selectOptions: P,
|
|
24
|
+
isMultiSelect: H,
|
|
25
|
+
initialModel: k,
|
|
26
|
+
api: u
|
|
27
27
|
}) => {
|
|
28
|
-
const { t:
|
|
29
|
-
const e = {},
|
|
30
|
-
return Object.keys(
|
|
31
|
-
e[
|
|
32
|
-
}), e[a] || (e[a] = "OR"), e;
|
|
33
|
-
}), [
|
|
34
|
-
const e =
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
if (!e.some((
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
const { t: d } = ue(), q = () => (k?.rules || []).filter((e) => !("logic" in e)), [g, z] = w("column"), [D, A] = w(() => {
|
|
29
|
+
const e = {}, o = k?.columnLogic, l = q(), c = M(l);
|
|
30
|
+
return Object.keys(c).forEach((n) => {
|
|
31
|
+
e[n] = o?.[n] || k?.logic || "OR";
|
|
32
|
+
}), e[a] || (e[a] = o?.[a] || "OR"), e;
|
|
33
|
+
}), [b, E] = w(() => {
|
|
34
|
+
const e = q();
|
|
35
|
+
if (u) {
|
|
36
|
+
const l = u.getFilterModel();
|
|
37
|
+
l && Object.keys(l).forEach((n) => {
|
|
38
|
+
if (!e.some((t) => t.columnId === n)) {
|
|
39
|
+
const t = l[n];
|
|
40
|
+
let i = null;
|
|
41
|
+
if (t.filterType === "date") {
|
|
42
|
+
const s = t, T = u.getColumn(n)?.getColDef()?.headerComponentParams?.datePickerVariant, f = T === "week" || T === "month", X = s.type === "inRange" && f ? "equals" : s.type || "equals";
|
|
43
|
+
i = {
|
|
44
|
+
id: F(),
|
|
45
|
+
columnId: n,
|
|
46
|
+
columnType: "date",
|
|
47
|
+
operator: X,
|
|
48
|
+
value: s.dateFrom || "",
|
|
49
|
+
valueTo: s.dateTo || ""
|
|
50
|
+
};
|
|
51
|
+
} else if (t.filterType === "text")
|
|
52
|
+
i = {
|
|
53
|
+
id: F(),
|
|
54
|
+
columnId: n,
|
|
45
55
|
columnType: "text",
|
|
46
|
-
operator:
|
|
47
|
-
value:
|
|
56
|
+
operator: t.type === "contains" ? "contains" : "equals",
|
|
57
|
+
value: t.filter
|
|
48
58
|
};
|
|
49
|
-
else if (
|
|
50
|
-
|
|
51
|
-
id:
|
|
52
|
-
columnId:
|
|
59
|
+
else if (t.filterType === "number")
|
|
60
|
+
i = {
|
|
61
|
+
id: F(),
|
|
62
|
+
columnId: n,
|
|
53
63
|
columnType: "number",
|
|
54
|
-
operator:
|
|
55
|
-
value: String(
|
|
64
|
+
operator: t.type === "equals" ? "equals" : t.type || "equals",
|
|
65
|
+
value: String(t.filter)
|
|
56
66
|
};
|
|
57
|
-
else if (
|
|
58
|
-
|
|
59
|
-
id:
|
|
60
|
-
columnId:
|
|
67
|
+
else if (t.filterType === "set")
|
|
68
|
+
i = {
|
|
69
|
+
id: F(),
|
|
70
|
+
columnId: n,
|
|
61
71
|
columnType: "select",
|
|
62
72
|
operator: "equals",
|
|
63
|
-
value:
|
|
73
|
+
value: t.values
|
|
64
74
|
};
|
|
65
|
-
else if (
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
id:
|
|
69
|
-
columnId:
|
|
75
|
+
else if (t.filterType === "multi") {
|
|
76
|
+
const s = t.filterModels?.find((x) => x && x.filterType === "set");
|
|
77
|
+
s && (i = {
|
|
78
|
+
id: F(),
|
|
79
|
+
columnId: n,
|
|
70
80
|
columnType: "multi",
|
|
71
81
|
// or select?
|
|
72
82
|
operator: "equals",
|
|
73
|
-
value:
|
|
83
|
+
value: s.values
|
|
74
84
|
});
|
|
75
85
|
}
|
|
76
|
-
|
|
86
|
+
i && e.push(i);
|
|
77
87
|
}
|
|
78
88
|
});
|
|
79
89
|
}
|
|
80
|
-
return e.some((
|
|
81
|
-
}), [
|
|
82
|
-
allRules:
|
|
90
|
+
return e.some((l) => l.columnId === a) || e.push(O(a, y)), e;
|
|
91
|
+
}), [R] = w(() => ({
|
|
92
|
+
allRules: b,
|
|
83
93
|
// Use the computed rules (potentially synced)
|
|
84
|
-
columnLogic: { ...
|
|
85
|
-
})),
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
}),
|
|
94
|
+
columnLogic: { ...D }
|
|
95
|
+
})), U = JSON.stringify({ allRules: b, columnLogic: D }) !== JSON.stringify(R), B = (e) => b.filter((o) => o.columnId === e), N = (e, o) => {
|
|
96
|
+
E((l) => {
|
|
97
|
+
const c = /* @__PURE__ */ new Set(), n = [];
|
|
98
|
+
l.forEach((i) => {
|
|
99
|
+
c.has(i.columnId) || (c.add(i.columnId), n.push(i.columnId));
|
|
100
|
+
}), c.has(e) || n.push(e);
|
|
101
|
+
const t = [];
|
|
102
|
+
return n.forEach((i) => {
|
|
103
|
+
i === e ? t.push(...o) : t.push(...l.filter((s) => s.columnId === i));
|
|
104
|
+
}), t;
|
|
95
105
|
});
|
|
96
|
-
},
|
|
97
|
-
|
|
106
|
+
}, _ = (e) => D[e] || "OR", S = (e, o) => {
|
|
107
|
+
A((l) => ({ ...l, [e]: o }));
|
|
108
|
+
}, W = () => {
|
|
109
|
+
g === "column" ? (N(a, [O(a, y)]), S(a, "OR")) : (E([O(a, y)]), A({ [a]: "OR" }));
|
|
110
|
+
}, Y = () => {
|
|
111
|
+
E(R.allRules.length > 0 ? R.allRules : [O(a, y)]), A(R.columnLogic);
|
|
98
112
|
}, K = () => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
g.filter((e) => e.operator === "empty" || e.operator === "notEmpty" ? !!e.columnId : e.columnId && e.value !== "" && e.value !== null)
|
|
113
|
-
)).length <= 1, $ = (e, n) => {
|
|
114
|
-
if (!p) return n;
|
|
115
|
-
const t = p.getColumn(e);
|
|
116
|
-
if (!t) return n;
|
|
117
|
-
const s = t.getColDef(), i = [];
|
|
118
|
-
let l = t.getParent();
|
|
119
|
-
for (; l; ) {
|
|
120
|
-
const c = l.getColGroupDef();
|
|
121
|
-
c && c.headerName && i.unshift(c.headerName), l = l.getParent();
|
|
113
|
+
const e = b.filter((o) => o.operator === "empty" || o.operator === "notEmpty" ? !!o.columnId : o.columnId && o.value !== "" && o.value !== null);
|
|
114
|
+
e.length === 0 ? p(null) : p({ logic: "OR", rules: e, columnLogic: { ...D } }), m();
|
|
115
|
+
}, Q = M(b), J = Object.keys(Q), C = Object.keys(M(
|
|
116
|
+
b.filter((e) => e.operator === "empty" || e.operator === "notEmpty" ? !!e.columnId : e.columnId && e.value !== "" && e.value !== null)
|
|
117
|
+
)).length <= 1, V = (e, o) => {
|
|
118
|
+
if (!u) return o;
|
|
119
|
+
const l = u.getColumn(e);
|
|
120
|
+
if (!l) return o;
|
|
121
|
+
const c = l.getColDef(), n = [];
|
|
122
|
+
let t = l.getParent();
|
|
123
|
+
for (; t; ) {
|
|
124
|
+
const s = t.getColGroupDef();
|
|
125
|
+
s && s.headerName && n.unshift(s.headerName), t = t.getParent();
|
|
122
126
|
}
|
|
123
|
-
const
|
|
124
|
-
return
|
|
127
|
+
const i = c?.headerName || e;
|
|
128
|
+
return n.push(i), n.join(" > ");
|
|
125
129
|
};
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */ f(_, { className: "w-[800px] max-w-[95vw] max-h-[90vh] flex flex-col p-0", hideClose: !0, children: [
|
|
134
|
-
/* @__PURE__ */ f(I, { className: "flex flex-row items-center justify-between px-4 py-3", children: [
|
|
135
|
-
/* @__PURE__ */ r(ee, { children: u("advancedFilter.title") }),
|
|
136
|
-
/* @__PURE__ */ r(te, { asChild: !0, children: /* @__PURE__ */ r(v, { variant: "ghost", size: "icon", className: "h-8 w-8 p-0 text-content-tertiary hover:text-brand-variant-hover", onClick: d, "aria-label": u("aria.close"), children: /* @__PURE__ */ r(ie, { size: 14 }) }) })
|
|
137
|
-
] }),
|
|
138
|
-
/* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-4 pb-2", children: [
|
|
139
|
-
/* @__PURE__ */ f("div", { className: "inline-flex", role: "group", "data-component": "button-group", children: [
|
|
140
|
-
/* @__PURE__ */ r(
|
|
141
|
-
v,
|
|
142
|
-
{
|
|
143
|
-
value: "column",
|
|
144
|
-
size: "md",
|
|
145
|
-
variant: "ghost",
|
|
146
|
-
"aria-pressed": h === "column",
|
|
147
|
-
className: `!shadow-none relative border transition-colors min-w-14 !rounded-none !rounded-l-md z-[1] ${h === "column" ? "!bg-accent !border-brand !text-brand z-10" : "!bg-canvas-elevated !border-button-primary-disabled !text-[#60697d] hover:!bg-canvas-elevated hover:!text-brand"}`,
|
|
148
|
-
onClick: () => P("column"),
|
|
149
|
-
children: u("advancedFilter.currentColumn")
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ f(re, { children: [
|
|
153
|
-
/* @__PURE__ */ r(oe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
154
|
-
"span",
|
|
155
|
-
{
|
|
156
|
-
style: {
|
|
157
|
-
cursor: y ? "not-allowed" : "default",
|
|
158
|
-
display: "inline-flex"
|
|
159
|
-
},
|
|
160
|
-
children: /* @__PURE__ */ r(
|
|
161
|
-
v,
|
|
162
|
-
{
|
|
163
|
-
value: "global",
|
|
164
|
-
size: "md",
|
|
165
|
-
variant: "ghost",
|
|
166
|
-
"aria-pressed": h === "global",
|
|
167
|
-
disabled: y,
|
|
168
|
-
style: y ? { pointerEvents: "none" } : void 0,
|
|
169
|
-
className: `!shadow-none relative border transition-colors min-w-14 !rounded-none !rounded-r-md -ml-px ${y ? "!bg-disabled-surface !border-disabled-border !text-disabled-foreground opacity-100" : h === "global" ? "!bg-accent !border-brand !text-brand z-10" : "!bg-canvas-elevated !border-button-primary-disabled !text-[#60697d] hover:!bg-canvas-elevated hover:!text-brand z-[1]"}`,
|
|
170
|
-
onClick: () => P("global"),
|
|
171
|
-
children: u("advancedFilter.allFilters")
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
}
|
|
175
|
-
) }),
|
|
176
|
-
y && /* @__PURE__ */ r(ae, { variant: "tertiary", children: u("advancedFilter.allFiltersDisabledTooltip") })
|
|
177
|
-
] })
|
|
178
|
-
] }),
|
|
179
|
-
/* @__PURE__ */ r(v, { variant: "ghost", onClick: K, className: "!text-brand", children: u("advancedFilter.clearAll") })
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ r(le, { className: "px-0 py-4 flex-1 overflow-y-auto min-h-0", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-6 w-full px-4", children: h === "column" ? (
|
|
182
|
-
// Column Mode: Single column section
|
|
183
|
-
/* @__PURE__ */ r(
|
|
184
|
-
B,
|
|
185
|
-
{
|
|
186
|
-
columnId: a,
|
|
187
|
-
columnLabel: $(a, V),
|
|
188
|
-
columnType: C,
|
|
189
|
-
selectOptions: A,
|
|
190
|
-
isMultiSelect: A ? !!J : !0,
|
|
191
|
-
datePickerVariant: G,
|
|
192
|
-
rules: q(a),
|
|
193
|
-
logic: T(a),
|
|
194
|
-
onLogicChange: (e) => L(a, e),
|
|
195
|
-
onRulesChange: (e) => D(a, e)
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
) : (
|
|
199
|
-
// Global Mode: All columns with filters
|
|
200
|
-
/* @__PURE__ */ r(Y, { children: M.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center py-8 text-content-placeholder", children: u("advancedFilter.noFiltersApplied") }) : M.map((e, n) => {
|
|
201
|
-
let t = null;
|
|
202
|
-
if (p) {
|
|
203
|
-
const b = p.getColumn(e);
|
|
204
|
-
b && (t = b.getColDef());
|
|
205
|
-
}
|
|
206
|
-
const s = t?.headerComponentParams, i = t?.headerName || e, l = $(e, i), o = t?.filter === "agNumberColumnFilter" ? "number" : t?.filter === "agDateColumnFilter" ? "date" : t?.filter === "agMultiColumnFilter" ? "multi" : t?.filter === "agSetColumnFilter" || s?.selectOptions ? "select" : "text";
|
|
207
|
-
console.log(`[AdvancedFilterDialog] Column: ${e}, Type: ${o}, Filter: ${t?.filter}`);
|
|
208
|
-
const c = s?.selectOptions, N = s?.isMultiSelect, X = s?.datePickerVariant || "date";
|
|
209
|
-
return /* @__PURE__ */ f("div", { children: [
|
|
210
|
-
n > 0 && /* @__PURE__ */ r("hr", { className: "border-stroke-hairline mb-6" }),
|
|
211
|
-
/* @__PURE__ */ r(
|
|
212
|
-
B,
|
|
213
|
-
{
|
|
214
|
-
columnId: e,
|
|
215
|
-
columnLabel: l,
|
|
216
|
-
columnType: o,
|
|
217
|
-
selectOptions: c,
|
|
218
|
-
isMultiSelect: N,
|
|
219
|
-
datePickerVariant: X,
|
|
220
|
-
rules: q(e),
|
|
221
|
-
logic: T(e),
|
|
222
|
-
onLogicChange: (b) => L(e, b),
|
|
223
|
-
onRulesChange: (b) => D(e, b),
|
|
224
|
-
canDeleteLastRule: !0,
|
|
225
|
-
onDeleteColumnFilter: () => D(e, [])
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
] }, e);
|
|
229
|
-
}) })
|
|
230
|
-
) }) }),
|
|
231
|
-
/* @__PURE__ */ r(ne, { className: "flex justify-end border-t border-[#D9DDE7]", children: /* @__PURE__ */ f("div", { className: "flex gap-3", children: [
|
|
130
|
+
return /* @__PURE__ */ r(I, { open: L, onOpenChange: m, children: /* @__PURE__ */ h(ee, { className: "w-[800px] max-w-[95vw] max-h-[90vh] flex flex-col p-0", hideClose: !0, children: [
|
|
131
|
+
/* @__PURE__ */ h(te, { className: "flex flex-row items-center justify-between px-4 py-3", children: [
|
|
132
|
+
/* @__PURE__ */ r(le, { children: d("advancedFilter.title") }),
|
|
133
|
+
/* @__PURE__ */ r(oe, { asChild: !0, children: /* @__PURE__ */ r(v, { variant: "ghost", size: "icon", className: "h-8 w-8 p-0 text-content-tertiary hover:text-brand-variant-hover", onClick: m, "aria-label": d("aria.close"), children: /* @__PURE__ */ r(ce, { size: 14 }) }) })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-4 pb-2", children: [
|
|
136
|
+
/* @__PURE__ */ h("div", { className: "inline-flex", role: "group", "data-component": "button-group", children: [
|
|
232
137
|
/* @__PURE__ */ r(
|
|
233
138
|
v,
|
|
234
139
|
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
140
|
+
value: "column",
|
|
141
|
+
size: "md",
|
|
142
|
+
variant: "ghost",
|
|
143
|
+
"aria-pressed": g === "column",
|
|
144
|
+
className: `!shadow-none relative border transition-colors min-w-14 !rounded-none !rounded-l-md z-[1] ${g === "column" ? "!bg-accent !border-brand !text-brand z-10" : "!bg-canvas-elevated !border-button-primary-disabled !text-[#60697d] hover:!bg-canvas-elevated hover:!text-brand"}`,
|
|
145
|
+
onClick: () => z("column"),
|
|
146
|
+
children: d("advancedFilter.currentColumn")
|
|
239
147
|
}
|
|
240
148
|
),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
149
|
+
/* @__PURE__ */ h(ae, { children: [
|
|
150
|
+
/* @__PURE__ */ r(ie, { asChild: !0, children: /* @__PURE__ */ r(
|
|
151
|
+
"span",
|
|
152
|
+
{
|
|
153
|
+
style: {
|
|
154
|
+
cursor: C ? "not-allowed" : "default",
|
|
155
|
+
display: "inline-flex"
|
|
156
|
+
},
|
|
157
|
+
children: /* @__PURE__ */ r(
|
|
158
|
+
v,
|
|
159
|
+
{
|
|
160
|
+
value: "global",
|
|
161
|
+
size: "md",
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
"aria-pressed": g === "global",
|
|
164
|
+
disabled: C,
|
|
165
|
+
style: C ? { pointerEvents: "none" } : void 0,
|
|
166
|
+
className: `!shadow-none relative border transition-colors min-w-14 !rounded-none !rounded-r-md -ml-px ${C ? "!bg-disabled-surface !border-disabled-border !text-disabled-foreground opacity-100" : g === "global" ? "!bg-accent !border-brand !text-brand z-10" : "!bg-canvas-elevated !border-button-primary-disabled !text-[#60697d] hover:!bg-canvas-elevated hover:!text-brand z-[1]"}`,
|
|
167
|
+
onClick: () => z("global"),
|
|
168
|
+
children: d("advancedFilter.allFilters")
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
) }),
|
|
173
|
+
C && /* @__PURE__ */ r(se, { variant: "tertiary", children: d("advancedFilter.allFiltersDisabledTooltip") })
|
|
174
|
+
] })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ r(v, { variant: "ghost", onClick: W, className: "!text-brand", children: d("advancedFilter.clearAll") })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ r(ne, { className: "px-0 py-4 flex-1 overflow-y-auto min-h-0", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-6 w-full px-4", children: g === "column" ? (
|
|
179
|
+
// Column Mode: Single column section
|
|
180
|
+
/* @__PURE__ */ r(
|
|
181
|
+
$,
|
|
182
|
+
{
|
|
183
|
+
columnId: a,
|
|
184
|
+
columnLabel: V(a, G),
|
|
185
|
+
columnType: y,
|
|
186
|
+
selectOptions: P,
|
|
187
|
+
isMultiSelect: P ? !!H : !0,
|
|
188
|
+
rules: B(a),
|
|
189
|
+
logic: _(a),
|
|
190
|
+
onLogicChange: (e) => S(a, e),
|
|
191
|
+
onRulesChange: (e) => N(a, e),
|
|
192
|
+
dateDisplayFormat: u ? u.getColumn(a)?.getColDef()?.headerComponentParams?.dateDisplayFormat || j : j
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
) : (
|
|
196
|
+
// Global Mode: All columns with filters
|
|
197
|
+
/* @__PURE__ */ r(Z, { children: J.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center py-8 text-content-placeholder", children: d("advancedFilter.noFiltersApplied") }) : J.map((e, o) => {
|
|
198
|
+
let l = null;
|
|
199
|
+
if (u) {
|
|
200
|
+
const f = u.getColumn(e);
|
|
201
|
+
f && (l = f.getColDef());
|
|
202
|
+
}
|
|
203
|
+
const c = l?.headerComponentParams, n = l?.headerName || e, t = V(e, n), i = l?.filter === "agNumberColumnFilter" ? "number" : l?.filter === "agDateColumnFilter" ? "date" : l?.filter === "agMultiColumnFilter" ? "multi" : l?.filter === "agSetColumnFilter" || c?.selectOptions ? "select" : "text", s = c?.selectOptions, x = c?.isMultiSelect, T = c?.dateDisplayFormat || j;
|
|
204
|
+
return /* @__PURE__ */ h("div", { children: [
|
|
205
|
+
o > 0 && /* @__PURE__ */ r("hr", { className: "border-stroke-hairline mb-6" }),
|
|
206
|
+
/* @__PURE__ */ r(
|
|
207
|
+
$,
|
|
208
|
+
{
|
|
209
|
+
columnId: e,
|
|
210
|
+
columnLabel: t,
|
|
211
|
+
columnType: i,
|
|
212
|
+
selectOptions: s,
|
|
213
|
+
isMultiSelect: x,
|
|
214
|
+
rules: B(e),
|
|
215
|
+
logic: _(e),
|
|
216
|
+
onLogicChange: (f) => S(e, f),
|
|
217
|
+
onRulesChange: (f) => N(e, f),
|
|
218
|
+
canDeleteLastRule: !0,
|
|
219
|
+
onDeleteColumnFilter: () => N(e, []),
|
|
220
|
+
dateDisplayFormat: T
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] }, e);
|
|
224
|
+
}) })
|
|
225
|
+
) }) }),
|
|
226
|
+
/* @__PURE__ */ r(re, { className: "flex justify-end border-t border-[#D9DDE7]", children: /* @__PURE__ */ h("div", { className: "flex gap-3", children: [
|
|
227
|
+
/* @__PURE__ */ r(
|
|
228
|
+
v,
|
|
229
|
+
{
|
|
230
|
+
onClick: Y,
|
|
231
|
+
variant: "secondary",
|
|
232
|
+
disabled: !U,
|
|
233
|
+
children: d("advancedFilter.discard")
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ r(v, { onClick: K, variant: "default", children: d("advancedFilter.apply") })
|
|
237
|
+
] }) })
|
|
238
|
+
] }) });
|
|
245
239
|
};
|
|
246
240
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
241
|
+
Fe as AdvancedFilterDialog,
|
|
242
|
+
Fe as default
|
|
249
243
|
};
|
|
@@ -9,14 +9,14 @@ export interface ColumnFilterSectionProps {
|
|
|
9
9
|
value: string;
|
|
10
10
|
}>;
|
|
11
11
|
isMultiSelect?: boolean;
|
|
12
|
-
/** Which picker to render for date columns. Default: 'date' */
|
|
13
|
-
datePickerVariant?: 'date' | 'month';
|
|
14
12
|
rules: AdvancedFilterRule[];
|
|
15
13
|
logic: 'AND' | 'OR';
|
|
16
14
|
onLogicChange: (logic: 'AND' | 'OR') => void;
|
|
17
15
|
onRulesChange: (rules: AdvancedFilterRule[]) => void;
|
|
18
16
|
canDeleteLastRule?: boolean;
|
|
19
17
|
onDeleteColumnFilter?: () => void;
|
|
18
|
+
/** Display format for dates in this column (date-fns token string). Default: "MM/dd/yyyy" */
|
|
19
|
+
dateDisplayFormat?: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* ColumnFilterSection - Self-contained filter UI for one column.
|