impact-nova 1.7.39 → 1.7.41

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.
Files changed (44) hide show
  1. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +58 -48
  2. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +0 -2
  3. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +212 -218
  4. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -2
  5. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +97 -127
  6. package/dist/components/ui/ag-grid-react/headers/components/date-filter-picker.d.ts +39 -0
  7. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +433 -299
  8. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +33 -1
  9. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +60 -26
  10. package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.d.ts +11 -10
  11. package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +284 -260
  12. package/dist/components/ui/ag-grid-react/index.js +24 -25
  13. package/dist/components/ui/data-table/column-indicator.d.ts +17 -0
  14. package/dist/components/ui/data-table/column-indicator.js +30 -0
  15. package/dist/components/ui/data-table/data-table-column-list.js +210 -154
  16. package/dist/components/ui/data-table/data-table.js +60 -59
  17. package/dist/components/ui/data-table/index.d.ts +3 -0
  18. package/dist/components/ui/data-table/index.js +34 -28
  19. package/dist/components/ui/data-table/indicator-legend.d.ts +8 -0
  20. package/dist/components/ui/data-table/indicator-legend.js +20 -0
  21. package/dist/components/ui/data-table/pin-switch.d.ts +30 -0
  22. package/dist/components/ui/data-table/pin-switch.js +75 -0
  23. package/dist/components/ui/date-picker/date-picker.js +65 -63
  24. package/dist/components/ui/date-picker/date-range-picker.js +77 -75
  25. package/dist/components/ui/nested-list/components/NestedListContent.js +7 -7
  26. package/dist/components/ui/nested-list/components/SortableItem.d.ts +10 -0
  27. package/dist/components/ui/nested-list/components/SortableItem.js +91 -83
  28. package/dist/components/ui/nested-list/nested-list.js +184 -178
  29. package/dist/components/ui/types/ag-grid.types.d.ts +16 -2
  30. package/dist/components/ui/types/date-picker.types.d.ts +4 -0
  31. package/dist/components/ui/types/nested-list.types.d.ts +12 -0
  32. package/dist/i18n/defaultMessages.d.ts +10 -0
  33. package/dist/i18n/defaultMessages.js +16 -8
  34. package/dist/i18n/locales/de.js +8 -0
  35. package/dist/i18n/locales/es.js +8 -0
  36. package/dist/i18n/locales/hi.js +8 -0
  37. package/dist/i18n/locales/kn.js +8 -0
  38. package/dist/icons/assets/archive.svg.js +5 -0
  39. package/dist/icons/index.d.ts +1 -0
  40. package/dist/icons/index.js +280 -278
  41. package/dist/impact-nova.css +1 -1
  42. package/dist/index.js +180 -174
  43. package/package.json +1 -1
  44. package/tailwind.config.js +16 -0
@@ -1,26 +1,26 @@
1
- import { jsx as C } from "react/jsx-runtime";
2
- import { forwardRef as N, useState as S, useImperativeHandle as P, useEffect as j, useCallback as u } from "react";
3
- import { Calendar as I } from "../../../calendar.js";
4
- const p = (o) => {
5
- if (!(o == null || o === ""))
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 r = o instanceof Date ? o : new Date(String(o));
8
- return isNaN(r.getTime()) ? void 0 : r;
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
- }, O = N((o, r) => {
12
+ }, H = O((n, s) => {
13
13
  const {
14
- value: a,
15
- min: m,
16
- max: f,
17
- node: i,
18
- column: g,
19
- stopEditing: v
20
- } = o, s = a && typeof a == "object" && "value" in a, d = s ? a.cellMetadata : void 0, D = s ? a.value : a, h = p(D), [M, b] = S(h), [w, E] = S(h || /* @__PURE__ */ new Date());
21
- P(r, () => ({
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 a;
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
- })), j(() => {
35
- const e = "ag-custom-component-popup", l = (t) => {
36
- t instanceof HTMLElement && t.hasAttribute("data-radix-popper-content-wrapper") && t.classList.add(e);
37
- }, n = new MutationObserver((t) => {
38
- for (const V of t)
39
- V.addedNodes.forEach(l);
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 n.observe(document.body, { childList: !0, subtree: !0 }), document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach((t) => {
42
- t.classList.add(e);
43
- }), () => n.disconnect();
44
- }, []);
45
- const c = u((e) => {
46
- const l = g?.getColId();
47
- if (l && i) {
48
- const n = e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : null, t = s ? { value: n, ...d !== void 0 && { cellMetadata: d } } : n;
49
- i.setDataValue(l, t);
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
- v();
52
- }, [g, i, v, s, d]), A = u((e) => {
53
- b(e), c(e);
54
- }, [c]), x = u(() => {
55
- b(void 0), c(void 0);
56
- }, [c]), y = m ? p(m) : void 0, L = f ? p(f) : void 0;
57
- return /* @__PURE__ */ C("div", { className: "ag-custom-component-popup bg-canvas-elevated border border-field rounded-md shadow-lg", children: /* @__PURE__ */ C(
58
- I,
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: M,
62
- onSelect: A,
63
- month: w,
64
- onMonthChange: E,
65
- disabled: { before: y, after: L },
71
+ selected: A,
72
+ onSelect: N,
73
+ month: y,
74
+ onMonthChange: V,
75
+ disabled: { before: R, after: j },
66
76
  showFooter: !1,
67
- onClear: x,
77
+ onClear: P,
68
78
  captionLayout: "dropdown"
69
79
  }
70
80
  ) });
71
81
  });
72
- O.displayName = "DateCellEditor";
82
+ H.displayName = "DateCellEditor";
73
83
  export {
74
- O as DateCellEditor
84
+ H as DateCellEditor
75
85
  };
@@ -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 { jsxs as f, jsx as r, Fragment as Y } from "react/jsx-runtime";
2
- import { useState as R } from "react";
3
- import { Dialog as Z, DialogContent as _, DialogHeader as I, DialogTitle as ee, DialogClose as te, DialogBody as le, DialogFooter as ne } from "../../../dialog.js";
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 re, TooltipTrigger as oe, TooltipContent as ae } from "../../../tooltip.js";
6
- import { Cross as ie } from "../../../../../icons/index.js";
7
- import { ColumnFilterSection as B } from "./column-filter-section.js";
8
- import { createEmptyRule as w } from "../utils/filter-utils.js";
9
- import { useImpactNovaI18n as se } from "../../../../../i18n/ImpactNovaI18nContext.js";
10
- const j = (S) => {
11
- const d = {};
12
- return S.forEach((m) => {
13
- m.columnId && (d[m.columnId] || (d[m.columnId] = []), d[m.columnId].push(m));
14
- }), d;
15
- }, Ce = ({
16
- isOpen: S,
17
- onClose: d,
18
- onApply: m,
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: V,
21
- columnType: C,
22
- selectOptions: A,
23
- isMultiSelect: J,
24
- datePickerVariant: G = "date",
25
- initialModel: E,
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: u } = se(), z = () => (E?.rules || []).filter((e) => !("logic" in e)), [h, P] = R("column"), [x, O] = R(() => {
29
- const e = {}, n = z(), t = j(n);
30
- return Object.keys(t).forEach((s) => {
31
- e[s] = E?.logic || "OR";
32
- }), e[a] || (e[a] = "OR"), e;
33
- }), [g, k] = R(() => {
34
- const e = z();
35
- if (p) {
36
- const t = p.getFilterModel();
37
- t && Object.keys(t).forEach((i) => {
38
- if (!e.some((l) => l.columnId === i)) {
39
- const l = t[i];
40
- let o = null;
41
- if (l.filterType === "text")
42
- o = {
43
- id: Math.random().toString(36).substr(2, 9),
44
- columnId: i,
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: l.type === "contains" ? "contains" : "equals",
47
- value: l.filter
56
+ operator: t.type === "contains" ? "contains" : "equals",
57
+ value: t.filter
48
58
  };
49
- else if (l.filterType === "number")
50
- o = {
51
- id: Math.random().toString(36).substr(2, 9),
52
- columnId: i,
59
+ else if (t.filterType === "number")
60
+ i = {
61
+ id: F(),
62
+ columnId: n,
53
63
  columnType: "number",
54
- operator: l.type === "equals" ? "equals" : l.type || "equals",
55
- value: String(l.filter)
64
+ operator: t.type === "equals" ? "equals" : t.type || "equals",
65
+ value: String(t.filter)
56
66
  };
57
- else if (l.filterType === "set")
58
- o = {
59
- id: Math.random().toString(36).substr(2, 9),
60
- columnId: i,
67
+ else if (t.filterType === "set")
68
+ i = {
69
+ id: F(),
70
+ columnId: n,
61
71
  columnType: "select",
62
72
  operator: "equals",
63
- value: l.values
73
+ value: t.values
64
74
  };
65
- else if (l.filterType === "multi") {
66
- const c = l.filterModels?.find((N) => N && N.filterType === "set");
67
- c && (o = {
68
- id: Math.random().toString(36).substr(2, 9),
69
- columnId: i,
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: c.values
83
+ value: s.values
74
84
  });
75
85
  }
76
- o && e.push(o);
86
+ i && e.push(i);
77
87
  }
78
88
  });
79
89
  }
80
- return e.some((t) => t.columnId === a) || e.push(w(a, C)), e;
81
- }), [F] = R(() => ({
82
- allRules: g,
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: { ...x }
85
- })), H = JSON.stringify({ allRules: g, columnLogic: x }) !== JSON.stringify(F), q = (e) => g.filter((n) => n.columnId === e), D = (e, n) => {
86
- k((t) => {
87
- const s = /* @__PURE__ */ new Set(), i = [];
88
- t.forEach((o) => {
89
- s.has(o.columnId) || (s.add(o.columnId), i.push(o.columnId));
90
- }), s.has(e) || i.push(e);
91
- const l = [];
92
- return i.forEach((o) => {
93
- o === e ? l.push(...n) : l.push(...t.filter((c) => c.columnId === o));
94
- }), l;
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
- }, T = (e) => x[e] || "OR", L = (e, n) => {
97
- O((t) => ({ ...t, [e]: n }));
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
- h === "column" ? (D(a, [w(a, C)]), L(a, "OR")) : (k([w(a, C)]), O({ [a]: "OR" }));
100
- }, Q = () => {
101
- k(F.allRules.length > 0 ? F.allRules : [w(a, C)]), O(F.columnLogic);
102
- }, U = () => {
103
- const e = g.filter((n) => n.operator === "empty" || n.operator === "notEmpty" ? !!n.columnId : n.columnId && n.value !== "" && n.value !== null);
104
- if (e.length === 0)
105
- m(null);
106
- else {
107
- const n = e[0].columnId;
108
- m({ logic: T(n), rules: e });
109
- }
110
- d();
111
- }, W = j(g), M = Object.keys(W), y = Object.keys(j(
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 o = s?.headerName || e;
124
- return i.push(o), i.join(" > ");
127
+ const i = c?.headerName || e;
128
+ return n.push(i), n.join(" > ");
125
129
  };
126
- return /* @__PURE__ */ f(Z, { open: S, onOpenChange: d, children: [
127
- (console.log("[AdvancedFilterDialog] Current State:", {
128
- mode: h,
129
- allRules: g,
130
- columnLogic: x,
131
- activeColumns: M
132
- }), null),
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
- onClick: Q,
236
- variant: "secondary",
237
- disabled: !H,
238
- children: u("advancedFilter.discard")
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__ */ r(v, { onClick: U, variant: "default", children: u("advancedFilter.apply") })
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
- Ce as AdvancedFilterDialog,
248
- Ce as default
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.