@nivaro/react 0.3.118 → 0.3.119
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/ItemEditForm.js +2047 -2026
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +6 -4
- package/dist/shared/components/item-edit/FieldComments.js +45 -43
- package/dist/shared/components/item-edit/HeaderTools.js +237 -142
- package/dist/shared/components/item-edit/RecordHelpChip.js +10 -10
- package/dist/shared/components/item-edit/addendum-view.js +6 -0
- package/dist/shared/components/layout-editor/pickers/field-picker.js +118 -105
- package/package.json +1 -1
|
@@ -1,243 +1,338 @@
|
|
|
1
|
-
import { jsx as w, jsxs as
|
|
2
|
-
import { MoreHorizontal as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { cn as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (!(
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
return !
|
|
1
|
+
import { jsx as w, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontal as F } from "lucide-react";
|
|
3
|
+
import { useRef as m, useState as M, useEffect as R, useContext as K, createContext as U } from "react";
|
|
4
|
+
import { createPortal as P } from "react-dom";
|
|
5
|
+
import { cn as W } from "../../lib/utils.js";
|
|
6
|
+
function j(i, t) {
|
|
7
|
+
const s = i.target;
|
|
8
|
+
if (!(s != null && s.closest)) return !0;
|
|
9
|
+
if (s.closest("[data-radix-popper-content-wrapper]")) return !1;
|
|
10
|
+
const n = s.closest('[role="dialog"]');
|
|
11
|
+
return !n || !!(t && n.contains(t));
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const N = U(!0), q = '[role="dialog"],[role="alertdialog"]';
|
|
14
|
+
function J(i, t) {
|
|
15
|
+
return i instanceof Element ? (i.matches(q) ? [i] : Array.from(i.querySelectorAll(q))).some((n) => !n.closest("[data-radix-popper-content-wrapper]") && !t(n)) : !1;
|
|
16
|
+
}
|
|
17
|
+
const Q = 1500;
|
|
18
|
+
function G(i, t, s) {
|
|
19
|
+
const n = m(t);
|
|
20
|
+
n.current = t;
|
|
21
|
+
const p = m(s);
|
|
22
|
+
p.current = s, R(() => {
|
|
23
|
+
if (!i) return;
|
|
24
|
+
let f = 0;
|
|
25
|
+
const o = [], u = (a) => {
|
|
26
|
+
const c = a.target;
|
|
27
|
+
if (!(c != null && c.closest) || !p.current(c)) return;
|
|
28
|
+
const d = window.location.href, h = !!c.closest("a[href]");
|
|
29
|
+
f = Date.now() + Q;
|
|
30
|
+
const l = () => {
|
|
31
|
+
(h || window.location.href !== d) && n.current();
|
|
32
|
+
};
|
|
33
|
+
o.push(setTimeout(l, 0), setTimeout(l, 250));
|
|
34
|
+
}, r = typeof MutationObserver > "u" ? null : new MutationObserver((a) => {
|
|
35
|
+
if (!(Date.now() > f)) {
|
|
36
|
+
for (const c of a)
|
|
37
|
+
for (const d of Array.from(c.addedNodes))
|
|
38
|
+
if (J(d, p.current)) {
|
|
39
|
+
f = 0, n.current();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return r == null || r.observe(document.body, { childList: !0, subtree: !0 }), window.addEventListener("click", u, !0), () => {
|
|
45
|
+
r == null || r.disconnect(), window.removeEventListener("click", u, !0);
|
|
46
|
+
for (const a of o) clearTimeout(a);
|
|
47
|
+
};
|
|
48
|
+
}, [i]);
|
|
49
|
+
}
|
|
50
|
+
function O(i, t) {
|
|
51
|
+
const s = i.querySelector("[data-nvr-header-title]"), n = s == null ? void 0 : s.querySelector("[data-nvr-record-title]"), p = n == null ? void 0 : n.parentElement;
|
|
52
|
+
if (!s || !n || !p || !t) return 0;
|
|
53
|
+
const f = s.getBoundingClientRect();
|
|
54
|
+
if (t.getBoundingClientRect().top >= f.bottom - 1) return 0;
|
|
55
|
+
const u = n.getBoundingClientRect().top, r = Array.from(p.children).filter(
|
|
56
|
+
(d) => d instanceof HTMLElement && d.offsetWidth > 0
|
|
57
|
+
);
|
|
58
|
+
if (!r.some((d) => d.getBoundingClientRect().top > u + 2)) return 0;
|
|
59
|
+
const a = Number.parseFloat(getComputedStyle(p).columnGap) || 0, c = r.reduce((d, h) => d + h.offsetWidth, 0) + a * (r.length - 1);
|
|
60
|
+
return Math.max(0, Math.ceil(c - p.clientWidth));
|
|
61
|
+
}
|
|
62
|
+
function te({ children: i }) {
|
|
63
|
+
var x, k;
|
|
64
|
+
const t = m(null), s = m(null), [n, p] = M(!1), f = m(!1);
|
|
65
|
+
f.current = n;
|
|
66
|
+
const o = m(0), u = m(0), [r, a] = M(!1), c = m(null), d = m(!1);
|
|
67
|
+
if (n ? r && (d.current = !0) : d.current = !1, G(
|
|
68
|
+
r,
|
|
69
|
+
() => a(!1),
|
|
70
|
+
(e) => {
|
|
71
|
+
var b;
|
|
72
|
+
return !!((b = c.current) != null && b.contains(e) || e.closest("[data-nvr-header-menu-panel]"));
|
|
73
|
+
}
|
|
74
|
+
), R(() => {
|
|
75
|
+
var A, B;
|
|
76
|
+
const e = (A = t.current) == null ? void 0 : A.closest("[data-nvr-header-row]");
|
|
21
77
|
if (!e) return;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
78
|
+
const b = () => {
|
|
79
|
+
var I, D;
|
|
80
|
+
if (!f.current) {
|
|
81
|
+
if (e.scrollWidth > e.clientWidth + 2) {
|
|
82
|
+
o.current = e.scrollWidth, p(!0), a(!1);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const H = O(e, ((I = t.current) == null ? void 0 : I.parentElement) ?? null);
|
|
86
|
+
H > 0 && (o.current = e.clientWidth + H, p(!0), a(!1));
|
|
25
87
|
return;
|
|
26
88
|
}
|
|
27
|
-
const
|
|
28
|
-
!
|
|
89
|
+
const C = e.hasAttribute("data-nvr-header-wrap"), S = e.scrollWidth > e.clientWidth + 2, T = C || e.querySelector('[data-nvr-header-fold="inline"]') ? 0 : O(e, ((D = t.current) == null ? void 0 : D.parentElement) ?? null);
|
|
90
|
+
!C && (S || T > 0) ? (u.current = Math.max(
|
|
91
|
+
S ? e.scrollWidth : 0,
|
|
92
|
+
e.clientWidth + T
|
|
93
|
+
), e.setAttribute("data-nvr-header-wrap", "")) : C && e.clientWidth > u.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !C && o.current > 0 && e.clientWidth > o.current + 32 && p(!1);
|
|
29
94
|
};
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
95
|
+
b();
|
|
96
|
+
const E = new ResizeObserver(b);
|
|
97
|
+
E.observe(e);
|
|
98
|
+
const v = (B = t.current) == null ? void 0 : B.parentElement;
|
|
99
|
+
v && v !== e && E.observe(v);
|
|
100
|
+
let y = 0;
|
|
101
|
+
const _ = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
102
|
+
y || (y = requestAnimationFrame(() => {
|
|
103
|
+
y = 0, b();
|
|
39
104
|
}));
|
|
40
105
|
});
|
|
41
|
-
return
|
|
42
|
-
|
|
106
|
+
return _ == null || _.observe(e, { childList: !0, subtree: !0 }), () => {
|
|
107
|
+
E.disconnect(), _ == null || _.disconnect(), y && cancelAnimationFrame(y);
|
|
43
108
|
};
|
|
44
|
-
}),
|
|
45
|
-
if (!
|
|
46
|
-
const e = (
|
|
47
|
-
|
|
109
|
+
}), R(() => {
|
|
110
|
+
if (!r) return;
|
|
111
|
+
const e = (b) => {
|
|
112
|
+
b.key !== "Escape" || !j(b, t.current) || (b.stopPropagation(), a(!1));
|
|
48
113
|
};
|
|
49
114
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
50
|
-
}, [
|
|
51
|
-
if (!
|
|
52
|
-
const e = (
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
115
|
+
}, [r]), R(() => {
|
|
116
|
+
if (!r) return;
|
|
117
|
+
const e = (E) => {
|
|
118
|
+
const v = E.target;
|
|
119
|
+
if (v.closest("[data-nvr-header-tools-panel]") || v.closest("[data-nvr-header-tools-btn]") || v.closest("[data-nvr-header-menu-panel]") || v.closest("[data-radix-popper-content-wrapper]"))
|
|
55
120
|
return;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
121
|
+
const y = v.closest('[role="dialog"]');
|
|
122
|
+
y && !y.contains(t.current) || a(!1);
|
|
123
|
+
}, b = (E) => {
|
|
124
|
+
E.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && a(!1);
|
|
60
125
|
};
|
|
61
|
-
return window.addEventListener("mousedown", e, !0), window.addEventListener("click",
|
|
62
|
-
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click",
|
|
126
|
+
return window.addEventListener("mousedown", e, !0), window.addEventListener("click", b), () => {
|
|
127
|
+
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", b);
|
|
63
128
|
};
|
|
64
|
-
}, [
|
|
65
|
-
return /* @__PURE__ */ w("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children:
|
|
66
|
-
const
|
|
67
|
-
return /* @__PURE__ */
|
|
129
|
+
}, [r]), !n)
|
|
130
|
+
return /* @__PURE__ */ w("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: /* @__PURE__ */ w(N.Provider, { value: !0, children: i }) });
|
|
131
|
+
const h = r ? (x = s.current) == null ? void 0 : x.getBoundingClientRect() : void 0, l = ((k = s.current) == null ? void 0 : k.closest('[role="dialog"]')) ?? document.body, g = h ? h.right - (l === document.body ? 0 : l.getBoundingClientRect().left) - 16 : 440;
|
|
132
|
+
return /* @__PURE__ */ L("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
|
|
68
133
|
/* @__PURE__ */ w(
|
|
69
134
|
"button",
|
|
70
135
|
{
|
|
71
|
-
ref:
|
|
136
|
+
ref: s,
|
|
72
137
|
type: "button",
|
|
73
138
|
"data-nvr-header-tools-btn": !0,
|
|
74
|
-
"aria-expanded":
|
|
139
|
+
"aria-expanded": r,
|
|
75
140
|
"aria-label": "More tools",
|
|
76
141
|
"data-tip": "More tools",
|
|
77
|
-
onClick: () =>
|
|
78
|
-
className:
|
|
142
|
+
onClick: () => a((e) => !e),
|
|
143
|
+
className: W(
|
|
79
144
|
"inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
|
|
80
|
-
|
|
145
|
+
r && "bg-accent text-accent-foreground dark:bg-accent"
|
|
81
146
|
),
|
|
82
|
-
children: /* @__PURE__ */ w(
|
|
147
|
+
children: /* @__PURE__ */ w(F, { className: "h-4 w-4" })
|
|
83
148
|
}
|
|
84
149
|
),
|
|
85
|
-
|
|
150
|
+
d.current && P(
|
|
86
151
|
/* @__PURE__ */ w(
|
|
87
152
|
"div",
|
|
88
153
|
{
|
|
154
|
+
ref: c,
|
|
89
155
|
"data-nvr-header-tools-panel": !0,
|
|
90
|
-
style:
|
|
156
|
+
style: r && h ? l === document.body ? {
|
|
91
157
|
position: "fixed",
|
|
92
|
-
top:
|
|
93
|
-
right: Math.max(8, window.innerWidth -
|
|
94
|
-
maxWidth: Math.min(440,
|
|
158
|
+
top: h.bottom + 6,
|
|
159
|
+
right: Math.max(8, window.innerWidth - h.right),
|
|
160
|
+
maxWidth: Math.min(440, g),
|
|
95
161
|
zIndex: 110
|
|
96
162
|
} : {
|
|
97
163
|
position: "absolute",
|
|
98
|
-
top:
|
|
99
|
-
right: Math.max(8,
|
|
100
|
-
maxWidth: Math.min(440,
|
|
164
|
+
top: h.bottom - l.getBoundingClientRect().top + 6,
|
|
165
|
+
right: Math.max(8, l.getBoundingClientRect().right - h.right),
|
|
166
|
+
maxWidth: Math.min(440, g),
|
|
101
167
|
zIndex: 110
|
|
102
|
-
},
|
|
168
|
+
} : { display: "none" },
|
|
103
169
|
className: "flex flex-wrap items-center justify-end gap-1.5 rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card [&_[data-nvr-header-tool-group]]:h-auto [&_[data-nvr-header-tool-group]]:min-h-9 [&_[data-nvr-header-tool-group]]:max-w-full [&_[data-nvr-header-tool-group]]:shrink [&_[data-nvr-header-tool-group]]:flex-wrap",
|
|
104
|
-
children:
|
|
170
|
+
children: /* @__PURE__ */ w(N.Provider, { value: r, children: i })
|
|
105
171
|
}
|
|
106
172
|
),
|
|
107
|
-
|
|
173
|
+
l
|
|
108
174
|
)
|
|
109
175
|
] });
|
|
110
176
|
}
|
|
111
|
-
function
|
|
112
|
-
const [
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
const
|
|
117
|
-
if (!t || !
|
|
118
|
-
!t &&
|
|
177
|
+
function ne(i, t) {
|
|
178
|
+
const [s, n] = M(!1), p = m(!1);
|
|
179
|
+
p.current = s;
|
|
180
|
+
const f = m(0);
|
|
181
|
+
return R(() => {
|
|
182
|
+
const o = i.current, u = o == null ? void 0 : o.closest("[data-nvr-header-row]");
|
|
183
|
+
if (!t || !o || !u) {
|
|
184
|
+
!t && p.current && n(!1);
|
|
119
185
|
return;
|
|
120
186
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
187
|
+
o.setAttribute("data-nvr-header-fold", p.current ? "folded" : "inline");
|
|
188
|
+
const r = () => {
|
|
189
|
+
if (p.current)
|
|
190
|
+
f.current > 0 && u.clientWidth > f.current + 32 && n(!1);
|
|
124
191
|
else {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if ((r == null ? void 0 : r.getAttribute("data-nvr-header-tools")) === "inline" && r.childElementCount > 0)
|
|
192
|
+
const h = u.scrollWidth > u.clientWidth + 2, l = u.querySelector("[data-nvr-header-tools]");
|
|
193
|
+
if ((l == null ? void 0 : l.getAttribute("data-nvr-header-tools")) === "inline" && l.childElementCount > 0)
|
|
128
194
|
return;
|
|
129
|
-
|
|
195
|
+
const g = h ? 0 : O(u, o.parentElement);
|
|
196
|
+
if (!h && g <= 0) return;
|
|
197
|
+
f.current = h ? u.scrollWidth : u.clientWidth + g, n(!0);
|
|
130
198
|
}
|
|
131
199
|
};
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
200
|
+
r();
|
|
201
|
+
const a = new ResizeObserver(r);
|
|
202
|
+
a.observe(u), o.parentElement && o.parentElement !== u && a.observe(o.parentElement);
|
|
203
|
+
let c = 0;
|
|
204
|
+
const d = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
205
|
+
c || (c = requestAnimationFrame(() => {
|
|
206
|
+
c = 0, r();
|
|
207
|
+
}));
|
|
208
|
+
});
|
|
209
|
+
return d == null || d.observe(u, { childList: !0, subtree: !0 }), () => {
|
|
210
|
+
a.disconnect(), d == null || d.disconnect(), c && cancelAnimationFrame(c);
|
|
211
|
+
};
|
|
212
|
+
}), R(() => {
|
|
213
|
+
var o;
|
|
214
|
+
t || (o = i.current) == null || o.removeAttribute("data-nvr-header-fold");
|
|
215
|
+
}, [t, i]), s;
|
|
136
216
|
}
|
|
137
|
-
const
|
|
138
|
-
function
|
|
139
|
-
return Math.max(8, Math.min(
|
|
217
|
+
const V = 240;
|
|
218
|
+
function z(i, t) {
|
|
219
|
+
return Math.max(8, Math.min(i, t - V - 8));
|
|
140
220
|
}
|
|
141
|
-
function
|
|
142
|
-
children:
|
|
221
|
+
function re({
|
|
222
|
+
children: i,
|
|
143
223
|
label: t = "More",
|
|
144
|
-
className:
|
|
224
|
+
className: s
|
|
145
225
|
}) {
|
|
146
|
-
var
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
226
|
+
var d, h;
|
|
227
|
+
const n = m(null), p = m(null), [f, o] = M(!1), u = m(!1);
|
|
228
|
+
f && (u.current = !0), G(
|
|
229
|
+
f,
|
|
230
|
+
() => o(!1),
|
|
231
|
+
(l) => {
|
|
232
|
+
var g;
|
|
233
|
+
return !!((g = p.current) != null && g.contains(l));
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
const r = K(N);
|
|
237
|
+
R(() => {
|
|
238
|
+
r || o(!1);
|
|
239
|
+
}, [r]), R(() => {
|
|
240
|
+
if (!f) return;
|
|
241
|
+
const l = (x) => {
|
|
242
|
+
var e;
|
|
243
|
+
const k = x.target;
|
|
244
|
+
k.closest("[data-nvr-header-menu-panel]") || k.closest("[data-nvr-header-menu-btn]") || k.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
|
|
245
|
+
k.closest('[role="dialog"]') && !((e = k.closest('[role="dialog"]')) != null && e.contains(n.current)) || o(!1);
|
|
246
|
+
}, g = (x) => {
|
|
247
|
+
x.key !== "Escape" || !j(x, n.current) || (x.stopPropagation(), o(!1));
|
|
157
248
|
};
|
|
158
|
-
return window.addEventListener("mousedown",
|
|
159
|
-
window.removeEventListener("mousedown",
|
|
249
|
+
return window.addEventListener("mousedown", l, !0), window.addEventListener("keydown", g, !0), () => {
|
|
250
|
+
window.removeEventListener("mousedown", l, !0), window.removeEventListener("keydown", g, !0);
|
|
160
251
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const
|
|
163
|
-
return /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
252
|
+
}, [f]);
|
|
253
|
+
const a = f ? (d = n.current) == null ? void 0 : d.getBoundingClientRect() : void 0, c = ((h = n.current) == null ? void 0 : h.closest('[role="dialog"]')) ?? document.body;
|
|
254
|
+
return /* @__PURE__ */ L("div", { className: W("relative shrink-0", s), children: [
|
|
255
|
+
/* @__PURE__ */ L(
|
|
165
256
|
"button",
|
|
166
257
|
{
|
|
167
|
-
ref:
|
|
258
|
+
ref: n,
|
|
168
259
|
type: "button",
|
|
169
260
|
"data-nvr-header-menu-btn": !0,
|
|
170
261
|
"aria-haspopup": "menu",
|
|
171
|
-
"aria-expanded":
|
|
262
|
+
"aria-expanded": f,
|
|
172
263
|
"aria-label": t,
|
|
173
264
|
"data-tip": "More actions",
|
|
174
|
-
onClick: () =>
|
|
175
|
-
className:
|
|
265
|
+
onClick: () => o((l) => !l),
|
|
266
|
+
className: W(
|
|
176
267
|
"inline-flex h-9 items-center gap-1 rounded-md border border-input bg-background px-2.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
|
|
177
|
-
|
|
268
|
+
f && "bg-accent text-accent-foreground dark:bg-accent"
|
|
178
269
|
),
|
|
179
270
|
children: [
|
|
180
|
-
/* @__PURE__ */ w(
|
|
271
|
+
/* @__PURE__ */ w(F, { className: "h-4 w-4" }),
|
|
181
272
|
/* @__PURE__ */ w("span", { className: "hidden lg:inline", children: t })
|
|
182
273
|
]
|
|
183
274
|
}
|
|
184
275
|
),
|
|
185
|
-
|
|
276
|
+
u.current && P(
|
|
186
277
|
/* @__PURE__ */ w(
|
|
187
278
|
"div",
|
|
188
279
|
{
|
|
280
|
+
ref: p,
|
|
189
281
|
"data-nvr-header-menu-panel": !0,
|
|
190
282
|
role: "menu",
|
|
191
|
-
onClick: (
|
|
192
|
-
|
|
283
|
+
onClick: (l) => {
|
|
284
|
+
l.target.closest("[data-nvr-menu-close]") && o(!1);
|
|
193
285
|
},
|
|
194
|
-
style:
|
|
286
|
+
style: f && a ? c === document.body ? {
|
|
195
287
|
position: "fixed",
|
|
196
|
-
top:
|
|
197
|
-
right:
|
|
288
|
+
top: a.bottom + 6,
|
|
289
|
+
right: z(window.innerWidth - a.right, window.innerWidth),
|
|
198
290
|
zIndex: 110
|
|
199
291
|
} : {
|
|
200
292
|
position: "absolute",
|
|
201
|
-
top:
|
|
202
|
-
right:
|
|
203
|
-
|
|
204
|
-
|
|
293
|
+
top: a.bottom - c.getBoundingClientRect().top + 6,
|
|
294
|
+
right: z(
|
|
295
|
+
c.getBoundingClientRect().right - a.right,
|
|
296
|
+
c.getBoundingClientRect().width
|
|
205
297
|
),
|
|
206
298
|
zIndex: 110
|
|
207
|
-
},
|
|
208
|
-
className:
|
|
299
|
+
} : { display: "none" },
|
|
300
|
+
className: W(
|
|
209
301
|
"flex w-[240px] flex-col gap-px rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-border dark:bg-card",
|
|
210
302
|
"[&_button]:h-8 [&_button]:w-full [&_button]:justify-start [&_button]:gap-2 [&_button]:rounded-sm [&_button]:border-0 [&_button]:bg-transparent [&_button]:px-2 [&_button]:text-[12.5px] [&_button]:font-medium [&_button]:shadow-none",
|
|
211
303
|
"[&_button:hover]:bg-accent [&_button:hover]:text-accent-foreground [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button_svg]:shrink-0 [&_button_svg]:text-slate-500",
|
|
212
304
|
"[&>[data-nvr-menu-divider]]:my-1 [&>[data-nvr-menu-divider]]:h-px [&>[data-nvr-menu-divider]]:bg-slate-100 dark:[&>[data-nvr-menu-divider]]:bg-border"
|
|
213
305
|
),
|
|
214
|
-
children:
|
|
306
|
+
children: i
|
|
215
307
|
}
|
|
216
308
|
),
|
|
217
|
-
|
|
309
|
+
c
|
|
218
310
|
)
|
|
219
311
|
] });
|
|
220
312
|
}
|
|
221
|
-
function
|
|
222
|
-
children:
|
|
313
|
+
function oe({
|
|
314
|
+
children: i,
|
|
223
315
|
className: t
|
|
224
316
|
}) {
|
|
225
317
|
return /* @__PURE__ */ w(
|
|
226
318
|
"div",
|
|
227
319
|
{
|
|
228
320
|
"data-nvr-header-tool-group": !0,
|
|
229
|
-
className:
|
|
321
|
+
className: W(
|
|
230
322
|
"inline-flex h-9 shrink-0 items-center rounded-md border border-input bg-background px-0.5 shadow-sm [&>*+*]:border-l [&>*+*]:border-input/70",
|
|
231
323
|
t
|
|
232
324
|
),
|
|
233
|
-
children:
|
|
325
|
+
children: i
|
|
234
326
|
}
|
|
235
327
|
);
|
|
236
328
|
}
|
|
237
329
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
330
|
+
re as HeaderMenu,
|
|
331
|
+
oe as HeaderToolGroup,
|
|
332
|
+
te as HeaderTools,
|
|
333
|
+
z as menuRight,
|
|
334
|
+
J as openedLayerIn,
|
|
335
|
+
O as titleChipDeficit,
|
|
336
|
+
G as useCloseWhenRowOpensLayer,
|
|
337
|
+
ne as useHeaderFold
|
|
243
338
|
};
|
|
@@ -12,8 +12,8 @@ const h = (e, t) => [
|
|
|
12
12
|
function K(e) {
|
|
13
13
|
const t = Array.isArray(e == null ? void 0 : e.tickets) ? e.tickets[0] : void 0;
|
|
14
14
|
if (!e || !t) return null;
|
|
15
|
-
const i = e.tickets.length - 1, c = t.requested_by,
|
|
16
|
-
return i > 0 ? `${
|
|
15
|
+
const i = e.tickets.length - 1, c = t.requested_by, n = c ? `Help requested by ${c}` : "Help requested";
|
|
16
|
+
return i > 0 ? `${n} +${i}` : n;
|
|
17
17
|
}
|
|
18
18
|
function y(e) {
|
|
19
19
|
const t = e.tickets[0];
|
|
@@ -23,7 +23,7 @@ function y(e) {
|
|
|
23
23
|
}
|
|
24
24
|
function Q({ collection: e, itemId: t }) {
|
|
25
25
|
var f;
|
|
26
|
-
const i = C(), c = x(),
|
|
26
|
+
const i = C(), c = x(), n = q(), a = t && t !== "new" ? String(t) : null, { data: s } = v({
|
|
27
27
|
queryKey: h(e, a ?? ""),
|
|
28
28
|
queryFn: () => i.request(
|
|
29
29
|
N(`/support/record/${encodeURIComponent(e)}/${encodeURIComponent(a ?? "")}`)
|
|
@@ -40,9 +40,9 @@ function Q({ collection: e, itemId: t }) {
|
|
|
40
40
|
includeOwn: !0,
|
|
41
41
|
client: c
|
|
42
42
|
});
|
|
43
|
-
const d = K(
|
|
44
|
-
if (!
|
|
45
|
-
const l =
|
|
43
|
+
const d = K(s);
|
|
44
|
+
if (!s || !d) return null;
|
|
45
|
+
const l = s.tickets[0], u = l ? ((f = n.consoleUrl) == null ? void 0 : f.call(n, `/support?ticket=${l.id}`)) ?? (n.consoleUrl ? null : `/support?ticket=${l.id}`) : null, p = "nvr-fade-in relative inline-flex min-w-0 max-w-[min(16rem,100%)] shrink-0 items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-1 py-1 text-[10.5px] font-medium text-amber-800 sm:px-2 sm:py-px dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200", m = /* @__PURE__ */ g(k, { children: [
|
|
46
46
|
/* @__PURE__ */ o($, { className: "h-3 w-3 shrink-0 text-amber-700 dark:text-amber-300", "aria-hidden": !0 }),
|
|
47
47
|
/* @__PURE__ */ o("span", { className: "hidden truncate sm:inline", children: d }),
|
|
48
48
|
/* @__PURE__ */ o("span", { className: "sr-only sm:hidden", children: d })
|
|
@@ -51,15 +51,15 @@ function Q({ collection: e, itemId: t }) {
|
|
|
51
51
|
"a",
|
|
52
52
|
{
|
|
53
53
|
href: u,
|
|
54
|
-
"data-record-help":
|
|
55
|
-
"data-tip": y(
|
|
54
|
+
"data-record-help": s.open,
|
|
55
|
+
"data-tip": y(s),
|
|
56
56
|
onClick: (r) => {
|
|
57
|
-
r.metaKey || r.ctrlKey || r.shiftKey || /^https?:/.test(u) || (r.preventDefault(),
|
|
57
|
+
r.metaKey || r.ctrlKey || r.shiftKey || /^https?:/.test(u) || (r.preventDefault(), n.navigate(u));
|
|
58
58
|
},
|
|
59
59
|
className: `${p} hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400 dark:hover:bg-amber-500/20`,
|
|
60
60
|
children: m
|
|
61
61
|
}
|
|
62
|
-
) : /* @__PURE__ */ o("span", { "data-record-help":
|
|
62
|
+
) : /* @__PURE__ */ o("span", { "data-record-help": s.open, "data-tip": y(s), className: p, children: m });
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
65
|
Q as RecordHelpChip,
|