impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.8
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/data/ag-grid-react/ag-grid.types.d.ts +6 -0
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
- package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +109 -100
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +93 -21
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
- package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
- package/dist/components/data/data-table/data-table-saved-views.js +37 -37
- package/dist/components/data/data-table/data-table.js +78 -73
- package/dist/components/data/data-table/data-table.types.d.ts +7 -1
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +20 -17
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
- package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
- package/dist/components/feedback/dialog/dialog.js +3 -3
- package/dist/components/feedback/drawer/drawer.js +32 -32
- package/dist/components/feedback/sheet/sheet.js +8 -8
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +245 -258
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-summary.js +41 -41
- package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
- package/dist/components/flows/wizard/wizard.js +32 -32
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +70 -70
- package/dist/components/forms/date-picker/date-picker.js +31 -30
- package/dist/components/forms/file-upload/file-upload.js +146 -168
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +123 -120
- package/dist/components/forms/select/select.types.d.ts +95 -204
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +113 -116
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/sidebar/sidebar.js +5 -5
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/kbd/kbd.variants.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova-base.scss +8 -5
- package/dist/impact-nova-components.css +2 -2
- package/dist/impact-nova-tokens.scss +346 -189
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +505 -499
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +22 -254
- package/tailwind.config.js +10 -229
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ColDef, ColGroupDef, IHeaderParams, IHeaderGroupParams, Column, ValueFormatterParams } from 'ag-grid-community';
|
|
3
|
+
import { Theme } from 'ag-grid-enterprise';
|
|
3
4
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
4
5
|
/** ColDef extended with Impact Nova runtime metadata set during column processing */
|
|
5
6
|
export interface ImpactNovaColDef<TData = unknown> extends ColDef<TData> {
|
|
@@ -137,6 +138,11 @@ export interface AgGridWrapperProps<TData = unknown> extends Omit<AgGridReactPro
|
|
|
137
138
|
* Example: `{ currency: (p) => '$' + p.value }` then column def uses `valueFormatter: 'currency'`.
|
|
138
139
|
*/
|
|
139
140
|
valueFormatters?: Record<string, (params: ValueFormatterParams) => string>;
|
|
141
|
+
/**
|
|
142
|
+
* Theme Builder preview only — resolves AG Grid params from a scoped DOM node.
|
|
143
|
+
* Application code must rely on document CSS variables and the default theme.
|
|
144
|
+
*/
|
|
145
|
+
themeOverride?: Theme;
|
|
140
146
|
}
|
|
141
147
|
/**
|
|
142
148
|
* Filter operators for advanced filtering.
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { jsxs as Z, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import ee, { forwardRef as te, useRef as d, useMemo as
|
|
2
|
+
import ee, { forwardRef as te, useRef as d, useMemo as O, useState as P, useImperativeHandle as ne, useEffect as C, useCallback as E } from "react";
|
|
3
3
|
import { createPortal as re } from "react-dom";
|
|
4
4
|
function oe(r) {
|
|
5
5
|
if ("options" in r && r.options) return r.options;
|
|
6
6
|
const f = [];
|
|
7
7
|
if (!r || r.step <= 0 || r.min > r.max) return f;
|
|
8
8
|
for (let n = r.min; n <= r.max; n += r.step) {
|
|
9
|
-
const
|
|
10
|
-
f.push(String(
|
|
9
|
+
const x = Math.round(n * 1e10) / 1e10;
|
|
10
|
+
f.push(String(x));
|
|
11
11
|
}
|
|
12
12
|
return f;
|
|
13
13
|
}
|
|
14
14
|
function ae(r, f) {
|
|
15
15
|
if (!f) return r;
|
|
16
16
|
const n = f.toLowerCase();
|
|
17
|
-
return r.filter((
|
|
17
|
+
return r.filter((x) => x.toLowerCase().includes(n));
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const K = te((r, f) => {
|
|
20
20
|
const {
|
|
21
21
|
value: n,
|
|
22
|
-
placeholder:
|
|
23
|
-
min:
|
|
24
|
-
max:
|
|
25
|
-
step:
|
|
22
|
+
placeholder: x,
|
|
23
|
+
min: F,
|
|
24
|
+
max: U,
|
|
25
|
+
step: _,
|
|
26
26
|
maxLength: D,
|
|
27
27
|
onValueChange: p,
|
|
28
28
|
colDef: q,
|
|
29
29
|
className: z,
|
|
30
30
|
autocompleteRule: w
|
|
31
|
-
} = r,
|
|
31
|
+
} = r, u = q?.cellDataType === "number", G = w ? "text" : u ? "number" : "text", i = d(null), a = !!w, S = O(
|
|
32
32
|
() => w ? oe(w) : [],
|
|
33
33
|
[w]
|
|
34
|
-
), [c, J] = P(""), [b,
|
|
34
|
+
), [c, J] = P(""), [b, v] = P(-1), M = d(-1);
|
|
35
35
|
M.current = b;
|
|
36
|
-
const g = d("keyboard"), H = d(null), A = d(null), L = d(null), I = d(!1), [R, Q] = P(null), s =
|
|
37
|
-
|
|
36
|
+
const g = d("keyboard"), H = d(null), A = d(null), L = d(null), I = d(!1), [R, Q] = P(null), s = O(() => ae(S, c), [S, c]), B = d(s);
|
|
37
|
+
B.current = s;
|
|
38
38
|
const y = n && typeof n == "object" && "value" in n, N = y ? n.cellMetadata : void 0, W = y ? n.value : n;
|
|
39
39
|
ne(f, () => ({
|
|
40
40
|
getValue() {
|
|
41
41
|
if (a) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
42
|
+
const l = H.current;
|
|
43
|
+
if (l == null)
|
|
44
44
|
return n;
|
|
45
|
-
const h = Number(
|
|
45
|
+
const h = Number(l), $ = u && !isNaN(h) ? h : l;
|
|
46
46
|
return y ? {
|
|
47
|
-
value:
|
|
47
|
+
value: $,
|
|
48
48
|
...N !== void 0 && { cellMetadata: N }
|
|
49
|
-
} :
|
|
49
|
+
} : $;
|
|
50
50
|
}
|
|
51
51
|
const t = i.current?.value;
|
|
52
52
|
let o;
|
|
53
|
-
if (
|
|
53
|
+
if (u)
|
|
54
54
|
if (!t || t === "" || t === "-")
|
|
55
55
|
o = null;
|
|
56
56
|
else {
|
|
57
|
-
const
|
|
58
|
-
o = isNaN(
|
|
57
|
+
const l = Number(t);
|
|
58
|
+
o = isNaN(l) ? null : l;
|
|
59
59
|
}
|
|
60
60
|
else
|
|
61
61
|
o = t === "" ? null : t;
|
|
@@ -70,18 +70,18 @@ const O = te((r, f) => {
|
|
|
70
70
|
isCancelAfterEnd() {
|
|
71
71
|
return !1;
|
|
72
72
|
}
|
|
73
|
-
}), [a,
|
|
73
|
+
}), [a, u, y, N, n]), C(() => {
|
|
74
74
|
if (i.current) {
|
|
75
75
|
const e = n && typeof n == "object" && "value" in n ? n.value : n;
|
|
76
|
-
if (i.current.value = e != null ? String(e) : "",
|
|
76
|
+
if (i.current.value = e != null ? String(e) : "", u) {
|
|
77
77
|
const t = i.current, o = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
|
|
78
78
|
Object.defineProperty(t, "value", {
|
|
79
79
|
get() {
|
|
80
|
-
const
|
|
81
|
-
return isNaN(
|
|
80
|
+
const l = this.valueAsNumber;
|
|
81
|
+
return isNaN(l) ? o.get.call(this) : l;
|
|
82
82
|
},
|
|
83
|
-
set(
|
|
84
|
-
o.set.call(this,
|
|
83
|
+
set(l) {
|
|
84
|
+
o.set.call(this, l);
|
|
85
85
|
},
|
|
86
86
|
configurable: !0
|
|
87
87
|
});
|
|
@@ -90,16 +90,16 @@ const O = te((r, f) => {
|
|
|
90
90
|
}
|
|
91
91
|
return () => {
|
|
92
92
|
};
|
|
93
|
-
}, [n,
|
|
93
|
+
}, [n, u, r.suppressAutoFocus]);
|
|
94
94
|
const j = E(() => {
|
|
95
95
|
I.current || (I.current = !0, r.stopEditing?.());
|
|
96
96
|
}, [r]), V = E((e) => {
|
|
97
97
|
if (H.current = e, p) {
|
|
98
|
-
const t = Number(e), o =
|
|
98
|
+
const t = Number(e), o = u && !isNaN(t) ? t : e;
|
|
99
99
|
p(o);
|
|
100
100
|
}
|
|
101
101
|
I.current = !0, r.stopEditing?.();
|
|
102
|
-
}, [
|
|
102
|
+
}, [u, p, r]), k = d(V);
|
|
103
103
|
k.current = V, C(() => {
|
|
104
104
|
if (a && L.current) {
|
|
105
105
|
const e = L.current.getBoundingClientRect();
|
|
@@ -108,9 +108,9 @@ const O = te((r, f) => {
|
|
|
108
108
|
}, [a]), C(() => {
|
|
109
109
|
if (!a) return;
|
|
110
110
|
const e = k, t = (o) => {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const h =
|
|
111
|
+
const l = o.target.closest?.("[data-autocomplete-value]");
|
|
112
|
+
if (l && A.current?.contains(l)) {
|
|
113
|
+
const h = l.getAttribute("data-autocomplete-value");
|
|
114
114
|
h != null && (o.stopImmediatePropagation(), o.preventDefault(), e.current(h));
|
|
115
115
|
}
|
|
116
116
|
};
|
|
@@ -119,11 +119,11 @@ const O = te((r, f) => {
|
|
|
119
119
|
a && b >= 0 && A.current && A.current.querySelectorAll("[data-autocomplete-item]")[b]?.scrollIntoView({ block: "nearest" });
|
|
120
120
|
}, [b, a]), C(() => {
|
|
121
121
|
if (!a || !c) {
|
|
122
|
-
|
|
122
|
+
v(-1);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const e = s.findIndex((t) => t.toLowerCase() === c.toLowerCase());
|
|
126
|
-
g.current = "mouse",
|
|
126
|
+
g.current = "mouse", v(e >= 0 ? e : -1);
|
|
127
127
|
}, [a, c, s]);
|
|
128
128
|
const X = E(() => {
|
|
129
129
|
const e = i.current?.value;
|
|
@@ -132,34 +132,34 @@ const O = te((r, f) => {
|
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
if (!(D && e && e.length > D)) {
|
|
135
|
-
if (
|
|
135
|
+
if (u && i.current) {
|
|
136
136
|
const t = i.current.valueAsNumber;
|
|
137
137
|
isNaN(t) || i.current.setAttribute("data-value", String(t));
|
|
138
138
|
}
|
|
139
139
|
p?.(e);
|
|
140
140
|
}
|
|
141
|
-
}, [D, p,
|
|
141
|
+
}, [D, p, u, a]), T = E((e) => {
|
|
142
142
|
if (a) {
|
|
143
143
|
if (e.key === "Escape") {
|
|
144
144
|
e.stopPropagation(), j();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (e.key === "ArrowDown") {
|
|
148
|
-
e.preventDefault(), e.stopPropagation(), g.current = "keyboard",
|
|
148
|
+
e.preventDefault(), e.stopPropagation(), g.current = "keyboard", v((t) => t < s.length - 1 ? t + 1 : 0);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
if (e.key === "ArrowUp") {
|
|
152
|
-
e.preventDefault(), e.stopPropagation(), g.current = "keyboard",
|
|
152
|
+
e.preventDefault(), e.stopPropagation(), g.current = "keyboard", v((t) => t > 0 ? t - 1 : s.length - 1);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
156
156
|
e.preventDefault(), e.stopPropagation(), e.nativeEvent.stopImmediatePropagation();
|
|
157
|
-
const t = M.current, o =
|
|
157
|
+
const t = M.current, o = B.current;
|
|
158
158
|
if (t >= 0 && t < o.length)
|
|
159
159
|
k.current(o[t]);
|
|
160
160
|
else {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const l = o.find((h) => h.toLowerCase() === c.toLowerCase());
|
|
162
|
+
l ? k.current(l) : j();
|
|
163
163
|
}
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
@@ -190,25 +190,25 @@ const O = te((r, f) => {
|
|
|
190
190
|
{
|
|
191
191
|
ref: L,
|
|
192
192
|
className: `w-full h-full flex items-center ag-cell-inner-padding in-ag-editable-cell-highlight ${z ?? ""}`,
|
|
193
|
-
onKeyDownCapture: a ?
|
|
193
|
+
onKeyDownCapture: a ? T : void 0,
|
|
194
194
|
children: [
|
|
195
195
|
/* @__PURE__ */ m(
|
|
196
196
|
"div",
|
|
197
197
|
{
|
|
198
|
-
className: `flex w-full items-center rounded-[8px] bg-canvas-elevated px-1.5 h-7 ${
|
|
198
|
+
className: `flex w-full items-center rounded-[8px] bg-canvas-elevated px-1.5 h-7 ${u ? "justify-end text-right" : ""}`,
|
|
199
199
|
children: /* @__PURE__ */ m(
|
|
200
200
|
"input",
|
|
201
201
|
{
|
|
202
202
|
ref: i,
|
|
203
203
|
type: G,
|
|
204
204
|
onChange: X,
|
|
205
|
-
onKeyDown: a ? void 0 :
|
|
205
|
+
onKeyDown: a ? void 0 : T,
|
|
206
206
|
onBlur: Y,
|
|
207
|
-
placeholder:
|
|
208
|
-
className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-content outline-none placeholder:font-medium placeholder:text-content-empty ${
|
|
209
|
-
min: a ? void 0 :
|
|
210
|
-
max: a ? void 0 :
|
|
211
|
-
step: a ? void 0 :
|
|
207
|
+
placeholder: x,
|
|
208
|
+
className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-content outline-none placeholder:font-medium placeholder:text-content-empty ${u ? "text-right" : ""}`,
|
|
209
|
+
min: a ? void 0 : F,
|
|
210
|
+
max: a ? void 0 : U,
|
|
211
|
+
step: a ? void 0 : _
|
|
212
212
|
}
|
|
213
213
|
)
|
|
214
214
|
}
|
|
@@ -218,7 +218,7 @@ const O = te((r, f) => {
|
|
|
218
218
|
"div",
|
|
219
219
|
{
|
|
220
220
|
ref: A,
|
|
221
|
-
className: "fixed z-[9999] overflow-hidden rounded-[12px] bg-
|
|
221
|
+
className: "fixed z-[9999] overflow-hidden rounded-[12px] bg-canvas-elevated text-base shadow-elevation-select focus:outline-none sm:text-sm flex flex-col border-none",
|
|
222
222
|
style: { top: R.top, left: R.left, width: R.width, maxHeight: 250 },
|
|
223
223
|
children: /* @__PURE__ */ m(
|
|
224
224
|
"div",
|
|
@@ -227,10 +227,10 @@ const O = te((r, f) => {
|
|
|
227
227
|
style: { maxHeight: 240, overscrollBehavior: "contain" },
|
|
228
228
|
role: "listbox",
|
|
229
229
|
onMouseLeave: () => {
|
|
230
|
-
g.current = "mouse",
|
|
230
|
+
g.current = "mouse", v(-1);
|
|
231
231
|
},
|
|
232
|
-
children: s.length === 0 ? /* @__PURE__ */ m("div", { className: "flex items-center justify-center py-6 text-sm text-
|
|
233
|
-
const o = t === b,
|
|
232
|
+
children: s.length === 0 ? /* @__PURE__ */ m("div", { className: "flex items-center justify-center py-6 text-sm text-content-secondary", children: "No options found" }) : s.map((e, t) => {
|
|
233
|
+
const o = t === b, l = e === String(W ?? "");
|
|
234
234
|
return /* @__PURE__ */ m(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
@@ -241,10 +241,10 @@ const O = te((r, f) => {
|
|
|
241
241
|
"data-autocomplete-item": !0,
|
|
242
242
|
role: "option",
|
|
243
243
|
"aria-selected": o,
|
|
244
|
-
className: `cursor-default select-none py-[6px] px-3 flex items-center ${
|
|
244
|
+
className: `cursor-default select-none py-[6px] px-3 flex items-center ${u ? "justify-end text-right" : "justify-between"} transition-colors rounded-md ${o && g.current === "keyboard" ? "ring-2 ring-inset ring-primary bg-accent text-content" : o && g.current === "mouse" ? "bg-muted text-content" : l ? "bg-accent text-content" : "text-content hover:bg-muted cursor-pointer"}`,
|
|
245
245
|
"data-autocomplete-value": e,
|
|
246
246
|
onMouseEnter: () => {
|
|
247
|
-
g.current = "mouse",
|
|
247
|
+
g.current = "mouse", v(t);
|
|
248
248
|
},
|
|
249
249
|
children: /* @__PURE__ */ m("span", { className: "text-sm", children: e })
|
|
250
250
|
}
|
|
@@ -263,8 +263,8 @@ const O = te((r, f) => {
|
|
|
263
263
|
}
|
|
264
264
|
);
|
|
265
265
|
});
|
|
266
|
-
|
|
267
|
-
const se = ee.memo(
|
|
266
|
+
K.displayName = "InputCellEditor";
|
|
267
|
+
const se = ee.memo(K, () => !0);
|
|
268
268
|
export {
|
|
269
269
|
se as InputCellEditor
|
|
270
270
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight bus for column-picker filter/search indicators.
|
|
3
|
+
* Replaces synthetic `gridApi.onFilterChanged('api')` on search open/close,
|
|
4
|
+
* which incorrectly triggers SSRM refetches when the filter model is unchanged.
|
|
5
|
+
*/
|
|
6
|
+
type ColumnIndicatorSyncListener = () => void;
|
|
7
|
+
export declare function subscribeColumnIndicatorSync(listener: ColumnIndicatorSyncListener): () => void;
|
|
8
|
+
export declare function emitColumnIndicatorSync(): void;
|
|
9
|
+
export {};
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Settings as
|
|
4
|
-
import { DropdownMenu as A, DropdownMenuTrigger as
|
|
5
|
-
import { useImpactNovaI18n as
|
|
6
|
-
import { useGridHeader as
|
|
7
|
-
const
|
|
8
|
-
isOpen:
|
|
3
|
+
import { Settings as W, Checkmark as m, Search as J } from "impact-nova-icons";
|
|
4
|
+
import { DropdownMenu as A, DropdownMenuTrigger as F, DropdownMenuContent as P, DropdownMenuItem as i, DropdownMenuLabel as T, DropdownMenuSeparator as j, DropdownMenuSub as g, DropdownMenuSubTrigger as C, DropdownMenuSubContent as x } from "../../../../feedback/dropdown-menu/dropdown-menu.js";
|
|
5
|
+
import { useImpactNovaI18n as K } from "../../../../../i18n/use-impact-nova-i18n.js";
|
|
6
|
+
import { useGridHeader as Q } from "../context/grid-header-context.js";
|
|
7
|
+
const I = ({
|
|
8
|
+
isOpen: S,
|
|
9
9
|
onClose: a,
|
|
10
10
|
columnId: c,
|
|
11
11
|
gridApi: s,
|
|
12
|
-
anchor:
|
|
12
|
+
anchor: q,
|
|
13
13
|
variant: d = "column"
|
|
14
14
|
}) => {
|
|
15
|
-
const { t
|
|
15
|
+
const { t } = K(), h = Q(), u = d === "column" ? s.getColumn(c) : null;
|
|
16
16
|
if (d === "column" && !u) return null;
|
|
17
|
-
const l = u?.getColDef(),
|
|
17
|
+
const l = u?.getColDef(), w = u?.getSort(), y = u?.getPinned(), E = d === "column" && l?.sortable !== !1, H = l?.filter || "agTextColumnFilter", b = H === "agNumberColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("numericColumn") : l?.type === "numericColumn"), k = H === "agDateColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("dateColumn") : l?.type === "dateColumn"), G = s.getGridOption("suppressRowVirtualisation") !== !0, p = (n) => {
|
|
18
18
|
queueMicrotask(() => {
|
|
19
19
|
s.applyColumnState({
|
|
20
|
-
state: [{ colId: c, sort:
|
|
20
|
+
state: [{ colId: c, sort: n }],
|
|
21
21
|
defaultState: { sort: null }
|
|
22
22
|
});
|
|
23
23
|
}), a();
|
|
24
|
-
},
|
|
24
|
+
}, f = (n) => {
|
|
25
25
|
queueMicrotask(() => {
|
|
26
26
|
s.applyColumnState({
|
|
27
|
-
state: [{ colId: c, pinned:
|
|
27
|
+
state: [{ colId: c, pinned: n }]
|
|
28
28
|
});
|
|
29
29
|
}), a();
|
|
30
|
-
}, N = (
|
|
31
|
-
|
|
30
|
+
}, N = (n) => {
|
|
31
|
+
n ? s.autoSizeAllColumns() : s.autoSizeColumns([c]), a();
|
|
32
32
|
}, D = () => {
|
|
33
33
|
queueMicrotask(() => {
|
|
34
34
|
s.showColumnChooser();
|
|
35
35
|
}), a();
|
|
36
|
-
},
|
|
36
|
+
}, v = () => {
|
|
37
37
|
queueMicrotask(() => {
|
|
38
38
|
s.resetColumnState();
|
|
39
39
|
}), a();
|
|
40
|
-
}, G = () => {
|
|
41
|
-
const t = s.getGridOption("context") || {};
|
|
42
|
-
s.setGridOption("context", { ...t, activeSearchColumnId: c }), s.refreshHeader(), a();
|
|
43
40
|
}, R = () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
if (h)
|
|
42
|
+
h.openSearch(c);
|
|
43
|
+
else {
|
|
44
|
+
const n = s.getGridOption("context") || {};
|
|
45
|
+
s.setGridOption("context", { ...n, activeSearchColumnId: c }), s.refreshHeader();
|
|
46
|
+
}
|
|
47
|
+
a();
|
|
48
|
+
}, L = () => {
|
|
49
|
+
const n = l?.headerComponentParams;
|
|
50
|
+
n?.onAdvanceSearchClick ? n.onAdvanceSearchClick(u) : n?.toggleAdvanceSearch ? n.toggleAdvanceSearch(c) : h && h.openAdvancedFilter(c), a();
|
|
51
|
+
}, o = q?.getBoundingClientRect(), z = l?.headerComponentParams, M = d === "column" && z?.isSearchable, O = d === "column" && z?.advanceSearchEnabled, V = t(G ? "gridHeader.autosizeAllVisibleColumns" : "gridHeader.autosizeAllColumns");
|
|
52
|
+
return d === "group" ? /* @__PURE__ */ r(A, { open: S, onOpenChange: (n) => !n && a(), children: [
|
|
53
|
+
o && /* @__PURE__ */ e(F, { asChild: !0, children: /* @__PURE__ */ e(
|
|
49
54
|
"div",
|
|
50
55
|
{
|
|
51
56
|
style: {
|
|
@@ -60,21 +65,21 @@ const $ = ({
|
|
|
60
65
|
}
|
|
61
66
|
) }),
|
|
62
67
|
/* @__PURE__ */ e(
|
|
63
|
-
|
|
68
|
+
P,
|
|
64
69
|
{
|
|
65
70
|
align: "end",
|
|
66
71
|
side: "bottom",
|
|
67
72
|
sideOffset: 5,
|
|
68
|
-
className: "w-[200px] p-2 rounded-[8px] border-none !shadow-
|
|
69
|
-
onCloseAutoFocus: (
|
|
73
|
+
className: "w-[200px] p-2 rounded-[8px] border-none !shadow-elevation-settings",
|
|
74
|
+
onCloseAutoFocus: (n) => n.preventDefault(),
|
|
70
75
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
71
|
-
/* @__PURE__ */ e(i, { onClick: D, children:
|
|
72
|
-
/* @__PURE__ */ e(i, { onClick:
|
|
76
|
+
/* @__PURE__ */ e(i, { onClick: D, children: t("gridHeader.chooseColumns") }),
|
|
77
|
+
/* @__PURE__ */ e(i, { onClick: v, children: t("gridHeader.resetColumns") })
|
|
73
78
|
] })
|
|
74
79
|
}
|
|
75
80
|
)
|
|
76
|
-
] }) : /* @__PURE__ */ r(A, { open:
|
|
77
|
-
o && /* @__PURE__ */ e(
|
|
81
|
+
] }) : /* @__PURE__ */ r(A, { open: S, onOpenChange: (n) => !n && a(), children: [
|
|
82
|
+
o && /* @__PURE__ */ e(F, { asChild: !0, children: /* @__PURE__ */ e(
|
|
78
83
|
"div",
|
|
79
84
|
{
|
|
80
85
|
style: {
|
|
@@ -89,66 +94,66 @@ const $ = ({
|
|
|
89
94
|
}
|
|
90
95
|
) }),
|
|
91
96
|
/* @__PURE__ */ e(
|
|
92
|
-
|
|
97
|
+
P,
|
|
93
98
|
{
|
|
94
99
|
align: "end",
|
|
95
100
|
side: "bottom",
|
|
96
101
|
sideOffset: 5,
|
|
97
|
-
className: "w-[200px] p-2 rounded-[8px] border-none !shadow-
|
|
98
|
-
onCloseAutoFocus: (
|
|
102
|
+
className: "w-[200px] p-2 rounded-[8px] border-none !shadow-elevation-settings",
|
|
103
|
+
onCloseAutoFocus: (n) => n.preventDefault(),
|
|
99
104
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
100
|
-
/* @__PURE__ */ r(
|
|
101
|
-
/* @__PURE__ */ e(
|
|
105
|
+
/* @__PURE__ */ r(T, { className: "flex items-center gap-2 text-content-tertiary", children: [
|
|
106
|
+
/* @__PURE__ */ e(W, { size: "xs" }),
|
|
102
107
|
" ",
|
|
103
|
-
|
|
108
|
+
t("gridHeader.columnSettings")
|
|
104
109
|
] }),
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
/* @__PURE__ */ r(
|
|
109
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
110
|
-
/* @__PURE__ */ e("span", { children:
|
|
111
|
-
|
|
110
|
+
/* @__PURE__ */ e(j, {}),
|
|
111
|
+
E && /* @__PURE__ */ r(g, { children: [
|
|
112
|
+
/* @__PURE__ */ e(C, { inset: !0, children: t("gridHeader.sort") }),
|
|
113
|
+
/* @__PURE__ */ r(x, { sideOffset: 10, alignOffset: -5, children: [
|
|
114
|
+
/* @__PURE__ */ e(i, { onClick: () => p("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
115
|
+
/* @__PURE__ */ e("span", { children: t(b ? "gridHeader.sortAscNumber" : k ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
|
|
116
|
+
w === "asc" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
112
117
|
] }) }),
|
|
113
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
114
|
-
/* @__PURE__ */ e("span", { children:
|
|
115
|
-
|
|
118
|
+
/* @__PURE__ */ e(i, { onClick: () => p("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
119
|
+
/* @__PURE__ */ e("span", { children: t(b ? "gridHeader.sortDescNumber" : k ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
|
|
120
|
+
w === "desc" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
116
121
|
] }) }),
|
|
117
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
122
|
+
/* @__PURE__ */ e(i, { onClick: () => p(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.reset") }) })
|
|
118
123
|
] })
|
|
119
124
|
] }),
|
|
120
|
-
/* @__PURE__ */ r(
|
|
121
|
-
/* @__PURE__ */ e(
|
|
122
|
-
/* @__PURE__ */ r(
|
|
123
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
124
|
-
/* @__PURE__ */ e("span", { children:
|
|
125
|
-
|
|
125
|
+
/* @__PURE__ */ r(g, { children: [
|
|
126
|
+
/* @__PURE__ */ e(C, { inset: !0, children: t("gridHeader.freezeColumn") }),
|
|
127
|
+
/* @__PURE__ */ r(x, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
|
|
128
|
+
/* @__PURE__ */ e(i, { onClick: () => f("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
129
|
+
/* @__PURE__ */ e("span", { children: t("gridHeader.pinLeft") }),
|
|
130
|
+
y === "left" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
126
131
|
] }) }),
|
|
127
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
128
|
-
/* @__PURE__ */ e("span", { children:
|
|
129
|
-
|
|
132
|
+
/* @__PURE__ */ e(i, { onClick: () => f("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
133
|
+
/* @__PURE__ */ e("span", { children: t("gridHeader.pinRight") }),
|
|
134
|
+
y === "right" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
130
135
|
] }) }),
|
|
131
|
-
/* @__PURE__ */ e(i, { onClick: () =>
|
|
136
|
+
/* @__PURE__ */ e(i, { onClick: () => f(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.noPin") }) })
|
|
132
137
|
] })
|
|
133
138
|
] }),
|
|
134
|
-
/* @__PURE__ */ r(
|
|
135
|
-
/* @__PURE__ */ e(
|
|
136
|
-
/* @__PURE__ */ r(
|
|
137
|
-
/* @__PURE__ */ e(i, { onClick: () => N(!1), children:
|
|
138
|
-
/* @__PURE__ */ e(i, { onClick: () => N(!0), children:
|
|
139
|
+
/* @__PURE__ */ r(g, { children: [
|
|
140
|
+
/* @__PURE__ */ e(C, { inset: !0, children: t("gridHeader.columnWidth") }),
|
|
141
|
+
/* @__PURE__ */ r(x, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
|
|
142
|
+
/* @__PURE__ */ e(i, { onClick: () => N(!1), children: t("gridHeader.autosizeThisColumn") }),
|
|
143
|
+
/* @__PURE__ */ e(i, { onClick: () => N(!0), children: V })
|
|
139
144
|
] })
|
|
140
145
|
] }),
|
|
141
|
-
/* @__PURE__ */ e(i, { inset: !0, onClick: D, children:
|
|
142
|
-
/* @__PURE__ */ e(i, { inset: !0, onClick:
|
|
143
|
-
(M || O) && /* @__PURE__ */ r(
|
|
144
|
-
/* @__PURE__ */ e(
|
|
145
|
-
/* @__PURE__ */ r(
|
|
146
|
-
/* @__PURE__ */ e(
|
|
146
|
+
/* @__PURE__ */ e(i, { inset: !0, onClick: D, children: t("gridHeader.chooseColumns") }),
|
|
147
|
+
/* @__PURE__ */ e(i, { inset: !0, onClick: v, children: t("gridHeader.resetColumns") }),
|
|
148
|
+
(M || O) && /* @__PURE__ */ r(B, { children: [
|
|
149
|
+
/* @__PURE__ */ e(j, {}),
|
|
150
|
+
/* @__PURE__ */ r(T, { className: "flex items-center gap-2 text-content-tertiary", children: [
|
|
151
|
+
/* @__PURE__ */ e(J, { size: "xs" }),
|
|
147
152
|
" ",
|
|
148
|
-
|
|
153
|
+
t("gridHeader.searchOptions")
|
|
149
154
|
] }),
|
|
150
|
-
M && /* @__PURE__ */ e(i, { inset: !0, onClick:
|
|
151
|
-
O && /* @__PURE__ */ e(i, { inset: !0, onClick:
|
|
155
|
+
M && /* @__PURE__ */ e(i, { inset: !0, onClick: R, children: t("gridHeader.search") }),
|
|
156
|
+
O && /* @__PURE__ */ e(i, { inset: !0, onClick: L, children: t("gridHeader.advanceSearch") })
|
|
152
157
|
] })
|
|
153
158
|
] })
|
|
154
159
|
}
|
|
@@ -156,5 +161,5 @@ const $ = ({
|
|
|
156
161
|
] });
|
|
157
162
|
};
|
|
158
163
|
export {
|
|
159
|
-
|
|
164
|
+
I as ColumnSettingsMenu
|
|
160
165
|
};
|
|
@@ -140,7 +140,9 @@ const re = ({ api: o }) => {
|
|
|
140
140
|
{
|
|
141
141
|
column: s,
|
|
142
142
|
api: i,
|
|
143
|
-
onClose: () =>
|
|
143
|
+
onClose: () => {
|
|
144
|
+
l.closeSearch();
|
|
145
|
+
},
|
|
144
146
|
handleInlineSearch: N,
|
|
145
147
|
handleClearSearchInline: x ? () => x(o) : void 0,
|
|
146
148
|
onAdvanceSearchClick: y,
|