impact-nova 1.2.4 → 1.5.0
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/README.md +49 -0
- package/dist/components/layout/dashboard-layout.d.ts +15 -1
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
- package/dist/components/ui/accordion.js +38 -34
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
- package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
- package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
- package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
- package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/alert.js +76 -60
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +355 -354
- package/dist/components/ui/chart/chart.js +63 -62
- package/dist/components/ui/chips.js +42 -38
- package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
- package/dist/components/ui/command-palette/command-palette-context.js +110 -0
- package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
- package/dist/components/ui/command-palette/command-palette.js +402 -0
- package/dist/components/ui/command-palette/index.d.ts +23 -0
- package/dist/components/ui/command-palette/index.js +44 -0
- package/dist/components/ui/command-palette/kbd.d.ts +28 -0
- package/dist/components/ui/command-palette/kbd.js +52 -0
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
- package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
- package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
- package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
- package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
- package/dist/components/ui/command-palette/use-shortcut.js +49 -0
- package/dist/components/ui/command-palette/utils.d.ts +119 -0
- package/dist/components/ui/command-palette/utils.js +248 -0
- package/dist/components/ui/data-table/data-table-column-list.js +87 -86
- package/dist/components/ui/data-table/data-table-format-options.js +45 -44
- package/dist/components/ui/data-table/data-table-view-options.js +39 -38
- package/dist/components/ui/date-picker/date-picker.js +89 -87
- package/dist/components/ui/date-picker/date-range-picker.js +140 -138
- package/dist/components/ui/date-picker/month-picker.js +82 -81
- package/dist/components/ui/date-picker/month-range-picker.js +108 -105
- package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
- package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
- package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
- package/dist/components/ui/date-picker/week-picker.js +117 -115
- package/dist/components/ui/date-picker/week-range-picker.js +166 -164
- package/dist/components/ui/dialog.js +78 -73
- package/dist/components/ui/drawer.js +71 -66
- package/dist/components/ui/file-upload.js +131 -127
- package/dist/components/ui/filter-panel/filter-panel.js +98 -94
- package/dist/components/ui/filter-strip/filter-strip.js +95 -91
- package/dist/components/ui/filter-strip/filter-summary.js +91 -90
- package/dist/components/ui/header.js +57 -53
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
- package/dist/components/ui/loader.js +17 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
- package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
- package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
- package/dist/components/ui/nested-list/nested-list.js +184 -182
- package/dist/components/ui/notification-panel/notification-panel.js +60 -53
- package/dist/components/ui/popover.js +45 -40
- package/dist/components/ui/prompt.js +90 -85
- package/dist/components/ui/select/select.js +225 -229
- package/dist/components/ui/sheet.d.ts +1 -0
- package/dist/components/ui/sheet.js +50 -48
- package/dist/components/ui/sidebar.js +273 -267
- package/dist/components/ui/stepper.js +75 -63
- package/dist/components/ui/tabs.d.ts +11 -1
- package/dist/components/ui/tabs.js +79 -54
- package/dist/components/ui/tag.js +48 -44
- package/dist/components/ui/toast.js +46 -41
- package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
- package/dist/i18n/ImpactNovaI18nContext.js +76 -0
- package/dist/i18n/defaultMessages.d.ts +231 -0
- package/dist/i18n/defaultMessages.js +206 -0
- package/dist/i18n/getDateFnsLocale.d.ts +11 -0
- package/dist/i18n/getDateFnsLocale.js +21 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/locales/de.d.ts +2 -0
- package/dist/i18n/locales/de.js +206 -0
- package/dist/i18n/locales/es.d.ts +2 -0
- package/dist/i18n/locales/es.js +206 -0
- package/dist/i18n/locales/hi.d.ts +2 -0
- package/dist/i18n/locales/hi.js +206 -0
- package/dist/i18n/locales/index.d.ts +4 -0
- package/dist/i18n/locales/kn.d.ts +2 -0
- package/dist/i18n/locales/kn.js +206 -0
- package/dist/icons/assets/boxAdd.svg.js +5 -0
- package/dist/icons/assets/boxed.svg.js +5 -0
- package/dist/icons/assets/trolley.svg.js +5 -0
- package/dist/icons/assets/unlocked.svg.js +5 -0
- package/dist/icons/assets/webp/delete-3d.webp.js +4 -0
- package/dist/icons/assets/webp/info-3d.webp.js +4 -0
- package/dist/icons/assets/webp/success-3d.webp.js +4 -0
- package/dist/icons/assets/webp/warning-3d.webp.js +4 -0
- package/dist/icons/index.d.ts +8 -0
- package/dist/icons/index.js +197 -181
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +260 -199
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,221 +1,188 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "react";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Input as
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { DateRangePicker as
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as w } from "react";
|
|
3
|
+
import { Button as u } from "../../../button.js";
|
|
4
|
+
import { Input as v } from "../../../input.js";
|
|
5
|
+
import { DatePicker as P } from "../../../date-picker/date-picker.js";
|
|
6
|
+
import { DateRangePicker as T } from "../../../date-picker/date-range-picker.js";
|
|
7
7
|
import p from "../../../select/select.js";
|
|
8
|
-
import { Bin as
|
|
9
|
-
import { createEmptyRule as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{ label: "Empty", value: "empty" },
|
|
19
|
-
{ label: "Not Empty", value: "notEmpty" }
|
|
20
|
-
],
|
|
21
|
-
number: [
|
|
22
|
-
{ label: "Equals", value: "equals" },
|
|
23
|
-
{ label: "Not equal", value: "notEqual" },
|
|
24
|
-
{ label: "Greater than", value: "greaterThan" },
|
|
25
|
-
{ label: "≥", value: "greaterThanOrEqual" },
|
|
26
|
-
{ label: "Less than", value: "lessThan" },
|
|
27
|
-
{ label: "≤", value: "lessThanOrEqual" },
|
|
28
|
-
{ label: "In range", value: "inRange" },
|
|
29
|
-
{ label: "Empty", value: "empty" },
|
|
30
|
-
{ label: "Not Empty", value: "notEmpty" }
|
|
31
|
-
],
|
|
32
|
-
date: [
|
|
33
|
-
{ label: "Equals", value: "equals" },
|
|
34
|
-
{ label: "Not equal", value: "notEqual" },
|
|
35
|
-
{ label: "After", value: "greaterThan" },
|
|
36
|
-
{ label: "Before", value: "lessThan" },
|
|
37
|
-
{ label: "Between", value: "inRange" }
|
|
38
|
-
],
|
|
39
|
-
select: [
|
|
40
|
-
{ label: "In Set", value: "equals" }
|
|
41
|
-
// agSetColumnFilter only supports inclusion (Set model)
|
|
42
|
-
],
|
|
43
|
-
multi: [
|
|
44
|
-
{ label: "Contains", value: "contains" },
|
|
45
|
-
{ label: "Not contains", value: "notContains" },
|
|
46
|
-
{ label: "Starts with", value: "startsWith" },
|
|
47
|
-
{ label: "Ends with", value: "endsWith" },
|
|
48
|
-
{ label: "In Set", value: "equals" },
|
|
49
|
-
{ label: "Not In Set", value: "notEqual" },
|
|
50
|
-
{ label: "Empty", value: "empty" },
|
|
51
|
-
{ label: "Not Empty", value: "notEmpty" }
|
|
52
|
-
]
|
|
53
|
-
}, w = [
|
|
54
|
-
{ label: "all", value: "AND" },
|
|
55
|
-
{ label: "any", value: "OR" }
|
|
56
|
-
], G = ({
|
|
8
|
+
import { Bin as E } from "../../../../../icons/index.js";
|
|
9
|
+
import { createEmptyRule as q } from "../utils/filter-utils.js";
|
|
10
|
+
import { useImpactNovaI18n as I } from "../../../../../i18n/ImpactNovaI18nContext.js";
|
|
11
|
+
const C = {
|
|
12
|
+
text: ["contains", "notContains", "equals", "notEqual", "startsWith", "endsWith", "empty", "notEmpty"],
|
|
13
|
+
number: ["equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "empty", "notEmpty"],
|
|
14
|
+
date: ["equals", "notEqual", "greaterThan", "lessThan", "inRange"],
|
|
15
|
+
select: ["equals"],
|
|
16
|
+
multi: ["contains", "notContains", "startsWith", "endsWith", "equals", "notEqual", "empty", "notEmpty"]
|
|
17
|
+
}, $ = ({
|
|
57
18
|
columnId: h,
|
|
58
|
-
columnLabel:
|
|
19
|
+
columnLabel: R,
|
|
59
20
|
columnType: n,
|
|
60
|
-
selectOptions:
|
|
61
|
-
isMultiSelect:
|
|
62
|
-
rules:
|
|
63
|
-
logic:
|
|
64
|
-
onLogicChange:
|
|
65
|
-
onRulesChange:
|
|
66
|
-
canDeleteLastRule:
|
|
67
|
-
onDeleteColumnFilter:
|
|
21
|
+
selectOptions: g,
|
|
22
|
+
isMultiSelect: c,
|
|
23
|
+
rules: s,
|
|
24
|
+
logic: y,
|
|
25
|
+
onLogicChange: O,
|
|
26
|
+
onRulesChange: m,
|
|
27
|
+
canDeleteLastRule: f = !1,
|
|
28
|
+
onDeleteColumnFilter: x
|
|
68
29
|
}) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
30
|
+
const { t: r } = I(), b = w(() => (C[n] ?? C.text).map((l) => ({ label: r(`filter.operators.${n === "date" && l === "greaterThan" ? "after" : n === "date" && l === "lessThan" ? "before" : n === "date" && l === "inRange" ? "between" : l}`), value: l })), [n, r]), N = w(
|
|
31
|
+
() => [
|
|
32
|
+
{ label: r("filter.logicAll"), value: "AND" },
|
|
33
|
+
{ label: r("filter.logicAny"), value: "OR" }
|
|
34
|
+
],
|
|
35
|
+
[r]
|
|
36
|
+
), A = () => {
|
|
37
|
+
m([...s, q(h, n)]);
|
|
38
|
+
}, F = (e) => {
|
|
39
|
+
if (s.length > 1 || f) {
|
|
40
|
+
const l = s.filter((t) => t.id !== e);
|
|
41
|
+
l.length === 0 && f ? m([]) : m(l.length > 0 ? l : [q(h, n)]);
|
|
75
42
|
}
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
43
|
+
}, i = (e, l) => {
|
|
44
|
+
m(s.map((t) => t.id === e ? { ...t, ...l } : t));
|
|
45
|
+
}, S = (e) => {
|
|
79
46
|
if (e.operator === "empty" || e.operator === "notEmpty")
|
|
80
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ a("span", { className: "text-slate-400 italic text-sm", children: r("advancedFilter.noValueNeeded") });
|
|
81
48
|
if (n === "date")
|
|
82
|
-
return e.operator === "inRange" ? /* @__PURE__ */
|
|
83
|
-
|
|
49
|
+
return e.operator === "inRange" ? /* @__PURE__ */ a(
|
|
50
|
+
T,
|
|
84
51
|
{
|
|
85
52
|
value: {
|
|
86
53
|
from: e.value ? new Date(e.value) : void 0,
|
|
87
54
|
to: e.valueTo ? new Date(e.valueTo) : void 0
|
|
88
55
|
},
|
|
89
|
-
onChange: (
|
|
90
|
-
|
|
91
|
-
value:
|
|
92
|
-
valueTo:
|
|
56
|
+
onChange: (t) => {
|
|
57
|
+
i(e.id, {
|
|
58
|
+
value: t?.from?.toISOString() || "",
|
|
59
|
+
valueTo: t?.to?.toISOString() || ""
|
|
93
60
|
});
|
|
94
61
|
},
|
|
95
62
|
showFooter: !0
|
|
96
63
|
}
|
|
97
|
-
) : /* @__PURE__ */
|
|
98
|
-
|
|
64
|
+
) : /* @__PURE__ */ a(
|
|
65
|
+
P,
|
|
99
66
|
{
|
|
100
67
|
value: e.value ? new Date(e.value) : void 0,
|
|
101
|
-
onChange: (
|
|
102
|
-
placeholder: "
|
|
68
|
+
onChange: (t) => i(e.id, { value: t?.toISOString() || "" }),
|
|
69
|
+
placeholder: r("filter.selectDate"),
|
|
103
70
|
showFooter: !0
|
|
104
71
|
}
|
|
105
72
|
);
|
|
106
|
-
const
|
|
107
|
-
return n === "select" || n === "multi" &&
|
|
73
|
+
const l = e.operator === "equals" || e.operator === "notEqual";
|
|
74
|
+
return n === "select" || n === "multi" && l ? /* @__PURE__ */ a(
|
|
108
75
|
p,
|
|
109
76
|
{
|
|
110
|
-
options:
|
|
77
|
+
options: g || [],
|
|
111
78
|
value: (() => {
|
|
112
|
-
const
|
|
113
|
-
return
|
|
79
|
+
const t = (g || []).filter((o) => Array.isArray(e.value) ? e.value.includes(o.value) : String(e.value) === String(o.value));
|
|
80
|
+
return t.length === 0 ? null : c !== !1 ? t : t[0];
|
|
114
81
|
})(),
|
|
115
|
-
onChange: (
|
|
116
|
-
Array.isArray(
|
|
82
|
+
onChange: (t) => {
|
|
83
|
+
Array.isArray(t) ? i(e.id, { value: t.map((o) => o.value) }) : i(e.id, { value: t?.value || "" });
|
|
117
84
|
},
|
|
118
|
-
isMulti:
|
|
119
|
-
placeholder:
|
|
85
|
+
isMulti: c !== void 0 ? c : !0,
|
|
86
|
+
placeholder: r(c === !1 ? "filter.selectValue" : "filter.selectValues"),
|
|
120
87
|
className: "w-full",
|
|
121
88
|
menuPortalTarget: document.body
|
|
122
89
|
}
|
|
123
|
-
) : e.operator === "inRange" ? /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
90
|
+
) : e.operator === "inRange" ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 w-full", children: [
|
|
91
|
+
/* @__PURE__ */ a(
|
|
92
|
+
v,
|
|
126
93
|
{
|
|
127
94
|
value: e.value,
|
|
128
|
-
onChange: (
|
|
129
|
-
placeholder: "
|
|
95
|
+
onChange: (t) => i(e.id, { value: t.target.value }),
|
|
96
|
+
placeholder: r("filter.from"),
|
|
130
97
|
type: n === "number" ? "number" : "text",
|
|
131
98
|
className: "flex-1"
|
|
132
99
|
}
|
|
133
100
|
),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
101
|
+
/* @__PURE__ */ a("span", { className: "text-slate-400 shrink-0", children: r("filter.to") }),
|
|
102
|
+
/* @__PURE__ */ a(
|
|
103
|
+
v,
|
|
137
104
|
{
|
|
138
105
|
value: e.valueTo || "",
|
|
139
|
-
onChange: (
|
|
140
|
-
placeholder: "
|
|
106
|
+
onChange: (t) => i(e.id, { valueTo: t.target.value }),
|
|
107
|
+
placeholder: r("filter.to"),
|
|
141
108
|
type: n === "number" ? "number" : "text",
|
|
142
109
|
className: "flex-1"
|
|
143
110
|
}
|
|
144
111
|
)
|
|
145
|
-
] }) : /* @__PURE__ */
|
|
146
|
-
|
|
112
|
+
] }) : /* @__PURE__ */ a(
|
|
113
|
+
v,
|
|
147
114
|
{
|
|
148
115
|
value: e.value,
|
|
149
|
-
onChange: (
|
|
150
|
-
placeholder: "
|
|
116
|
+
onChange: (t) => i(e.id, { value: t.target.value }),
|
|
117
|
+
placeholder: r("filter.enterValue"),
|
|
151
118
|
type: n === "number" ? "number" : "text",
|
|
152
119
|
className: "w-full"
|
|
153
120
|
}
|
|
154
121
|
);
|
|
155
|
-
},
|
|
156
|
-
const
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
122
|
+
}, k = (e) => {
|
|
123
|
+
const l = b.find((t) => t.value === e.operator);
|
|
124
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
125
|
+
/* @__PURE__ */ a("div", { className: "w-[120px] shrink-0", children: /* @__PURE__ */ a(
|
|
159
126
|
p,
|
|
160
127
|
{
|
|
161
|
-
options:
|
|
162
|
-
value:
|
|
163
|
-
onChange: (
|
|
164
|
-
const
|
|
165
|
-
|
|
128
|
+
options: b,
|
|
129
|
+
value: l || null,
|
|
130
|
+
onChange: (t) => {
|
|
131
|
+
const o = t;
|
|
132
|
+
o && i(e.id, { operator: o.value });
|
|
166
133
|
},
|
|
167
|
-
placeholder: "
|
|
134
|
+
placeholder: r("filter.operator"),
|
|
168
135
|
className: "w-full",
|
|
169
136
|
menuPortalTarget: document.body
|
|
170
137
|
}
|
|
171
138
|
) }),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
|
|
139
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: S(e) }),
|
|
140
|
+
/* @__PURE__ */ a(
|
|
141
|
+
u,
|
|
175
142
|
{
|
|
176
|
-
onClick: () =>
|
|
143
|
+
onClick: () => F(e.id),
|
|
177
144
|
variant: "tertiary",
|
|
178
145
|
size: "icon",
|
|
179
|
-
"aria-label": "
|
|
180
|
-
disabled:
|
|
181
|
-
children: /* @__PURE__ */
|
|
146
|
+
"aria-label": r("aria.removeRule"),
|
|
147
|
+
disabled: s.length === 1 && !f,
|
|
148
|
+
children: /* @__PURE__ */ a(E, { size: "xs" })
|
|
182
149
|
}
|
|
183
150
|
)
|
|
184
151
|
] }, e.id);
|
|
185
152
|
};
|
|
186
|
-
return /* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4", children: [
|
|
154
|
+
/* @__PURE__ */ d("div", { className: "text-slate-500 text-sm flex items-center gap-2 flex-wrap", children: [
|
|
155
|
+
/* @__PURE__ */ a("span", { children: r("advancedFilter.match") }),
|
|
156
|
+
/* @__PURE__ */ a("div", { className: "w-[80px]", children: /* @__PURE__ */ a(
|
|
190
157
|
p,
|
|
191
158
|
{
|
|
192
|
-
options:
|
|
193
|
-
value:
|
|
159
|
+
options: N,
|
|
160
|
+
value: N.find((e) => e.value === y),
|
|
194
161
|
onChange: (e) => {
|
|
195
|
-
const
|
|
196
|
-
|
|
162
|
+
const l = e;
|
|
163
|
+
l && O(l.value);
|
|
197
164
|
},
|
|
198
165
|
className: "h-8",
|
|
199
166
|
menuPortalTarget: document.body,
|
|
200
167
|
isClearable: !1
|
|
201
168
|
}
|
|
202
169
|
) }),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ a("span", { children: r("advancedFilter.ofTheFollowingRulesForColumn") }),
|
|
171
|
+
/* @__PURE__ */ a("span", { className: "font-semibold text-slate-700", children: R })
|
|
205
172
|
] }),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
210
|
-
|
|
173
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: s.map((e) => k(e)) }),
|
|
174
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mt-1", children: [
|
|
175
|
+
/* @__PURE__ */ a(u, { onClick: A, variant: "outline", size: "sm", children: r("advancedFilter.addRule") }),
|
|
176
|
+
x && /* @__PURE__ */ d(
|
|
177
|
+
u,
|
|
211
178
|
{
|
|
212
179
|
variant: "outline",
|
|
213
180
|
size: "sm",
|
|
214
|
-
onClick:
|
|
181
|
+
onClick: x,
|
|
215
182
|
className: "text-red-500 hover:text-red-600 hover:bg-red-50 border-red-300",
|
|
216
183
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
"
|
|
184
|
+
/* @__PURE__ */ a(E, { size: "xs" }),
|
|
185
|
+
r("advancedFilter.deleteColumn")
|
|
219
186
|
]
|
|
220
187
|
}
|
|
221
188
|
)
|
|
@@ -223,5 +190,5 @@ const E = {
|
|
|
223
190
|
] });
|
|
224
191
|
};
|
|
225
192
|
export {
|
|
226
|
-
|
|
193
|
+
$ as ColumnFilterSection
|
|
227
194
|
};
|
|
@@ -1,108 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Settings as
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import { useGridHeader as
|
|
6
|
-
|
|
3
|
+
import { Settings as F, Checkmark as h, Search as _ } from "../../../../../icons/index.js";
|
|
4
|
+
import { DropdownMenu as E, DropdownMenuTrigger as G, DropdownMenuContent as L, DropdownMenuLabel as k, DropdownMenuSeparator as z, DropdownMenuSub as p, DropdownMenuSubTrigger as f, DropdownMenuSubContent as g, DropdownMenuItem as a } from "../../../dropdown-menu.js";
|
|
5
|
+
import { useGridHeader as R } from "../context/grid-header-context.js";
|
|
6
|
+
import { useImpactNovaI18n as B } from "../../../../../i18n/ImpactNovaI18nContext.js";
|
|
7
|
+
const U = ({
|
|
7
8
|
isOpen: O,
|
|
8
|
-
onClose:
|
|
9
|
-
columnId:
|
|
10
|
-
gridApi:
|
|
9
|
+
onClose: c,
|
|
10
|
+
columnId: l,
|
|
11
|
+
gridApi: i,
|
|
11
12
|
anchor: A
|
|
12
13
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
state: [{ colId:
|
|
14
|
+
const { t: n } = B(), C = R(), d = i.getColumn(l);
|
|
15
|
+
if (!d) return null;
|
|
16
|
+
const s = d.getColDef(), x = d.getSort(), S = d.getPinned(), M = s?.sortable !== !1, D = s?.filter || "agTextColumnFilter", H = D === "agNumberColumnFilter" || (Array.isArray(s?.type) ? s.type.includes("numericColumn") : s?.type === "numericColumn"), b = D === "agDateColumnFilter" || (Array.isArray(s?.type) ? s.type.includes("dateColumn") : s?.type === "dateColumn"), u = (t) => {
|
|
17
|
+
i.applyColumnState({
|
|
18
|
+
state: [{ colId: l, sort: t }],
|
|
18
19
|
defaultState: { sort: null }
|
|
19
|
-
}),
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
state: [{ colId:
|
|
20
|
+
}), c();
|
|
21
|
+
}, m = (t) => {
|
|
22
|
+
i.applyColumnState({
|
|
23
|
+
state: [{ colId: l, pinned: t }],
|
|
23
24
|
defaultState: { pinned: null }
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
t ?
|
|
25
|
+
}), c();
|
|
26
|
+
}, w = (t) => {
|
|
27
|
+
t ? i.autoSizeAllColumns() : i.autoSizeColumns([l]), c();
|
|
27
28
|
}, P = () => {
|
|
28
|
-
const t =
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
const t =
|
|
32
|
-
t?.onAdvanceSearchClick ? t.onAdvanceSearchClick(
|
|
33
|
-
},
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
29
|
+
const t = i.getGridOption("context") || {};
|
|
30
|
+
i.setGridOption("context", { ...t, activeSearchColumnId: l }), i.refreshHeader(), c();
|
|
31
|
+
}, T = () => {
|
|
32
|
+
const t = s?.headerComponentParams;
|
|
33
|
+
t?.onAdvanceSearchClick ? t.onAdvanceSearchClick(d) : t?.toggleAdvanceSearch ? t.toggleAdvanceSearch(l) : C && C.openAdvancedFilter(l), c();
|
|
34
|
+
}, o = A?.getBoundingClientRect(), y = s?.headerComponentParams, N = y?.isSearchable, v = y?.advanceSearchEnabled;
|
|
35
|
+
return /* @__PURE__ */ r(E, { open: O, onOpenChange: (t) => !t && c(), children: [
|
|
36
|
+
o && /* @__PURE__ */ e(G, { asChild: !0, children: /* @__PURE__ */ e(
|
|
36
37
|
"div",
|
|
37
38
|
{
|
|
38
39
|
style: {
|
|
39
40
|
position: "fixed",
|
|
40
|
-
left:
|
|
41
|
-
top:
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
41
|
+
left: o.left,
|
|
42
|
+
top: o.top,
|
|
43
|
+
width: o.width,
|
|
44
|
+
height: o.height,
|
|
44
45
|
pointerEvents: "none",
|
|
45
46
|
visibility: "hidden"
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
) }),
|
|
49
50
|
/* @__PURE__ */ e(
|
|
50
|
-
|
|
51
|
+
L,
|
|
51
52
|
{
|
|
52
53
|
align: "end",
|
|
53
54
|
side: "bottom",
|
|
54
55
|
sideOffset: 5,
|
|
55
56
|
className: "w-[200px] p-2 rounded-[8px] border-none !shadow-[0px_0px_2px_0px_rgba(0,0,0,0.25)]",
|
|
56
57
|
onCloseAutoFocus: (t) => t.preventDefault(),
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ e(
|
|
60
|
-
"
|
|
58
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
59
|
+
/* @__PURE__ */ r(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
|
|
60
|
+
/* @__PURE__ */ e(F, { size: "xs" }),
|
|
61
|
+
" ",
|
|
62
|
+
n("gridHeader.columnSettings")
|
|
61
63
|
] }),
|
|
62
64
|
/* @__PURE__ */ e(z, {}),
|
|
63
|
-
M && /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */ e("span", { children:
|
|
68
|
-
|
|
65
|
+
M && /* @__PURE__ */ r(p, { children: [
|
|
66
|
+
/* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.sort") }),
|
|
67
|
+
/* @__PURE__ */ r(g, { sideOffset: 10, alignOffset: -5, children: [
|
|
68
|
+
/* @__PURE__ */ e(a, { onClick: () => u("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
69
|
+
/* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortAscNumber" : b ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
|
|
70
|
+
x === "asc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
|
|
69
71
|
] }) }),
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e("span", { children:
|
|
72
|
-
|
|
72
|
+
/* @__PURE__ */ e(a, { onClick: () => u("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
73
|
+
/* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortDescNumber" : b ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
|
|
74
|
+
x === "desc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
|
|
73
75
|
] }) }),
|
|
74
|
-
/* @__PURE__ */ e(
|
|
76
|
+
/* @__PURE__ */ e(a, { onClick: () => u(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.reset") }) })
|
|
75
77
|
] })
|
|
76
78
|
] }),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */ e(
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ e(
|
|
81
|
-
/* @__PURE__ */ e("span", { children: "
|
|
82
|
-
|
|
79
|
+
/* @__PURE__ */ r(p, { children: [
|
|
80
|
+
/* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.freezeColumn") }),
|
|
81
|
+
/* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
|
|
82
|
+
/* @__PURE__ */ e(a, { onClick: () => m("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
83
|
+
/* @__PURE__ */ e("span", { children: n("gridHeader.pinLeft") }),
|
|
84
|
+
S === "left" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
|
|
83
85
|
] }) }),
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
-
/* @__PURE__ */ e("span", { children: "
|
|
86
|
-
|
|
86
|
+
/* @__PURE__ */ e(a, { onClick: () => m("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
87
|
+
/* @__PURE__ */ e("span", { children: n("gridHeader.pinRight") }),
|
|
88
|
+
S === "right" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
|
|
87
89
|
] }) }),
|
|
88
|
-
/* @__PURE__ */ e(
|
|
90
|
+
/* @__PURE__ */ e(a, { onClick: () => m(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.noPin") }) })
|
|
89
91
|
] })
|
|
90
92
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
/* @__PURE__ */ e(
|
|
93
|
+
/* @__PURE__ */ r(p, { children: [
|
|
94
|
+
/* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.columnWidth") }),
|
|
95
|
+
/* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
|
|
96
|
+
/* @__PURE__ */ e(a, { onClick: () => w(!1), children: n("gridHeader.autosizeThisColumn") }),
|
|
97
|
+
/* @__PURE__ */ e(a, { onClick: () => w(!0), children: n("gridHeader.autosizeAllColumns") })
|
|
96
98
|
] })
|
|
97
99
|
] }),
|
|
98
|
-
(N || v) && /* @__PURE__ */
|
|
100
|
+
(N || v) && /* @__PURE__ */ r(j, { children: [
|
|
99
101
|
/* @__PURE__ */ e(z, {}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ e(
|
|
102
|
-
"
|
|
102
|
+
/* @__PURE__ */ r(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
|
|
103
|
+
/* @__PURE__ */ e(_, { size: "xs" }),
|
|
104
|
+
" ",
|
|
105
|
+
n("gridHeader.searchOptions")
|
|
103
106
|
] }),
|
|
104
|
-
N && /* @__PURE__ */ e(
|
|
105
|
-
v && /* @__PURE__ */ e(
|
|
107
|
+
N && /* @__PURE__ */ e(a, { inset: !0, onClick: P, children: n("gridHeader.search") }),
|
|
108
|
+
v && /* @__PURE__ */ e(a, { inset: !0, onClick: T, children: n("gridHeader.advanceSearch") })
|
|
106
109
|
] })
|
|
107
110
|
] })
|
|
108
111
|
}
|
|
@@ -110,5 +113,5 @@ const K = ({
|
|
|
110
113
|
] });
|
|
111
114
|
};
|
|
112
115
|
export {
|
|
113
|
-
|
|
116
|
+
U as ColumnSettingsMenu
|
|
114
117
|
};
|