@nivaro/react 0.3.117 → 0.3.118
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 +136 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,108 +1,130 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { post as
|
|
6
|
-
import { HEADER_LABEL as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Popover as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as F, useQuery as Q } from "@tanstack/react-query";
|
|
3
|
+
import { useEffect as E, useState as v, useRef as W } from "react";
|
|
4
|
+
import { useNivaroClient as K } from "../../context.js";
|
|
5
|
+
import { post as P } from "../../lib/commands.js";
|
|
6
|
+
import { HEADER_LABEL as V, HEADER_VALUE_LINE as j, HEADER_VALUE_HERO as B, HEADER_SUB as z, HEADER_TILE as G } from "../../lib/header-strip.js";
|
|
7
|
+
import { cn as U } from "../../lib/utils.js";
|
|
8
|
+
import { Popover as J, PopoverTrigger as M, PopoverContent as X } from "../ui/popover.js";
|
|
9
|
+
import { RecalcValue as Y } from "./RecalcValue.js";
|
|
10
|
+
function oe({
|
|
11
|
+
collection: o,
|
|
12
|
+
itemId: a,
|
|
13
|
+
field: i,
|
|
14
|
+
config: r,
|
|
15
|
+
onOpen: k,
|
|
16
|
+
recalculating: h,
|
|
17
|
+
...C
|
|
18
|
+
}) {
|
|
19
|
+
const R = K(), f = F();
|
|
20
|
+
E(() => {
|
|
12
21
|
let t = null;
|
|
13
|
-
const
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
typeof
|
|
18
|
-
() => void
|
|
22
|
+
const _ = f.getQueryCache().subscribe((d) => {
|
|
23
|
+
var D;
|
|
24
|
+
if (d.type !== "updated" || ((D = d.action) == null ? void 0 : D.type) !== "success") return;
|
|
25
|
+
const m = d.query.queryKey, p = m == null ? void 0 : m[0];
|
|
26
|
+
typeof p != "string" || !p.startsWith("o2m-rows") && !p.startsWith("nested") || d.query.state.dataUpdateCount <= 1 || p.startsWith("o2m-rows") && String(m[3]) !== String(a) || (t && clearTimeout(t), t = setTimeout(
|
|
27
|
+
() => void f.invalidateQueries({ queryKey: ["child-summary", o, a] }),
|
|
19
28
|
400
|
|
20
29
|
));
|
|
21
30
|
});
|
|
22
31
|
return () => {
|
|
23
|
-
|
|
32
|
+
_(), t && clearTimeout(t);
|
|
24
33
|
};
|
|
25
|
-
}, [
|
|
26
|
-
const { data: e, isLoading:
|
|
27
|
-
queryKey: ["child-summary",
|
|
28
|
-
queryFn: () =>
|
|
29
|
-
|
|
30
|
-
field:
|
|
34
|
+
}, [f, o, a]);
|
|
35
|
+
const { data: e, isLoading: N, dataUpdatedAt: S } = Q({
|
|
36
|
+
queryKey: ["child-summary", o, a, i, r.formula, r.positive_only],
|
|
37
|
+
queryFn: () => R.request(
|
|
38
|
+
P(`/items/${o}/${a}/child-summary`, {
|
|
39
|
+
field: i,
|
|
31
40
|
formula: r.formula,
|
|
32
41
|
positive_only: r.positive_only !== !1,
|
|
33
42
|
row_label: r.row_label
|
|
34
43
|
})
|
|
35
44
|
).then((t) => t.data),
|
|
36
|
-
enabled: !!
|
|
45
|
+
enabled: !!a && a !== "new",
|
|
37
46
|
staleTime: 3e4,
|
|
38
47
|
placeholderData: (t) => t
|
|
39
|
-
}), [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
}), [T, w] = v(!1), A = !!e && !!(h != null && h(e.child_collection)), [s, u] = v(null), [q, L] = v(!1), y = W(s);
|
|
49
|
+
y.current = s, E(() => {
|
|
50
|
+
A ? u({ endedAt: null }) : y.current && y.current.endedAt == null && u({ endedAt: Date.now() });
|
|
51
|
+
}, [A]), E(() => {
|
|
52
|
+
if (!s || s.endedAt == null) return;
|
|
53
|
+
if (S > s.endedAt) {
|
|
54
|
+
u(null), L(!0);
|
|
55
|
+
const _ = setTimeout(() => L(!1), 1400);
|
|
56
|
+
return () => clearTimeout(_);
|
|
57
|
+
}
|
|
58
|
+
const t = setTimeout(() => u(null), 15e3);
|
|
59
|
+
return () => clearTimeout(t);
|
|
60
|
+
}, [s, S]);
|
|
61
|
+
const H = s ? "pending" : q ? "landed" : null;
|
|
62
|
+
if (!e && !N || e && e.count === 0 && r.hide_when_zero !== !1) return null;
|
|
63
|
+
const O = e ? r.format === "number" ? e.total.toLocaleString("en-US", { maximumFractionDigits: 2 }) : e.total.toLocaleString("en-US", { style: "currency", currency: "USD" }) : "—", c = r.count_label ?? "rows", b = !!(e != null && e.first_id), g = (t) => r.format === "number" ? t.toLocaleString("en-US", { maximumFractionDigits: 2 }) : t.toLocaleString("en-US", { style: "currency", currency: "USD" }), $ = (t) => {
|
|
64
|
+
e && (w(!1), k({ childCollection: e.child_collection, fkField: e.fk_field, rowId: t, field: i }));
|
|
65
|
+
}, x = (e == null ? void 0 : e.items) ?? [];
|
|
66
|
+
return /* @__PURE__ */ n(J, { open: T, onOpenChange: w, children: [
|
|
67
|
+
/* @__PURE__ */ l(M, { asChild: !0, children: /* @__PURE__ */ n(
|
|
46
68
|
"button",
|
|
47
69
|
{
|
|
48
70
|
type: "button",
|
|
49
|
-
disabled: !
|
|
50
|
-
className:
|
|
51
|
-
|
|
71
|
+
disabled: !b,
|
|
72
|
+
className: U(
|
|
73
|
+
G,
|
|
52
74
|
"text-left",
|
|
53
|
-
|
|
75
|
+
b ? "cursor-pointer" : "cursor-default hover:bg-transparent dark:hover:bg-transparent"
|
|
54
76
|
),
|
|
55
|
-
"data-tip":
|
|
56
|
-
"data-header-summary":
|
|
77
|
+
"data-tip": b ? `Which ${c} contribute` : void 0,
|
|
78
|
+
"data-header-summary": i,
|
|
57
79
|
"data-header-money": "",
|
|
58
|
-
...
|
|
80
|
+
...C,
|
|
59
81
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
e && /* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ l("span", { className: V, "data-header-label": !0, children: r.label }),
|
|
83
|
+
/* @__PURE__ */ n("span", { className: `${j} items-baseline`, "data-header-value": !0, children: [
|
|
84
|
+
/* @__PURE__ */ l(Y, { state: H, inline: !0, children: /* @__PURE__ */ l("span", { className: U(B, N && !e && "text-slate-300"), children: O }) }),
|
|
85
|
+
e && /* @__PURE__ */ n("span", { className: z, children: [
|
|
64
86
|
"across ",
|
|
65
87
|
e.count,
|
|
66
88
|
" ",
|
|
67
|
-
e.count === 1 ?
|
|
89
|
+
e.count === 1 ? c.replace(/s$/, "") : c
|
|
68
90
|
] })
|
|
69
91
|
] })
|
|
70
92
|
]
|
|
71
93
|
}
|
|
72
94
|
) }),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ n(X, { align: "start", className: "w-[360px] p-2 text-[11.5px]", children: [
|
|
96
|
+
/* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
75
97
|
r.label,
|
|
76
98
|
" — ",
|
|
77
99
|
(e == null ? void 0 : e.count) ?? 0,
|
|
78
100
|
" ",
|
|
79
|
-
|
|
101
|
+
c
|
|
80
102
|
] }),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
103
|
+
/* @__PURE__ */ n("div", { className: "max-h-[260px] space-y-px overflow-y-auto", children: [
|
|
104
|
+
x.map((t) => /* @__PURE__ */ n(
|
|
83
105
|
"button",
|
|
84
106
|
{
|
|
85
107
|
type: "button",
|
|
86
|
-
onClick: () =>
|
|
108
|
+
onClick: () => $(t.id),
|
|
87
109
|
className: "flex w-full items-baseline gap-2 rounded px-1.5 py-1 text-left hover:bg-slate-50 dark:hover:bg-muted",
|
|
88
110
|
"data-tip": "Open this line",
|
|
89
111
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ l("span", { className: "min-w-0 flex-1 truncate text-slate-700 dark:text-slate-200", children: t.label }),
|
|
113
|
+
/* @__PURE__ */ l("span", { className: "shrink-0 font-mono tabular-nums text-slate-900 dark:text-slate-100", children: g(t.value) })
|
|
92
114
|
]
|
|
93
115
|
},
|
|
94
116
|
t.id
|
|
95
117
|
)),
|
|
96
|
-
e && e.count >
|
|
118
|
+
e && e.count > x.length && /* @__PURE__ */ n("p", { className: "px-1.5 py-1 text-[10.5px] text-slate-400", children: [
|
|
97
119
|
"+",
|
|
98
|
-
e.count -
|
|
120
|
+
e.count - x.length,
|
|
99
121
|
" more"
|
|
100
122
|
] })
|
|
101
123
|
] }),
|
|
102
|
-
e && /* @__PURE__ */
|
|
124
|
+
e && /* @__PURE__ */ l("p", { className: "border-t border-slate-100 px-1.5 pt-1.5 text-right font-medium text-slate-700 dark:border-border dark:text-slate-200", children: g(e.total) })
|
|
103
125
|
] })
|
|
104
126
|
] });
|
|
105
127
|
}
|
|
106
128
|
export {
|
|
107
|
-
|
|
129
|
+
oe as HeaderSummaryChip
|
|
108
130
|
};
|
|
@@ -1,62 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MoreHorizontal as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { cn as
|
|
6
|
-
function
|
|
1
|
+
import { jsx as w, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontal as B } from "lucide-react";
|
|
3
|
+
import { useRef as v, useState as E, useEffect as y } from "react";
|
|
4
|
+
import { createPortal as z } from "react-dom";
|
|
5
|
+
import { cn as R } from "../../lib/utils.js";
|
|
6
|
+
function O(c, t) {
|
|
7
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
11
|
return !a || !!(t && a.contains(t));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
const t =
|
|
13
|
+
function P({ children: c }) {
|
|
14
|
+
var m, _;
|
|
15
|
+
const t = v(null), d = v(null), [a, i] = E(!1), u = v(!1);
|
|
16
16
|
u.current = a;
|
|
17
|
-
const n =
|
|
18
|
-
if (
|
|
19
|
-
var
|
|
20
|
-
const e = (
|
|
17
|
+
const n = v(0), o = v(0), [s, l] = E(!1);
|
|
18
|
+
if (y(() => {
|
|
19
|
+
var C, N;
|
|
20
|
+
const e = (C = t.current) == null ? void 0 : C.closest("[data-nvr-header-row]");
|
|
21
21
|
if (!e) return;
|
|
22
|
-
const
|
|
22
|
+
const p = () => {
|
|
23
23
|
if (!u.current) {
|
|
24
24
|
e.scrollWidth > e.clientWidth + 2 && (n.current = e.scrollWidth, i(!0), l(!1));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
!
|
|
27
|
+
const W = e.hasAttribute("data-nvr-header-wrap");
|
|
28
|
+
!W && e.scrollWidth > e.clientWidth + 2 ? (o.current = e.scrollWidth, e.setAttribute("data-nvr-header-wrap", "")) : W && e.clientWidth > o.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !W && n.current > 0 && e.clientWidth > n.current + 32 && i(!1);
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
p();
|
|
31
|
+
const x = new ResizeObserver(p);
|
|
32
|
+
x.observe(e);
|
|
33
|
+
const h = (N = t.current) == null ? void 0 : N.parentElement;
|
|
34
|
+
h && h !== e && x.observe(h);
|
|
35
|
+
let g = 0;
|
|
36
|
+
const k = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
37
|
+
g || (g = requestAnimationFrame(() => {
|
|
38
|
+
g = 0, p();
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
return k == null || k.observe(e, { childList: !0, subtree: !0 }), () => {
|
|
42
|
+
x.disconnect(), k == null || k.disconnect(), g && cancelAnimationFrame(g);
|
|
43
|
+
};
|
|
44
|
+
}), y(() => {
|
|
36
45
|
if (!s) return;
|
|
37
|
-
const e = (
|
|
38
|
-
|
|
46
|
+
const e = (p) => {
|
|
47
|
+
p.key !== "Escape" || !O(p, t.current) || (p.stopPropagation(), l(!1));
|
|
39
48
|
};
|
|
40
49
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
41
|
-
}, [s]),
|
|
50
|
+
}, [s]), y(() => {
|
|
42
51
|
if (!s) return;
|
|
43
|
-
const e = (
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
52
|
+
const e = (x) => {
|
|
53
|
+
const h = x.target;
|
|
54
|
+
if (h.closest("[data-nvr-header-tools-panel]") || h.closest("[data-nvr-header-tools-btn]") || h.closest("[data-nvr-header-menu-panel]") || h.closest("[data-radix-popper-content-wrapper]"))
|
|
46
55
|
return;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
56
|
+
const g = h.closest('[role="dialog"]');
|
|
57
|
+
g && !g.contains(t.current) || l(!1);
|
|
58
|
+
}, p = (x) => {
|
|
59
|
+
x.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && l(!1);
|
|
51
60
|
};
|
|
52
|
-
return window.addEventListener("mousedown", e, !0), window.addEventListener("click",
|
|
53
|
-
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click",
|
|
61
|
+
return window.addEventListener("mousedown", e, !0), window.addEventListener("click", p), () => {
|
|
62
|
+
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", p);
|
|
54
63
|
};
|
|
55
64
|
}, [s]), !a)
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
const r = s ? (
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ w("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
|
|
66
|
+
const r = s ? (m = d.current) == null ? void 0 : m.getBoundingClientRect() : void 0, f = ((_ = d.current) == null ? void 0 : _.closest('[role="dialog"]')) ?? document.body, b = r ? r.right - (f === document.body ? 0 : f.getBoundingClientRect().left) - 16 : 440;
|
|
67
|
+
return /* @__PURE__ */ M("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
|
|
68
|
+
/* @__PURE__ */ w(
|
|
60
69
|
"button",
|
|
61
70
|
{
|
|
62
71
|
ref: d,
|
|
@@ -66,44 +75,44 @@ function D({ children: c }) {
|
|
|
66
75
|
"aria-label": "More tools",
|
|
67
76
|
"data-tip": "More tools",
|
|
68
77
|
onClick: () => l((e) => !e),
|
|
69
|
-
className:
|
|
78
|
+
className: R(
|
|
70
79
|
"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",
|
|
71
80
|
s && "bg-accent text-accent-foreground dark:bg-accent"
|
|
72
81
|
),
|
|
73
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ w(B, { className: "h-4 w-4" })
|
|
74
83
|
}
|
|
75
84
|
),
|
|
76
|
-
s && r &&
|
|
77
|
-
/* @__PURE__ */
|
|
85
|
+
s && r && z(
|
|
86
|
+
/* @__PURE__ */ w(
|
|
78
87
|
"div",
|
|
79
88
|
{
|
|
80
89
|
"data-nvr-header-tools-panel": !0,
|
|
81
|
-
style:
|
|
90
|
+
style: f === document.body ? {
|
|
82
91
|
position: "fixed",
|
|
83
92
|
top: r.bottom + 6,
|
|
84
93
|
right: Math.max(8, window.innerWidth - r.right),
|
|
85
|
-
maxWidth: Math.min(440,
|
|
94
|
+
maxWidth: Math.min(440, b),
|
|
86
95
|
zIndex: 110
|
|
87
96
|
} : {
|
|
88
97
|
position: "absolute",
|
|
89
|
-
top: r.bottom -
|
|
90
|
-
right: Math.max(8,
|
|
91
|
-
maxWidth: Math.min(440,
|
|
98
|
+
top: r.bottom - f.getBoundingClientRect().top + 6,
|
|
99
|
+
right: Math.max(8, f.getBoundingClientRect().right - r.right),
|
|
100
|
+
maxWidth: Math.min(440, b),
|
|
92
101
|
zIndex: 110
|
|
93
102
|
},
|
|
94
103
|
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",
|
|
95
104
|
children: c
|
|
96
105
|
}
|
|
97
106
|
),
|
|
98
|
-
|
|
107
|
+
f
|
|
99
108
|
)
|
|
100
109
|
] });
|
|
101
110
|
}
|
|
102
|
-
function
|
|
103
|
-
const [d, a] =
|
|
111
|
+
function T(c, t) {
|
|
112
|
+
const [d, a] = E(!1), i = v(!1);
|
|
104
113
|
i.current = d;
|
|
105
|
-
const u =
|
|
106
|
-
return
|
|
114
|
+
const u = v(0);
|
|
115
|
+
return y(() => {
|
|
107
116
|
const n = c.current, o = n == null ? void 0 : n.closest("[data-nvr-header-row]");
|
|
108
117
|
if (!t || !n || !o) {
|
|
109
118
|
!t && i.current && a(!1);
|
|
@@ -125,34 +134,34 @@ function P(c, t) {
|
|
|
125
134
|
return l.observe(o), n.parentElement && n.parentElement !== o && l.observe(n.parentElement), () => l.disconnect();
|
|
126
135
|
}), d;
|
|
127
136
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
130
|
-
return Math.max(8, Math.min(c, t -
|
|
137
|
+
const A = 240;
|
|
138
|
+
function L(c, t) {
|
|
139
|
+
return Math.max(8, Math.min(c, t - A - 8));
|
|
131
140
|
}
|
|
132
|
-
function
|
|
141
|
+
function q({
|
|
133
142
|
children: c,
|
|
134
143
|
label: t = "More",
|
|
135
144
|
className: d
|
|
136
145
|
}) {
|
|
137
146
|
var s, l;
|
|
138
|
-
const a =
|
|
139
|
-
|
|
147
|
+
const a = v(null), [i, u] = E(!1);
|
|
148
|
+
y(() => {
|
|
140
149
|
if (!i) return;
|
|
141
|
-
const r = (
|
|
142
|
-
var
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
|
|
150
|
+
const r = (b) => {
|
|
151
|
+
var _;
|
|
152
|
+
const m = b.target;
|
|
153
|
+
m.closest("[data-nvr-header-menu-panel]") || m.closest("[data-nvr-header-menu-btn]") || m.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
|
|
154
|
+
m.closest('[role="dialog"]') && !((_ = m.closest('[role="dialog"]')) != null && _.contains(a.current)) || u(!1);
|
|
155
|
+
}, f = (b) => {
|
|
156
|
+
b.key !== "Escape" || !O(b, a.current) || (b.stopPropagation(), u(!1));
|
|
148
157
|
};
|
|
149
|
-
return window.addEventListener("mousedown", r, !0), window.addEventListener("keydown",
|
|
150
|
-
window.removeEventListener("mousedown", r, !0), window.removeEventListener("keydown",
|
|
158
|
+
return window.addEventListener("mousedown", r, !0), window.addEventListener("keydown", f, !0), () => {
|
|
159
|
+
window.removeEventListener("mousedown", r, !0), window.removeEventListener("keydown", f, !0);
|
|
151
160
|
};
|
|
152
161
|
}, [i]);
|
|
153
162
|
const n = i ? (s = a.current) == null ? void 0 : s.getBoundingClientRect() : void 0, o = ((l = a.current) == null ? void 0 : l.closest('[role="dialog"]')) ?? document.body;
|
|
154
|
-
return /* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ M("div", { className: R("relative shrink-0", d), children: [
|
|
164
|
+
/* @__PURE__ */ M(
|
|
156
165
|
"button",
|
|
157
166
|
{
|
|
158
167
|
ref: a,
|
|
@@ -163,18 +172,18 @@ function T({
|
|
|
163
172
|
"aria-label": t,
|
|
164
173
|
"data-tip": "More actions",
|
|
165
174
|
onClick: () => u((r) => !r),
|
|
166
|
-
className:
|
|
175
|
+
className: R(
|
|
167
176
|
"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",
|
|
168
177
|
i && "bg-accent text-accent-foreground dark:bg-accent"
|
|
169
178
|
),
|
|
170
179
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ w(B, { className: "h-4 w-4" }),
|
|
181
|
+
/* @__PURE__ */ w("span", { className: "hidden lg:inline", children: t })
|
|
173
182
|
]
|
|
174
183
|
}
|
|
175
184
|
),
|
|
176
|
-
i && n &&
|
|
177
|
-
/* @__PURE__ */
|
|
185
|
+
i && n && z(
|
|
186
|
+
/* @__PURE__ */ w(
|
|
178
187
|
"div",
|
|
179
188
|
{
|
|
180
189
|
"data-nvr-header-menu-panel": !0,
|
|
@@ -185,18 +194,18 @@ function T({
|
|
|
185
194
|
style: o === document.body ? {
|
|
186
195
|
position: "fixed",
|
|
187
196
|
top: n.bottom + 6,
|
|
188
|
-
right:
|
|
197
|
+
right: L(window.innerWidth - n.right, window.innerWidth),
|
|
189
198
|
zIndex: 110
|
|
190
199
|
} : {
|
|
191
200
|
position: "absolute",
|
|
192
201
|
top: n.bottom - o.getBoundingClientRect().top + 6,
|
|
193
|
-
right:
|
|
202
|
+
right: L(
|
|
194
203
|
o.getBoundingClientRect().right - n.right,
|
|
195
204
|
o.getBoundingClientRect().width
|
|
196
205
|
),
|
|
197
206
|
zIndex: 110
|
|
198
207
|
},
|
|
199
|
-
className:
|
|
208
|
+
className: R(
|
|
200
209
|
"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",
|
|
201
210
|
"[&_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",
|
|
202
211
|
"[&_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",
|
|
@@ -209,15 +218,15 @@ function T({
|
|
|
209
218
|
)
|
|
210
219
|
] });
|
|
211
220
|
}
|
|
212
|
-
function
|
|
221
|
+
function K({
|
|
213
222
|
children: c,
|
|
214
223
|
className: t
|
|
215
224
|
}) {
|
|
216
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ w(
|
|
217
226
|
"div",
|
|
218
227
|
{
|
|
219
228
|
"data-nvr-header-tool-group": !0,
|
|
220
|
-
className:
|
|
229
|
+
className: R(
|
|
221
230
|
"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",
|
|
222
231
|
t
|
|
223
232
|
),
|
|
@@ -226,9 +235,9 @@ function F({
|
|
|
226
235
|
);
|
|
227
236
|
}
|
|
228
237
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
238
|
+
q as HeaderMenu,
|
|
239
|
+
K as HeaderToolGroup,
|
|
240
|
+
P as HeaderTools,
|
|
241
|
+
L as menuRight,
|
|
242
|
+
T as useHeaderFold
|
|
234
243
|
};
|