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.
- 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/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,224 +1,194 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
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
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { DateRangePicker as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
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
|
-
},
|
|
20
|
-
columnId:
|
|
21
|
-
columnLabel:
|
|
18
|
+
}, M = ({
|
|
19
|
+
columnId: p,
|
|
20
|
+
columnLabel: q,
|
|
22
21
|
columnType: l,
|
|
23
|
-
selectOptions:
|
|
24
|
-
isMultiSelect:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
logic: q,
|
|
22
|
+
selectOptions: g,
|
|
23
|
+
isMultiSelect: c,
|
|
24
|
+
rules: s,
|
|
25
|
+
logic: C,
|
|
28
26
|
onLogicChange: F,
|
|
29
|
-
onRulesChange:
|
|
27
|
+
onRulesChange: m,
|
|
30
28
|
canDeleteLastRule: u = !1,
|
|
31
|
-
onDeleteColumnFilter:
|
|
29
|
+
onDeleteColumnFilter: x,
|
|
30
|
+
dateDisplayFormat: b = D
|
|
32
31
|
}) => {
|
|
33
|
-
const { t:
|
|
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:
|
|
36
|
-
{ label:
|
|
34
|
+
{ label: n("filter.logicAll"), value: "AND" },
|
|
35
|
+
{ label: n("filter.logicAny"), value: "OR" }
|
|
37
36
|
],
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
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
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
+
V,
|
|
101
69
|
{
|
|
102
70
|
value: e.value ? new Date(e.value) : void 0,
|
|
103
|
-
onChange: (t) =>
|
|
104
|
-
placeholder:
|
|
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
|
-
|
|
110
|
-
|
|
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:
|
|
81
|
+
options: g || [],
|
|
114
82
|
value: (() => {
|
|
115
|
-
const t = (
|
|
116
|
-
return t.length === 0 ? null :
|
|
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) ?
|
|
87
|
+
Array.isArray(t) ? o(e.id, { value: t.map((i) => i.value) }) : o(e.id, { value: t?.value || "" });
|
|
120
88
|
},
|
|
121
|
-
isMulti:
|
|
122
|
-
placeholder:
|
|
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__ */
|
|
94
|
+
) : e.operator === "inRange" ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 w-full", children: [
|
|
127
95
|
/* @__PURE__ */ a(
|
|
128
|
-
|
|
96
|
+
f,
|
|
129
97
|
{
|
|
130
98
|
value: e.value,
|
|
131
|
-
onChange: (t) =>
|
|
132
|
-
placeholder:
|
|
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:
|
|
105
|
+
/* @__PURE__ */ a("span", { className: "text-content-placeholder shrink-0", children: n("filter.to") }),
|
|
138
106
|
/* @__PURE__ */ a(
|
|
139
|
-
|
|
107
|
+
f,
|
|
140
108
|
{
|
|
141
109
|
value: e.valueTo || "",
|
|
142
|
-
onChange: (t) =>
|
|
143
|
-
placeholder:
|
|
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
|
-
|
|
117
|
+
f,
|
|
150
118
|
{
|
|
151
119
|
value: e.value,
|
|
152
|
-
onChange: (t) =>
|
|
153
|
-
placeholder:
|
|
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
|
-
},
|
|
159
|
-
const
|
|
160
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
130
|
+
h,
|
|
163
131
|
{
|
|
164
|
-
options:
|
|
165
|
-
value:
|
|
132
|
+
options: N,
|
|
133
|
+
value: r || null,
|
|
166
134
|
onChange: (t) => {
|
|
167
|
-
const
|
|
168
|
-
|
|
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:
|
|
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:
|
|
145
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: k(e) }),
|
|
176
146
|
/* @__PURE__ */ a(
|
|
177
147
|
v,
|
|
178
148
|
{
|
|
179
|
-
onClick: () =>
|
|
149
|
+
onClick: () => S(e.id),
|
|
180
150
|
variant: "tertiary",
|
|
181
151
|
size: "icon",
|
|
182
|
-
"aria-label":
|
|
183
|
-
disabled:
|
|
184
|
-
children: /* @__PURE__ */ a(
|
|
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__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */ a("span", { children:
|
|
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
|
-
|
|
163
|
+
h,
|
|
194
164
|
{
|
|
195
|
-
options:
|
|
196
|
-
value:
|
|
165
|
+
options: w,
|
|
166
|
+
value: w.find((e) => e.value === C),
|
|
197
167
|
onChange: (e) => {
|
|
198
|
-
const
|
|
199
|
-
|
|
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:
|
|
207
|
-
/* @__PURE__ */ a("span", { className: "font-semibold text-content-tertiary", children:
|
|
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:
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */ a(v, { onClick:
|
|
212
|
-
|
|
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:
|
|
187
|
+
onClick: x,
|
|
218
188
|
className: "text-validation hover:text-destructive hover:bg-feedback-error-surface border-destructive",
|
|
219
189
|
children: [
|
|
220
|
-
/* @__PURE__ */ a(
|
|
221
|
-
|
|
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
|
-
|
|
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;
|