@nivaro/react 0.3.15 → 0.3.16
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/index.d.ts +127 -6
- package/dist/index.js +736 -734
- package/dist/shared/components/CollectionBrowserView.js +2344 -2309
- package/dist/shared/components/ItemEditForm.js +3773 -3604
- package/dist/shared/components/RecordGridEditor.js +319 -282
- package/dist/shared/components/RecordReadView.js +202 -200
- package/dist/shared/components/cbv/unknown-fields.js +18 -8
- package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
- package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
- package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
- package/dist/shared/components/item-edit/FieldRow.js +198 -184
- package/dist/shared/components/item-edit/HeaderTools.js +107 -99
- package/dist/shared/components/item-edit/InlineTableField.js +138 -136
- package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
- package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
- package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
- package/dist/shared/components/item-edit/column-length.js +12 -0
- package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
- package/dist/shared/components/panels/ItemLockBanner.js +307 -285
- package/dist/shared/components/panels/PipelinePanel.js +486 -465
- package/dist/shared/components/panels/RevisionsPanel.js +210 -204
- package/dist/shared/components/profile/DelegationCard.js +178 -121
- package/dist/shared/components/profile/PersonActivity.js +152 -139
- package/dist/shared/components/queue/QueueWorklist.js +668 -659
- package/dist/shared/components/queue/transition-note.js +90 -0
- package/dist/shared/components/support/SupportRequestDialog.js +100 -89
- package/dist/shared/components/support/TicketDetailSheet.js +104 -91
- package/dist/shared/lib/autofill-runs.js +33 -26
- package/dist/shared/lib/draft-store.js +40 -24
- package/dist/shared/lib/live-queries.js +10 -9
- package/dist/shared/lib/restore-skipped.js +10 -0
- package/package.json +1 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MoreHorizontal as
|
|
3
|
-
import { useRef as v, useState as
|
|
1
|
+
import { jsx as m, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontal as W } from "lucide-react";
|
|
3
|
+
import { useRef as v, useState as y, useEffect as k } from "react";
|
|
4
4
|
import { createPortal as M } from "react-dom";
|
|
5
|
-
import { cn as
|
|
6
|
-
function
|
|
7
|
-
const d =
|
|
5
|
+
import { cn as _ } from "../../lib/utils.js";
|
|
6
|
+
function N(c, t) {
|
|
7
|
+
const d = c.target;
|
|
8
8
|
if (!(d != null && d.closest)) return !0;
|
|
9
9
|
if (d.closest("[data-radix-popper-content-wrapper]")) return !1;
|
|
10
10
|
const a = d.closest('[role="dialog"]');
|
|
11
|
-
return !a || !!(
|
|
11
|
+
return !a || !!(t && a.contains(t));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const o = v(0), [e,
|
|
13
|
+
function j({ children: c }) {
|
|
14
|
+
var h, g;
|
|
15
|
+
const t = v(null), d = v(null), [a, i] = y(!1), l = v(!1);
|
|
16
|
+
l.current = a;
|
|
17
|
+
const o = v(0), [e, u] = y(!1);
|
|
18
18
|
if (k(() => {
|
|
19
19
|
var x, R;
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
const
|
|
23
|
-
|
|
20
|
+
const r = (x = t.current) == null ? void 0 : x.closest("[data-nvr-header-row]");
|
|
21
|
+
if (!r) return;
|
|
22
|
+
const f = () => {
|
|
23
|
+
l.current ? o.current > 0 && r.clientWidth > o.current + 32 && i(!1) : r.scrollWidth > r.clientWidth + 2 && (o.current = r.scrollWidth, i(!0), u(!1));
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
25
|
+
f();
|
|
26
|
+
const b = new ResizeObserver(f);
|
|
27
|
+
b.observe(r);
|
|
28
|
+
const p = (R = t.current) == null ? void 0 : R.parentElement;
|
|
29
|
+
return p && p !== r && b.observe(p), () => b.disconnect();
|
|
30
30
|
}), k(() => {
|
|
31
31
|
if (!e) return;
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const r = (f) => {
|
|
33
|
+
f.key !== "Escape" || !N(f, t.current) || (f.stopPropagation(), u(!1));
|
|
34
34
|
};
|
|
35
|
-
return window.addEventListener("keydown",
|
|
35
|
+
return window.addEventListener("keydown", r, !0), () => window.removeEventListener("keydown", r, !0);
|
|
36
36
|
}, [e]), k(() => {
|
|
37
37
|
if (!e) return;
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
38
|
+
const r = (b) => {
|
|
39
|
+
const p = b.target;
|
|
40
|
+
if (p.closest("[data-nvr-header-tools-panel]") || p.closest("[data-nvr-header-tools-btn]") || p.closest("[data-nvr-header-menu-panel]") || p.closest("[data-radix-popper-content-wrapper]"))
|
|
41
41
|
return;
|
|
42
|
-
const x =
|
|
43
|
-
x && !x.contains(
|
|
44
|
-
},
|
|
45
|
-
|
|
42
|
+
const x = p.closest('[role="dialog"]');
|
|
43
|
+
x && !x.contains(t.current) || u(!1);
|
|
44
|
+
}, f = (b) => {
|
|
45
|
+
b.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && u(!1);
|
|
46
46
|
};
|
|
47
|
-
return window.addEventListener("mousedown",
|
|
48
|
-
window.removeEventListener("mousedown",
|
|
47
|
+
return window.addEventListener("mousedown", r, !0), window.addEventListener("click", f), () => {
|
|
48
|
+
window.removeEventListener("mousedown", r, !0), window.removeEventListener("click", f);
|
|
49
49
|
};
|
|
50
50
|
}, [e]), !a)
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
const s = e ? (
|
|
53
|
-
return /* @__PURE__ */ E("div", { ref:
|
|
54
|
-
/* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ m("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
|
|
52
|
+
const s = e ? (h = d.current) == null ? void 0 : h.getBoundingClientRect() : void 0, n = ((g = d.current) == null ? void 0 : g.closest('[role="dialog"]')) ?? document.body, w = s ? s.right - (n === document.body ? 0 : n.getBoundingClientRect().left) - 16 : 440;
|
|
53
|
+
return /* @__PURE__ */ E("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
|
|
54
|
+
/* @__PURE__ */ m(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
ref: d,
|
|
@@ -60,20 +60,20 @@ function I({ children: u }) {
|
|
|
60
60
|
"aria-expanded": e,
|
|
61
61
|
"aria-label": "More tools",
|
|
62
62
|
"data-tip": "More tools",
|
|
63
|
-
onClick: () =>
|
|
64
|
-
className:
|
|
63
|
+
onClick: () => u((r) => !r),
|
|
64
|
+
className: _(
|
|
65
65
|
"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",
|
|
66
66
|
e && "bg-accent text-accent-foreground dark:bg-accent"
|
|
67
67
|
),
|
|
68
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ m(W, { className: "h-4 w-4" })
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
71
|
e && s && M(
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ m(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
"data-nvr-header-tools-panel": !0,
|
|
76
|
-
style:
|
|
76
|
+
style: n === document.body ? {
|
|
77
77
|
position: "fixed",
|
|
78
78
|
top: s.bottom + 6,
|
|
79
79
|
right: Math.max(8, window.innerWidth - s.right),
|
|
@@ -81,68 +81,72 @@ function I({ children: u }) {
|
|
|
81
81
|
zIndex: 110
|
|
82
82
|
} : {
|
|
83
83
|
position: "absolute",
|
|
84
|
-
top: s.bottom -
|
|
85
|
-
right: Math.max(8,
|
|
84
|
+
top: s.bottom - n.getBoundingClientRect().top + 6,
|
|
85
|
+
right: Math.max(8, n.getBoundingClientRect().right - s.right),
|
|
86
86
|
maxWidth: Math.min(440, w),
|
|
87
87
|
zIndex: 110
|
|
88
88
|
},
|
|
89
|
-
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",
|
|
90
|
-
children:
|
|
89
|
+
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",
|
|
90
|
+
children: c
|
|
91
91
|
}
|
|
92
92
|
),
|
|
93
|
-
|
|
93
|
+
n
|
|
94
94
|
)
|
|
95
95
|
] });
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const [d, a] =
|
|
97
|
+
function D(c, t) {
|
|
98
|
+
const [d, a] = y(!1), i = v(!1);
|
|
99
99
|
i.current = d;
|
|
100
|
-
const
|
|
100
|
+
const l = v(0);
|
|
101
101
|
return k(() => {
|
|
102
|
-
const o =
|
|
103
|
-
if (!
|
|
104
|
-
!
|
|
102
|
+
const o = c.current, e = o == null ? void 0 : o.closest("[data-nvr-header-row]");
|
|
103
|
+
if (!t || !o || !e) {
|
|
104
|
+
!t && i.current && a(!1);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const u = () => {
|
|
108
108
|
if (i.current)
|
|
109
|
-
|
|
109
|
+
l.current > 0 && e.clientWidth > l.current + 32 && a(!1);
|
|
110
110
|
else {
|
|
111
111
|
if (e.scrollWidth <= e.clientWidth + 2) return;
|
|
112
|
-
const
|
|
113
|
-
if ((
|
|
112
|
+
const n = e.querySelector("[data-nvr-header-tools]");
|
|
113
|
+
if ((n == null ? void 0 : n.getAttribute("data-nvr-header-tools")) === "inline" && n.childElementCount > 0)
|
|
114
114
|
return;
|
|
115
|
-
|
|
115
|
+
l.current = e.scrollWidth, a(!0);
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
const s = new ResizeObserver(
|
|
118
|
+
u();
|
|
119
|
+
const s = new ResizeObserver(u);
|
|
120
120
|
return s.observe(e), o.parentElement && o.parentElement !== e && s.observe(o.parentElement), () => s.disconnect();
|
|
121
121
|
}), d;
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
const L = 240;
|
|
124
|
+
function C(c, t) {
|
|
125
|
+
return Math.max(8, Math.min(c, t - L - 8));
|
|
126
|
+
}
|
|
127
|
+
function P({
|
|
128
|
+
children: c,
|
|
129
|
+
label: t = "More",
|
|
126
130
|
className: d
|
|
127
131
|
}) {
|
|
128
|
-
var
|
|
129
|
-
const a = v(null), [i,
|
|
132
|
+
var u, s;
|
|
133
|
+
const a = v(null), [i, l] = y(!1);
|
|
130
134
|
k(() => {
|
|
131
135
|
if (!i) return;
|
|
132
|
-
const
|
|
133
|
-
var
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}, w = (
|
|
138
|
-
|
|
136
|
+
const n = (h) => {
|
|
137
|
+
var r;
|
|
138
|
+
const g = h.target;
|
|
139
|
+
g.closest("[data-nvr-header-menu-panel]") || g.closest("[data-nvr-header-menu-btn]") || g.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
|
|
140
|
+
g.closest('[role="dialog"]') && !((r = g.closest('[role="dialog"]')) != null && r.contains(a.current)) || l(!1);
|
|
141
|
+
}, w = (h) => {
|
|
142
|
+
h.key !== "Escape" || !N(h, a.current) || (h.stopPropagation(), l(!1));
|
|
139
143
|
};
|
|
140
|
-
return window.addEventListener("mousedown",
|
|
141
|
-
window.removeEventListener("mousedown",
|
|
144
|
+
return window.addEventListener("mousedown", n, !0), window.addEventListener("keydown", w, !0), () => {
|
|
145
|
+
window.removeEventListener("mousedown", n, !0), window.removeEventListener("keydown", w, !0);
|
|
142
146
|
};
|
|
143
147
|
}, [i]);
|
|
144
|
-
const o = i ? (
|
|
145
|
-
return /* @__PURE__ */ E("div", { className:
|
|
148
|
+
const o = i ? (u = a.current) == null ? void 0 : u.getBoundingClientRect() : void 0, e = ((s = a.current) == null ? void 0 : s.closest('[role="dialog"]')) ?? document.body;
|
|
149
|
+
return /* @__PURE__ */ E("div", { className: _("relative shrink-0", d), children: [
|
|
146
150
|
/* @__PURE__ */ E(
|
|
147
151
|
"button",
|
|
148
152
|
{
|
|
@@ -151,71 +155,75 @@ function j({
|
|
|
151
155
|
"data-nvr-header-menu-btn": !0,
|
|
152
156
|
"aria-haspopup": "menu",
|
|
153
157
|
"aria-expanded": i,
|
|
154
|
-
"aria-label":
|
|
158
|
+
"aria-label": t,
|
|
155
159
|
"data-tip": "More actions",
|
|
156
|
-
onClick: () =>
|
|
157
|
-
className:
|
|
160
|
+
onClick: () => l((n) => !n),
|
|
161
|
+
className: _(
|
|
158
162
|
"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",
|
|
159
163
|
i && "bg-accent text-accent-foreground dark:bg-accent"
|
|
160
164
|
),
|
|
161
165
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ m(W, { className: "h-4 w-4" }),
|
|
167
|
+
/* @__PURE__ */ m("span", { className: "hidden lg:inline", children: t })
|
|
164
168
|
]
|
|
165
169
|
}
|
|
166
170
|
),
|
|
167
171
|
i && o && M(
|
|
168
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ m(
|
|
169
173
|
"div",
|
|
170
174
|
{
|
|
171
175
|
"data-nvr-header-menu-panel": !0,
|
|
172
176
|
role: "menu",
|
|
173
|
-
onClick: (
|
|
174
|
-
|
|
177
|
+
onClick: (n) => {
|
|
178
|
+
n.target.closest("[data-nvr-menu-close]") && l(!1);
|
|
175
179
|
},
|
|
176
180
|
style: e === document.body ? {
|
|
177
181
|
position: "fixed",
|
|
178
182
|
top: o.bottom + 6,
|
|
179
|
-
right:
|
|
183
|
+
right: C(window.innerWidth - o.right, window.innerWidth),
|
|
180
184
|
zIndex: 110
|
|
181
185
|
} : {
|
|
182
186
|
position: "absolute",
|
|
183
187
|
top: o.bottom - e.getBoundingClientRect().top + 6,
|
|
184
|
-
right:
|
|
188
|
+
right: C(
|
|
189
|
+
e.getBoundingClientRect().right - o.right,
|
|
190
|
+
e.getBoundingClientRect().width
|
|
191
|
+
),
|
|
185
192
|
zIndex: 110
|
|
186
193
|
},
|
|
187
|
-
className:
|
|
194
|
+
className: _(
|
|
188
195
|
"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",
|
|
189
196
|
"[&_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",
|
|
190
197
|
"[&_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",
|
|
191
198
|
"[&>[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"
|
|
192
199
|
),
|
|
193
|
-
children:
|
|
200
|
+
children: c
|
|
194
201
|
}
|
|
195
202
|
),
|
|
196
203
|
e
|
|
197
204
|
)
|
|
198
205
|
] });
|
|
199
206
|
}
|
|
200
|
-
function
|
|
201
|
-
children:
|
|
202
|
-
className:
|
|
207
|
+
function T({
|
|
208
|
+
children: c,
|
|
209
|
+
className: t
|
|
203
210
|
}) {
|
|
204
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ m(
|
|
205
212
|
"div",
|
|
206
213
|
{
|
|
207
214
|
"data-nvr-header-tool-group": !0,
|
|
208
|
-
className:
|
|
215
|
+
className: _(
|
|
209
216
|
"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",
|
|
210
|
-
|
|
217
|
+
t
|
|
211
218
|
),
|
|
212
|
-
children:
|
|
219
|
+
children: c
|
|
213
220
|
}
|
|
214
221
|
);
|
|
215
222
|
}
|
|
216
223
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
P as HeaderMenu,
|
|
225
|
+
T as HeaderToolGroup,
|
|
226
|
+
j as HeaderTools,
|
|
227
|
+
C as menuRight,
|
|
228
|
+
D as useHeaderFold
|
|
221
229
|
};
|