impact-nova 1.6.0 → 1.6.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/dist/components/ui/calendar.js +352 -347
- package/dist/components/ui/command-palette/command-palette.js +53 -50
- package/dist/components/ui/command-palette/shortcut-settings.js +53 -52
- package/dist/components/ui/date-picker/multi-week-picker.js +30 -30
- package/dist/components/ui/date-picker/week-picker.js +45 -45
- package/package.json +1 -1
|
@@ -28,8 +28,8 @@ function fe({
|
|
|
28
28
|
commands: n,
|
|
29
29
|
placeholder: i = "Type a command or search...",
|
|
30
30
|
emptyTitle: m = "No results found",
|
|
31
|
-
emptyDescription:
|
|
32
|
-
recentGroupLabel:
|
|
31
|
+
emptyDescription: p = "Try a different search term",
|
|
32
|
+
recentGroupLabel: f = "Recently Used",
|
|
33
33
|
defaultGroupLabel: d = "Commands",
|
|
34
34
|
navigateLabel: I = "Navigate",
|
|
35
35
|
runLabel: z = "Run",
|
|
@@ -38,34 +38,37 @@ function fe({
|
|
|
38
38
|
onCommandExecute: O,
|
|
39
39
|
onOpenChange: W
|
|
40
40
|
}) {
|
|
41
|
-
const { open: E, setOpen: Y, getPaletteCommands: Z, getEffectiveKeybinding: G, registry: k } = ie(), [
|
|
41
|
+
const { open: E, setOpen: Y, getPaletteCommands: Z, getEffectiveKeybinding: G, registry: k } = ie(), [y, $] = r.useState(""), [N, g] = r.useState(0), A = r.useRef(null), F = r.useRef(null), j = r.useMemo(() => (n ?? Z()).filter((s) => {
|
|
42
|
+
const u = s.source ?? "user";
|
|
43
|
+
return u === "user" || u === "ag-grid";
|
|
44
|
+
}), [n, E]), q = r.useMemo(() => {
|
|
42
45
|
const t = le(
|
|
43
46
|
j,
|
|
44
|
-
|
|
47
|
+
y,
|
|
45
48
|
(s) => `${s.category ? s.category + ": " : ""}${s.label}${s.description ? " " + s.description : ""}`
|
|
46
49
|
);
|
|
47
|
-
if (!
|
|
48
|
-
const s = k.getRecentCommandIds(),
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
return
|
|
50
|
+
if (!y.trim()) {
|
|
51
|
+
const s = k.getRecentCommandIds(), u = new Set(s), x = [], C = [];
|
|
52
|
+
for (const h of t)
|
|
53
|
+
u.has(h.item.id) ? x.push(h) : C.push(h);
|
|
54
|
+
return x.sort((h, oe) => s.indexOf(h.item.id) - s.indexOf(oe.item.id)), [...x, ...C];
|
|
52
55
|
}
|
|
53
56
|
return t;
|
|
54
|
-
}, [j,
|
|
57
|
+
}, [j, y, k]), T = r.useMemo(
|
|
55
58
|
() => q.map((t) => t.item),
|
|
56
59
|
[q]
|
|
57
60
|
), ee = r.useMemo(
|
|
58
61
|
() => de({
|
|
59
62
|
filteredCommands: T,
|
|
60
|
-
emptyQuery: !
|
|
63
|
+
emptyQuery: !y.trim(),
|
|
61
64
|
recentCommandIds: k.getRecentCommandIds(),
|
|
62
|
-
recentGroupLabel:
|
|
65
|
+
recentGroupLabel: f,
|
|
63
66
|
defaultGroupLabel: d
|
|
64
67
|
}),
|
|
65
|
-
[T,
|
|
68
|
+
[T, y, k, f, d]
|
|
66
69
|
), { groups: te, orderedCommands: b } = ee, S = r.useRef({ ordered: b, index: N });
|
|
67
70
|
S.current = { ordered: b, index: N }, r.useEffect(() => {
|
|
68
|
-
E && ($(""),
|
|
71
|
+
E && ($(""), g(0), requestAnimationFrame(() => {
|
|
69
72
|
A.current?.focus();
|
|
70
73
|
}));
|
|
71
74
|
}, [E]);
|
|
@@ -75,28 +78,28 @@ function fe({
|
|
|
75
78
|
t.handler(), k.addRecentCommand(t.id), O?.(t), K(!1);
|
|
76
79
|
}, [k, O]), ae = r.useCallback(
|
|
77
80
|
(t) => {
|
|
78
|
-
const { ordered: s } = S.current,
|
|
81
|
+
const { ordered: s } = S.current, u = Math.max(s.length - 1, 0);
|
|
79
82
|
switch (t.key) {
|
|
80
83
|
case "ArrowDown": {
|
|
81
|
-
t.preventDefault(),
|
|
84
|
+
t.preventDefault(), g((x) => Math.min(x + 1, u));
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
84
87
|
case "ArrowUp": {
|
|
85
|
-
t.preventDefault(),
|
|
88
|
+
t.preventDefault(), g((x) => Math.max(x - 1, 0));
|
|
86
89
|
break;
|
|
87
90
|
}
|
|
88
91
|
case "Enter": {
|
|
89
92
|
t.preventDefault();
|
|
90
|
-
const { ordered:
|
|
91
|
-
|
|
93
|
+
const { ordered: x, index: C } = S.current, h = x[C];
|
|
94
|
+
h && w(h);
|
|
92
95
|
break;
|
|
93
96
|
}
|
|
94
97
|
case "Home": {
|
|
95
|
-
t.preventDefault(),
|
|
98
|
+
t.preventDefault(), g(0);
|
|
96
99
|
break;
|
|
97
100
|
}
|
|
98
101
|
case "End": {
|
|
99
|
-
t.preventDefault(),
|
|
102
|
+
t.preventDefault(), g(u);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -104,10 +107,10 @@ function fe({
|
|
|
104
107
|
[w]
|
|
105
108
|
);
|
|
106
109
|
r.useEffect(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
110
|
+
g(0);
|
|
111
|
+
}, [y]), r.useEffect(() => {
|
|
109
112
|
const t = b.length;
|
|
110
|
-
|
|
113
|
+
g((s) => t === 0 ? 0 : Math.min(s, t - 1));
|
|
111
114
|
}, [b.length]), r.useLayoutEffect(() => {
|
|
112
115
|
const t = F.current;
|
|
113
116
|
if (!t) return;
|
|
@@ -120,16 +123,16 @@ function fe({
|
|
|
120
123
|
}, [N]);
|
|
121
124
|
const ne = r.useMemo(
|
|
122
125
|
() => ({
|
|
123
|
-
query:
|
|
126
|
+
query: y,
|
|
124
127
|
setQuery: $,
|
|
125
128
|
selectedIndex: N,
|
|
126
|
-
setSelectedIndex:
|
|
129
|
+
setSelectedIndex: g,
|
|
127
130
|
orderedCommands: b,
|
|
128
131
|
onExecute: w,
|
|
129
132
|
placeholder: i,
|
|
130
133
|
emptyTitle: m,
|
|
131
|
-
emptyDescription:
|
|
132
|
-
recentGroupLabel:
|
|
134
|
+
emptyDescription: p,
|
|
135
|
+
recentGroupLabel: f,
|
|
133
136
|
defaultGroupLabel: d,
|
|
134
137
|
navigateLabel: I,
|
|
135
138
|
runLabel: z,
|
|
@@ -137,14 +140,14 @@ function fe({
|
|
|
137
140
|
configureShortcutsLabel: D
|
|
138
141
|
}),
|
|
139
142
|
[
|
|
140
|
-
|
|
143
|
+
y,
|
|
141
144
|
N,
|
|
142
145
|
b,
|
|
143
146
|
w,
|
|
144
147
|
i,
|
|
145
148
|
m,
|
|
146
|
-
u,
|
|
147
149
|
p,
|
|
150
|
+
f,
|
|
148
151
|
d,
|
|
149
152
|
I,
|
|
150
153
|
z,
|
|
@@ -190,18 +193,18 @@ function fe({
|
|
|
190
193
|
),
|
|
191
194
|
/* @__PURE__ */ e(_, { ref: F, children: b.length === 0 ? /* @__PURE__ */ e(V, {}) : te.map((t, s) => /* @__PURE__ */ c(r.Fragment, { children: [
|
|
192
195
|
s > 0 && /* @__PURE__ */ e(X, {}),
|
|
193
|
-
/* @__PURE__ */ e(B, { heading: t.heading, children: t.items.map((
|
|
194
|
-
const C = t.rowStart +
|
|
196
|
+
/* @__PURE__ */ e(B, { heading: t.heading, children: t.items.map((u, x) => {
|
|
197
|
+
const C = t.rowStart + x, h = G(u.id);
|
|
195
198
|
return /* @__PURE__ */ e(
|
|
196
199
|
H,
|
|
197
200
|
{
|
|
198
|
-
command:
|
|
201
|
+
command: u,
|
|
199
202
|
isSelected: C === N,
|
|
200
|
-
onSelect: () => w(
|
|
201
|
-
onMouseEnter: () =>
|
|
202
|
-
keybinding:
|
|
203
|
+
onSelect: () => w(u),
|
|
204
|
+
onMouseEnter: () => g(C),
|
|
205
|
+
keybinding: h
|
|
203
206
|
},
|
|
204
|
-
|
|
207
|
+
u.id
|
|
205
208
|
);
|
|
206
209
|
}) })
|
|
207
210
|
] }, `${t.heading}-${t.rowStart}`)) }),
|
|
@@ -215,7 +218,7 @@ function fe({
|
|
|
215
218
|
fe.displayName = "CommandPalette";
|
|
216
219
|
const U = r.forwardRef(
|
|
217
220
|
({ className: o, placeholder: a, onValueChange: n, ...i }, m) => {
|
|
218
|
-
const { query:
|
|
221
|
+
const { query: p, setQuery: f } = r.useContext(R);
|
|
219
222
|
return /* @__PURE__ */ c(
|
|
220
223
|
"div",
|
|
221
224
|
{
|
|
@@ -230,9 +233,9 @@ const U = r.forwardRef(
|
|
|
230
233
|
"input",
|
|
231
234
|
{
|
|
232
235
|
ref: m,
|
|
233
|
-
value:
|
|
236
|
+
value: p,
|
|
234
237
|
onChange: (d) => {
|
|
235
|
-
|
|
238
|
+
f(d.target.value), n?.(d.target.value);
|
|
236
239
|
},
|
|
237
240
|
placeholder: a,
|
|
238
241
|
autoComplete: "off",
|
|
@@ -308,12 +311,12 @@ function xe({ source: o, isSelected: a }) {
|
|
|
308
311
|
) : null;
|
|
309
312
|
}
|
|
310
313
|
const H = r.forwardRef(
|
|
311
|
-
({ className: o, command: a, isSelected: n, onSelect: i, keybinding: m, ...
|
|
314
|
+
({ className: o, command: a, isSelected: n, onSelect: i, keybinding: m, ...p }, f) => {
|
|
312
315
|
const d = pe(a.source);
|
|
313
316
|
return /* @__PURE__ */ c(
|
|
314
317
|
"div",
|
|
315
318
|
{
|
|
316
|
-
ref:
|
|
319
|
+
ref: f,
|
|
317
320
|
role: "option",
|
|
318
321
|
"aria-selected": n,
|
|
319
322
|
"data-selected": n,
|
|
@@ -327,7 +330,7 @@ const H = r.forwardRef(
|
|
|
327
330
|
n ? "bg-brand text-brand-foreground" : d ? "text-content-muted hover:bg-canvas-muted" : "text-content-charcoal hover:bg-canvas-muted",
|
|
328
331
|
o
|
|
329
332
|
),
|
|
330
|
-
...
|
|
333
|
+
...p,
|
|
331
334
|
children: [
|
|
332
335
|
a.icon && /* @__PURE__ */ e("span", { className: l(
|
|
333
336
|
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
@@ -352,14 +355,14 @@ const H = r.forwardRef(
|
|
|
352
355
|
);
|
|
353
356
|
H.displayName = "CommandPaletteItem";
|
|
354
357
|
function L({ keybinding: o, isSelected: a, external: n, className: i, ...m }) {
|
|
355
|
-
const
|
|
358
|
+
const p = ce(o);
|
|
356
359
|
return /* @__PURE__ */ e(
|
|
357
360
|
"span",
|
|
358
361
|
{
|
|
359
362
|
className: l("ml-auto flex items-center gap-0.5 shrink-0", i),
|
|
360
363
|
"data-command-palette-shortcut": !0,
|
|
361
364
|
...m,
|
|
362
|
-
children:
|
|
365
|
+
children: p.map((f, d) => /* @__PURE__ */ e(
|
|
363
366
|
"kbd",
|
|
364
367
|
{
|
|
365
368
|
className: l(
|
|
@@ -367,9 +370,9 @@ function L({ keybinding: o, isSelected: a, external: n, className: i, ...m }) {
|
|
|
367
370
|
"transition-[color,background-color,border-color] duration-150 ease-out",
|
|
368
371
|
a ? "bg-canvas-elevated/20 text-brand-foreground border border-brand-foreground/30" : n ? "bg-canvas-muted text-stroke-hairline border border-stroke-hairline" : "bg-canvas-muted text-content-muted border border-stroke-hairline"
|
|
369
372
|
),
|
|
370
|
-
children:
|
|
373
|
+
children: f
|
|
371
374
|
},
|
|
372
|
-
`${
|
|
375
|
+
`${f}-${d}`
|
|
373
376
|
))
|
|
374
377
|
}
|
|
375
378
|
);
|
|
@@ -407,7 +410,7 @@ function X({ className: o, ...a }) {
|
|
|
407
410
|
}
|
|
408
411
|
X.displayName = "CommandPaletteSeparator";
|
|
409
412
|
function J({ className: o, ...a }) {
|
|
410
|
-
const { navigateLabel: n, runLabel: i, closeLabel: m, configureShortcutsLabel:
|
|
413
|
+
const { navigateLabel: n, runLabel: i, closeLabel: m, configureShortcutsLabel: p } = r.useContext(R);
|
|
411
414
|
return /* @__PURE__ */ c(
|
|
412
415
|
"div",
|
|
413
416
|
{
|
|
@@ -431,9 +434,9 @@ function J({ className: o, ...a }) {
|
|
|
431
434
|
/* @__PURE__ */ e(v, { keys: ["Escape"], size: "sm", variant: "muted" }),
|
|
432
435
|
/* @__PURE__ */ e("span", { children: m })
|
|
433
436
|
] }),
|
|
434
|
-
|
|
437
|
+
p && /* @__PURE__ */ c("span", { className: "ml-auto inline-flex items-center gap-1", children: [
|
|
435
438
|
/* @__PURE__ */ e(v, { keybinding: { key: "k", alt: !0 }, size: "sm", variant: "muted" }),
|
|
436
|
-
/* @__PURE__ */ e("span", { children:
|
|
439
|
+
/* @__PURE__ */ e("span", { children: p })
|
|
437
440
|
] })
|
|
438
441
|
]
|
|
439
442
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as K } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { User as j, Monitor as z, AlertTriangle as G, Lock as T, RotateCcw as U } from "lucide-react";
|
|
4
4
|
import { cn as h } from "../../../lib/utils.js";
|
|
5
5
|
import { ModuleRegistry as B, AllCommunityModule as $ } from "ag-grid-community";
|
|
@@ -8,11 +8,11 @@ import { DataTable as V, DataTableContent as q } from "../data-table/data-table.
|
|
|
8
8
|
import { AG_CELL_NO_PADDING as D } from "../ag-grid-react/cell-renderers/index.js";
|
|
9
9
|
import { Kbd as J } from "./kbd.js";
|
|
10
10
|
import { useCommandPalette as Q } from "./command-palette-context.js";
|
|
11
|
-
import { COMMAND_SOURCE_LABELS as
|
|
11
|
+
import { COMMAND_SOURCE_LABELS as m, keybindingToString as X, keybindingFromEvent as Y, isReservedShortcut as Z } from "./utils.js";
|
|
12
12
|
import { BadgeCellRenderer as W } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
13
13
|
B.registerModules([$, H]);
|
|
14
|
-
function ee(
|
|
15
|
-
const e =
|
|
14
|
+
function ee(l) {
|
|
15
|
+
const e = l.data;
|
|
16
16
|
return e ? /* @__PURE__ */ p("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
17
17
|
!e.customisable && /* @__PURE__ */ r(T, { className: "h-3 w-3 text-content-muted shrink-0" }),
|
|
18
18
|
/* @__PURE__ */ p("div", { className: "flex flex-col min-w-0 gap-0", children: [
|
|
@@ -21,10 +21,10 @@ function ee(n) {
|
|
|
21
21
|
] })
|
|
22
22
|
] }) : null;
|
|
23
23
|
}
|
|
24
|
-
function te(
|
|
25
|
-
const e =
|
|
24
|
+
function te(l) {
|
|
25
|
+
const e = l.data;
|
|
26
26
|
if (!e) return null;
|
|
27
|
-
const d =
|
|
27
|
+
const d = l.recordingCommandId === e.id;
|
|
28
28
|
return /* @__PURE__ */ r("div", { className: h(
|
|
29
29
|
"w-full h-full flex items-center ag-cell-inner-padding",
|
|
30
30
|
e.customisable ? "in-ag-editable-cell-highlight" : ""
|
|
@@ -36,13 +36,13 @@ function te(n) {
|
|
|
36
36
|
e.customisable ? "bg-canvas-elevated" : "bg-transparent",
|
|
37
37
|
d && "ring-1 ring-brand border border-brand"
|
|
38
38
|
),
|
|
39
|
-
children: d ? /* @__PURE__ */ r("span", { className: "text-xs text-brand font-medium animate-pulse", children:
|
|
39
|
+
children: d ? /* @__PURE__ */ r("span", { className: "text-xs text-brand font-medium animate-pulse", children: l.recordingLabel ?? "Press desired shortcut..." }) : /* @__PURE__ */ p(K, { children: [
|
|
40
40
|
e.keybinding ? /* @__PURE__ */ r(
|
|
41
41
|
"button",
|
|
42
42
|
{
|
|
43
43
|
type: "button",
|
|
44
44
|
onClick: (o) => {
|
|
45
|
-
o.stopPropagation(), e.customisable &&
|
|
45
|
+
o.stopPropagation(), e.customisable && l.onStartRecording(e.id);
|
|
46
46
|
},
|
|
47
47
|
disabled: !e.customisable,
|
|
48
48
|
className: h(
|
|
@@ -56,10 +56,10 @@ function te(n) {
|
|
|
56
56
|
{
|
|
57
57
|
type: "button",
|
|
58
58
|
onClick: (o) => {
|
|
59
|
-
o.stopPropagation(),
|
|
59
|
+
o.stopPropagation(), l.onStartRecording(e.id);
|
|
60
60
|
},
|
|
61
61
|
className: "flex items-center justify-end h-full w-full text-xs text-content-muted hover:text-brand transition-colors cursor-pointer text-right",
|
|
62
|
-
children:
|
|
62
|
+
children: l.addShortcutLabel ?? "Add shortcut"
|
|
63
63
|
}
|
|
64
64
|
) : /* @__PURE__ */ r("span", { className: "text-xs text-transparent", children: "--" }),
|
|
65
65
|
e.hasOverride && e.customisable && !d && /* @__PURE__ */ r(
|
|
@@ -67,7 +67,7 @@ function te(n) {
|
|
|
67
67
|
{
|
|
68
68
|
type: "button",
|
|
69
69
|
onClick: (o) => {
|
|
70
|
-
o.stopPropagation(),
|
|
70
|
+
o.stopPropagation(), l.onReset(e.id);
|
|
71
71
|
},
|
|
72
72
|
className: "absolute right-1 p-0.5 rounded bg-canvas-elevated hover:bg-canvas-muted hover:text-destructive cursor-pointer opacity-0 group-hover/row:opacity-100 transition-opacity z-10",
|
|
73
73
|
title: "Reset to default",
|
|
@@ -78,16 +78,16 @@ function te(n) {
|
|
|
78
78
|
}
|
|
79
79
|
) });
|
|
80
80
|
}
|
|
81
|
-
function re(
|
|
82
|
-
const e =
|
|
81
|
+
function re(l) {
|
|
82
|
+
const e = l.data;
|
|
83
83
|
return e ? /* @__PURE__ */ r("div", { className: "flex items-center h-full", children: /* @__PURE__ */ r("span", { className: "text-xs text-content-muted capitalize", children: e.scope }) }) : null;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
className:
|
|
85
|
+
function ne({
|
|
86
|
+
className: l,
|
|
87
87
|
scopes: e,
|
|
88
88
|
sources: d,
|
|
89
89
|
renderStatus: o,
|
|
90
|
-
recordingLabel:
|
|
90
|
+
recordingLabel: le,
|
|
91
91
|
pressShortcutLabel: x,
|
|
92
92
|
addShortcutLabel: y,
|
|
93
93
|
conflictWarnLabel: v = "Conflicts with other shortcuts",
|
|
@@ -101,17 +101,20 @@ function le({
|
|
|
101
101
|
updateKeybinding: S,
|
|
102
102
|
resetKeybinding: N,
|
|
103
103
|
version: A
|
|
104
|
-
} = Q(), [c, f] =
|
|
105
|
-
let
|
|
106
|
-
return
|
|
107
|
-
const
|
|
104
|
+
} = Q(), [c, f] = s.useState(null), [u, a] = s.useState(null), L = s.useMemo(() => {
|
|
105
|
+
let n = w();
|
|
106
|
+
return n = n.filter((t) => {
|
|
107
|
+
const i = t.source ?? "user";
|
|
108
|
+
return i === "user" || i === "ag-grid";
|
|
109
|
+
}), e && (n = n.filter((t) => e.includes(t.scope))), d && (n = n.filter((t) => t.source && d.includes(t.source))), n.map((t) => {
|
|
110
|
+
const i = C(t.id), g = t.source ?? "user", E = m[g] ?? g ?? "User", P = E.toLowerCase() === "user";
|
|
108
111
|
return {
|
|
109
112
|
id: t.id,
|
|
110
113
|
command: t.label,
|
|
111
114
|
description: t.description || "",
|
|
112
115
|
category: t.category || "General",
|
|
113
|
-
keybinding:
|
|
114
|
-
keybindingDisplay:
|
|
116
|
+
keybinding: i,
|
|
117
|
+
keybindingDisplay: i ? X(i) : "",
|
|
115
118
|
scope: t.scope,
|
|
116
119
|
source: E,
|
|
117
120
|
sourceColor: P ? "primary" : "neutral",
|
|
@@ -122,33 +125,33 @@ function le({
|
|
|
122
125
|
_def: t
|
|
123
126
|
};
|
|
124
127
|
});
|
|
125
|
-
}, [A, e, d, w, C]), R =
|
|
126
|
-
f(
|
|
127
|
-
}, []), k =
|
|
128
|
-
N(
|
|
128
|
+
}, [A, e, d, w, C]), R = s.useCallback((n) => {
|
|
129
|
+
f(n), a(null);
|
|
130
|
+
}, []), k = s.useCallback((n) => {
|
|
131
|
+
N(n), a(null);
|
|
129
132
|
}, [N]);
|
|
130
|
-
|
|
133
|
+
s.useEffect(() => {
|
|
131
134
|
if (!c) return;
|
|
132
|
-
const
|
|
135
|
+
const n = (t) => {
|
|
133
136
|
if (t.preventDefault(), t.stopPropagation(), t.key === "Escape") {
|
|
134
|
-
f(null),
|
|
137
|
+
f(null), a(null);
|
|
135
138
|
return;
|
|
136
139
|
}
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
139
|
-
if (Z(
|
|
140
|
-
|
|
140
|
+
const i = Y(t);
|
|
141
|
+
if (!i) return;
|
|
142
|
+
if (Z(i)) {
|
|
143
|
+
a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3);
|
|
141
144
|
return;
|
|
142
145
|
}
|
|
143
|
-
const g = S(c,
|
|
144
|
-
g.success ? (f(null),
|
|
146
|
+
const g = S(c, i);
|
|
147
|
+
g.success ? (f(null), a(null)) : g.conflict ? (a({
|
|
145
148
|
type: "conflict",
|
|
146
149
|
text: v
|
|
147
|
-
}), f(null), setTimeout(() =>
|
|
150
|
+
}), f(null), setTimeout(() => a(null), 3e3)) : g.reserved && (a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3));
|
|
148
151
|
};
|
|
149
|
-
return window.addEventListener("keydown",
|
|
152
|
+
return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
|
|
150
153
|
}, [c, S, b, v]);
|
|
151
|
-
const _ =
|
|
154
|
+
const _ = s.useMemo(() => [
|
|
152
155
|
{
|
|
153
156
|
field: "command",
|
|
154
157
|
headerName: "Command",
|
|
@@ -156,8 +159,8 @@ function le({
|
|
|
156
159
|
minWidth: 200,
|
|
157
160
|
filter: "agTextColumnFilter",
|
|
158
161
|
cellRenderer: ee,
|
|
159
|
-
filterValueGetter: (
|
|
160
|
-
const t =
|
|
162
|
+
filterValueGetter: (n) => {
|
|
163
|
+
const t = n.data;
|
|
161
164
|
return t ? `${t.command} ${t.description}` : "";
|
|
162
165
|
}
|
|
163
166
|
},
|
|
@@ -220,24 +223,22 @@ function le({
|
|
|
220
223
|
isSearchable: !0,
|
|
221
224
|
advanceSearchEnabled: !0,
|
|
222
225
|
selectOptions: [
|
|
223
|
-
{ label:
|
|
224
|
-
{ label:
|
|
225
|
-
{ label: a["ag-grid"], value: a["ag-grid"] },
|
|
226
|
-
{ label: a.browser, value: a.browser }
|
|
226
|
+
{ label: m.user, value: m.user },
|
|
227
|
+
{ label: m["ag-grid"], value: m["ag-grid"] }
|
|
227
228
|
],
|
|
228
229
|
isMultiSelect: !0
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
], [c, R, k, x, y]), I =
|
|
232
|
+
], [c, R, k, x, y]), I = s.useMemo(() => ({
|
|
232
233
|
filter: {
|
|
233
234
|
filterModel: {
|
|
234
235
|
source: {
|
|
235
236
|
filterType: "set",
|
|
236
|
-
values: [
|
|
237
|
+
values: [m.user, m["ag-grid"]]
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
}), []), O =
|
|
241
|
+
}), []), O = s.useMemo(() => ({
|
|
241
242
|
sortable: !0,
|
|
242
243
|
resizable: !0,
|
|
243
244
|
filter: !0,
|
|
@@ -252,7 +253,7 @@ function le({
|
|
|
252
253
|
u?.type === "conflict" ? /* @__PURE__ */ r(G, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(T, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
253
254
|
/* @__PURE__ */ r("span", { children: u ? u.text : F })
|
|
254
255
|
] }) : null;
|
|
255
|
-
return /* @__PURE__ */ p(V, { className: h("flex flex-col w-full h-full border-t-0",
|
|
256
|
+
return /* @__PURE__ */ p(V, { className: h("flex flex-col w-full h-full border-t-0", l), children: [
|
|
256
257
|
o ? o(M) : M,
|
|
257
258
|
/* @__PURE__ */ r(
|
|
258
259
|
q,
|
|
@@ -265,14 +266,14 @@ function le({
|
|
|
265
266
|
animateRows: !1,
|
|
266
267
|
rowSelection: "single",
|
|
267
268
|
suppressCellFocus: !0,
|
|
268
|
-
getRowId: (
|
|
269
|
+
getRowId: (n) => n.data.id,
|
|
269
270
|
suppressRowClickSelection: !0,
|
|
270
271
|
domLayout: "normal"
|
|
271
272
|
}
|
|
272
273
|
)
|
|
273
274
|
] });
|
|
274
275
|
}
|
|
275
|
-
|
|
276
|
+
ne.displayName = "ShortcutSettings";
|
|
276
277
|
export {
|
|
277
|
-
|
|
278
|
+
ne as ShortcutSettings
|
|
278
279
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { X } from "lucide-react";
|
|
4
4
|
import { CalendarMonth as q } from "../../../icons/index.js";
|
|
@@ -11,97 +11,97 @@ import { Tooltip as C, TooltipTrigger as M, TooltipContent as P } from "../toolt
|
|
|
11
11
|
import { getDateFnsLocale as K } from "../../../i18n/getDateFnsLocale.js";
|
|
12
12
|
import { useImpactNovaI18n as Q } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
13
13
|
const U = (e, o = "MM/dd/yyyy", n) => {
|
|
14
|
-
const l = g(e.startDate, o, n ? { locale: n } : {}),
|
|
15
|
-
return `${l} - ${
|
|
14
|
+
const l = g(e.startDate, o, n ? { locale: n } : {}), p = g(e.endDate, o, n ? { locale: n } : {});
|
|
15
|
+
return `${l} - ${p}`;
|
|
16
16
|
}, Y = s.forwardRef(
|
|
17
17
|
({
|
|
18
18
|
value: e,
|
|
19
19
|
onChange: o,
|
|
20
20
|
format: n = "MM/dd/yyyy",
|
|
21
21
|
placeholder: l,
|
|
22
|
-
minDate:
|
|
22
|
+
minDate: p,
|
|
23
23
|
maxDate: T,
|
|
24
24
|
startMonth: W,
|
|
25
25
|
endMonth: w,
|
|
26
|
-
showFooter:
|
|
26
|
+
showFooter: d = !0,
|
|
27
27
|
calendarType: x = "calendar",
|
|
28
28
|
fiscalMode: N = "basic",
|
|
29
29
|
selectionMode: S = "week",
|
|
30
30
|
fiscalMonthPattern: A,
|
|
31
31
|
fiscalYearStartMonth: v = 1,
|
|
32
32
|
weekStartsOn: D = 1,
|
|
33
|
-
disabled:
|
|
33
|
+
disabled: m,
|
|
34
34
|
className: L,
|
|
35
35
|
...O
|
|
36
36
|
}, I) => {
|
|
37
|
-
const { locale: h, t:
|
|
37
|
+
const { locale: h, t: f } = Q(), $ = s.useMemo(() => K(h), [h]), j = l ?? f("datePicker.selectWeeks"), [y, a] = s.useState(!1), [k, i] = s.useState(e);
|
|
38
38
|
s.useEffect(() => {
|
|
39
39
|
i(e);
|
|
40
40
|
}, [y, e]);
|
|
41
|
-
const
|
|
42
|
-
i(
|
|
43
|
-
},
|
|
44
|
-
o?.(
|
|
41
|
+
const R = (t) => {
|
|
42
|
+
i(t), d || o?.(t);
|
|
43
|
+
}, b = (t) => {
|
|
44
|
+
o?.(t !== void 0 ? t : k), a(!1);
|
|
45
45
|
}, E = () => {
|
|
46
46
|
i(e), a(!1);
|
|
47
47
|
}, u = () => {
|
|
48
|
-
i(void 0), o?.(void 0),
|
|
48
|
+
i(void 0), o?.(void 0), d || a(!1);
|
|
49
49
|
}, V = e && e.length > 0 ? e.length === 1 ? U(e[0], n, $) : `${e.length} weeks selected` : "";
|
|
50
|
-
return /* @__PURE__ */ c(F, { open: y, onOpenChange: a, children: [
|
|
51
|
-
/* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ c(F, { open: y, onOpenChange: (t) => !m && a(t), children: [
|
|
51
|
+
/* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
52
52
|
B,
|
|
53
53
|
{
|
|
54
54
|
ref: I,
|
|
55
55
|
value: V,
|
|
56
|
-
placeholder:
|
|
56
|
+
placeholder: j,
|
|
57
57
|
readOnly: !0,
|
|
58
|
-
disabled:
|
|
58
|
+
disabled: m,
|
|
59
59
|
className: z("cursor-pointer", L),
|
|
60
60
|
suffix: /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
61
|
-
e && e.length > 0 && !
|
|
62
|
-
/* @__PURE__ */
|
|
61
|
+
e && e.length > 0 && !m && /* @__PURE__ */ c(C, { children: [
|
|
62
|
+
/* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
|
|
63
63
|
X,
|
|
64
64
|
{
|
|
65
65
|
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
66
|
-
onClick: (
|
|
67
|
-
|
|
66
|
+
onClick: (t) => {
|
|
67
|
+
t.stopPropagation(), u();
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
) }),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ r(P, { variant: "tertiary", side: "top", children: f("calendar.clear") })
|
|
72
72
|
] }),
|
|
73
73
|
/* @__PURE__ */ c(C, { children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(q, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
75
|
+
/* @__PURE__ */ r(P, { variant: "tertiary", side: "top", children: f("datePicker.selectWeeks") })
|
|
76
76
|
] })
|
|
77
77
|
] }),
|
|
78
78
|
...O
|
|
79
79
|
}
|
|
80
80
|
) }) }),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ r(
|
|
82
82
|
H,
|
|
83
83
|
{
|
|
84
84
|
className: "w-auto p-0",
|
|
85
85
|
align: "start",
|
|
86
|
-
onOpenAutoFocus: (
|
|
87
|
-
children: /* @__PURE__ */
|
|
86
|
+
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
87
|
+
children: /* @__PURE__ */ r(
|
|
88
88
|
J,
|
|
89
89
|
{
|
|
90
90
|
pickerType: "week",
|
|
91
91
|
weekMode: "multiple",
|
|
92
92
|
selectedWeeks: k,
|
|
93
|
-
onWeekSelect:
|
|
94
|
-
disabled: { before:
|
|
93
|
+
onWeekSelect: R,
|
|
94
|
+
disabled: { before: p, after: T },
|
|
95
95
|
startMonth: W,
|
|
96
96
|
endMonth: w,
|
|
97
|
-
showFooter:
|
|
97
|
+
showFooter: d,
|
|
98
98
|
calendarType: x,
|
|
99
99
|
fiscalMode: N,
|
|
100
100
|
selectionMode: S,
|
|
101
101
|
fiscalMonthPattern: A,
|
|
102
102
|
fiscalYearStartMonth: v,
|
|
103
103
|
weekStartsOn: D,
|
|
104
|
-
onApply:
|
|
104
|
+
onApply: b,
|
|
105
105
|
onCancel: E,
|
|
106
106
|
onClear: u,
|
|
107
107
|
captionLayout: "dropdown"
|