impact-nova 2.1.0-alpha.9 → 2.2.1
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 +6 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +15 -13
- package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -58
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
- package/dist/components/data/ag-grid-react/index.js +166 -163
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -4
- package/dist/components/data/ag-grid-react/theme.js +0 -2
- package/dist/components/data/data-table/data-table-column-list.js +1 -1
- package/dist/components/data/data-table/data-table-saved-views.js +1 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +7 -6
- package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
- package/dist/components/data/nested-list/components/SortableItem.js +111 -109
- package/dist/components/data-display/calendar/calendar-footer-emphasis.d.ts +28 -0
- package/dist/components/data-display/calendar/calendar-footer-emphasis.js +8 -0
- package/dist/components/data-display/calendar/calendar-footer.d.ts +4 -1
- package/dist/components/data-display/calendar/calendar-footer.js +60 -38
- package/dist/components/data-display/calendar/calendar.js +86 -82
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/filter-strip/filter-strip.js +36 -29
- package/dist/components/flows/filter-strip/filter-summary.js +2 -2
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +118 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +164 -0
- package/dist/components/forms/date-picker/date-picker.js +202 -138
- package/dist/components/forms/date-picker/date-range-picker.js +302 -215
- package/dist/components/forms/date-picker/month-picker.js +160 -119
- package/dist/components/forms/date-picker/month-range-picker.js +302 -245
- package/dist/components/forms/date-picker/multi-date-picker.js +94 -80
- package/dist/components/forms/date-picker/multi-month-picker.js +97 -83
- package/dist/components/forms/date-picker/multi-week-picker.js +107 -93
- package/dist/components/forms/date-picker/week-picker.js +230 -140
- package/dist/components/forms/date-picker/week-range-picker.js +332 -226
- package/dist/components/forms/file-upload/file-upload.js +312 -174
- package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
- package/dist/components/layout/dynamic-layout/dynamic-layout.variants.d.ts +1 -1
- package/dist/components/layout/header/header.js +45 -38
- package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
- package/dist/components/layout/horizontal-scroller/index.js +3 -2
- package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
- package/dist/components/ui/show.d.ts +10 -0
- package/dist/components/ui/show.js +7 -0
- package/dist/components/ui/show.types.d.ts +5 -0
- package/dist/i18n/defaultMessages.d.ts +17 -0
- package/dist/i18n/defaultMessages.js +29 -17
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +12 -0
- package/dist/i18n/locales/es.js +12 -0
- package/dist/i18n/locales/hi.js +12 -0
- package/dist/i18n/locales/kn.js +12 -0
- package/dist/impact-nova-base.scss +6 -2
- package/dist/impact-nova-components.css +141 -16
- package/dist/impact-nova-tokens.scss +12 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +273 -271
- package/dist/lib/utils.js +40 -24
- 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/tailwind.config.js +36 -4
- package/dist/theme/tailwind-colors.js +3 -1
- package/package.json +15 -6
- package/tailwind.config.d.ts +3 -0
- package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -58
package/README.md
CHANGED
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
[](#internationalization-i18n)
|
|
15
15
|
[](https://impact-nova.iaproducts.ai/)
|
|
16
16
|
[](https://www.npmjs.com/package/impact-nova-mcp)
|
|
17
|
+
[](https://vitest.dev/)
|
|
18
|
+
[](https://testing-library.com/docs/react-testing-library/intro/)
|
|
19
|
+
[](https://playwright.dev/)
|
|
20
|
+
[](https://storybook.js.org/docs/writing-tests)
|
|
21
|
+
[](https://storybook.js.org/docs/writing-tests/accessibility-testing)
|
|
22
|
+
[](https://impact-nova.iaproducts.ai/?path=/docs/brand-identity-testing-quality--documentation)
|
|
17
23
|
|
|
18
24
|
</div>
|
|
19
25
|
|
|
@@ -1,127 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as F, useImperativeHandle as B, useEffect as H, useMemo as L, useCallback as M } from "react";
|
|
3
|
+
import { resolveValueFormatter as q, applyValueFormatter as J, resolveCellEditable as I } from "../cell-renderer-utils.js";
|
|
4
|
+
import { initializeSplitCellFocusSession as Q } from "./split-cell-focus.js";
|
|
5
|
+
function X() {
|
|
5
6
|
return document;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
function Y(p, w, a, u, r) {
|
|
9
|
+
const n = a, s = typeof u?.editable == "boolean" ? u.editable : void 0, f = p[w], i = f?.field?.split(".")?.pop(), l = i ? r?.[i] : void 0;
|
|
10
|
+
return I(s, f?.editable, n, l);
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
const { splits:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
const h = Y().__splitCellLastClickY;
|
|
28
|
-
if (h == null)
|
|
29
|
-
return { index: e, wasEditable: t, clearClickY: a, activeIndex: o };
|
|
30
|
-
const w = d.getBoundingClientRect(), K = h - w.top, E = w.height / l.length, F = Math.floor(K / E);
|
|
31
|
-
return e = Math.max(0, Math.min(F, l.length - 1)), a = !0, o = e, t = A(l, e, r, i, n), { index: e, wasEditable: t, clearClickY: a, activeIndex: o };
|
|
32
|
-
} catch {
|
|
33
|
-
return { index: 0, wasEditable: !0, clearClickY: !1, activeIndex: void 0 };
|
|
34
|
-
}
|
|
35
|
-
}, [l, g, S, r, i, n]);
|
|
36
|
-
R(() => {
|
|
37
|
-
const e = Y();
|
|
38
|
-
v.clearClickY && (e.__splitCellLastClickY = void 0), v.activeIndex != null && (e.__splitCellLastActiveIndex = v.activeIndex), e.__splitCellLastWasEditable = v.wasEditable;
|
|
39
|
-
}, [v]);
|
|
40
|
-
const k = v.index, y = x(() => {
|
|
41
|
-
if (!l?.length) return !1;
|
|
42
|
-
const e = l[k];
|
|
43
|
-
if (!e) return !1;
|
|
44
|
-
const t = r, a = typeof i?.editable == "boolean" ? i.editable : void 0, o = e.field?.split(".")?.pop(), d = o ? n?.[o] : void 0;
|
|
45
|
-
return !D(a, e.editable, t, d);
|
|
46
|
-
}, [l, k, r, i, n]) || S && !M;
|
|
47
|
-
B(_, () => ({
|
|
12
|
+
const Z = z((p, w) => {
|
|
13
|
+
const { splits: a, commonParams: u, data: r, node: n, api: s, column: f, context: i, value: l, colDef: o, valueFormatter: U, eventKey: D } = p, [N] = F(() => {
|
|
14
|
+
const e = p.eGridCell;
|
|
15
|
+
return Q({
|
|
16
|
+
cellElement: e,
|
|
17
|
+
splits: a,
|
|
18
|
+
eventKey: D,
|
|
19
|
+
data: r,
|
|
20
|
+
colDef: o,
|
|
21
|
+
value: l,
|
|
22
|
+
documentState: X(),
|
|
23
|
+
resolveSplitEditable: Y
|
|
24
|
+
});
|
|
25
|
+
}), { targetSplitIndex: k, isKeyboardEntry: A, lastWasEditable: P, targetIsNonEditable: R } = N, v = R || A && !P;
|
|
26
|
+
B(w, () => ({
|
|
48
27
|
getValue() {
|
|
49
|
-
const e =
|
|
50
|
-
return e &&
|
|
28
|
+
const e = o?.field;
|
|
29
|
+
return e && n?.data ? n.data[e] : l;
|
|
51
30
|
},
|
|
52
31
|
isCancelBeforeStart() {
|
|
53
|
-
return
|
|
32
|
+
return v;
|
|
54
33
|
},
|
|
55
34
|
isCancelAfterEnd() {
|
|
56
35
|
return !1;
|
|
57
36
|
}
|
|
58
|
-
}), [
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
}), [o, n, l, v]), H(() => {
|
|
38
|
+
v && setTimeout(() => {
|
|
39
|
+
s?.stopEditing();
|
|
61
40
|
}, 0);
|
|
62
|
-
}, [
|
|
63
|
-
const j =
|
|
64
|
-
const t = e?.field?.split(".")?.pop() ?? "",
|
|
65
|
-
return { valueKey: t, field: e.field, newValue:
|
|
66
|
-
}) ?? [], [
|
|
67
|
-
const t =
|
|
68
|
-
if (!t || !
|
|
69
|
-
const
|
|
70
|
-
if (String(t.newValue ?? "") === String(
|
|
41
|
+
}, [v, s]);
|
|
42
|
+
const j = L(() => a?.map((e) => {
|
|
43
|
+
const t = e?.field?.split(".")?.pop() ?? "", d = l?.[t]?.value;
|
|
44
|
+
return { valueKey: t, field: e.field, newValue: d };
|
|
45
|
+
}) ?? [], [a, l]), [g, O] = F(j), $ = M((e) => {
|
|
46
|
+
const t = g.find((b) => b.field === e);
|
|
47
|
+
if (!t || !o.field) return;
|
|
48
|
+
const d = l?.[t.valueKey]?.value;
|
|
49
|
+
if (String(t.newValue ?? "") === String(d ?? ""))
|
|
71
50
|
return;
|
|
72
51
|
document.__splitCellLastWasEditable = !0;
|
|
73
|
-
const
|
|
74
|
-
api:
|
|
75
|
-
colDef:
|
|
76
|
-
column:
|
|
77
|
-
context:
|
|
52
|
+
const c = {
|
|
53
|
+
api: s,
|
|
54
|
+
colDef: o,
|
|
55
|
+
column: f,
|
|
56
|
+
context: i,
|
|
78
57
|
data: r,
|
|
79
|
-
field:
|
|
80
|
-
node:
|
|
81
|
-
rowIndex:
|
|
82
|
-
rowPinned:
|
|
58
|
+
field: o.field,
|
|
59
|
+
node: n,
|
|
60
|
+
rowIndex: n?.rowIndex ?? null,
|
|
61
|
+
rowPinned: n?.rowPinned ?? void 0,
|
|
83
62
|
source: "edit",
|
|
84
63
|
type: "cellValueChanged",
|
|
85
64
|
currentCellUpdate: t,
|
|
86
65
|
newValue: { [t.valueKey]: { value: t.newValue } },
|
|
87
|
-
oldValue: { [t.valueKey]: { value:
|
|
66
|
+
oldValue: { [t.valueKey]: { value: l?.[t.valueKey]?.value } },
|
|
88
67
|
value: { [t.valueKey]: { value: t.newValue } }
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
}, [
|
|
68
|
+
}, m = l?.[t.valueKey] ?? {};
|
|
69
|
+
n.setDataValue(o.field, { ...l, [t.valueKey]: { ...m, value: t.newValue } }), i?.onCellUpdate?.(c);
|
|
70
|
+
}, [g, s, o, f, i, r, n, l]), G = (e) => {
|
|
92
71
|
if (typeof e == "string") {
|
|
93
|
-
const t =
|
|
94
|
-
return
|
|
72
|
+
const t = s?.getGridOption("components");
|
|
73
|
+
return i?.frameworkComponents?.[e] || t?.[e];
|
|
95
74
|
}
|
|
96
75
|
return e;
|
|
97
76
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
77
|
+
return /* @__PURE__ */ C("div", { style: { display: "grid", gridTemplateRows: `repeat(${a?.length}, 1fr)`, height: "100%", width: "100%" }, children: a?.map((e, t) => {
|
|
78
|
+
const d = e?.field?.split(".")?.pop();
|
|
79
|
+
if (!d) return null;
|
|
80
|
+
const c = l?.[d], m = c?.value, b = r, V = q(c, b, e?.valueFormatter, U ?? null), h = V ? J(V, m) : m?.toString(), T = typeof o?.editable == "boolean" ? o.editable : void 0, y = I(T, e.editable, b, c), W = t === k && y, E = y ? u?.cellEditor ?? u?.cellRenderer : u?.cellRenderer ?? void 0, S = E ? G(E) : void 0;
|
|
81
|
+
return /* @__PURE__ */ C("div", { className: "flex items-center max-h-full overflow-hidden", children: S ? /* @__PURE__ */ C(
|
|
82
|
+
S,
|
|
104
83
|
{
|
|
105
|
-
context:
|
|
84
|
+
context: i,
|
|
106
85
|
data: r,
|
|
107
|
-
value:
|
|
108
|
-
onValueChange: (
|
|
109
|
-
const
|
|
110
|
-
|
|
86
|
+
value: c,
|
|
87
|
+
onValueChange: (x) => {
|
|
88
|
+
const K = g.find((_) => _.field === e.field);
|
|
89
|
+
K ? K.newValue = x : O([...g, { valueKey: d, field: e.field, newValue: x }]);
|
|
111
90
|
},
|
|
112
|
-
valueFormatted:
|
|
113
|
-
colDef: { ...e, editable:
|
|
91
|
+
valueFormatted: h ?? void 0,
|
|
92
|
+
colDef: { ...e, editable: y },
|
|
114
93
|
stopEditing: () => {
|
|
115
|
-
|
|
94
|
+
$(e.field);
|
|
116
95
|
},
|
|
117
|
-
node:
|
|
118
|
-
suppressAutoFocus: !
|
|
119
|
-
className: t !==
|
|
96
|
+
node: n,
|
|
97
|
+
suppressAutoFocus: !W,
|
|
98
|
+
className: t !== a.length - 1 ? "border-b border-stroke-hairline" : ""
|
|
120
99
|
}
|
|
121
|
-
) : /* @__PURE__ */
|
|
100
|
+
) : /* @__PURE__ */ C("div", { className: "w-full h-full flex items-center ag-cell-inner-padding overflow-hidden text-ellipsis whitespace-nowrap", children: String(h ?? m ?? "") }) }, `${e.field}-${t}`);
|
|
122
101
|
}) });
|
|
123
102
|
});
|
|
124
|
-
|
|
103
|
+
Z.displayName = "SplitCellEditor";
|
|
125
104
|
export {
|
|
126
|
-
|
|
105
|
+
Z as SplitCellEditor
|
|
127
106
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ColDef } from 'ag-grid-enterprise';
|
|
2
|
+
import { SplitConfig, SplitCellValue } from '../types';
|
|
3
|
+
export type SplitCellDocumentState = {
|
|
4
|
+
__splitCellLastClickY?: number;
|
|
5
|
+
__splitCellLastActiveIndex?: number;
|
|
6
|
+
__splitCellLastWasEditable?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* True when edit was started by keyboard (Enter/F2/type-to-edit), not mouse click.
|
|
10
|
+
* eventKey wins over stale __splitCellLastClickY left by a prior mousedown that did not edit.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isSplitCellKeyboardEntry(eventKey: string | null | undefined, documentState: SplitCellDocumentState): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Call from colDef.suppressKeyboardEvent before AG Grid evaluates editable().
|
|
15
|
+
* Clears stale click coordinates so Enter/F2/type-to-edit use keyboard focus rules.
|
|
16
|
+
*/
|
|
17
|
+
export declare function prepareSplitCellKeyboardEditStart(eventKey: string, isEditing: boolean): void;
|
|
18
|
+
export type SplitCellFocusMeta = {
|
|
19
|
+
index: number;
|
|
20
|
+
wasEditable: boolean;
|
|
21
|
+
clearClickY: boolean;
|
|
22
|
+
activeIndex?: number;
|
|
23
|
+
};
|
|
24
|
+
type ResolveSplitEditable = (splits: SplitConfig[], index: number, data: unknown, colDef: ColDef | undefined, value: SplitCellValue | undefined) => boolean;
|
|
25
|
+
export declare function computeSplitCellFocusMeta(options: {
|
|
26
|
+
cellElement?: HTMLElement;
|
|
27
|
+
splits?: SplitConfig[];
|
|
28
|
+
isKeyboardEntry: boolean;
|
|
29
|
+
eventKey: string | null | undefined;
|
|
30
|
+
data: unknown;
|
|
31
|
+
colDef: ColDef | undefined;
|
|
32
|
+
value: SplitCellValue | undefined;
|
|
33
|
+
documentState: SplitCellDocumentState;
|
|
34
|
+
resolveSplitEditable: ResolveSplitEditable;
|
|
35
|
+
}): SplitCellFocusMeta;
|
|
36
|
+
export type SplitCellFocusSession = {
|
|
37
|
+
targetSplitIndex: number;
|
|
38
|
+
isKeyboardEntry: boolean;
|
|
39
|
+
lastWasEditable: boolean;
|
|
40
|
+
targetIsNonEditable: boolean;
|
|
41
|
+
};
|
|
42
|
+
export declare function initializeSplitCellFocusSession(options: {
|
|
43
|
+
cellElement?: HTMLElement;
|
|
44
|
+
splits?: SplitConfig[];
|
|
45
|
+
eventKey: string | null | undefined;
|
|
46
|
+
data: unknown;
|
|
47
|
+
colDef: ColDef | undefined;
|
|
48
|
+
value: SplitCellValue | undefined;
|
|
49
|
+
documentState: SplitCellDocumentState;
|
|
50
|
+
resolveSplitEditable: ResolveSplitEditable;
|
|
51
|
+
}): SplitCellFocusSession;
|
|
52
|
+
export declare function applySplitCellFocusMeta(documentState: SplitCellDocumentState, focusMeta: SplitCellFocusMeta): void;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function x(e, l) {
|
|
2
|
+
return e != null && e !== "" ? !0 : l.__splitCellLastClickY == null;
|
|
3
|
+
}
|
|
4
|
+
function _(e, l, a, n, s, i) {
|
|
5
|
+
for (let t = 0; t < e.length; t++)
|
|
6
|
+
if (s(e, t, l, a, n))
|
|
7
|
+
return i.__splitCellLastActiveIndex = t, i.__splitCellLastWasEditable = !0, { index: t, wasEditable: !0, clearClickY: !1 };
|
|
8
|
+
return i.__splitCellLastWasEditable = !1, { index: 0, wasEditable: !1, clearClickY: !1 };
|
|
9
|
+
}
|
|
10
|
+
function b(e, l, a, n, s, i) {
|
|
11
|
+
const t = i.__splitCellLastActiveIndex;
|
|
12
|
+
if (t != null && t >= 0 && t < e.length) {
|
|
13
|
+
const r = s(e, t, l, a, n);
|
|
14
|
+
return i.__splitCellLastWasEditable = r, { index: t, wasEditable: r, clearClickY: !1 };
|
|
15
|
+
}
|
|
16
|
+
return _(e, l, a, n, s, i);
|
|
17
|
+
}
|
|
18
|
+
function p(e, l, a, n, s, i, t) {
|
|
19
|
+
const r = t.__splitCellLastClickY;
|
|
20
|
+
if (r == null)
|
|
21
|
+
return { index: 0, wasEditable: !0, clearClickY: !1 };
|
|
22
|
+
const c = e.getBoundingClientRect(), d = r - c.top, u = c.height / l.length, f = Math.floor(d / u), C = Math.max(0, Math.min(f, l.length - 1)), o = i(l, C, a, n, s);
|
|
23
|
+
return t.__splitCellLastClickY = void 0, t.__splitCellLastActiveIndex = C, t.__splitCellLastWasEditable = o, {
|
|
24
|
+
index: C,
|
|
25
|
+
wasEditable: o,
|
|
26
|
+
clearClickY: !1,
|
|
27
|
+
activeIndex: void 0
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function E(e) {
|
|
31
|
+
const {
|
|
32
|
+
cellElement: l,
|
|
33
|
+
splits: a,
|
|
34
|
+
isKeyboardEntry: n,
|
|
35
|
+
eventKey: s,
|
|
36
|
+
data: i,
|
|
37
|
+
colDef: t,
|
|
38
|
+
value: r,
|
|
39
|
+
documentState: c,
|
|
40
|
+
resolveSplitEditable: d
|
|
41
|
+
} = e;
|
|
42
|
+
return !l || !a?.length ? { index: 0, wasEditable: !0, clearClickY: !1 } : n ? s === "Tab" ? b(
|
|
43
|
+
a,
|
|
44
|
+
i,
|
|
45
|
+
t,
|
|
46
|
+
r,
|
|
47
|
+
d,
|
|
48
|
+
c
|
|
49
|
+
) : _(
|
|
50
|
+
a,
|
|
51
|
+
i,
|
|
52
|
+
t,
|
|
53
|
+
r,
|
|
54
|
+
d,
|
|
55
|
+
c
|
|
56
|
+
) : p(
|
|
57
|
+
l,
|
|
58
|
+
a,
|
|
59
|
+
i,
|
|
60
|
+
t,
|
|
61
|
+
r,
|
|
62
|
+
d,
|
|
63
|
+
c
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
const L = {
|
|
67
|
+
index: 0,
|
|
68
|
+
wasEditable: !0,
|
|
69
|
+
clearClickY: !1
|
|
70
|
+
};
|
|
71
|
+
function k(e) {
|
|
72
|
+
const { documentState: l, eventKey: a } = e, n = x(a, l);
|
|
73
|
+
n && (l.__splitCellLastClickY = void 0);
|
|
74
|
+
const s = l.__splitCellLastWasEditable !== !1;
|
|
75
|
+
let i = L;
|
|
76
|
+
try {
|
|
77
|
+
i = E({
|
|
78
|
+
...e,
|
|
79
|
+
isKeyboardEntry: n
|
|
80
|
+
}), v(l, i);
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
targetSplitIndex: i.index,
|
|
85
|
+
isKeyboardEntry: n,
|
|
86
|
+
lastWasEditable: s,
|
|
87
|
+
targetIsNonEditable: !i.wasEditable
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function v(e, l) {
|
|
91
|
+
l.clearClickY && (e.__splitCellLastClickY = void 0), l.activeIndex != null && (e.__splitCellLastActiveIndex = l.activeIndex), e.__splitCellLastWasEditable = l.wasEditable;
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
v as applySplitCellFocusMeta,
|
|
95
|
+
E as computeSplitCellFocusMeta,
|
|
96
|
+
k as initializeSplitCellFocusSession,
|
|
97
|
+
x as isSplitCellKeyboardEntry
|
|
98
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Settings as W, Checkmark as m, Search as
|
|
3
|
+
import { Settings as W, Checkmark as m, Search as I } from "impact-nova-icons";
|
|
4
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
|
|
6
|
-
import { useGridHeader as
|
|
7
|
-
|
|
5
|
+
import { useImpactNovaI18n as J } from "../../../../../i18n/use-impact-nova-i18n.js";
|
|
6
|
+
import { useGridHeader as K } from "../context/grid-header-context.js";
|
|
7
|
+
import { setActiveSearchColumnId as Q } from "../header-search-active-state.js";
|
|
8
|
+
import { notifyColumnIndicatorSync as U } from "../../notify-column-indicator-sync.js";
|
|
9
|
+
const re = ({
|
|
8
10
|
isOpen: S,
|
|
9
11
|
onClose: a,
|
|
10
12
|
columnId: c,
|
|
@@ -12,9 +14,9 @@ const I = ({
|
|
|
12
14
|
anchor: q,
|
|
13
15
|
variant: d = "column"
|
|
14
16
|
}) => {
|
|
15
|
-
const { t } =
|
|
17
|
+
const { t } = J(), h = K(), u = d === "column" ? s.getColumn(c) : null;
|
|
16
18
|
if (d === "column" && !u) return null;
|
|
17
|
-
const l = u?.getColDef(),
|
|
19
|
+
const l = u?.getColDef(), y = u?.getSort(), w = 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
20
|
queueMicrotask(() => {
|
|
19
21
|
s.applyColumnState({
|
|
20
22
|
state: [{ colId: c, sort: n }],
|
|
@@ -42,7 +44,7 @@ const I = ({
|
|
|
42
44
|
h.openSearch(c);
|
|
43
45
|
else {
|
|
44
46
|
const n = s.getGridOption("context") || {};
|
|
45
|
-
s.setGridOption("context", { ...n, activeSearchColumnId: c }),
|
|
47
|
+
s.setGridOption("context", { ...n, activeSearchColumnId: c }), Q(c), U(s);
|
|
46
48
|
}
|
|
47
49
|
a();
|
|
48
50
|
}, L = () => {
|
|
@@ -113,11 +115,11 @@ const I = ({
|
|
|
113
115
|
/* @__PURE__ */ r(x, { sideOffset: 10, alignOffset: -5, children: [
|
|
114
116
|
/* @__PURE__ */ e(i, { onClick: () => p("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
115
117
|
/* @__PURE__ */ e("span", { children: t(b ? "gridHeader.sortAscNumber" : k ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
|
|
116
|
-
|
|
118
|
+
y === "asc" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
117
119
|
] }) }),
|
|
118
120
|
/* @__PURE__ */ e(i, { onClick: () => p("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
119
121
|
/* @__PURE__ */ e("span", { children: t(b ? "gridHeader.sortDescNumber" : k ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
|
|
120
|
-
|
|
122
|
+
y === "desc" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
121
123
|
] }) }),
|
|
122
124
|
/* @__PURE__ */ e(i, { onClick: () => p(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.reset") }) })
|
|
123
125
|
] })
|
|
@@ -127,11 +129,11 @@ const I = ({
|
|
|
127
129
|
/* @__PURE__ */ r(x, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
|
|
128
130
|
/* @__PURE__ */ e(i, { onClick: () => f("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
129
131
|
/* @__PURE__ */ e("span", { children: t("gridHeader.pinLeft") }),
|
|
130
|
-
|
|
132
|
+
w === "left" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
131
133
|
] }) }),
|
|
132
134
|
/* @__PURE__ */ e(i, { onClick: () => f("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
|
|
133
135
|
/* @__PURE__ */ e("span", { children: t("gridHeader.pinRight") }),
|
|
134
|
-
|
|
136
|
+
w === "right" && /* @__PURE__ */ e(m, { size: "sm", className: "ml-2 text-content-tertiary" })
|
|
135
137
|
] }) }),
|
|
136
138
|
/* @__PURE__ */ e(i, { onClick: () => f(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.noPin") }) })
|
|
137
139
|
] })
|
|
@@ -148,7 +150,7 @@ const I = ({
|
|
|
148
150
|
(M || O) && /* @__PURE__ */ r(B, { children: [
|
|
149
151
|
/* @__PURE__ */ e(j, {}),
|
|
150
152
|
/* @__PURE__ */ r(T, { className: "flex items-center gap-2 text-content-tertiary", children: [
|
|
151
|
-
/* @__PURE__ */ e(
|
|
153
|
+
/* @__PURE__ */ e(I, { size: "xs" }),
|
|
152
154
|
" ",
|
|
153
155
|
t("gridHeader.searchOptions")
|
|
154
156
|
] }),
|
|
@@ -161,5 +163,5 @@ const I = ({
|
|
|
161
163
|
] });
|
|
162
164
|
};
|
|
163
165
|
export {
|
|
164
|
-
|
|
166
|
+
re as ColumnSettingsMenu
|
|
165
167
|
};
|