impact-nova 3.0.0-alpha.17 → 3.0.0-alpha.19
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 +15 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
- package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -56
- package/dist/components/data/ag-grid-react/index.d.ts +2 -1
- package/dist/components/data/ag-grid-react/index.js +315 -296
- package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +14 -1
- package/dist/components/data/ag-grid-react/list-drag-grid-options.js +95 -31
- package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.d.ts +9 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.js +67 -0
- package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +10 -2
- package/dist/components/data/ag-grid-react/process-backend-columndefs.js +84 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +10 -2
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +130 -107
- package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +4 -1
- package/dist/components/data/ag-grid-react/use-list-drag-preview.js +131 -32
- package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +2 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +60 -41
- package/dist/components/data/data-table/data-table-list-header.js +1 -1
- package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
- package/dist/components/data/data-table/data-table-overlay.js +18 -0
- package/dist/components/data/data-table/data-table.types.d.ts +1 -0
- package/dist/components/data/data-table/index.d.ts +3 -0
- package/dist/components/data/data-table/index.js +67 -63
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
- package/dist/components/data/scenario-comparison/index.d.ts +3 -0
- package/dist/components/data/scenario-comparison/index.js +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
- package/dist/components/data-display/badge/index.d.ts +2 -0
- package/dist/components/data-display/badge/index.js +4 -2
- package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
- package/dist/components/data-display/badge/trophy-icon.js +28 -0
- package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
- package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
- package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
- package/dist/components/feedback/find-bar/find-bar.js +266 -0
- package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
- package/dist/components/feedback/find-bar/index.d.ts +4 -0
- package/dist/components/feedback/find-bar/index.js +11 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/flows/iris-chat/iris-chat-composer.js +213 -184
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +23 -10
- package/dist/components/flows/iris-chat/iris-chat.variants.js +4 -4
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.d.ts +6 -0
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.js +23 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +13 -2
- package/dist/components/forms/choice-card/choice-card.js +432 -342
- package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
- package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
- package/dist/components/primitives/tabs/tabs.js +178 -112
- package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
- package/dist/i18n/defaultMessages.d.ts +19 -0
- package/dist/i18n/defaultMessages.js +54 -38
- package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
- package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +17 -1
- package/dist/i18n/locales/es.js +17 -1
- package/dist/i18n/locales/hi.js +17 -1
- package/dist/i18n/locales/kn.js +17 -1
- package/dist/impact-nova-components.css +189 -14
- package/dist/impact-nova-tokens.scss +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +621 -607
- package/dist/lib/virtualized/index.d.ts +2 -0
- package/dist/lib/virtualized/index.js +35 -31
- package/dist/lib/virtualized/list-index.d.ts +5 -0
- package/dist/lib/virtualized/list-index.js +13 -0
- package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
- package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
- package/dist/lib/virtualized/types.d.ts +4 -2
- package/dist/lib/virtualized/useRowState.js +60 -56
- package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,139 +1,162 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as so } from "react/jsx-runtime";
|
|
2
|
+
import { useState as lo, useMemo as A, useCallback as p, useEffect as wo } from "react";
|
|
3
|
+
import { useImpactNovaI18n as go } from "../../../i18n/use-impact-nova-i18n.js";
|
|
4
|
+
import { isListDropAllowed as B, applyUnmanagedRowDrag as co, applyKeyboardListRowReorder as Do } from "./list-row-move.js";
|
|
5
|
+
import { buildDragListColumnDefs as Ro } from "./build-list-drag-column-defs.js";
|
|
6
|
+
import { createDefaultRowDragText as uo, createListRowStyle as po, formatListReorderLiveMessage as fo, isListDragPointerOverHost as mo, dropPositionFromEvent as W, readDragRowId as h, isAgGridListDragEnabled as Io, isAgGridListVariant as Lo, itemIdFromGetRowId as q, readListKeyboardRow as yo } from "./list-drag-grid-options.js";
|
|
7
|
+
import { useListDragPreview as ho } from "./use-list-drag-preview.js";
|
|
8
|
+
function z(x) {
|
|
9
|
+
const w = [];
|
|
10
|
+
return x.forEachNodeAfterFilterAndSort((P) => {
|
|
11
|
+
const g = h(P);
|
|
12
|
+
g && w.push(g);
|
|
13
|
+
}), w;
|
|
11
14
|
}
|
|
12
|
-
function
|
|
13
|
-
const r = [];
|
|
14
|
-
return d.forEachNodeAfterFilterAndSort((I) => {
|
|
15
|
-
const g = m(I);
|
|
16
|
-
g && r.push(g);
|
|
17
|
-
}), r;
|
|
18
|
-
}
|
|
19
|
-
function Io(d) {
|
|
15
|
+
function Go(x) {
|
|
20
16
|
const {
|
|
21
|
-
variant:
|
|
22
|
-
listHeader:
|
|
17
|
+
variant: w,
|
|
18
|
+
listHeader: P,
|
|
23
19
|
columnDefs: g,
|
|
24
|
-
mergedColumnDefs:
|
|
25
|
-
listRowGradient:
|
|
26
|
-
listDragPreview:
|
|
27
|
-
isRowDragDisabled:
|
|
28
|
-
getRowDragHandleLabel:
|
|
29
|
-
canDropRow:
|
|
30
|
-
onRowReorder:
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
mergedColumnDefs: E,
|
|
21
|
+
listRowGradient: f,
|
|
22
|
+
listDragPreview: J,
|
|
23
|
+
isRowDragDisabled: m,
|
|
24
|
+
getRowDragHandleLabel: C,
|
|
25
|
+
canDropRow: d,
|
|
26
|
+
onRowReorder: M,
|
|
27
|
+
onRowMoveBeyondEdge: v,
|
|
28
|
+
getRowStyle: b,
|
|
29
|
+
getRowId: n,
|
|
33
30
|
rowData: l,
|
|
34
|
-
rowDragManaged:
|
|
35
|
-
rowDragText:
|
|
36
|
-
onRowDragEnter:
|
|
37
|
-
onRowDragMove:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
rowDragManaged: Q,
|
|
32
|
+
rowDragText: G,
|
|
33
|
+
onRowDragEnter: X,
|
|
34
|
+
onRowDragMove: T,
|
|
35
|
+
onRowDragLeave: S,
|
|
36
|
+
onRowDragCancel: Y,
|
|
37
|
+
onRowDragEnd: k,
|
|
38
|
+
gridContainerRef: c,
|
|
39
|
+
gridApiRef: H
|
|
40
|
+
} = x, D = Lo(w), t = Io({ variant: w, onRowReorder: M, getRowId: n }), N = D && P === "none", e = Q === !0, { t: K } = go(), [Z, _] = lo(""), $ = A(() => t ? Ro({
|
|
41
|
+
columnDefs: E,
|
|
42
|
+
isRowDragDisabled: m,
|
|
43
|
+
getRowDragHandleLabel: C
|
|
44
|
+
}) : E, [C, t, m, E]), F = A(
|
|
45
|
+
() => uo(g),
|
|
48
46
|
[g]
|
|
49
|
-
),
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
52
|
-
),
|
|
47
|
+
), O = A(
|
|
48
|
+
() => D ? po(f, b) : b,
|
|
49
|
+
[b, D, f]
|
|
50
|
+
), I = p(
|
|
53
51
|
(o) => {
|
|
54
|
-
|
|
52
|
+
M?.(o), _(
|
|
53
|
+
fo(o.toIndex + 1, K("dataTable.listMovedToPosition"))
|
|
54
|
+
);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
56
|
+
[M, K]
|
|
57
|
+
), a = ho({
|
|
58
58
|
enabled: t,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
gridContainerRef: c,
|
|
60
|
+
listDragPreview: J,
|
|
61
|
+
rowDragText: G ?? F,
|
|
62
|
+
onRowDragEnter: X,
|
|
63
|
+
onRowDragCancel: Y
|
|
64
|
+
}), oo = p(
|
|
63
65
|
(o) => {
|
|
64
|
-
if (
|
|
65
|
-
const i = Math.max(o.overIndex, 0),
|
|
66
|
+
if (a.handleRowDragMove(o), !e) {
|
|
67
|
+
const i = Math.max(o.overIndex, 0), r = o.node.data && B(d, { row: o.node.data, toIndex: i }), R = mo(
|
|
68
|
+
o,
|
|
69
|
+
c.current
|
|
70
|
+
);
|
|
66
71
|
o.api.setRowDropPositionIndicator(
|
|
67
|
-
|
|
72
|
+
R && r && o.overNode ? { row: o.overNode, dropIndicatorPosition: W(o) } : null
|
|
68
73
|
);
|
|
69
74
|
}
|
|
70
|
-
|
|
75
|
+
T?.(o);
|
|
76
|
+
},
|
|
77
|
+
[d, c, e, T, a]
|
|
78
|
+
), ro = p(
|
|
79
|
+
(o) => {
|
|
80
|
+
e || o.api.setRowDropPositionIndicator(null), S?.(o);
|
|
71
81
|
},
|
|
72
|
-
[
|
|
73
|
-
),
|
|
82
|
+
[e, S]
|
|
83
|
+
), eo = p(
|
|
74
84
|
(o) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
e || o.api.setRowDropPositionIndicator(null), a.handleRowDragCancel(o);
|
|
86
|
+
},
|
|
87
|
+
[e, a]
|
|
88
|
+
), to = p(
|
|
89
|
+
(o) => {
|
|
90
|
+
if (a.clearPreview(), o.api.setRowDropPositionIndicator(null), !e && l && o.node.data && n) {
|
|
91
|
+
const i = h(o.node), r = Math.max(o.overIndex, 0);
|
|
92
|
+
if (o.node.data && B(d, { row: o.node.data, toIndex: r }) && i) {
|
|
93
|
+
const s = co({
|
|
79
94
|
items: l,
|
|
80
|
-
getItemId: (
|
|
95
|
+
getItemId: (u) => q(n, u) ?? "",
|
|
81
96
|
draggedId: i,
|
|
82
|
-
overId:
|
|
83
|
-
position:
|
|
97
|
+
overId: h(o.overNode),
|
|
98
|
+
position: W(o)
|
|
84
99
|
});
|
|
85
|
-
|
|
100
|
+
s && I(s);
|
|
86
101
|
}
|
|
87
|
-
} else typeof
|
|
88
|
-
|
|
102
|
+
} else typeof f == "function" && o.api.redrawRows();
|
|
103
|
+
k?.(o);
|
|
89
104
|
},
|
|
90
|
-
[
|
|
105
|
+
[d, I, n, f, e, k, a, l]
|
|
91
106
|
);
|
|
92
|
-
|
|
93
|
-
const o =
|
|
94
|
-
if (!t || !o || !
|
|
95
|
-
const i = (
|
|
96
|
-
if (!
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
wo(() => {
|
|
108
|
+
const o = c.current;
|
|
109
|
+
if (!t || !o || !n) return;
|
|
110
|
+
const i = (r) => {
|
|
111
|
+
if (!r.altKey || r.key !== "ArrowUp" && r.key !== "ArrowDown") return;
|
|
112
|
+
const R = r.target;
|
|
113
|
+
if (R?.closest('input, textarea, [contenteditable="true"]')) return;
|
|
114
|
+
const s = H.current, u = yo({ api: s ?? void 0, target: R });
|
|
115
|
+
if (!u?.data || !l || !s) return;
|
|
116
|
+
const L = h(u);
|
|
117
|
+
if (!L) return;
|
|
118
|
+
r.preventDefault();
|
|
119
|
+
const y = r.key === "ArrowUp" ? "up" : "down", U = Do({
|
|
103
120
|
items: l,
|
|
104
|
-
displayedRowIds:
|
|
105
|
-
draggedId:
|
|
106
|
-
direction:
|
|
107
|
-
getItemId: (
|
|
108
|
-
isRowDragDisabled:
|
|
109
|
-
canDropRow:
|
|
121
|
+
displayedRowIds: z(s),
|
|
122
|
+
draggedId: L,
|
|
123
|
+
direction: y,
|
|
124
|
+
getItemId: (io) => q(n, io) ?? "",
|
|
125
|
+
isRowDragDisabled: m,
|
|
126
|
+
canDropRow: d
|
|
110
127
|
});
|
|
111
|
-
|
|
128
|
+
if (U) {
|
|
129
|
+
I(U);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const V = z(s), j = V.indexOf(L);
|
|
133
|
+
(y === "up" && j === 0 || y === "down" && j === V.length - 1) && v && v({ rowId: L, direction: y, row: u.data });
|
|
112
134
|
};
|
|
113
135
|
return o.addEventListener("keydown", i), () => o.removeEventListener("keydown", i);
|
|
114
|
-
}, [
|
|
115
|
-
const
|
|
116
|
-
rowDragManaged:
|
|
117
|
-
rowDragText:
|
|
136
|
+
}, [d, I, n, H, c, t, m, v, l]);
|
|
137
|
+
const ao = t ? /* @__PURE__ */ so("div", { className: "sr-only", "aria-live": "polite", children: Z }) : null, no = t ? {
|
|
138
|
+
rowDragManaged: e,
|
|
139
|
+
rowDragText: G ?? F,
|
|
118
140
|
suppressMoveWhenRowDragging: !0,
|
|
119
141
|
animateRows: !0,
|
|
120
|
-
getRowStyle:
|
|
121
|
-
onRowDragEnter:
|
|
122
|
-
onRowDragMove:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
getRowStyle: O,
|
|
143
|
+
onRowDragEnter: a.handleRowDragEnter,
|
|
144
|
+
onRowDragMove: oo,
|
|
145
|
+
onRowDragLeave: ro,
|
|
146
|
+
onRowDragCancel: eo,
|
|
147
|
+
onRowDragEnd: to
|
|
148
|
+
} : D ? { getRowStyle: O } : null;
|
|
126
149
|
return {
|
|
127
150
|
isDragList: t,
|
|
128
|
-
isListVariant:
|
|
129
|
-
hideColumnHeader:
|
|
130
|
-
dragListColumnDefs:
|
|
131
|
-
dragListGridProps:
|
|
132
|
-
listHeaderGridProps:
|
|
133
|
-
dragPreviewPortal:
|
|
134
|
-
liveRegion:
|
|
151
|
+
isListVariant: D,
|
|
152
|
+
hideColumnHeader: N,
|
|
153
|
+
dragListColumnDefs: $,
|
|
154
|
+
dragListGridProps: no,
|
|
155
|
+
listHeaderGridProps: N ? { headerHeight: 0 } : null,
|
|
156
|
+
dragPreviewPortal: a.dragPreviewPortal,
|
|
157
|
+
liveRegion: ao
|
|
135
158
|
};
|
|
136
159
|
}
|
|
137
160
|
export {
|
|
138
|
-
|
|
161
|
+
Go as useAgGridDragList
|
|
139
162
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { RowDragCancelEvent, RowDragEnterEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
3
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
3
4
|
export declare function useListDragPreview<TData>(options: {
|
|
4
5
|
enabled: boolean;
|
|
6
|
+
gridContainerRef: RefObject<HTMLElement | null>;
|
|
5
7
|
listDragPreview?: (params: {
|
|
6
8
|
data: TData;
|
|
7
9
|
}) => ReactNode;
|
|
10
|
+
rowDragText?: AgGridReactProps<TData>['rowDragText'];
|
|
8
11
|
onRowDragEnter?: (event: RowDragEnterEvent<TData>) => void;
|
|
9
12
|
onRowDragMove?: (event: RowDragMoveEvent<TData>) => void;
|
|
10
13
|
onRowDragCancel?: (event: RowDragCancelEvent<TData>) => void;
|
|
@@ -1,49 +1,148 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useRef as T, useCallback as u, useEffect as A } from "react";
|
|
3
|
+
import { createPortal as F } from "react-dom";
|
|
4
|
+
import { ListDragPreviewCard as H } from "./list-drag-preview-card.js";
|
|
5
|
+
import { readListDragPreviewPosition as N, readListDragPreviewMarkup as q, readListDragRowFrame as B } from "./list-drag-preview-snapshot.js";
|
|
6
|
+
function k(r) {
|
|
7
|
+
return r ? { x: r.clientX, y: r.clientY } : { x: 0, y: 0 };
|
|
8
|
+
}
|
|
9
|
+
function G(r, a) {
|
|
10
|
+
return r ? r({ rowNode: a, defaultTextValue: a.id ?? "" }, 1) : "";
|
|
11
|
+
}
|
|
12
|
+
function I(r) {
|
|
13
|
+
return {
|
|
14
|
+
frame: B(r),
|
|
15
|
+
markup: q(r)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function x(r, a, s) {
|
|
19
|
+
return { ...r, pointerX: a, pointerY: s };
|
|
20
|
+
}
|
|
21
|
+
function C(r) {
|
|
22
|
+
return r.pointerType === "mouse" || r.pointerType === "pen" ? r.buttons === 1 : r.buttons !== 0;
|
|
23
|
+
}
|
|
24
|
+
function K(r) {
|
|
25
|
+
const {
|
|
26
|
+
enabled: a,
|
|
27
|
+
gridContainerRef: s,
|
|
28
|
+
listDragPreview: f,
|
|
29
|
+
rowDragText: P,
|
|
30
|
+
onRowDragEnter: g,
|
|
31
|
+
onRowDragMove: y,
|
|
32
|
+
onRowDragCancel: L
|
|
33
|
+
} = r, [n, l] = E(null), [p, D] = E(!1), c = T(!1), i = u(() => {
|
|
34
|
+
c.current = !1, l(null), D(!1);
|
|
35
|
+
}, []), h = u(
|
|
6
36
|
(e) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
37
|
+
D(!0), l({
|
|
38
|
+
body: e.body,
|
|
39
|
+
label: e.label,
|
|
40
|
+
pointerX: e.pointerX,
|
|
41
|
+
pointerY: e.pointerY,
|
|
42
|
+
frame: e.frame,
|
|
43
|
+
markup: e.markup
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
[]
|
|
47
|
+
), R = u(
|
|
48
|
+
(e, t, o, d) => {
|
|
49
|
+
const m = s.current;
|
|
50
|
+
if (!m?.querySelector(".ag-row.ag-row-dragging")) return !1;
|
|
51
|
+
const v = I(m);
|
|
52
|
+
return v.frame ? (c.current = !0, h({
|
|
53
|
+
pointerX: e,
|
|
54
|
+
pointerY: t,
|
|
55
|
+
label: o,
|
|
56
|
+
body: d,
|
|
57
|
+
frame: v.frame,
|
|
58
|
+
markup: v.markup
|
|
59
|
+
}), !0) : !1;
|
|
12
60
|
},
|
|
13
|
-
[
|
|
14
|
-
),
|
|
61
|
+
[h, s]
|
|
62
|
+
), S = u(
|
|
15
63
|
(e) => {
|
|
16
|
-
|
|
17
|
-
(
|
|
18
|
-
|
|
64
|
+
if (c.current) {
|
|
65
|
+
g?.(e);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const t = k(e.event), o = e.node.data, d = G(P, e.node), m = f && o ? f({ data: o }) : null;
|
|
69
|
+
requestAnimationFrame(() => {
|
|
70
|
+
c.current || R(t.x, t.y, d, m);
|
|
71
|
+
}), g?.(e);
|
|
19
72
|
},
|
|
20
|
-
[
|
|
21
|
-
),
|
|
22
|
-
o(null), u(!1);
|
|
23
|
-
}, []), D = r(
|
|
73
|
+
[R, f, g, P]
|
|
74
|
+
), X = u(
|
|
24
75
|
(e) => {
|
|
25
|
-
|
|
76
|
+
if (!C(e.event ?? {})) {
|
|
77
|
+
i();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const t = k(e.event);
|
|
81
|
+
l((o) => o && x(o, t.x, t.y)), y?.(e);
|
|
26
82
|
},
|
|
27
|
-
[
|
|
83
|
+
[i, y]
|
|
84
|
+
), Y = u(
|
|
85
|
+
(e) => {
|
|
86
|
+
i(), L?.(e);
|
|
87
|
+
},
|
|
88
|
+
[i, L]
|
|
28
89
|
);
|
|
29
|
-
|
|
30
|
-
if (!
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
90
|
+
A(() => {
|
|
91
|
+
if (!a || !p) return;
|
|
92
|
+
document.body.setAttribute("data-in-list-drag", "true");
|
|
93
|
+
const e = (o) => {
|
|
94
|
+
if (!C(o)) {
|
|
95
|
+
i();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
l(
|
|
99
|
+
(d) => d && x(d, o.clientX, o.clientY)
|
|
100
|
+
);
|
|
101
|
+
}, t = () => {
|
|
102
|
+
i();
|
|
103
|
+
};
|
|
104
|
+
return document.addEventListener("pointermove", e), document.addEventListener("pointerup", t), document.addEventListener("pointercancel", t), window.addEventListener("blur", t), () => {
|
|
105
|
+
document.body.removeAttribute("data-in-list-drag"), document.removeEventListener("pointermove", e), document.removeEventListener("pointerup", t), document.removeEventListener("pointercancel", t), window.removeEventListener("blur", t);
|
|
106
|
+
};
|
|
107
|
+
}, [i, a, p]);
|
|
108
|
+
const w = n == null ? null : N({
|
|
109
|
+
pointerX: n.pointerX,
|
|
110
|
+
pointerY: n.pointerY,
|
|
111
|
+
frame: n.frame
|
|
112
|
+
}), M = a && p && n && w && typeof document < "u" ? F(
|
|
113
|
+
/* @__PURE__ */ b(
|
|
35
114
|
"div",
|
|
36
115
|
{
|
|
37
116
|
"data-component": "ag-grid-drag-preview",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
className: "pointer-events-none fixed z-[9999] box-border overflow-hidden",
|
|
119
|
+
style: {
|
|
120
|
+
left: w.left,
|
|
121
|
+
top: w.top,
|
|
122
|
+
width: n.frame?.width,
|
|
123
|
+
height: n.frame?.cardHeight,
|
|
124
|
+
borderRadius: n.frame?.listBorderRadius || void 0,
|
|
125
|
+
"--in-ag-list-row-gradient": n.frame?.rowGradient || void 0
|
|
126
|
+
},
|
|
127
|
+
children: n.body ?? (n.markup ? /* @__PURE__ */ b(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: "in-ag-list-drag-preview-content",
|
|
131
|
+
dangerouslySetInnerHTML: { __html: n.markup }
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ b(H, { label: n.label }))
|
|
41
134
|
}
|
|
42
135
|
),
|
|
43
136
|
document.body
|
|
44
137
|
) : null;
|
|
45
|
-
return {
|
|
138
|
+
return {
|
|
139
|
+
handleRowDragEnter: S,
|
|
140
|
+
handleRowDragMove: X,
|
|
141
|
+
handleRowDragCancel: Y,
|
|
142
|
+
clearPreview: i,
|
|
143
|
+
dragPreviewPortal: M
|
|
144
|
+
};
|
|
46
145
|
}
|
|
47
146
|
export {
|
|
48
|
-
|
|
147
|
+
K as useListDragPreview
|
|
49
148
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { KeyAttributeRow } from './ag-grid-list.demo-board';
|
|
3
|
+
interface UseKeyAttributesFindOptions {
|
|
4
|
+
topRows: KeyAttributeRow[];
|
|
5
|
+
benchRows: KeyAttributeRow[];
|
|
6
|
+
showBench: boolean;
|
|
7
|
+
topApi: GridApi<KeyAttributeRow> | null;
|
|
8
|
+
benchApi: GridApi<KeyAttributeRow> | null;
|
|
9
|
+
}
|
|
10
|
+
/** Refresh name cells on the rows that changed. Omit `rowIds` to refresh the whole name column. */
|
|
11
|
+
export declare function refreshFindHighlightGrids(options: {
|
|
12
|
+
topApi: GridApi<KeyAttributeRow> | null;
|
|
13
|
+
benchApi: GridApi<KeyAttributeRow> | null;
|
|
14
|
+
rowIds?: string[];
|
|
15
|
+
}): void;
|
|
16
|
+
export interface KeyAttributesFindGridContext {
|
|
17
|
+
findQuery: string;
|
|
18
|
+
currentMatchRowId?: string;
|
|
19
|
+
/** Active substring within the row name (0-based among matches in that cell). */
|
|
20
|
+
currentOccurrenceIndexInRow?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const KEY_ATTRIBUTES_FIND_CONTEXT_KEY = "keyAttributesFind";
|
|
23
|
+
export declare function readKeyAttributesFindFromGridContext(context: unknown): KeyAttributesFindGridContext;
|
|
24
|
+
/** Key Attributes demo hook — not part of the public `impact-nova/data-table` API. */
|
|
25
|
+
export declare function useListFind(options: UseKeyAttributesFindOptions): {
|
|
26
|
+
open: boolean;
|
|
27
|
+
query: string;
|
|
28
|
+
activeIndex: number;
|
|
29
|
+
matchCount: number;
|
|
30
|
+
openFind: () => void;
|
|
31
|
+
closeFind: () => void;
|
|
32
|
+
setQuery: (nextQuery: string) => void;
|
|
33
|
+
goPrevious: () => void;
|
|
34
|
+
goNext: () => void;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { GridApi, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
2
2
|
import { ListRowDropCheck, ListRowTransferMeta } from './list-row-move';
|
|
3
|
+
/** Stable key for drop-zone pairing — ignores a new `lists` object with the same APIs. */
|
|
4
|
+
export declare function readListDropZoneIdentity(lists: Record<string, object | null | undefined>): string;
|
|
3
5
|
export interface UseListRowDropZonesOptions<TData> {
|
|
4
6
|
/** Grid APIs from each list's `onGridReady`. A `null` api is skipped (hidden list). */
|
|
5
7
|
lists: Record<string, GridApi<TData> | null>;
|
|
@@ -1,73 +1,92 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
import { buildListRowTransferMeta as
|
|
3
|
-
import { readDragRowId as
|
|
4
|
-
|
|
1
|
+
import { useRef as y, useEffect as w } from "react";
|
|
2
|
+
import { buildListRowTransferMeta as A, listRowTransferDropIndex as P, isListDropAllowed as Z } from "./list-row-move.js";
|
|
3
|
+
import { readDragRowId as v, dropPositionFromEvent as m } from "./list-drag-grid-options.js";
|
|
4
|
+
const D = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
let R = 1;
|
|
6
|
+
function N(t) {
|
|
7
|
+
const o = D.get(t);
|
|
8
|
+
if (o) return o;
|
|
9
|
+
const r = R;
|
|
10
|
+
return R += 1, D.set(t, r), r;
|
|
11
|
+
}
|
|
12
|
+
function T(t) {
|
|
13
|
+
return Object.keys(t).sort().map((o) => {
|
|
14
|
+
const r = t[o];
|
|
15
|
+
return `${o}:${r == null ? "0" : String(N(r))}`;
|
|
16
|
+
}).join("|");
|
|
17
|
+
}
|
|
18
|
+
function L(t) {
|
|
5
19
|
let o = 0;
|
|
6
|
-
return
|
|
20
|
+
return t.forEachNodeAfterFilterAndSort(() => {
|
|
7
21
|
o += 1;
|
|
8
22
|
}), o;
|
|
9
23
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const n =
|
|
14
|
-
overIndex:
|
|
15
|
-
overNode:
|
|
16
|
-
targetDisplayedCount:
|
|
17
|
-
position:
|
|
24
|
+
function C(t, o) {
|
|
25
|
+
const r = t.node.data;
|
|
26
|
+
if (!r) return !1;
|
|
27
|
+
const n = P({
|
|
28
|
+
overIndex: t.overIndex,
|
|
29
|
+
overNode: t.overNode,
|
|
30
|
+
targetDisplayedCount: L(o.target),
|
|
31
|
+
position: m(t)
|
|
18
32
|
});
|
|
19
|
-
return
|
|
20
|
-
row:
|
|
33
|
+
return Z(o.canDropRow, {
|
|
34
|
+
row: r,
|
|
21
35
|
toIndex: n,
|
|
22
36
|
fromListId: o.fromListId,
|
|
23
37
|
toListId: o.toListId
|
|
24
38
|
});
|
|
25
39
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
row:
|
|
40
|
+
function b(t, o) {
|
|
41
|
+
const r = t.node.data, n = v(t.node);
|
|
42
|
+
return A({
|
|
43
|
+
row: r,
|
|
30
44
|
rowId: n,
|
|
31
45
|
fromListId: o.fromListId,
|
|
32
46
|
toListId: o.toListId,
|
|
33
|
-
overIndex:
|
|
34
|
-
overNode:
|
|
35
|
-
targetDisplayedCount:
|
|
36
|
-
position:
|
|
47
|
+
overIndex: t.overIndex,
|
|
48
|
+
overNode: t.overNode,
|
|
49
|
+
targetDisplayedCount: L(o.target),
|
|
50
|
+
position: m(t),
|
|
37
51
|
canDropRow: o.canDropRow
|
|
38
52
|
});
|
|
39
53
|
}
|
|
40
|
-
function
|
|
41
|
-
const { lists: o, onRowTransfer:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
function S(t) {
|
|
55
|
+
const { lists: o, onRowTransfer: r, canDropRow: n } = t, c = y(o), g = T(o);
|
|
56
|
+
w(() => {
|
|
57
|
+
c.current = o;
|
|
58
|
+
}), w(() => {
|
|
59
|
+
const x = c.current, f = Object.entries(x).filter(
|
|
60
|
+
(e) => e[1] != null
|
|
61
|
+
), u = [];
|
|
62
|
+
for (const [e, s] of f)
|
|
63
|
+
for (const [p, i] of f) {
|
|
64
|
+
if (e === p) continue;
|
|
65
|
+
const l = { fromListId: e, toListId: p, target: i, canDropRow: n }, d = i.getRowDropZoneParams({
|
|
48
66
|
onDragging: (a) => {
|
|
49
|
-
|
|
67
|
+
s.setRowDropPositionIndicator(null), C(a, l) || i.setRowDropPositionIndicator(null);
|
|
50
68
|
},
|
|
51
69
|
onDragStop: (a) => {
|
|
52
70
|
i.setRowDropPositionIndicator(null);
|
|
53
|
-
const
|
|
54
|
-
|
|
71
|
+
const I = b(a, l);
|
|
72
|
+
I && r(I);
|
|
55
73
|
},
|
|
56
74
|
onDragLeave: () => {
|
|
57
75
|
s.setRowDropPositionIndicator(null), i.setRowDropPositionIndicator(null);
|
|
58
76
|
}
|
|
59
77
|
});
|
|
60
|
-
d && (s.addRowDropZone(d),
|
|
78
|
+
d && (s.addRowDropZone(d), u.push({ source: s, params: d }));
|
|
61
79
|
}
|
|
62
80
|
return () => {
|
|
63
|
-
for (const { source: e, params: s } of
|
|
81
|
+
for (const { source: e, params: s } of u)
|
|
64
82
|
e.removeRowDropZone(s);
|
|
65
83
|
};
|
|
66
|
-
}, [n,
|
|
84
|
+
}, [n, g, r]);
|
|
67
85
|
}
|
|
68
86
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
L as displayedRowCount,
|
|
88
|
+
C as previewListTransferAllowed,
|
|
89
|
+
T as readListDropZoneIdentity,
|
|
90
|
+
b as tryListRowTransfer,
|
|
91
|
+
S as useListRowDropZones
|
|
73
92
|
};
|
|
@@ -12,7 +12,7 @@ function d({
|
|
|
12
12
|
{
|
|
13
13
|
"data-component": "data-table-list-header",
|
|
14
14
|
className: r(
|
|
15
|
-
"mb-
|
|
15
|
+
"mb-2 flex h-10 shrink-0 items-center justify-between gap-4 rounded-lg bg-canvas-muted px-5",
|
|
16
16
|
s
|
|
17
17
|
),
|
|
18
18
|
...i,
|