impact-nova 1.7.8 → 1.7.10
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/ui/accordion.js +7 -7
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +9 -8
- package/dist/components/ui/ag-grid-react/index.js +16 -14
- package/dist/components/ui/badge.js +12 -11
- package/dist/components/ui/button-group.js +10 -10
- package/dist/components/ui/command-palette/shortcut-overlay.js +68 -69
- package/dist/components/ui/command-palette/shortcut-registry.js +4 -4
- package/dist/components/ui/data-table/data-table-context.d.ts +12 -4
- package/dist/components/ui/data-table/data-table-context.js +9 -2
- package/dist/components/ui/data-table/data-table-sheet.d.ts +16 -0
- package/dist/components/ui/data-table/data-table-sheet.js +88 -65
- package/dist/components/ui/data-table/data-table.js +93 -81
- package/dist/components/ui/data-table/index.js +21 -17
- package/dist/components/ui/filter-strip/filter-tag-list.js +2 -2
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +162 -158
- package/package.json +1 -1
|
@@ -5,21 +5,21 @@ import { ChevronRight as g } from "lucide-react";
|
|
|
5
5
|
import { cn as a } from "../../lib/utils.js";
|
|
6
6
|
import { Tooltip as p, TooltipTrigger as u, TooltipContent as v } from "./tooltip.js";
|
|
7
7
|
import { useImpactNovaI18n as x } from "../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
-
const R = t.Root,
|
|
8
|
+
const R = t.Root, b = d.forwardRef(({ className: o, ...i }, r) => /* @__PURE__ */ e(
|
|
9
9
|
t.Item,
|
|
10
10
|
{
|
|
11
11
|
ref: r,
|
|
12
12
|
"data-item": i.value,
|
|
13
13
|
"data-disabled": i.disabled ? "" : void 0,
|
|
14
14
|
className: a(
|
|
15
|
-
"ia-accordion-item border rounded-lg bg-white border-[#
|
|
15
|
+
"ia-accordion-item border-b rounded-lg bg-white border-[#EFF2FA]",
|
|
16
16
|
o
|
|
17
17
|
),
|
|
18
18
|
...i
|
|
19
19
|
}
|
|
20
20
|
));
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
b.displayName = "AccordionItem";
|
|
22
|
+
const h = d.forwardRef(({ className: o, children: i, badge: r, rightActions: s, variant: l = "default", ...c }, m) => {
|
|
23
23
|
const { t: f } = x();
|
|
24
24
|
return l === "plain" ? /* @__PURE__ */ e(t.Header, { className: "flex flex-1", children: /* @__PURE__ */ e(
|
|
25
25
|
t.Trigger,
|
|
@@ -59,7 +59,7 @@ const b = d.forwardRef(({ className: o, children: i, badge: r, rightActions: s,
|
|
|
59
59
|
}
|
|
60
60
|
) });
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
h.displayName = t.Trigger.displayName;
|
|
63
63
|
const N = d.forwardRef(({ className: o, children: i, surfaceClassName: r, ...s }, l) => /* @__PURE__ */ e(
|
|
64
64
|
t.Content,
|
|
65
65
|
{
|
|
@@ -73,6 +73,6 @@ N.displayName = t.Content.displayName;
|
|
|
73
73
|
export {
|
|
74
74
|
R as Accordion,
|
|
75
75
|
N as AccordionContent,
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
b as AccordionItem,
|
|
77
|
+
h as AccordionTrigger
|
|
78
78
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as d, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { Badge as g } from "../../badge.js";
|
|
3
|
-
import { getFieldValue as
|
|
4
|
-
const
|
|
5
|
-
const { data:
|
|
6
|
-
return
|
|
3
|
+
import { getFieldValue as l, mapBadgeColor as f, mapBadgeVariant as u } from "./cell-renderer-utils.js";
|
|
4
|
+
const h = (e) => {
|
|
5
|
+
const { data: i, value: n } = e, a = l(e.badgeLabelField, e.badgeLabel, i) ?? (n != null ? String(n) : void 0), c = l(e.variantField, e.variant, i) ?? "filled", r = l(e.colorField, e.color, i) ?? "default", o = l(e.isIconField, e.isIcon, i), t = l(e.iconField, e.icon, i), s = l(e.sizeField, e.size, i);
|
|
6
|
+
return a ? /* @__PURE__ */ d("div", { className: "w-full h-full flex items-center justify-start ag-cell-inner-padding", children: /* @__PURE__ */ d(
|
|
7
7
|
g,
|
|
8
8
|
{
|
|
9
9
|
variant: u(c),
|
|
10
10
|
color: f(r),
|
|
11
11
|
size: s === "small" ? "sm" : "md",
|
|
12
|
+
style: { fontSize: "inherit", lineHeight: "inherit" },
|
|
12
13
|
children: o && t ? /* @__PURE__ */ m("span", { className: "flex items-center gap-1", children: [
|
|
13
14
|
t,
|
|
14
|
-
|
|
15
|
-
] }) :
|
|
15
|
+
a
|
|
16
|
+
] }) : a
|
|
16
17
|
}
|
|
17
18
|
) }) : null;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
h.displayName = "BadgeCellRenderer";
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
h as BadgeCellRenderer
|
|
22
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as U, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { lazy as V, useRef as D, useState as f, useCallback as
|
|
2
|
+
import { lazy as V, useRef as D, useState as f, useCallback as v, useMemo as y, useEffect as W, Suspense as _ } from "react";
|
|
3
3
|
import { ModuleRegistry as $, AllCommunityModule as q, ValidationModule as K } from "ag-grid-community";
|
|
4
4
|
import { AllEnterpriseModule as z } from "ag-grid-enterprise";
|
|
5
5
|
import { AgGridReact as J } from "ag-grid-react";
|
|
@@ -22,11 +22,11 @@ function ye({
|
|
|
22
22
|
onGridReady: m,
|
|
23
23
|
...u
|
|
24
24
|
}) {
|
|
25
|
-
const r = D(null), s = D(null), [h, M] = f(null), [
|
|
25
|
+
const r = D(null), s = D(null), [h, M] = f(null), [x, C] = f(!1), [b, G] = f(null), [R, S] = f(!1), [A, k] = f(null), [N, E] = f(null), O = v((e) => {
|
|
26
26
|
if (!r.current) return;
|
|
27
27
|
const t = Z(e);
|
|
28
28
|
r.current.setFilterModel(t), r.current.onFilterChanged();
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), F = y(() => ({
|
|
30
30
|
openSearch: (e) => {
|
|
31
31
|
if (!r.current) return;
|
|
32
32
|
const t = r.current.getGridOption("context") || {};
|
|
@@ -38,10 +38,10 @@ function ye({
|
|
|
38
38
|
r.current.setGridOption("context", { ...e, activeSearchColumnId: null }), r.current.refreshHeader();
|
|
39
39
|
},
|
|
40
40
|
openAdvancedFilter: (e) => {
|
|
41
|
-
|
|
41
|
+
G(e || null), C(!0);
|
|
42
42
|
},
|
|
43
43
|
closeAdvancedFilter: () => {
|
|
44
|
-
C(!1),
|
|
44
|
+
C(!1), G(null);
|
|
45
45
|
},
|
|
46
46
|
applyAdvancedFilter: (e) => {
|
|
47
47
|
O(e);
|
|
@@ -53,8 +53,10 @@ function ye({
|
|
|
53
53
|
S(!1), k(null), E(null);
|
|
54
54
|
},
|
|
55
55
|
activeMenuColumnId: A
|
|
56
|
-
}), [O, A]), T =
|
|
57
|
-
r.current = e.api, M(e.api)
|
|
56
|
+
}), [O, A]), T = v((e) => {
|
|
57
|
+
r.current = e.api, M(e.api);
|
|
58
|
+
const t = e.api.getGridOption("context") || {};
|
|
59
|
+
e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), m && m(e);
|
|
58
60
|
}, [m]);
|
|
59
61
|
W(() => {
|
|
60
62
|
const e = s.current;
|
|
@@ -103,13 +105,13 @@ function ye({
|
|
|
103
105
|
// User components override
|
|
104
106
|
...d
|
|
105
107
|
// Optional custom formatters override defaults
|
|
106
|
-
}), [d, u.components]), P =
|
|
108
|
+
}), [d, u.components]), P = v((e) => {
|
|
107
109
|
if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
|
|
108
110
|
const t = Object.entries(e.value).map(([n, l]) => l && typeof l == "object" && "value" in l ? l.value : typeof l != "object" && typeof l < "u" ? l : null).filter((n) => n != null);
|
|
109
111
|
return t.length > 0 ? t.join(" ") : "";
|
|
110
112
|
}
|
|
111
113
|
return e.value;
|
|
112
|
-
}, []), w =
|
|
114
|
+
}, []), w = v((e) => {
|
|
113
115
|
if (typeof e.value == "string") {
|
|
114
116
|
const t = e.value.trim();
|
|
115
117
|
if (t.startsWith("{") || t.startsWith("["))
|
|
@@ -121,7 +123,7 @@ function ye({
|
|
|
121
123
|
}
|
|
122
124
|
return e.value;
|
|
123
125
|
}, []);
|
|
124
|
-
return /* @__PURE__ */ U(Y.Provider, { value:
|
|
126
|
+
return /* @__PURE__ */ U(Y.Provider, { value: F, children: [
|
|
125
127
|
/* @__PURE__ */ a("div", { ref: s, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ a(
|
|
126
128
|
J,
|
|
127
129
|
{
|
|
@@ -167,11 +169,11 @@ function ye({
|
|
|
167
169
|
/* @__PURE__ */ a(
|
|
168
170
|
le,
|
|
169
171
|
{
|
|
170
|
-
isOpen:
|
|
172
|
+
isOpen: x,
|
|
171
173
|
columnId: b,
|
|
172
174
|
gridApi: h,
|
|
173
|
-
onClose:
|
|
174
|
-
onApply:
|
|
175
|
+
onClose: F.closeAdvancedFilter,
|
|
176
|
+
onApply: F.applyAdvancedFilter
|
|
175
177
|
}
|
|
176
178
|
),
|
|
177
179
|
/* @__PURE__ */ a(
|
|
@@ -181,7 +183,7 @@ function ye({
|
|
|
181
183
|
columnId: A,
|
|
182
184
|
gridApi: h,
|
|
183
185
|
anchor: N,
|
|
184
|
-
onClose:
|
|
186
|
+
onClose: F.closeMenu
|
|
185
187
|
}
|
|
186
188
|
)
|
|
187
189
|
] });
|
|
@@ -3,7 +3,7 @@ import * as g from "react";
|
|
|
3
3
|
import { cva as f } from "class-variance-authority";
|
|
4
4
|
import { cn as v } from "../../lib/utils.js";
|
|
5
5
|
const m = f(
|
|
6
|
-
"inline-flex min-w-0 max-w-[164px] shrink-0 items-center justify-center border font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 [&_[data-slot=badge-icon]_svg]:size-4 [&_[data-slot=badge-icon]_svg]:shrink-0",
|
|
6
|
+
"inline-flex min-w-0 max-w-[164px] shrink-0 items-center justify-center border font-sans font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 [&_[data-slot=badge-icon]_svg]:size-4 [&_[data-slot=badge-icon]_svg]:shrink-0",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -33,7 +33,8 @@ const m = f(
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
compoundVariants: [
|
|
36
|
-
{ size: "md", layout: "default", class: "text-sm leading-5" },
|
|
36
|
+
{ size: "md", layout: "default", class: "h-6 text-sm leading-5" },
|
|
37
|
+
{ size: "md", layout: "iconOnly", class: "h-6" },
|
|
37
38
|
{ size: "sm", layout: "default", class: "h-5 text-xs leading-4" },
|
|
38
39
|
{ size: "sm", layout: "iconOnly", class: "h-5" },
|
|
39
40
|
{
|
|
@@ -73,7 +74,7 @@ const m = f(
|
|
|
73
74
|
{
|
|
74
75
|
variant: "subtle",
|
|
75
76
|
color: "primary",
|
|
76
|
-
class: "border-transparent bg-
|
|
77
|
+
class: "border-transparent bg-accent text-brand"
|
|
77
78
|
},
|
|
78
79
|
{ variant: "subtle", color: "neutral", class: "border-transparent bg-badge-neutral-muted text-content-badge" },
|
|
79
80
|
{
|
|
@@ -101,39 +102,39 @@ const m = f(
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
|
-
function
|
|
105
|
+
function h({
|
|
105
106
|
className: o,
|
|
106
107
|
variant: l,
|
|
107
108
|
color: i,
|
|
108
109
|
size: d,
|
|
109
110
|
shape: c,
|
|
110
111
|
icon: e,
|
|
111
|
-
disabled:
|
|
112
|
-
children:
|
|
112
|
+
disabled: a,
|
|
113
|
+
children: r,
|
|
113
114
|
...b
|
|
114
115
|
}) {
|
|
115
|
-
const t = g.Children.count(
|
|
116
|
+
const t = g.Children.count(r) > 0, s = e != null && !t ? "iconOnly" : "default";
|
|
116
117
|
return /* @__PURE__ */ u(
|
|
117
118
|
"div",
|
|
118
119
|
{
|
|
119
120
|
role: "status",
|
|
120
121
|
"data-component": "badge",
|
|
121
122
|
"data-layout": s,
|
|
122
|
-
"aria-disabled":
|
|
123
|
+
"aria-disabled": a ? !0 : void 0,
|
|
123
124
|
className: v(
|
|
124
125
|
m({ variant: l, color: i, size: d, shape: c, layout: s }),
|
|
125
|
-
|
|
126
|
+
a && "pointer-events-none border border-disabled-border bg-disabled-surface text-disabled-foreground",
|
|
126
127
|
o
|
|
127
128
|
),
|
|
128
129
|
...b,
|
|
129
130
|
children: [
|
|
130
131
|
e != null ? /* @__PURE__ */ n("span", { "data-slot": "badge-icon", className: "inline-flex shrink-0 text-current", children: e }) : null,
|
|
131
|
-
t ? /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-center", children:
|
|
132
|
+
t ? /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-center", children: r }) : null
|
|
132
133
|
]
|
|
133
134
|
}
|
|
134
135
|
);
|
|
135
136
|
}
|
|
136
137
|
export {
|
|
137
|
-
|
|
138
|
+
h as Badge,
|
|
138
139
|
m as badgeVariants
|
|
139
140
|
};
|
|
@@ -34,10 +34,10 @@ const H = A("inline-flex", {
|
|
|
34
34
|
helperTextPosition: x = "absolute",
|
|
35
35
|
isError: a,
|
|
36
36
|
required: S,
|
|
37
|
-
"aria-label":
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
const l = p === "none",
|
|
37
|
+
"aria-label": k,
|
|
38
|
+
...B
|
|
39
|
+
}, I) => {
|
|
40
|
+
const l = p === "none", V = u === "horizontal", _ = r.useId(), z = o ? `${_}-label` : void 0;
|
|
41
41
|
return /* @__PURE__ */ i("div", { className: t("grid gap-1.5", w), children: [
|
|
42
42
|
o && /* @__PURE__ */ i(
|
|
43
43
|
"label",
|
|
@@ -65,27 +65,27 @@ const H = A("inline-flex", {
|
|
|
65
65
|
/* @__PURE__ */ n(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
|
-
ref:
|
|
68
|
+
ref: I,
|
|
69
69
|
className: t(H({ orientation: u, spacing: p })),
|
|
70
70
|
role: "group",
|
|
71
71
|
"data-component": "button-group",
|
|
72
72
|
"data-orientation": u,
|
|
73
73
|
"data-spacing": p,
|
|
74
74
|
"data-fused": l ? "true" : "false",
|
|
75
|
-
"aria-label": o ? void 0 :
|
|
75
|
+
"aria-label": o ? void 0 : k,
|
|
76
76
|
"aria-labelledby": o ? z : void 0,
|
|
77
|
-
...
|
|
77
|
+
...B,
|
|
78
78
|
children: r.Children.map(y, (f) => {
|
|
79
79
|
if (!r.isValidElement(f)) return f;
|
|
80
80
|
const e = f, g = e.props.value ?? e.props.children?.toString?.() ?? "", c = typeof g == "string" ? g : String(g), d = v !== void 0 && v === c, m = !!(e.props.disabled || h), G = e.props.size === "icon" || e.props.size === "iconMd" || e.props.size === "iconSm", j = t(
|
|
81
81
|
"!shadow-none relative border transition-colors",
|
|
82
82
|
l && !G && "min-w-14",
|
|
83
|
-
l ?
|
|
83
|
+
l ? V ? "!rounded-none first:!rounded-l-md last:!rounded-r-md -ml-px first:ml-0" : "!rounded-none first:!rounded-t-md last:!rounded-b-md -mt-px first:mt-0" : "!rounded-md",
|
|
84
84
|
l && (d ? "z-10" : "z-[1]")
|
|
85
85
|
), C = m ? "!bg-disabled-surface !border-disabled-border !text-disabled-foreground opacity-100 [&_svg]:!text-disabled-foreground" : d ? "!bg-accent !border-brand !text-brand [&_svg]:!text-brand" : t(
|
|
86
86
|
"!bg-canvas-elevated !border-button-primary-disabled !text-[#60697d]",
|
|
87
|
-
"[&_svg]
|
|
88
|
-
"hover:!
|
|
87
|
+
"[&_svg]:!text-[inherit]",
|
|
88
|
+
"hover:!bg-canvas-elevated hover:!text-brand"
|
|
89
89
|
), O = a && !d && !m && "!border-destructive !text-destructive [&_svg]:!text-destructive";
|
|
90
90
|
return r.cloneElement(e, {
|
|
91
91
|
disabled: m,
|
|
@@ -1,91 +1,90 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useShortcutOverlay as
|
|
5
|
-
import { useCommandPalette as
|
|
6
|
-
import { Kbd as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
c() && (e.placement === "above" ? (e.placement = "below", e.top = e.top + u + 32 + s) : (e.placement = "above", e.top = e.top - u - 32 - s), c() && (e.left = e.left + h + s));
|
|
1
|
+
import { jsxs as x, Fragment as A, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { createPortal as L } from "react-dom";
|
|
4
|
+
import { useShortcutOverlay as M } from "./shortcut-overlay-context.js";
|
|
5
|
+
import { useCommandPalette as S } from "./command-palette-context.js";
|
|
6
|
+
import { Kbd as O } from "./kbd.js";
|
|
7
|
+
const p = 26, y = 80, s = 4;
|
|
8
|
+
function X(r) {
|
|
9
|
+
if (r.length <= 1) return r;
|
|
10
|
+
const i = [...r].sort((e, t) => e.top - t.top), c = (e, t) => Math.abs(e.left - t.left) < y && Math.abs(e.top - t.top) < p + s, d = (e) => i.slice(Math.max(0, e - 8), e).some((t) => c(t, i[e]));
|
|
11
|
+
for (let e = 1; e < i.length; e++) {
|
|
12
|
+
if (!d(e)) continue;
|
|
13
|
+
const t = i[e], u = t.top, v = t.left, o = t.placement;
|
|
14
|
+
if (t.placement === "above" ? (t.placement = "below", t.top = u + p + 32 + s) : (t.placement = "above", t.top = u - p - 32 - s), !!d(e)) {
|
|
15
|
+
t.top = u, t.placement = o;
|
|
16
|
+
for (let n = 1; n <= 3 && (t.left = v + (y + s) * n, !!d(e)); n++)
|
|
17
|
+
;
|
|
18
|
+
}
|
|
20
19
|
}
|
|
21
|
-
return
|
|
20
|
+
return i;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
22
|
+
function z(r) {
|
|
23
|
+
const i = window.innerWidth, c = window.innerHeight;
|
|
25
24
|
return {
|
|
26
|
-
...
|
|
27
|
-
top: Math.max(s, Math.min(
|
|
28
|
-
left: Math.max(
|
|
25
|
+
...r,
|
|
26
|
+
top: Math.max(s, Math.min(r.top, c - p - s)),
|
|
27
|
+
left: Math.max(y / 2, Math.min(r.left, i - y / 2))
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
const { isOverlayVisible:
|
|
33
|
-
return
|
|
34
|
-
if (!
|
|
35
|
-
|
|
30
|
+
function C() {
|
|
31
|
+
const { isOverlayVisible: r, setOverlayVisible: i } = M(), { getEffectiveKeybinding: c, version: d } = S(), [e, t] = m.useState([]), [u, v] = m.useState(0);
|
|
32
|
+
return m.useLayoutEffect(() => {
|
|
33
|
+
if (!r) {
|
|
34
|
+
t([]);
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
37
|
+
const o = document.querySelectorAll("[data-shortcut-id]"), n = [];
|
|
38
|
+
o.forEach((l) => {
|
|
39
|
+
const f = l.getAttribute("data-shortcut-id");
|
|
40
|
+
if (!f) return;
|
|
41
|
+
const w = window.getComputedStyle(l);
|
|
42
|
+
if (w.display === "none" || w.visibility === "hidden" || w.opacity === "0")
|
|
44
43
|
return;
|
|
45
|
-
const a =
|
|
44
|
+
const a = l.getBoundingClientRect();
|
|
46
45
|
if (a.width === 0 || a.height === 0 || a.bottom < 0 || a.top > window.innerHeight || a.right < 0 || a.left > window.innerWidth)
|
|
47
46
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
51
|
-
let k = "above",
|
|
52
|
-
|
|
53
|
-
id:
|
|
54
|
-
keybinding:
|
|
55
|
-
top:
|
|
56
|
-
left:
|
|
47
|
+
const g = c(f);
|
|
48
|
+
if (!g) return;
|
|
49
|
+
const E = a.left + a.width / 2;
|
|
50
|
+
let k = "above", b = a.top - p - s;
|
|
51
|
+
b < s && (k = "below", b = a.bottom + s), n.push({
|
|
52
|
+
id: f,
|
|
53
|
+
keybinding: g,
|
|
54
|
+
top: b,
|
|
55
|
+
left: E,
|
|
57
56
|
placement: k
|
|
58
57
|
});
|
|
59
|
-
}),
|
|
60
|
-
}, [
|
|
61
|
-
if (!
|
|
62
|
-
const o = (
|
|
63
|
-
|
|
58
|
+
}), t(X(n).map(z));
|
|
59
|
+
}, [r, c, d, u]), m.useEffect(() => {
|
|
60
|
+
if (!r) return;
|
|
61
|
+
const o = (n) => {
|
|
62
|
+
n.key === "Escape" && (n.preventDefault(), n.stopPropagation(), i(!1));
|
|
64
63
|
};
|
|
65
64
|
return window.addEventListener("keydown", o, !0), () => window.removeEventListener("keydown", o, !0);
|
|
66
|
-
}, [
|
|
67
|
-
if (!
|
|
65
|
+
}, [r, i]), m.useEffect(() => {
|
|
66
|
+
if (!r) return;
|
|
68
67
|
let o;
|
|
69
|
-
const
|
|
70
|
-
cancelAnimationFrame(o), o = requestAnimationFrame(() =>
|
|
68
|
+
const n = () => {
|
|
69
|
+
cancelAnimationFrame(o), o = requestAnimationFrame(() => v((f) => f + 1));
|
|
71
70
|
};
|
|
72
|
-
window.addEventListener("scroll",
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
window.addEventListener("scroll", n, !0), window.addEventListener("resize", n);
|
|
72
|
+
const l = new MutationObserver(n);
|
|
73
|
+
return l.observe(document.body, {
|
|
75
74
|
childList: !0,
|
|
76
75
|
subtree: !0,
|
|
77
76
|
attributes: !0,
|
|
78
77
|
attributeFilter: ["data-state"]
|
|
79
78
|
}), () => {
|
|
80
|
-
cancelAnimationFrame(o), window.removeEventListener("scroll",
|
|
79
|
+
cancelAnimationFrame(o), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n), l.disconnect();
|
|
81
80
|
};
|
|
82
|
-
}, [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
81
|
+
}, [r]), !r || e.length === 0 ? null : L(
|
|
82
|
+
/* @__PURE__ */ x(A, { children: [
|
|
83
|
+
/* @__PURE__ */ h(
|
|
85
84
|
"div",
|
|
86
85
|
{
|
|
87
86
|
"data-shortcut-overlay-backdrop": "",
|
|
88
|
-
onClick: () =>
|
|
87
|
+
onClick: () => i(!1),
|
|
89
88
|
style: {
|
|
90
89
|
position: "fixed",
|
|
91
90
|
inset: 0,
|
|
@@ -95,7 +94,7 @@ function T() {
|
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
),
|
|
98
|
-
e.map((o) => /* @__PURE__ */
|
|
97
|
+
e.map((o) => /* @__PURE__ */ h(
|
|
99
98
|
"div",
|
|
100
99
|
{
|
|
101
100
|
"data-shortcut-overlay-badge": "",
|
|
@@ -108,8 +107,8 @@ function T() {
|
|
|
108
107
|
pointerEvents: "none",
|
|
109
108
|
animation: o.placement === "below" ? "shortcut-overlay-badge-in-below 0.15s ease-out" : "shortcut-overlay-badge-in 0.15s ease-out"
|
|
110
109
|
},
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
-
|
|
110
|
+
children: /* @__PURE__ */ h(
|
|
111
|
+
O,
|
|
113
112
|
{
|
|
114
113
|
keybinding: o.keybinding,
|
|
115
114
|
size: "sm",
|
|
@@ -119,7 +118,7 @@ function T() {
|
|
|
119
118
|
},
|
|
120
119
|
o.id
|
|
121
120
|
)),
|
|
122
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ h("style", { children: `
|
|
123
122
|
@keyframes shortcut-overlay-badge-in {
|
|
124
123
|
from {
|
|
125
124
|
opacity: 0;
|
|
@@ -145,7 +144,7 @@ function T() {
|
|
|
145
144
|
document.body
|
|
146
145
|
);
|
|
147
146
|
}
|
|
148
|
-
|
|
147
|
+
C.displayName = "ShortcutOverlay";
|
|
149
148
|
export {
|
|
150
|
-
|
|
149
|
+
C as ShortcutOverlay
|
|
151
150
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deserialiseOverrides as h, serialiseOverrides as
|
|
1
|
+
import { deserialiseOverrides as h, serialiseOverrides as u, isReservedShortcut as f, keybindingsEqual as m, scopePriority as a, matchesKeybinding as g } from "./utils.js";
|
|
2
2
|
const v = 10;
|
|
3
3
|
class c {
|
|
4
4
|
static STORAGE_KEY = "impact-nova-shortcuts";
|
|
@@ -15,7 +15,7 @@ class c {
|
|
|
15
15
|
saveOverrides(e) {
|
|
16
16
|
if (!(typeof localStorage > "u"))
|
|
17
17
|
try {
|
|
18
|
-
localStorage.setItem(c.STORAGE_KEY,
|
|
18
|
+
localStorage.setItem(c.STORAGE_KEY, u(e));
|
|
19
19
|
} catch {
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -86,7 +86,7 @@ class C {
|
|
|
86
86
|
const s = this.commands.get(e);
|
|
87
87
|
if (!s) return { success: !1 };
|
|
88
88
|
if (!s.customisable) return { success: !1 };
|
|
89
|
-
if (
|
|
89
|
+
if (f(t))
|
|
90
90
|
return { success: !1, reserved: !0 };
|
|
91
91
|
const i = this.findConflict(e, t, s.scope);
|
|
92
92
|
return i ? { success: !1, conflict: i } : (s.keybinding = t, this.overrides.set(e, t), this.saveOverrides(), this.emit({ type: "update-keybinding", commandId: e }), { success: !0 });
|
|
@@ -147,7 +147,7 @@ class C {
|
|
|
147
147
|
getPaletteCommands() {
|
|
148
148
|
const t = this.getRegisteredInstances().length > 1;
|
|
149
149
|
return this.getAllCommands().filter((s) => {
|
|
150
|
-
if (s.hidden
|
|
150
|
+
if (s.hidden) return !1;
|
|
151
151
|
const i = this.getHighestActiveScopePriority();
|
|
152
152
|
return !(a(s.scope) > i || s.instance && t && this.activeInstance && s.instance !== this.activeInstance);
|
|
153
153
|
});
|
|
@@ -5,10 +5,6 @@ export type DataTableRowHeight = 'default' | 'compact' | 'comfort';
|
|
|
5
5
|
export interface DataTableContextValue {
|
|
6
6
|
gridApi: GridApi | null;
|
|
7
7
|
registerApi: (api: GridApi) => void;
|
|
8
|
-
sheetTarget: HTMLDivElement | null;
|
|
9
|
-
setSheetTarget: (node: HTMLDivElement | null) => void;
|
|
10
|
-
/** True while at least one `DataTableSheet` in this table has `open` — expands grid host so the portaled overlay is not clipped. */
|
|
11
|
-
scopedSheetOpen: boolean;
|
|
12
8
|
/** Call `+1` when a sheet opens, `-1` when it closes or unmounts (supports multiple sheets). */
|
|
13
9
|
registerScopedSheetDepth: (delta: 1 | -1) => void;
|
|
14
10
|
fontSize: DataTableFontSize;
|
|
@@ -20,3 +16,15 @@ export interface DataTableContextValue {
|
|
|
20
16
|
}
|
|
21
17
|
export declare const DataTableContext: import('react').Context<DataTableContextValue>;
|
|
22
18
|
export declare const useDataTable: () => DataTableContextValue;
|
|
19
|
+
/**
|
|
20
|
+
* Separate context for sheet-portal state that changes on every sheet open/close.
|
|
21
|
+
* Isolated from `DataTableContext` so that `scopedSheetOpen` toggling does NOT
|
|
22
|
+
* force grid consumers (`DataTableContent`, `AgGridWrapper`) to re-render.
|
|
23
|
+
*/
|
|
24
|
+
export interface DataTableSheetPortalContextValue {
|
|
25
|
+
sheetTarget: HTMLDivElement | null;
|
|
26
|
+
setSheetTarget: (node: HTMLDivElement | null) => void;
|
|
27
|
+
scopedSheetOpen: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const DataTableSheetPortalContext: import('react').Context<DataTableSheetPortalContextValue>;
|
|
30
|
+
export declare const useDataTableSheetPortal: () => DataTableSheetPortalContextValue;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { createContext as e, useContext as a } from "react";
|
|
2
|
-
const o = e(null),
|
|
2
|
+
const o = e(null), l = () => {
|
|
3
3
|
const t = a(o);
|
|
4
4
|
if (!t)
|
|
5
5
|
throw new Error("useDataTable must be used within a DataTable");
|
|
6
6
|
return t;
|
|
7
|
+
}, n = e(null), s = () => {
|
|
8
|
+
const t = a(n);
|
|
9
|
+
if (!t)
|
|
10
|
+
throw new Error("useDataTableSheetPortal must be used within a DataTable");
|
|
11
|
+
return t;
|
|
7
12
|
};
|
|
8
13
|
export {
|
|
9
14
|
o as DataTableContext,
|
|
10
|
-
|
|
15
|
+
n as DataTableSheetPortalContext,
|
|
16
|
+
l as useDataTable,
|
|
17
|
+
s as useDataTableSheetPortal
|
|
11
18
|
};
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Returns both `open` and `setOpen`.
|
|
4
|
+
* Subscribes to BOTH contexts — use only in components that genuinely
|
|
5
|
+
* need to read the `open` flag (DataTableSheetContent, Trigger, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export declare const useDataTableSheet: () => {
|
|
8
|
+
open: boolean;
|
|
9
|
+
setOpen: (open: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Returns ONLY `setOpen`. Does NOT subscribe to `open` changes, so the
|
|
13
|
+
* consuming component will NOT re-render when the sheet opens/closes.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDataTableSheetApi: () => {
|
|
16
|
+
setOpen: (open: boolean) => void;
|
|
17
|
+
};
|
|
2
18
|
export declare const DataTableSheet: ({ children, defaultOpen, open: controlledOpen, onOpenChange, }: {
|
|
3
19
|
children: React.ReactNode;
|
|
4
20
|
defaultOpen?: boolean;
|