impact-nova 1.7.39 → 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.
Files changed (41) 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/impact-nova.css +1 -1
  39. package/dist/index.js +180 -174
  40. package/package.json +1 -1
  41. package/tailwind.config.js +16 -0
@@ -1,224 +1,194 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
- import { useMemo as y } from "react";
1
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as E } from "react";
3
3
  import { Button as v } from "../../../button.js";
4
- import { Input as h } from "../../../input.js";
5
- import { DatePicker as P } from "../../../date-picker/date-picker.js";
6
- import { DateRangePicker as V } from "../../../date-picker/date-range-picker.js";
7
- import { MonthPicker as z } from "../../../date-picker/month-picker.js";
8
- import { MonthRangePicker as M } from "../../../date-picker/month-range-picker.js";
9
- import p from "../../../select/select.js";
10
- import { Bin as C } from "../../../../../icons/index.js";
11
- import { createEmptyRule as E } from "../utils/filter-utils.js";
12
- import { useImpactNovaI18n as W } from "../../../../../i18n/ImpactNovaI18nContext.js";
13
- const R = {
4
+ import { Input as f } from "../../../input.js";
5
+ import { DatePicker as V } from "../../../date-picker/date-picker.js";
6
+ import { DateRangePicker as I } from "../../../date-picker/date-range-picker.js";
7
+ import h from "../../../select/select.js";
8
+ import { Bin as R } from "../../../../../icons/index.js";
9
+ import { createEmptyRule as y } from "../utils/filter-utils.js";
10
+ import { DEFAULT_DATE_DISPLAY_FORMAT as D } from "../utils/date-utils.js";
11
+ import { useImpactNovaI18n as _ } from "../../../../../i18n/ImpactNovaI18nContext.js";
12
+ const T = {
14
13
  text: ["contains", "notContains", "equals", "notEqual", "startsWith", "endsWith", "empty", "notEmpty"],
15
14
  number: ["equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "empty", "notEmpty"],
16
15
  date: ["equals", "notEqual", "greaterThan", "lessThan", "inRange"],
17
16
  select: ["equals"],
18
17
  multi: ["contains", "notContains", "startsWith", "endsWith", "equals", "notEqual", "empty", "notEmpty"]
19
- }, Z = ({
20
- columnId: g,
21
- columnLabel: S,
18
+ }, M = ({
19
+ columnId: p,
20
+ columnLabel: q,
22
21
  columnType: l,
23
- selectOptions: x,
24
- isMultiSelect: m,
25
- datePickerVariant: O = "date",
26
- rules: d,
27
- logic: q,
22
+ selectOptions: g,
23
+ isMultiSelect: c,
24
+ rules: s,
25
+ logic: C,
28
26
  onLogicChange: F,
29
- onRulesChange: f,
27
+ onRulesChange: m,
30
28
  canDeleteLastRule: u = !1,
31
- onDeleteColumnFilter: b
29
+ onDeleteColumnFilter: x,
30
+ dateDisplayFormat: b = D
32
31
  }) => {
33
- const { t: r } = W(), w = y(() => (R[l] ?? R.text).map((n) => ({ label: r(`filter.operators.${l === "date" && n === "greaterThan" ? "after" : l === "date" && n === "lessThan" ? "before" : l === "date" && n === "inRange" ? "between" : n}`), value: n })), [l, r]), N = y(
32
+ const { t: n } = _(), N = E(() => (T[l] ?? T.text).map((r) => ({ label: n(`filter.operators.${l === "date" && r === "greaterThan" ? "after" : l === "date" && r === "lessThan" ? "before" : l === "date" && r === "inRange" ? "between" : r}`), value: r })), [l, n]), w = E(
34
33
  () => [
35
- { label: r("filter.logicAll"), value: "AND" },
36
- { label: r("filter.logicAny"), value: "OR" }
34
+ { label: n("filter.logicAll"), value: "AND" },
35
+ { label: n("filter.logicAny"), value: "OR" }
37
36
  ],
38
- [r]
39
- ), D = () => {
40
- f([...d, E(g, l)]);
41
- }, k = (e) => {
42
- if (d.length > 1 || u) {
43
- const n = d.filter((t) => t.id !== e);
44
- n.length === 0 && u ? f([]) : f(n.length > 0 ? n : [E(g, l)]);
37
+ [n]
38
+ ), O = () => {
39
+ m([...s, y(p, l)]);
40
+ }, S = (e) => {
41
+ if (s.length > 1 || u) {
42
+ const r = s.filter((t) => t.id !== e);
43
+ r.length === 0 && u ? m([]) : m(r.length > 0 ? r : [y(p, l)]);
45
44
  }
46
- }, i = (e, n) => {
47
- f(d.map((t) => t.id === e ? { ...t, ...n } : t));
48
- }, T = (e) => {
45
+ }, o = (e, r) => {
46
+ m(s.map((t) => t.id === e ? { ...t, ...r } : t));
47
+ }, k = (e) => {
49
48
  if (e.operator === "empty" || e.operator === "notEmpty")
50
- return /* @__PURE__ */ a("span", { className: "text-content-placeholder italic text-sm", children: r("advancedFilter.noValueNeeded") });
51
- if (l === "date") {
52
- if (O === "month") {
53
- const t = (o) => {
54
- if (!o) return;
55
- const s = new Date(o);
56
- return isNaN(s.getTime()) ? void 0 : { year: s.getFullYear(), month: s.getMonth() };
57
- };
58
- return e.operator === "inRange" ? /* @__PURE__ */ a(
59
- M,
60
- {
61
- value: {
62
- from: t(e.value) || { year: (/* @__PURE__ */ new Date()).getFullYear(), month: 0 },
63
- to: t(e.valueTo || "")
64
- },
65
- onChange: (o) => {
66
- const s = o?.from ? new Date(o.from.year, o.from.month, 1).toISOString() : "", I = o?.to ? new Date(o.to.year, o.to.month + 1, 0).toISOString() : "";
67
- i(e.id, { value: s, valueTo: I });
68
- },
69
- showFooter: !0
70
- }
71
- ) : /* @__PURE__ */ a(
72
- z,
73
- {
74
- value: t(e.value),
75
- onChange: (o) => {
76
- const s = o ? new Date(o.year, o.month, 1).toISOString() : "";
77
- i(e.id, { value: s });
78
- },
79
- placeholder: r("filter.selectMonth"),
80
- showFooter: !0
81
- }
82
- );
83
- }
49
+ return /* @__PURE__ */ a("span", { className: "text-content-placeholder italic text-sm", children: n("advancedFilter.noValueNeeded") });
50
+ if (l === "date")
84
51
  return e.operator === "inRange" ? /* @__PURE__ */ a(
85
- V,
52
+ I,
86
53
  {
87
54
  value: {
88
55
  from: e.value ? new Date(e.value) : void 0,
89
56
  to: e.valueTo ? new Date(e.valueTo) : void 0
90
57
  },
91
58
  onChange: (t) => {
92
- i(e.id, {
59
+ o(e.id, {
93
60
  value: t?.from?.toISOString() || "",
94
61
  valueTo: t?.to?.toISOString() || ""
95
62
  });
96
63
  },
64
+ format: b,
97
65
  showFooter: !0
98
66
  }
99
67
  ) : /* @__PURE__ */ a(
100
- P,
68
+ V,
101
69
  {
102
70
  value: e.value ? new Date(e.value) : void 0,
103
- onChange: (t) => i(e.id, { value: t?.toISOString() || "" }),
104
- placeholder: r("filter.selectDate"),
71
+ onChange: (t) => o(e.id, { value: t?.toISOString() || "" }),
72
+ placeholder: n("filter.selectDate"),
73
+ format: b,
105
74
  showFooter: !0
106
75
  }
107
76
  );
108
- }
109
- const n = e.operator === "equals" || e.operator === "notEqual";
110
- return l === "select" || l === "multi" && n ? /* @__PURE__ */ a(
111
- p,
77
+ const r = e.operator === "equals" || e.operator === "notEqual";
78
+ return l === "select" || l === "multi" && r ? /* @__PURE__ */ a(
79
+ h,
112
80
  {
113
- options: x || [],
81
+ options: g || [],
114
82
  value: (() => {
115
- const t = (x || []).filter((o) => Array.isArray(e.value) ? e.value.includes(o.value) : String(e.value) === String(o.value));
116
- return t.length === 0 ? null : m !== !1 ? t : t[0];
83
+ const t = (g || []).filter((i) => Array.isArray(e.value) ? e.value.includes(i.value) : String(e.value) === String(i.value));
84
+ return t.length === 0 ? null : c !== !1 ? t : t[0];
117
85
  })(),
118
86
  onChange: (t) => {
119
- Array.isArray(t) ? i(e.id, { value: t.map((o) => o.value) }) : i(e.id, { value: t?.value || "" });
87
+ Array.isArray(t) ? o(e.id, { value: t.map((i) => i.value) }) : o(e.id, { value: t?.value || "" });
120
88
  },
121
- isMulti: m !== void 0 ? m : !0,
122
- placeholder: r(m === !1 ? "filter.selectValue" : "filter.selectValues"),
89
+ isMulti: c !== void 0 ? c : !0,
90
+ placeholder: n(c === !1 ? "filter.selectValue" : "filter.selectValues"),
123
91
  className: "w-full",
124
92
  menuPortalTarget: document.body
125
93
  }
126
- ) : e.operator === "inRange" ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2 w-full", children: [
94
+ ) : e.operator === "inRange" ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 w-full", children: [
127
95
  /* @__PURE__ */ a(
128
- h,
96
+ f,
129
97
  {
130
98
  value: e.value,
131
- onChange: (t) => i(e.id, { value: t.target.value }),
132
- placeholder: r("filter.from"),
99
+ onChange: (t) => o(e.id, { value: t.target.value }),
100
+ placeholder: n("filter.from"),
133
101
  type: l === "number" ? "number" : "text",
134
102
  className: "flex-1"
135
103
  }
136
104
  ),
137
- /* @__PURE__ */ a("span", { className: "text-content-placeholder shrink-0", children: r("filter.to") }),
105
+ /* @__PURE__ */ a("span", { className: "text-content-placeholder shrink-0", children: n("filter.to") }),
138
106
  /* @__PURE__ */ a(
139
- h,
107
+ f,
140
108
  {
141
109
  value: e.valueTo || "",
142
- onChange: (t) => i(e.id, { valueTo: t.target.value }),
143
- placeholder: r("filter.to"),
110
+ onChange: (t) => o(e.id, { valueTo: t.target.value }),
111
+ placeholder: n("filter.to"),
144
112
  type: l === "number" ? "number" : "text",
145
113
  className: "flex-1"
146
114
  }
147
115
  )
148
116
  ] }) : /* @__PURE__ */ a(
149
- h,
117
+ f,
150
118
  {
151
119
  value: e.value,
152
- onChange: (t) => i(e.id, { value: t.target.value }),
153
- placeholder: r("filter.enterValue"),
120
+ onChange: (t) => o(e.id, { value: t.target.value }),
121
+ placeholder: n("filter.enterValue"),
154
122
  type: l === "number" ? "number" : "text",
155
123
  className: "w-full"
156
124
  }
157
125
  );
158
- }, A = (e) => {
159
- const n = w.find((t) => t.value === e.operator);
160
- return /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
126
+ }, P = (e) => {
127
+ const r = N.find((t) => t.value === e.operator);
128
+ return /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
161
129
  /* @__PURE__ */ a("div", { className: "w-[120px] shrink-0", children: /* @__PURE__ */ a(
162
- p,
130
+ h,
163
131
  {
164
- options: w,
165
- value: n || null,
132
+ options: N,
133
+ value: r || null,
166
134
  onChange: (t) => {
167
- const o = t;
168
- o && i(e.id, { operator: o.value });
135
+ const i = t;
136
+ if (!i) return;
137
+ const A = i.value === "inRange" && e.value && !e.valueTo ? Array.isArray(e.value) ? e.value[0] : e.value : void 0;
138
+ o(e.id, { operator: i.value, ...A != null && { valueTo: A } });
169
139
  },
170
- placeholder: r("filter.operator"),
140
+ placeholder: n("filter.operator"),
171
141
  className: "w-full",
172
142
  menuPortalTarget: document.body
173
143
  }
174
144
  ) }),
175
- /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: T(e) }),
145
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: k(e) }),
176
146
  /* @__PURE__ */ a(
177
147
  v,
178
148
  {
179
- onClick: () => k(e.id),
149
+ onClick: () => S(e.id),
180
150
  variant: "tertiary",
181
151
  size: "icon",
182
- "aria-label": r("aria.removeRule"),
183
- disabled: d.length === 1 && !u,
184
- children: /* @__PURE__ */ a(C, { size: "xs" })
152
+ "aria-label": n("aria.removeRule"),
153
+ disabled: s.length === 1 && !u,
154
+ children: /* @__PURE__ */ a(R, { size: "xs" })
185
155
  }
186
156
  )
187
157
  ] }, e.id);
188
158
  };
189
- return /* @__PURE__ */ c("div", { className: "flex flex-col gap-4", children: [
190
- /* @__PURE__ */ c("div", { className: "text-content-muted text-sm flex items-center gap-2 flex-wrap", children: [
191
- /* @__PURE__ */ a("span", { children: r("advancedFilter.match") }),
159
+ return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4", children: [
160
+ /* @__PURE__ */ d("div", { className: "text-content-muted text-sm flex items-center gap-2 flex-wrap", children: [
161
+ /* @__PURE__ */ a("span", { children: n("advancedFilter.match") }),
192
162
  /* @__PURE__ */ a("div", { className: "w-[80px]", children: /* @__PURE__ */ a(
193
- p,
163
+ h,
194
164
  {
195
- options: N,
196
- value: N.find((e) => e.value === q),
165
+ options: w,
166
+ value: w.find((e) => e.value === C),
197
167
  onChange: (e) => {
198
- const n = e;
199
- n && F(n.value);
168
+ const r = e;
169
+ r && F(r.value);
200
170
  },
201
171
  className: "h-8",
202
172
  menuPortalTarget: document.body,
203
173
  isClearable: !1
204
174
  }
205
175
  ) }),
206
- /* @__PURE__ */ a("span", { children: r("advancedFilter.ofTheFollowingRulesForColumn") }),
207
- /* @__PURE__ */ a("span", { className: "font-semibold text-content-tertiary", children: S })
176
+ /* @__PURE__ */ a("span", { children: n("advancedFilter.ofTheFollowingRulesForColumn") }),
177
+ /* @__PURE__ */ a("span", { className: "font-semibold text-content-tertiary", children: q })
208
178
  ] }),
209
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: d.map((e) => A(e)) }),
210
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between mt-1", children: [
211
- /* @__PURE__ */ a(v, { onClick: D, variant: "outline", size: "sm", children: r("advancedFilter.addRule") }),
212
- b && /* @__PURE__ */ c(
179
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: s.map((e) => P(e)) }),
180
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between mt-1", children: [
181
+ /* @__PURE__ */ a(v, { onClick: O, variant: "outline", size: "sm", children: n("advancedFilter.addRule") }),
182
+ x && /* @__PURE__ */ d(
213
183
  v,
214
184
  {
215
185
  variant: "outline",
216
186
  size: "sm",
217
- onClick: b,
187
+ onClick: x,
218
188
  className: "text-validation hover:text-destructive hover:bg-feedback-error-surface border-destructive",
219
189
  children: [
220
- /* @__PURE__ */ a(C, { size: "xs" }),
221
- r("advancedFilter.deleteColumn")
190
+ /* @__PURE__ */ a(R, { size: "xs" }),
191
+ n("advancedFilter.deleteColumn")
222
192
  ]
223
193
  }
224
194
  )
@@ -226,5 +196,5 @@ const R = {
226
196
  ] });
227
197
  };
228
198
  export {
229
- Z as ColumnFilterSection
199
+ M as ColumnFilterSection
230
200
  };
@@ -0,0 +1,39 @@
1
+ import { default as React } from 'react';
2
+ export type DatePickerVariant = 'date' | 'month' | 'week';
3
+ export interface FiscalConfig {
4
+ calendarType?: 'calendar' | 'fiscal';
5
+ fiscalMode?: 'basic' | 'advanced' | 'custom';
6
+ selectionMode?: 'week' | 'fiscalMonth';
7
+ fiscalMonthPattern?: number[];
8
+ fiscalYearStartMonth?: number;
9
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
10
+ }
11
+ export interface DateFilterPickerProps {
12
+ variant: DatePickerVariant;
13
+ mode: 'single' | 'range';
14
+ value: {
15
+ dateFrom?: string;
16
+ dateTo?: string;
17
+ } | null;
18
+ onChange: (value: {
19
+ dateFrom: string;
20
+ dateTo: string;
21
+ } | null) => void;
22
+ fiscalConfig?: FiscalConfig;
23
+ placeholder?: string;
24
+ className?: string;
25
+ showFooter?: boolean;
26
+ minDate?: Date;
27
+ maxDate?: Date;
28
+ disabled?: boolean;
29
+ onFocus?: () => void;
30
+ onBlur?: () => void;
31
+ /** Display format for dates (date-fns token string). Default: "MM/dd/yyyy" */
32
+ dateDisplayFormat?: string;
33
+ }
34
+ /**
35
+ * Unified date filter picker that abstracts date/month/week selection
36
+ * while maintaining consistent AG Grid filter model format.
37
+ */
38
+ export declare const DateFilterPicker: React.FC<DateFilterPickerProps>;
39
+ export default DateFilterPicker;