impact-nova 1.3.0 → 1.5.2
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.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
- 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.js +62 -58
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +354 -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 -86
- package/dist/components/ui/select/select.js +206 -209
- 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/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/index.d.ts +4 -0
- package/dist/icons/index.js +179 -171
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +232 -172
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as ce, useState as
|
|
3
|
-
import { Filter as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsxs as M, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as ce, useState as S, useEffect as fe, useCallback as He } from "react";
|
|
3
|
+
import { Filter as ze } from "lucide-react";
|
|
4
|
+
import { cn as Se } from "../../../../lib/utils.js";
|
|
5
5
|
import { DatePicker as ue } from "../../date-picker/date-picker.js";
|
|
6
|
-
import { Input as
|
|
6
|
+
import { Input as me } from "../../input.js";
|
|
7
7
|
import he from "../../select/select.js";
|
|
8
|
-
import { Popover as qe, PopoverTrigger as Ee, PopoverContent as Be, PopoverHeader as
|
|
9
|
-
import { Cross as
|
|
10
|
-
import { useGridHeader as
|
|
11
|
-
import { getMultiFilterIndices as
|
|
12
|
-
import { deserializeDate as
|
|
13
|
-
|
|
8
|
+
import { Popover as qe, PopoverTrigger as Ee, PopoverContent as Be, PopoverHeader as Re, PopoverTitle as ke, PopoverBody as Oe } from "../../popover.js";
|
|
9
|
+
import { Cross as pe } from "../../../../icons/index.js";
|
|
10
|
+
import { useGridHeader as We } from "./context/grid-header-context.js";
|
|
11
|
+
import { getMultiFilterIndices as D, getDisplayStringFromFilterModel as q, parseInputPattern as je } from "./utils/filter-utils.js";
|
|
12
|
+
import { deserializeDate as C, serializeDate as ge } from "./utils/date-utils.js";
|
|
13
|
+
import { useImpactNovaI18n as Ge } from "../../../../i18n/ImpactNovaI18nContext.js";
|
|
14
|
+
const Le = {
|
|
14
15
|
contains: "contains",
|
|
15
16
|
notContains: "notContains",
|
|
16
17
|
equals: "equals",
|
|
@@ -24,180 +25,180 @@ const je = {
|
|
|
24
25
|
inRange: "inRange",
|
|
25
26
|
empty: "blank",
|
|
26
27
|
notEmpty: "notBlank"
|
|
27
|
-
},
|
|
28
|
-
column:
|
|
29
|
-
api:
|
|
30
|
-
onClose:
|
|
31
|
-
handleInlineSearch:
|
|
32
|
-
handleClearSearchInline:
|
|
33
|
-
onAdvanceSearchClick:
|
|
34
|
-
toggleAdvanceSearch:
|
|
35
|
-
advanceSearchEnabled:
|
|
28
|
+
}, nt = ({
|
|
29
|
+
column: I,
|
|
30
|
+
api: d,
|
|
31
|
+
onClose: L,
|
|
32
|
+
handleInlineSearch: _,
|
|
33
|
+
handleClearSearchInline: V,
|
|
34
|
+
onAdvanceSearchClick: J,
|
|
35
|
+
toggleAdvanceSearch: K,
|
|
36
|
+
advanceSearchEnabled: xe = !1,
|
|
36
37
|
selectOptions: E,
|
|
37
|
-
isMultiSelect:
|
|
38
|
-
onSelectScrollToBottom:
|
|
39
|
-
onSelectSearchChange:
|
|
40
|
-
onSelectOpen:
|
|
41
|
-
isLoadingSelect:
|
|
42
|
-
enableSpaceSplitting:
|
|
43
|
-
enableBooleanParsing:
|
|
44
|
-
enableDateParsing:
|
|
38
|
+
isMultiSelect: b,
|
|
39
|
+
onSelectScrollToBottom: ye,
|
|
40
|
+
onSelectSearchChange: Fe,
|
|
41
|
+
onSelectOpen: Q,
|
|
42
|
+
isLoadingSelect: U,
|
|
43
|
+
enableSpaceSplitting: Me = !1,
|
|
44
|
+
enableBooleanParsing: ve = !1,
|
|
45
|
+
enableDateParsing: Ce = !1
|
|
45
46
|
}) => {
|
|
46
|
-
const a =
|
|
47
|
-
const t =
|
|
47
|
+
const { t: p } = Ge(), a = I.getColDef(), o = I.getColId(), B = a?.filter || "agTextColumnFilter", x = B === "agDateColumnFilter", R = B === "agSetColumnFilter" || E && E.length > 0 || a?.cellDataType === "boolean", X = We(), k = ce(null), Y = ce(!1), [O, W] = S(() => {
|
|
48
|
+
const t = d.getFilterModel()[o];
|
|
48
49
|
if (!t) return "";
|
|
49
50
|
if (t.filterType === "multi" && t.filterModels) {
|
|
50
|
-
const l =
|
|
51
|
+
const l = D(a), r = l.text !== -1 ? l.text : l.number;
|
|
51
52
|
if (r !== -1) {
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
53
|
+
const m = t.filterModels[r];
|
|
54
|
+
if (m) return q(o, m);
|
|
54
55
|
}
|
|
55
56
|
return "";
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
-
}), [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
const [
|
|
63
|
-
const t =
|
|
58
|
+
return x ? "" : q(o, t);
|
|
59
|
+
}), [Z, u] = S(!1);
|
|
60
|
+
fe(() => {
|
|
61
|
+
Y.current = Z;
|
|
62
|
+
}, [Z]);
|
|
63
|
+
const [$, j] = S(() => {
|
|
64
|
+
const t = d.getFilterModel()[o];
|
|
64
65
|
if (t) {
|
|
65
66
|
if (t.filterType === "multi" && t.filterModels) {
|
|
66
|
-
const { date: l } =
|
|
67
|
+
const { date: l } = D(a);
|
|
67
68
|
if (l !== -1) {
|
|
68
69
|
const r = t.filterModels[l];
|
|
69
70
|
if (r) {
|
|
70
|
-
if (r.dateFrom) return
|
|
71
|
-
if (r.filter) return
|
|
71
|
+
if (r.dateFrom) return C(r.dateFrom);
|
|
72
|
+
if (r.filter) return C(r.filter);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
if (
|
|
76
|
-
if (t.dateFrom) return
|
|
77
|
-
if (t.filter) return
|
|
76
|
+
if (x) {
|
|
77
|
+
if (t.dateFrom) return C(t.dateFrom);
|
|
78
|
+
if (t.filter) return C(t.filter);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
return null;
|
|
81
82
|
});
|
|
82
|
-
|
|
83
|
+
fe(() => {
|
|
83
84
|
const e = () => {
|
|
84
|
-
const l =
|
|
85
|
+
const l = d.getFilterModel()[o];
|
|
85
86
|
let r = "";
|
|
86
87
|
if (l)
|
|
87
88
|
if (l.filterType === "multi" && l.filterModels) {
|
|
88
|
-
const i =
|
|
89
|
+
const i = D(a), n = i.text !== -1 ? i.text : i.number;
|
|
89
90
|
if (n !== -1) {
|
|
90
|
-
const
|
|
91
|
-
r =
|
|
91
|
+
const c = l.filterModels[n];
|
|
92
|
+
r = c ? q(o, c) : "";
|
|
92
93
|
}
|
|
93
|
-
} else
|
|
94
|
-
|
|
95
|
-
let
|
|
94
|
+
} else x || (r = q(o, l));
|
|
95
|
+
Y.current || W((i) => i !== r ? r : i);
|
|
96
|
+
let m = null;
|
|
96
97
|
if (l)
|
|
97
98
|
if (l.filterType === "multi" && l.filterModels) {
|
|
98
|
-
const { date: i } =
|
|
99
|
+
const { date: i } = D(a);
|
|
99
100
|
if (i !== -1) {
|
|
100
101
|
const n = l.filterModels[i];
|
|
101
|
-
n && (
|
|
102
|
+
n && (m = n.dateFrom ? C(n.dateFrom) : n.filter ? C(n.filter) : null);
|
|
102
103
|
}
|
|
103
|
-
} else
|
|
104
|
-
|
|
104
|
+
} else x && (m = l.dateFrom ? C(l.dateFrom) : l.filter ? C(l.filter) : null);
|
|
105
|
+
j((i) => i?.getTime() !== m?.getTime() ? m : i);
|
|
105
106
|
};
|
|
106
|
-
return
|
|
107
|
-
|
|
107
|
+
return d.addEventListener("filterChanged", e), () => {
|
|
108
|
+
d.removeEventListener("filterChanged", e);
|
|
108
109
|
};
|
|
109
|
-
}, [
|
|
110
|
-
const
|
|
111
|
-
const r = { ...
|
|
112
|
-
const
|
|
110
|
+
}, [d, o, x]);
|
|
111
|
+
const ee = (e, t) => {
|
|
112
|
+
const r = { ...d.getFilterModel() }, m = (n) => n.replace(/[^0-9.\-+eE]/g, ""), i = (n, c) => {
|
|
113
|
+
const A = c === "number" ? m(n) : n, g = je(A, Me, ve, Ce);
|
|
113
114
|
if (console.log("[HeaderSearchInput] Pattern Debug:", {
|
|
114
115
|
input: n,
|
|
115
|
-
sanitizedInput:
|
|
116
|
-
filterType:
|
|
117
|
-
parsed:
|
|
118
|
-
}),
|
|
119
|
-
const T = (
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
return ["contains", "notContains", "startsWith", "endsWith"].includes(
|
|
124
|
-
type:
|
|
125
|
-
filter: parseFloat(h
|
|
126
|
-
filterTo: parseFloat(h
|
|
116
|
+
sanitizedInput: A,
|
|
117
|
+
filterType: c,
|
|
118
|
+
parsed: g
|
|
119
|
+
}), g.conditions.length === 0) return null;
|
|
120
|
+
const T = (h) => {
|
|
121
|
+
let v = Le[h.operator] || "contains";
|
|
122
|
+
if (c === "number") {
|
|
123
|
+
const de = parseFloat(m(h.value));
|
|
124
|
+
return ["contains", "notContains", "startsWith", "endsWith"].includes(v) && (v = v === "notContains" ? "notEqual" : "equals"), h.operator === "inRange" ? {
|
|
125
|
+
type: v,
|
|
126
|
+
filter: parseFloat(m(h.value)) || 0,
|
|
127
|
+
filterTo: parseFloat(m(h.valueTo || "")) || 0,
|
|
127
128
|
filterType: "number"
|
|
128
|
-
} : isNaN(
|
|
129
|
+
} : isNaN(de) ? null : { type: v, filter: de, filterType: "number" };
|
|
129
130
|
}
|
|
130
131
|
return {
|
|
131
|
-
type:
|
|
132
|
-
filter:
|
|
133
|
-
filterTo:
|
|
132
|
+
type: v,
|
|
133
|
+
filter: h.value,
|
|
134
|
+
filterTo: h.valueTo,
|
|
134
135
|
filterType: "text"
|
|
135
136
|
};
|
|
136
137
|
};
|
|
137
|
-
let
|
|
138
|
-
if (
|
|
139
|
-
|
|
138
|
+
let f = null;
|
|
139
|
+
if (g.conditions.length === 1)
|
|
140
|
+
f = T(g.conditions[0]);
|
|
140
141
|
else {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
filterType:
|
|
144
|
-
operator:
|
|
145
|
-
conditions:
|
|
142
|
+
const h = g.conditions.map(T).filter((v) => v !== null);
|
|
143
|
+
h.length === 0 ? f = null : h.length === 1 ? f = h[0] : f = {
|
|
144
|
+
filterType: c,
|
|
145
|
+
operator: g.logic,
|
|
146
|
+
conditions: h
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
|
-
return console.log("[HeaderSearchInput] Resulting Model:",
|
|
149
|
+
return console.log("[HeaderSearchInput] Resulting Model:", f), f;
|
|
149
150
|
};
|
|
150
151
|
if (a.filter === "agMultiColumnFilter") {
|
|
151
|
-
const n =
|
|
152
|
-
if (
|
|
153
|
-
const
|
|
152
|
+
const n = D(a), c = t === "text" ? n.text !== -1 ? n.text : n.number : t === "set" ? n.set : n.date;
|
|
153
|
+
if (c === -1) return;
|
|
154
|
+
const A = d.getFilterModel()[o], g = A && A.filterType === "multi" ? [...A.filterModels || []] : Array(a.filterParams?.filters?.length || 1).fill(null);
|
|
154
155
|
let T = null;
|
|
155
156
|
if (e !== null && e !== "" && (!Array.isArray(e) || e.length > 0))
|
|
156
157
|
if (t === "set")
|
|
157
158
|
T = { values: Array.isArray(e) ? e : [String(e)], filterType: "set" };
|
|
158
159
|
else if (t === "date") {
|
|
159
|
-
const
|
|
160
|
-
T =
|
|
160
|
+
const f = e instanceof Date ? ge(e) : null;
|
|
161
|
+
T = f ? { type: "equals", dateFrom: f, filterType: "date" } : null;
|
|
161
162
|
} else {
|
|
162
|
-
const
|
|
163
|
-
T = i(String(e),
|
|
163
|
+
const f = n.text !== -1 ? "text" : "number";
|
|
164
|
+
T = i(String(e), f);
|
|
164
165
|
}
|
|
165
|
-
|
|
166
|
+
g[c] = T, g.every((f) => f === null) ? delete r[o] : r[o] = { filterType: "multi", filterModels: g };
|
|
166
167
|
} else if (e === null || e === "" || Array.isArray(e) && e.length === 0)
|
|
167
168
|
delete r[o];
|
|
168
169
|
else if (t === "date") {
|
|
169
|
-
const n = e instanceof Date ?
|
|
170
|
+
const n = e instanceof Date ? ge(e) : null;
|
|
170
171
|
r[o] = n ? { type: "equals", dateFrom: n, filterType: "date" } : null;
|
|
171
172
|
} else if (t === "set")
|
|
172
173
|
r[o] = { filterType: "set", values: Array.isArray(e) ? e : [String(e)] };
|
|
173
174
|
else {
|
|
174
|
-
const n = B === "agNumberColumnFilter" ? "number" : "text",
|
|
175
|
-
|
|
175
|
+
const n = B === "agNumberColumnFilter" ? "number" : "text", c = i(String(e), n);
|
|
176
|
+
c ? r[o] = c : delete r[o];
|
|
176
177
|
}
|
|
177
178
|
console.log("[HeaderSearchInput] Final Model Applied:", {
|
|
178
179
|
column: o,
|
|
179
180
|
model: r[o]
|
|
180
|
-
}),
|
|
181
|
-
},
|
|
182
|
-
if (
|
|
183
|
-
|
|
181
|
+
}), d.setFilterModel(r), d.onFilterChanged();
|
|
182
|
+
}, G = (e) => {
|
|
183
|
+
if (_) {
|
|
184
|
+
_(Array.isArray(e) ? e.join(",") : e);
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
|
-
|
|
187
|
-
}, ee = (e) => {
|
|
188
|
-
const t = e.target.value;
|
|
189
|
-
O(t), j(t);
|
|
187
|
+
ee(e, x ? "date" : "text");
|
|
190
188
|
}, te = (e) => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
189
|
+
const t = e.target.value;
|
|
190
|
+
W(t), G(t);
|
|
191
|
+
}, le = (e) => {
|
|
192
|
+
j(e), G(e);
|
|
193
|
+
}, be = () => {
|
|
194
|
+
W(""), j(null), G(""), V && V();
|
|
195
|
+
}, w = (e) => {
|
|
196
|
+
ee(e, "set");
|
|
197
|
+
}, H = E || (a?.cellDataType === "boolean" ? [{ label: p("gridHeader.true"), value: "true" }, { label: p("gridHeader.false"), value: "false" }] : []), re = He(() => {
|
|
198
|
+
const e = d.getFilterModel()[o];
|
|
198
199
|
if (!e) return [];
|
|
199
200
|
if ("filterType" in e && e.filterType === "multi" && e.filterModels) {
|
|
200
|
-
const l =
|
|
201
|
+
const l = D(I.getColDef()).set;
|
|
201
202
|
if (l !== -1) {
|
|
202
203
|
const r = e.filterModels[l];
|
|
203
204
|
if (r?.filterType === "set" && r.values) return r.values;
|
|
@@ -209,152 +210,152 @@ const je = {
|
|
|
209
210
|
return [String(e.filter)];
|
|
210
211
|
}
|
|
211
212
|
return [];
|
|
212
|
-
}, [
|
|
213
|
-
const e =
|
|
214
|
-
return
|
|
215
|
-
},
|
|
213
|
+
}, [d, o, I]), [z, P] = S(null), ne = () => {
|
|
214
|
+
const e = z !== null ? z : re();
|
|
215
|
+
return b ? H.filter((t) => e.includes(t.value)) : H.find((t) => e.includes(t.value)) || null;
|
|
216
|
+
}, oe = (e) => {
|
|
216
217
|
let t = [];
|
|
217
|
-
if (Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e && (t = [e.value]), !
|
|
218
|
-
|
|
218
|
+
if (Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e && (t = [e.value]), !b) {
|
|
219
|
+
w(t), e && L();
|
|
219
220
|
return;
|
|
220
221
|
}
|
|
221
|
-
|
|
222
|
+
P(t);
|
|
222
223
|
}, Te = () => {
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
if (
|
|
224
|
+
w([]), P([]);
|
|
225
|
+
}, De = (e) => {
|
|
226
|
+
if (b) {
|
|
226
227
|
if (e !== void 0) {
|
|
227
228
|
let t = [];
|
|
228
|
-
Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e ? t = [e.value] : e === null && (t = []),
|
|
229
|
+
Array.isArray(e) ? t = e.map((l) => l.value) : e && typeof e == "object" && "value" in e ? t = [e.value] : e === null && (t = []), w(t), P(null);
|
|
229
230
|
return;
|
|
230
231
|
}
|
|
231
|
-
|
|
232
|
+
z !== null && (w(z), P(null));
|
|
232
233
|
}
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
e.stopPropagation(),
|
|
237
|
-
}, children: /* @__PURE__ */ s("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" }) }) : null,
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const l = t ===
|
|
242
|
-
return e !== null && l !==
|
|
234
|
+
}, Ne = () => {
|
|
235
|
+
P(re()), Q && Q();
|
|
236
|
+
}, Ae = () => xe ? /* @__PURE__ */ s("svg", { className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6] shrink-0", fill: "currentColor", focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", onClick: (e) => {
|
|
237
|
+
e.stopPropagation(), k.current && k.current.blur(), J ? J(I) : K ? K(o) : X && X.openAdvancedFilter(o);
|
|
238
|
+
}, children: /* @__PURE__ */ s("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" }) }) : null, Ie = () => /* @__PURE__ */ s("button", { onClick: L, className: "cursor-pointer shrink-0 text-[#4259ee] hover:text-[#0f1c76]", children: /* @__PURE__ */ s(pe, { size: "xs" }) }), N = a.filter === "agMultiColumnFilter", y = D(a);
|
|
239
|
+
let F = "text";
|
|
240
|
+
N ? F = y.set !== -1 ? "set" : y.date !== -1 ? "date" : "text" : R ? F = "set" : x && (F = "date");
|
|
241
|
+
const Pe = N ? y.text !== -1 || y.number !== -1 : !x && !R, se = N ? y.set !== -1 : R, ie = N ? y.date !== -1 : x, we = d.getFilterModel()[o], ae = N && we?.filterModels?.some((e, t) => {
|
|
242
|
+
const l = t === y.text || t === y.number ? "text" : t === y.set ? "set" : "date";
|
|
243
|
+
return e !== null && l !== F;
|
|
243
244
|
});
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
|
|
245
|
+
return /* @__PURE__ */ M("div", { className: "ag-header-cell-label flex items-center gap-1 w-full bg-[#eceefd] px-1 py-2 ag-header-cell-search-active h-full", children: [
|
|
246
|
+
F === "set" && se ? /* @__PURE__ */ s(
|
|
246
247
|
he,
|
|
247
248
|
{
|
|
248
|
-
options:
|
|
249
|
-
value:
|
|
250
|
-
onChange:
|
|
251
|
-
isMulti:
|
|
252
|
-
placeholder: "
|
|
249
|
+
options: H,
|
|
250
|
+
value: ne(),
|
|
251
|
+
onChange: oe,
|
|
252
|
+
isMulti: b !== void 0 ? b : a?.cellDataType !== "boolean",
|
|
253
|
+
placeholder: p("filter.select"),
|
|
253
254
|
className: "w-full bg-white",
|
|
254
255
|
parentClassName: "flex-1 min-w-0",
|
|
255
256
|
menuWidth: "200px",
|
|
256
257
|
menuPortalTarget: document.body,
|
|
257
258
|
autoFocus: !0,
|
|
258
|
-
onMenuOpen:
|
|
259
|
-
onMenuClose:
|
|
260
|
-
onMenuScrollToBottom:
|
|
261
|
-
onInputChange:
|
|
259
|
+
onMenuOpen: Ne,
|
|
260
|
+
onMenuClose: De,
|
|
261
|
+
onMenuScrollToBottom: ye,
|
|
262
|
+
onInputChange: Fe,
|
|
262
263
|
onClearAll: Te,
|
|
263
|
-
isLoading:
|
|
264
|
-
onFocus: () =>
|
|
265
|
-
onBlur: () =>
|
|
264
|
+
isLoading: U,
|
|
265
|
+
onFocus: () => u(!0),
|
|
266
|
+
onBlur: () => u(!1)
|
|
266
267
|
}
|
|
267
|
-
) :
|
|
268
|
+
) : F === "date" && ie ? /* @__PURE__ */ s(
|
|
268
269
|
ue,
|
|
269
270
|
{
|
|
270
|
-
value:
|
|
271
|
-
onChange: (e) =>
|
|
272
|
-
placeholder: "
|
|
271
|
+
value: $ || void 0,
|
|
272
|
+
onChange: (e) => le(e || null),
|
|
273
|
+
placeholder: p("filter.selectDate"),
|
|
273
274
|
format: "MM-dd-yyyy",
|
|
274
275
|
minDate: /* @__PURE__ */ new Date("2000-01-01"),
|
|
275
276
|
maxDate: /* @__PURE__ */ new Date("2100-12-31"),
|
|
276
277
|
className: "w-full bg-white",
|
|
277
|
-
onFocus: () =>
|
|
278
|
-
onBlur: () =>
|
|
278
|
+
onFocus: () => u(!0),
|
|
279
|
+
onBlur: () => u(!1)
|
|
279
280
|
}
|
|
280
281
|
) : /* @__PURE__ */ s(
|
|
281
|
-
|
|
282
|
+
me,
|
|
282
283
|
{
|
|
283
|
-
value:
|
|
284
|
-
onChange:
|
|
285
|
-
placeholder: "
|
|
284
|
+
value: O,
|
|
285
|
+
onChange: te,
|
|
286
|
+
placeholder: p("filter.search"),
|
|
286
287
|
type: "text",
|
|
287
288
|
className: "flex-1 bg-white",
|
|
288
289
|
autoFocus: !0,
|
|
289
|
-
ref:
|
|
290
|
-
onFocus: () =>
|
|
291
|
-
onBlur: () =>
|
|
292
|
-
suffix:
|
|
293
|
-
e.stopPropagation(),
|
|
294
|
-
}, className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6]", children: /* @__PURE__ */ s(
|
|
290
|
+
ref: k,
|
|
291
|
+
onFocus: () => u(!0),
|
|
292
|
+
onBlur: () => u(!1),
|
|
293
|
+
suffix: O && /* @__PURE__ */ s("button", { onClick: (e) => {
|
|
294
|
+
e.stopPropagation(), be();
|
|
295
|
+
}, className: "cursor-pointer text-[#7a8294] hover:text-[#3649C6]", children: /* @__PURE__ */ s(pe, { size: "xs" }) })
|
|
295
296
|
}
|
|
296
297
|
),
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
|
|
299
|
-
/* @__PURE__ */ s(Ee, { asChild: !0, children: /* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */ s(
|
|
301
|
-
|
|
298
|
+
/* @__PURE__ */ M("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
299
|
+
N && /* @__PURE__ */ M(qe, { children: [
|
|
300
|
+
/* @__PURE__ */ s(Ee, { asChild: !0, children: /* @__PURE__ */ M("div", { className: "relative group p-1 hover:bg-[#dbe0fb] rounded-md transition-colors cursor-pointer", children: [
|
|
301
|
+
/* @__PURE__ */ s(ze, { size: "md", className: Se("text-[#60697D] group-hover:text-[#3649C6]", ae && "text-[#3649C6]") }),
|
|
302
|
+
ae && /* @__PURE__ */ s("span", { className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-[#4259ee] border border-white shadow-sm" })
|
|
302
303
|
] }) }),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */ s(
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
307
|
-
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "
|
|
304
|
+
/* @__PURE__ */ M(Be, { align: "end", className: "w-[300px]", children: [
|
|
305
|
+
/* @__PURE__ */ s(Re, { children: /* @__PURE__ */ s(ke, { children: p("gridHeader.activeFilters") }) }),
|
|
306
|
+
/* @__PURE__ */ M(Oe, { className: "flex flex-col gap-4", children: [
|
|
307
|
+
F !== "text" && Pe && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
308
|
+
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: p("gridHeader.textSearch") }),
|
|
308
309
|
/* @__PURE__ */ s(
|
|
309
|
-
|
|
310
|
+
me,
|
|
310
311
|
{
|
|
311
|
-
value:
|
|
312
|
-
onChange:
|
|
313
|
-
placeholder: "
|
|
312
|
+
value: O,
|
|
313
|
+
onChange: te,
|
|
314
|
+
placeholder: p("filter.searchPlaceholder"),
|
|
314
315
|
className: "bg-white",
|
|
315
|
-
onFocus: () =>
|
|
316
|
-
onBlur: () =>
|
|
316
|
+
onFocus: () => u(!0),
|
|
317
|
+
onBlur: () => u(!1)
|
|
317
318
|
}
|
|
318
319
|
)
|
|
319
320
|
] }),
|
|
320
|
-
|
|
321
|
-
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "
|
|
321
|
+
F !== "set" && se && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
322
|
+
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: p("gridHeader.selectionFilter") }),
|
|
322
323
|
/* @__PURE__ */ s(
|
|
323
324
|
he,
|
|
324
325
|
{
|
|
325
|
-
options:
|
|
326
|
-
value:
|
|
327
|
-
onChange:
|
|
328
|
-
isMulti:
|
|
329
|
-
placeholder: "
|
|
326
|
+
options: H,
|
|
327
|
+
value: ne(),
|
|
328
|
+
onChange: oe,
|
|
329
|
+
isMulti: b !== void 0 ? b : a?.cellDataType !== "boolean",
|
|
330
|
+
placeholder: p("filter.select"),
|
|
330
331
|
className: "w-full bg-white",
|
|
331
|
-
isLoading:
|
|
332
|
-
onFocus: () =>
|
|
333
|
-
onBlur: () =>
|
|
332
|
+
isLoading: U,
|
|
333
|
+
onFocus: () => u(!0),
|
|
334
|
+
onBlur: () => u(!1)
|
|
334
335
|
}
|
|
335
336
|
)
|
|
336
337
|
] }),
|
|
337
|
-
|
|
338
|
-
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: "
|
|
338
|
+
F !== "date" && ie && /* @__PURE__ */ M("div", { className: "flex flex-col gap-1.5", children: [
|
|
339
|
+
/* @__PURE__ */ s("span", { className: "text-xs font-semibold text-[#60697D]", children: p("gridHeader.dateFilter") }),
|
|
339
340
|
/* @__PURE__ */ s(
|
|
340
341
|
ue,
|
|
341
342
|
{
|
|
342
|
-
value:
|
|
343
|
-
onChange: (e) =>
|
|
343
|
+
value: $ || void 0,
|
|
344
|
+
onChange: (e) => le(e || null),
|
|
344
345
|
className: "w-full bg-white",
|
|
345
|
-
onFocus: () =>
|
|
346
|
-
onBlur: () =>
|
|
346
|
+
onFocus: () => u(!0),
|
|
347
|
+
onBlur: () => u(!1)
|
|
347
348
|
}
|
|
348
349
|
)
|
|
349
350
|
] })
|
|
350
351
|
] })
|
|
351
352
|
] })
|
|
352
353
|
] }),
|
|
353
|
-
|
|
354
|
-
|
|
354
|
+
Ae(),
|
|
355
|
+
Ie()
|
|
355
356
|
] })
|
|
356
357
|
] });
|
|
357
358
|
};
|
|
358
359
|
export {
|
|
359
|
-
|
|
360
|
+
nt as HeaderSearchInput
|
|
360
361
|
};
|