@nivaro/react 0.3.116 → 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 +140 -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 +3855 -3785
- 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/ReportView.js +1086 -1091
- 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/cbv/column-totals.js +62 -57
- 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/charts/category-axis.js +93 -0
- 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/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- 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/use-query-entry.js +17 -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,233 +1,250 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { X as
|
|
4
|
-
import { useState as m, useRef as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { describeError as
|
|
9
|
-
import { cn as
|
|
10
|
-
import { RelationPicker as
|
|
11
|
-
import { Command as
|
|
12
|
-
import { Dialog as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Q, useMutation as V } from "@tanstack/react-query";
|
|
3
|
+
import { X as Y, ArrowRight as _, Plus as E, Loader2 as F } from "lucide-react";
|
|
4
|
+
import { useState as m, useRef as H, useMemo as K } from "react";
|
|
5
|
+
import { toast as G } from "sonner";
|
|
6
|
+
import { useNivaroClient as U } from "../../context.js";
|
|
7
|
+
import { post as W } from "../../lib/commands.js";
|
|
8
|
+
import { describeError as X } from "../../lib/error-message.js";
|
|
9
|
+
import { cn as b } from "../../lib/utils.js";
|
|
10
|
+
import { RelationPicker as z } from "../layout-editor/pickers/relation-picker.js";
|
|
11
|
+
import { Command as B, CommandInput as J, CommandList as Z, CommandEmpty as ee, CommandGroup as te, CommandItem as re } from "../ui/command.js";
|
|
12
|
+
import { Dialog as ae, DialogContent as ne, DialogHeader as le, DialogTitle as oe, DialogDescription as se } from "../ui/dialog.js";
|
|
13
|
+
import { Input as I } from "../ui/input.js";
|
|
14
|
+
import { Popover as ie, PopoverTrigger as de, PopoverContent as ce } from "../ui/popover.js";
|
|
15
|
+
import { SimpleSelect as ue } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { ProposalValue as me } from "./ProposalValue.js";
|
|
17
|
+
import { proposalsQueryKey as pe } from "./types.js";
|
|
18
|
+
const x = "h-9 w-full min-w-0 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-nvr-cyan focus-visible:ring-2 focus-visible:ring-nvr-cyan/25";
|
|
19
|
+
function he({
|
|
20
|
+
field: l,
|
|
21
|
+
value: t,
|
|
21
22
|
onChange: n
|
|
22
23
|
}) {
|
|
23
|
-
const
|
|
24
|
-
switch (
|
|
24
|
+
const o = `New ${l.label}`;
|
|
25
|
+
switch (l.kind) {
|
|
25
26
|
case "relation":
|
|
26
|
-
return
|
|
27
|
-
|
|
27
|
+
return l.relation ? /* @__PURE__ */ a(
|
|
28
|
+
z,
|
|
28
29
|
{
|
|
29
|
-
relatedCollection:
|
|
30
|
-
value:
|
|
31
|
-
onChange: (
|
|
30
|
+
relatedCollection: l.relation,
|
|
31
|
+
value: t ?? null,
|
|
32
|
+
onChange: (r) => n(r ?? null),
|
|
32
33
|
placeholder: "Pick a record…"
|
|
33
34
|
}
|
|
34
35
|
) : null;
|
|
35
36
|
case "boolean":
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ a(
|
|
37
38
|
"fieldset",
|
|
38
39
|
{
|
|
39
|
-
"aria-label":
|
|
40
|
+
"aria-label": o,
|
|
40
41
|
className: "m-0 inline-flex h-9 min-w-0 items-center rounded-md border border-input bg-background p-0.5 text-[12.5px] font-medium",
|
|
41
42
|
children: [
|
|
42
43
|
{ v: !0, t: "Yes" },
|
|
43
44
|
{ v: !1, t: "No" }
|
|
44
|
-
].map((
|
|
45
|
+
].map((r) => /* @__PURE__ */ a(
|
|
45
46
|
"button",
|
|
46
47
|
{
|
|
47
48
|
type: "button",
|
|
48
|
-
"aria-pressed":
|
|
49
|
-
onClick: () => n(
|
|
50
|
-
className:
|
|
49
|
+
"aria-pressed": t === r.v,
|
|
50
|
+
onClick: () => n(r.v),
|
|
51
|
+
className: b(
|
|
51
52
|
"inline-flex h-full items-center rounded px-3 transition-colors",
|
|
52
|
-
|
|
53
|
+
t === r.v ? "bg-nvr-cyan text-white" : "text-slate-600 hover:bg-muted dark:text-slate-300"
|
|
53
54
|
),
|
|
54
|
-
children:
|
|
55
|
+
children: r.t
|
|
55
56
|
},
|
|
56
|
-
|
|
57
|
+
r.t
|
|
57
58
|
))
|
|
58
59
|
}
|
|
59
60
|
);
|
|
60
61
|
case "choice":
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
62
|
+
return /* @__PURE__ */ a(
|
|
63
|
+
ue,
|
|
63
64
|
{
|
|
64
|
-
ariaLabel:
|
|
65
|
-
value:
|
|
66
|
-
onChange: (
|
|
65
|
+
ariaLabel: o,
|
|
66
|
+
value: t == null ? "" : String(t),
|
|
67
|
+
onChange: (r) => n(r === "" ? null : r),
|
|
67
68
|
options: [
|
|
68
69
|
{ value: "", label: "No value" },
|
|
69
|
-
...(
|
|
70
|
+
...(l.choices ?? []).map((r) => ({ value: String(r.value), label: r.text }))
|
|
70
71
|
],
|
|
71
72
|
className: "w-full"
|
|
72
73
|
}
|
|
73
74
|
);
|
|
74
75
|
case "textarea":
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ a(
|
|
76
77
|
"textarea",
|
|
77
78
|
{
|
|
78
|
-
"aria-label":
|
|
79
|
-
value:
|
|
80
|
-
onChange: (
|
|
79
|
+
"aria-label": o,
|
|
80
|
+
value: t == null ? "" : String(t),
|
|
81
|
+
onChange: (r) => n(r.target.value),
|
|
81
82
|
rows: 3,
|
|
82
|
-
className:
|
|
83
|
+
className: b(x, "h-auto py-2 leading-snug")
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
86
|
case "date":
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
|
|
87
|
+
return /* @__PURE__ */ a(
|
|
88
|
+
I,
|
|
88
89
|
{
|
|
89
90
|
type: "date",
|
|
90
|
-
"aria-label":
|
|
91
|
-
value:
|
|
92
|
-
onChange: (
|
|
93
|
-
className: u
|
|
91
|
+
"aria-label": o,
|
|
92
|
+
value: t == null ? "" : String(t).slice(0, 10),
|
|
93
|
+
onChange: (r) => n(r.target.value)
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
case "datetime":
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
|
|
97
|
+
return /* @__PURE__ */ a(
|
|
98
|
+
I,
|
|
99
99
|
{
|
|
100
100
|
type: "datetime-local",
|
|
101
|
-
"aria-label":
|
|
102
|
-
value:
|
|
103
|
-
onChange: (
|
|
104
|
-
className: u
|
|
101
|
+
"aria-label": o,
|
|
102
|
+
value: t == null ? "" : String(t).slice(0, 16),
|
|
103
|
+
onChange: (r) => n(r.target.value)
|
|
105
104
|
}
|
|
106
105
|
);
|
|
107
106
|
case "number":
|
|
108
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ a(
|
|
109
108
|
"input",
|
|
110
109
|
{
|
|
111
110
|
inputMode: "decimal",
|
|
112
|
-
"aria-label":
|
|
113
|
-
value:
|
|
114
|
-
onChange: (
|
|
115
|
-
className:
|
|
111
|
+
"aria-label": o,
|
|
112
|
+
value: t == null ? "" : String(t),
|
|
113
|
+
onChange: (r) => n(r.target.value),
|
|
114
|
+
className: b(x, "tabular-nums")
|
|
116
115
|
}
|
|
117
116
|
);
|
|
118
117
|
default:
|
|
119
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ a(
|
|
120
119
|
"input",
|
|
121
120
|
{
|
|
122
|
-
"aria-label":
|
|
123
|
-
value:
|
|
124
|
-
onChange: (
|
|
125
|
-
className:
|
|
121
|
+
"aria-label": o,
|
|
122
|
+
value: t == null ? "" : String(t),
|
|
123
|
+
onChange: (r) => n(r.target.value),
|
|
124
|
+
className: x
|
|
126
125
|
}
|
|
127
126
|
);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
|
-
function
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
const n = new Date(String(
|
|
129
|
+
function ge(l) {
|
|
130
|
+
const t = l.current;
|
|
131
|
+
if (t == null) return l.kind === "boolean" ? null : "";
|
|
132
|
+
if (l.kind === "date") return String(t).slice(0, 10);
|
|
133
|
+
if (l.kind === "datetime") {
|
|
134
|
+
const n = new Date(String(t));
|
|
136
135
|
if (Number.isNaN(n.getTime())) return "";
|
|
137
|
-
const
|
|
138
|
-
return `${n.getFullYear()}-${
|
|
136
|
+
const o = (r) => String(r).padStart(2, "0");
|
|
137
|
+
return `${n.getFullYear()}-${o(n.getMonth() + 1)}-${o(n.getDate())}T${o(n.getHours())}:${o(n.getMinutes())}`;
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
}
|
|
141
|
+
function be(l, t) {
|
|
142
|
+
const n = l.current, o = (r) => r == null || r === "";
|
|
143
|
+
if (o(t) || o(n)) return o(t) && o(n);
|
|
144
|
+
if (l.kind === "date") return String(t).slice(0, 10) === String(n).slice(0, 10);
|
|
145
|
+
if (l.kind === "datetime") {
|
|
146
|
+
const r = new Date(String(t)).getTime(), c = new Date(String(n)).getTime();
|
|
147
|
+
return !Number.isNaN(r) && Math.floor(r / 6e4) === Math.floor(c / 6e4);
|
|
148
|
+
}
|
|
149
|
+
if (l.kind === "number") return Number(t) === Number(n);
|
|
150
|
+
if (l.kind === "boolean") {
|
|
151
|
+
const r = (c) => c === !0 || c === 1 || c === "1" || c === "true";
|
|
152
|
+
return r(t) === r(n);
|
|
139
153
|
}
|
|
140
|
-
return
|
|
154
|
+
return String(t).trim() === String(n).trim();
|
|
141
155
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
144
|
-
if ((
|
|
145
|
-
const n = new Date(String(
|
|
146
|
-
return Number.isNaN(n.getTime()) ?
|
|
156
|
+
function xe(l, t) {
|
|
157
|
+
if (t == null || t === "") return null;
|
|
158
|
+
if ((l == null ? void 0 : l.kind) === "datetime") {
|
|
159
|
+
const n = new Date(String(t));
|
|
160
|
+
return Number.isNaN(n.getTime()) ? t : n.toISOString();
|
|
147
161
|
}
|
|
148
|
-
return
|
|
162
|
+
return t;
|
|
149
163
|
}
|
|
150
|
-
function
|
|
151
|
-
open:
|
|
152
|
-
onOpenChange:
|
|
164
|
+
function Oe({
|
|
165
|
+
open: l,
|
|
166
|
+
onOpenChange: t,
|
|
153
167
|
collection: n,
|
|
154
|
-
item:
|
|
155
|
-
recordLabel:
|
|
156
|
-
step:
|
|
157
|
-
fields:
|
|
168
|
+
item: o,
|
|
169
|
+
recordLabel: r,
|
|
170
|
+
step: c,
|
|
171
|
+
fields: f
|
|
158
172
|
}) {
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
const i =
|
|
163
|
-
i && (
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
const { [e]: d, ...
|
|
167
|
-
return
|
|
173
|
+
const j = U(), O = Q(), [u, N] = m([]), [k, p] = m({}), [v, D] = m(""), [q, $] = m(!1), [T, w] = m(null), h = H(!1), g = K(() => new Map(f.map((e) => [e.field, e])), [f]), M = f.filter((e) => !u.includes(e.field)), y = () => {
|
|
174
|
+
N([]), p({}), D(""), w(null), h.current = !1;
|
|
175
|
+
}, A = (e) => {
|
|
176
|
+
const i = g.get(e);
|
|
177
|
+
i && (N((d) => d.includes(e) ? d : [...d, e]), p((d) => e in d ? d : { ...d, [e]: ge(i) }), $(!1));
|
|
178
|
+
}, L = (e) => {
|
|
179
|
+
N((i) => i.filter((d) => d !== e)), p((i) => {
|
|
180
|
+
const { [e]: d, ...P } = i;
|
|
181
|
+
return P;
|
|
168
182
|
});
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
183
|
+
}, S = u.filter((e) => {
|
|
184
|
+
const i = g.get(e);
|
|
185
|
+
return !!i && !be(i, k[e]);
|
|
186
|
+
}), C = V({
|
|
187
|
+
mutationFn: () => j.request(
|
|
188
|
+
W(`/change-proposals/record/${n}/${encodeURIComponent(o)}`, {
|
|
189
|
+
values: Object.fromEntries(S.map((e) => [e, xe(g.get(e), k[e])])),
|
|
190
|
+
reason: v.trim()
|
|
174
191
|
})
|
|
175
192
|
),
|
|
176
193
|
onSuccess: () => {
|
|
177
|
-
|
|
194
|
+
O.invalidateQueries({ queryKey: pe(n, o) }), G.success("Proposal sent — the step’s owners will review it."), y(), t(!1);
|
|
178
195
|
},
|
|
179
196
|
onError: (e) => {
|
|
180
|
-
h.current = !1,
|
|
197
|
+
h.current = !1, w(X(e, "Could not send the proposal").title);
|
|
181
198
|
}
|
|
182
|
-
}),
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
|
|
199
|
+
}), R = S.length > 0 && v.trim().length >= 3 && !C.isPending;
|
|
200
|
+
return /* @__PURE__ */ a(
|
|
201
|
+
ae,
|
|
185
202
|
{
|
|
186
|
-
open:
|
|
203
|
+
open: l,
|
|
187
204
|
onOpenChange: (e) => {
|
|
188
|
-
e || y(),
|
|
205
|
+
e || y(), t(e);
|
|
189
206
|
},
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ s(ne, { className: "max-w-2xl dark:bg-card", "data-propose-change": !0, children: [
|
|
208
|
+
/* @__PURE__ */ s(le, { className: "px-6 pt-5", children: [
|
|
209
|
+
/* @__PURE__ */ s(oe, { className: "text-[15px] font-semibold text-slate-900 dark:text-slate-100", children: [
|
|
193
210
|
"Propose a change",
|
|
194
|
-
|
|
211
|
+
r ? ` · ${r}` : ""
|
|
195
212
|
] }),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
213
|
+
/* @__PURE__ */ s(se, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
214
|
+
c ? `This record is at ${c}, so you can’t edit it directly. ` : "You can’t edit this record directly. ",
|
|
198
215
|
"Enter the new values and say why — the owners of the step accept or decline them."
|
|
199
216
|
] })
|
|
200
217
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ s(
|
|
202
219
|
"form",
|
|
203
220
|
{
|
|
204
221
|
className: "space-y-4 px-6 pb-5 pt-2",
|
|
205
222
|
onSubmit: (e) => {
|
|
206
|
-
e.preventDefault(), !(!
|
|
223
|
+
e.preventDefault(), !(!R || h.current) && (h.current = !0, w(null), C.mutate());
|
|
207
224
|
},
|
|
208
225
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
|
|
211
|
-
const i =
|
|
212
|
-
return i ? /* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ s("div", { className: "space-y-2", "data-proposal-fields": !0, children: [
|
|
227
|
+
u.length > 0 && /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 dark:divide-border dark:border-border", children: u.map((e) => {
|
|
228
|
+
const i = g.get(e);
|
|
229
|
+
return i ? /* @__PURE__ */ s("li", { "data-proposal-field": e, className: "px-3 py-2.5", children: [
|
|
230
|
+
/* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
231
|
+
/* @__PURE__ */ a("span", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: i.label }),
|
|
232
|
+
/* @__PURE__ */ a(
|
|
216
233
|
"button",
|
|
217
234
|
{
|
|
218
235
|
type: "button",
|
|
219
236
|
"aria-label": `Remove ${i.label}`,
|
|
220
|
-
onClick: () =>
|
|
237
|
+
onClick: () => L(e),
|
|
221
238
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-slate-200",
|
|
222
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ a(Y, { className: "h-3.5 w-3.5" })
|
|
223
240
|
}
|
|
224
241
|
)
|
|
225
242
|
] }),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
|
|
243
|
+
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1.4fr)]", children: [
|
|
244
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
|
|
245
|
+
/* @__PURE__ */ a("span", { className: "mr-1.5 text-slate-400 dark:text-slate-500", children: "Now" }),
|
|
246
|
+
/* @__PURE__ */ a(
|
|
247
|
+
me,
|
|
231
248
|
{
|
|
232
249
|
value: i.current,
|
|
233
250
|
kind: i.kind,
|
|
@@ -236,60 +253,70 @@ function Ee({
|
|
|
236
253
|
}
|
|
237
254
|
)
|
|
238
255
|
] }),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
256
|
+
/* @__PURE__ */ a(
|
|
257
|
+
_,
|
|
241
258
|
{
|
|
242
259
|
"aria-hidden": !0,
|
|
243
260
|
className: "hidden h-3.5 w-3.5 text-slate-400 sm:block"
|
|
244
261
|
}
|
|
245
262
|
),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
263
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
264
|
+
/* @__PURE__ */ a(
|
|
265
|
+
he,
|
|
266
|
+
{
|
|
267
|
+
field: i,
|
|
268
|
+
value: k[e],
|
|
269
|
+
onChange: (d) => p((P) => ({ ...P, [e]: d }))
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
!S.includes(e) && /* @__PURE__ */ a(
|
|
273
|
+
"p",
|
|
274
|
+
{
|
|
275
|
+
className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400",
|
|
276
|
+
"data-proposal-same": !0,
|
|
277
|
+
children: "Same as now — not part of the proposal"
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
] })
|
|
254
281
|
] })
|
|
255
282
|
] }, e) : null;
|
|
256
283
|
}) }),
|
|
257
|
-
|
|
258
|
-
/* @__PURE__ */
|
|
284
|
+
M.length > 0 && /* @__PURE__ */ s(ie, { open: q, onOpenChange: $, children: [
|
|
285
|
+
/* @__PURE__ */ a(de, { asChild: !0, children: u.length === 0 ? /* @__PURE__ */ s(
|
|
259
286
|
"button",
|
|
260
287
|
{
|
|
261
288
|
type: "button",
|
|
262
289
|
"data-proposal-add-field": !0,
|
|
263
290
|
className: "flex w-full flex-col items-center gap-1 rounded-md border border-dashed border-slate-300 px-3 py-5 text-center transition-colors hover:border-nvr-cyan/60 hover:bg-nvr-cyan/5 dark:border-border",
|
|
264
291
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
|
|
293
|
+
/* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
|
|
267
294
|
"Pick a field to change"
|
|
268
295
|
] }),
|
|
269
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Only the fields you could edit if the record were open are offered." })
|
|
270
297
|
]
|
|
271
298
|
}
|
|
272
|
-
) : /* @__PURE__ */
|
|
299
|
+
) : /* @__PURE__ */ s(
|
|
273
300
|
"button",
|
|
274
301
|
{
|
|
275
302
|
type: "button",
|
|
276
303
|
"data-proposal-add-field": !0,
|
|
277
304
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-[12.5px] font-medium text-[#0e7490] transition-colors hover:bg-nvr-cyan/10 dark:text-[#67e8f9]",
|
|
278
305
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
|
|
280
307
|
"Add another field"
|
|
281
308
|
]
|
|
282
309
|
}
|
|
283
310
|
) }),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
|
|
311
|
+
/* @__PURE__ */ a(ce, { className: "w-72 p-0", align: "start", children: /* @__PURE__ */ s(B, { children: [
|
|
312
|
+
/* @__PURE__ */ a(J, { placeholder: "Search fields…" }),
|
|
313
|
+
/* @__PURE__ */ s(Z, { children: [
|
|
314
|
+
/* @__PURE__ */ a(ee, { children: "No field matches." }),
|
|
315
|
+
/* @__PURE__ */ a(te, { children: M.map((e) => /* @__PURE__ */ a(
|
|
316
|
+
re,
|
|
290
317
|
{
|
|
291
318
|
value: `${e.label} ${e.field}`,
|
|
292
|
-
onSelect: () =>
|
|
319
|
+
onSelect: () => A(e.field),
|
|
293
320
|
children: e.label
|
|
294
321
|
},
|
|
295
322
|
e.field
|
|
@@ -298,50 +325,50 @@ function Ee({
|
|
|
298
325
|
] }) })
|
|
299
326
|
] })
|
|
300
327
|
] }),
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ s("label", { className: "block", children: [
|
|
329
|
+
/* @__PURE__ */ a("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Why is the change needed?" }),
|
|
330
|
+
/* @__PURE__ */ a(
|
|
304
331
|
"textarea",
|
|
305
332
|
{
|
|
306
|
-
value:
|
|
307
|
-
onChange: (e) =>
|
|
333
|
+
value: v,
|
|
334
|
+
onChange: (e) => D(e.target.value),
|
|
308
335
|
rows: 3,
|
|
309
336
|
maxLength: 2e3,
|
|
310
337
|
"data-proposal-reason": !0,
|
|
311
338
|
placeholder: "e.g. The vendor sent a revised quote on Nov 12.",
|
|
312
|
-
className:
|
|
339
|
+
className: b(x, "h-auto py-2 leading-snug")
|
|
313
340
|
}
|
|
314
341
|
)
|
|
315
342
|
] }),
|
|
316
|
-
|
|
343
|
+
T && /* @__PURE__ */ a(
|
|
317
344
|
"p",
|
|
318
345
|
{
|
|
319
346
|
role: "alert",
|
|
320
347
|
className: "rounded-md border border-red-200 bg-red-50 px-3 py-2 text-[12.5px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
|
|
321
|
-
children:
|
|
348
|
+
children: T
|
|
322
349
|
}
|
|
323
350
|
),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
|
|
352
|
+
/* @__PURE__ */ a(
|
|
326
353
|
"button",
|
|
327
354
|
{
|
|
328
355
|
type: "button",
|
|
329
356
|
onClick: () => {
|
|
330
|
-
y(),
|
|
357
|
+
y(), t(!1);
|
|
331
358
|
},
|
|
332
359
|
className: "h-9 rounded-md px-3 text-[13px] font-medium text-slate-600 transition-colors hover:bg-muted dark:text-slate-300",
|
|
333
360
|
children: "Cancel"
|
|
334
361
|
}
|
|
335
362
|
),
|
|
336
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ s(
|
|
337
364
|
"button",
|
|
338
365
|
{
|
|
339
366
|
type: "submit",
|
|
340
|
-
disabled: !
|
|
367
|
+
disabled: !R,
|
|
341
368
|
"data-proposal-send": !0,
|
|
342
369
|
className: "inline-flex h-9 items-center gap-1.5 rounded-md bg-nvr-cyan px-4 text-[13px] font-semibold text-white shadow-sm transition-opacity disabled:opacity-50",
|
|
343
370
|
children: [
|
|
344
|
-
|
|
371
|
+
C.isPending && /* @__PURE__ */ a(F, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
345
372
|
"Send proposal"
|
|
346
373
|
]
|
|
347
374
|
}
|
|
@@ -355,5 +382,6 @@ function Ee({
|
|
|
355
382
|
);
|
|
356
383
|
}
|
|
357
384
|
export {
|
|
358
|
-
|
|
385
|
+
Oe as ProposeChangeDialog,
|
|
386
|
+
be as sameAsNow
|
|
359
387
|
};
|