@nivaro/react 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/fields/FileField.js +20 -19
- package/dist/full.css +1 -1
- package/dist/hooks/replayUploadQueue.js +107 -93
- package/dist/hooks/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +103 -101
- package/dist/index.d.ts +115 -2
- package/dist/index.js +466 -447
- package/dist/shared/components/CollectionBrowserView.js +1058 -1059
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/DataTable.js +230 -223
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +3687 -3580
- package/dist/shared/components/JsonMapEditor.js +18 -17
- package/dist/shared/components/MatrixEditor.js +8 -7
- package/dist/shared/components/MyWorkView.js +32 -31
- package/dist/shared/components/PageRenderer.js +146 -145
- package/dist/shared/components/QueryTable.js +49 -49
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
- package/dist/shared/components/ai/AskPanel.js +55 -54
- package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
- package/dist/shared/components/chat/ChatPanel.js +288 -287
- package/dist/shared/components/chat/SlashCommands.js +30 -29
- package/dist/shared/components/chat/chat-outbox.js +76 -75
- package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
- package/dist/shared/components/integrations/console/SignalCard.js +124 -123
- package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/InlineTableField.js +301 -300
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/staged-links.js +86 -0
- package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
- package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
- package/dist/shared/components/panels/CommentPanel.js +237 -236
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/profile/usePersonPresence.js +42 -37
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueWorklist.js +597 -598
- package/dist/shared/lib/client-version.js +63 -0
- package/dist/shared/lib/force-reload.js +36 -0
- package/dist/shared/lib/load-error.js +11 -10
- package/dist/shared/lib/presence-live.js +73 -0
- package/dist/shared/lib/presence-state.js +39 -31
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/request-gate.js +120 -102
- package/dist/shared/lib/rum.js +45 -36
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/signed-out.js +114 -0
- package/dist/shared/lib/socket-realtime.js +19 -17
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/dist/shared/lib/use-online-users.js +11 -10
- package/dist/shared/lib/worker-socket.js +89 -79
- package/package.json +1 -1
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { BellOff as D, Loader2 as g, EyeOff as S } from "lucide-react";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import { userErrorMessage as L } from "../../../lib/safe-error.js";
|
|
4
5
|
import { cn as C } from "../../../lib/utils.js";
|
|
5
|
-
import { Popover as
|
|
6
|
+
import { Popover as j, PopoverTrigger as T, PopoverContent as B } from "../../ui/popover.js";
|
|
6
7
|
import { useSnooze as P } from "./api.js";
|
|
7
|
-
const
|
|
8
|
+
const H = [
|
|
8
9
|
{ key: "day", label: "1 day" },
|
|
9
10
|
{ key: "week", label: "1 week" },
|
|
10
11
|
{ key: "change", label: "Until it changes" }
|
|
11
12
|
];
|
|
12
|
-
function
|
|
13
|
+
function W({ signal: r, rowKey: c }) {
|
|
13
14
|
const { add: n } = P();
|
|
14
15
|
return /* @__PURE__ */ t(
|
|
15
16
|
"button",
|
|
16
17
|
{
|
|
17
18
|
type: "button",
|
|
18
|
-
"data-ic-dismiss": `${r}:${
|
|
19
|
+
"data-ic-dismiss": `${r}:${c}`,
|
|
19
20
|
"aria-label": "Dismiss this occurrence",
|
|
20
21
|
"data-tip": "Hide until it happens again",
|
|
21
22
|
disabled: n.isPending,
|
|
22
|
-
onClick: () => n.mutate({ signal: r, row_key:
|
|
23
|
+
onClick: () => n.mutate({ signal: r, row_key: c, until_occurrence: !0 }),
|
|
23
24
|
className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60",
|
|
24
25
|
children: n.isPending ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(S, { className: "h-3.5 w-3.5" })
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function J({
|
|
29
30
|
signal: r,
|
|
30
|
-
signalLabel:
|
|
31
|
+
signalLabel: c,
|
|
31
32
|
rowKey: n,
|
|
32
33
|
group: i,
|
|
33
34
|
defaultScope: $,
|
|
34
35
|
compact: h
|
|
35
36
|
}) {
|
|
36
|
-
const { add: s } = P(), [b,
|
|
37
|
+
const { add: s } = P(), [b, u] = l(!1), x = $ ?? (n ? "row" : i ? "group" : "signal"), [d, y] = l(x), [v, _] = l("day"), [k, N] = l(""), [w, p] = l(null), E = [
|
|
37
38
|
...n ? [{ key: "row", label: "This problem" }] : [],
|
|
38
39
|
...i ? [{ key: "group", label: `Everything in ${i.label}` }] : [],
|
|
39
|
-
{ key: "signal", label: `All of “${
|
|
40
|
+
{ key: "signal", label: `All of “${c}”` }
|
|
40
41
|
], z = (e) => e !== "change" || d === "row", a = z(v) ? v : "day", O = () => {
|
|
41
42
|
p(null);
|
|
42
43
|
const e = a === "change" ? null : new Date(Date.now() + (a === "day" ? 1 : 7) * 864e5).toISOString();
|
|
@@ -51,24 +52,24 @@ function U({
|
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
onSuccess: () => {
|
|
54
|
-
|
|
55
|
+
u(!1), N("");
|
|
55
56
|
},
|
|
56
|
-
onError: (
|
|
57
|
-
const f =
|
|
58
|
-
p((f == null ? void 0 : f.error) ?? (
|
|
57
|
+
onError: (m) => {
|
|
58
|
+
const f = m == null ? void 0 : m.response;
|
|
59
|
+
p((f == null ? void 0 : f.error) ?? L(m, "Could not snooze"));
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|
|
63
64
|
return /* @__PURE__ */ o(
|
|
64
|
-
|
|
65
|
+
j,
|
|
65
66
|
{
|
|
66
67
|
open: b,
|
|
67
68
|
onOpenChange: (e) => {
|
|
68
|
-
|
|
69
|
+
u(e), e && (y(x), p(null));
|
|
69
70
|
},
|
|
70
71
|
children: [
|
|
71
|
-
/* @__PURE__ */ t(
|
|
72
|
+
/* @__PURE__ */ t(T, { asChild: !0, children: /* @__PURE__ */ o(
|
|
72
73
|
"button",
|
|
73
74
|
{
|
|
74
75
|
type: "button",
|
|
@@ -84,7 +85,7 @@ function U({
|
|
|
84
85
|
]
|
|
85
86
|
}
|
|
86
87
|
) }),
|
|
87
|
-
/* @__PURE__ */ o(
|
|
88
|
+
/* @__PURE__ */ o(B, { align: "end", className: "w-72 p-0", "data-ic-snooze-menu": !0, children: [
|
|
88
89
|
n && /* @__PURE__ */ t("div", { className: "border-b border-border p-1", children: /* @__PURE__ */ o(
|
|
89
90
|
"button",
|
|
90
91
|
{
|
|
@@ -94,7 +95,7 @@ function U({
|
|
|
94
95
|
onClick: () => {
|
|
95
96
|
s.mutate(
|
|
96
97
|
{ signal: r, row_key: n, until_occurrence: !0 },
|
|
97
|
-
{ onSuccess: () =>
|
|
98
|
+
{ onSuccess: () => u(!1) }
|
|
98
99
|
);
|
|
99
100
|
},
|
|
100
101
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px] font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60",
|
|
@@ -131,7 +132,7 @@ function U({
|
|
|
131
132
|
] }),
|
|
132
133
|
/* @__PURE__ */ o("fieldset", { children: [
|
|
133
134
|
/* @__PURE__ */ t("legend", { className: "mb-1.5 text-[12px] font-medium text-foreground", children: "For how long" }),
|
|
134
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children:
|
|
135
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: H.filter((e) => z(e.key)).map((e) => /* @__PURE__ */ t(
|
|
135
136
|
"button",
|
|
136
137
|
{
|
|
137
138
|
type: "button",
|
|
@@ -166,7 +167,7 @@ function U({
|
|
|
166
167
|
"button",
|
|
167
168
|
{
|
|
168
169
|
type: "button",
|
|
169
|
-
onClick: () =>
|
|
170
|
+
onClick: () => u(!1),
|
|
170
171
|
className: "h-7 rounded-md px-2.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
171
172
|
children: "Cancel"
|
|
172
173
|
}
|
|
@@ -192,6 +193,6 @@ function U({
|
|
|
192
193
|
);
|
|
193
194
|
}
|
|
194
195
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
W as DismissButton,
|
|
197
|
+
J as SnoozeMenu
|
|
197
198
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Copy as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { toast as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { post as
|
|
7
|
-
import { titleCase as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Dialog as
|
|
10
|
-
import { Input as
|
|
11
|
-
import { Label as
|
|
12
|
-
import { Switch as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
2
|
+
import { Copy as O, RotateCcw as T } from "lucide-react";
|
|
3
|
+
import { useState as b } from "react";
|
|
4
|
+
import { toast as v } from "sonner";
|
|
5
|
+
import { useNivaroClient as $ } from "../../context.js";
|
|
6
|
+
import { post as q } from "../../lib/commands.js";
|
|
7
|
+
import { titleCase as E, cn as R } from "../../lib/utils.js";
|
|
8
|
+
import { Button as w } from "../ui/button.js";
|
|
9
|
+
import { Dialog as H, DialogTrigger as K, DialogContent as P, DialogHeader as Y, DialogTitle as A, DialogFooter as G } from "../ui/dialog.js";
|
|
10
|
+
import { Input as m } from "../ui/input.js";
|
|
11
|
+
import { Label as z } from "../ui/label.js";
|
|
12
|
+
import { Switch as B } from "../ui/switch.js";
|
|
13
|
+
const Q = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "created_by", "updated_by"]);
|
|
14
|
+
function U(l, n, s) {
|
|
15
|
+
if (Q.has(l.field) || l.computed_formula) return !1;
|
|
16
16
|
const i = l.interface ?? "";
|
|
17
17
|
return !(["sub_rows", "repeater", "rich_text", "file", "image", "o2m", "m2m", "m2a"].includes(i) || ["sub_rows", "repeater", "rich_text"].includes(l.type) || n.some((p) => p.one_collection === s && p.one_field === l.field));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function W(l) {
|
|
20
20
|
return l.interface === "sub_rows" || l.type === "sub_rows";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function X(l) {
|
|
23
23
|
if (!l) return "";
|
|
24
24
|
try {
|
|
25
25
|
return new Date(String(l)).toISOString().slice(0, 16);
|
|
@@ -27,7 +27,7 @@ function U(l) {
|
|
|
27
27
|
return "";
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Z({ field: l, value: n, onChange: s }) {
|
|
31
31
|
return l.type === "boolean" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
32
32
|
/* @__PURE__ */ t(
|
|
33
33
|
"input",
|
|
@@ -40,15 +40,15 @@ function W({ field: l, value: n, onChange: s }) {
|
|
|
40
40
|
),
|
|
41
41
|
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: n ? "Yes" : "No" })
|
|
42
42
|
] }) : l.type === "datetime" || l.interface === "datetime" ? /* @__PURE__ */ t(
|
|
43
|
-
|
|
43
|
+
m,
|
|
44
44
|
{
|
|
45
45
|
type: "datetime-local",
|
|
46
|
-
value:
|
|
46
|
+
value: X(n),
|
|
47
47
|
onChange: (i) => s(i.target.value ? new Date(i.target.value).toISOString() : null),
|
|
48
48
|
className: "h-7 text-[12px]"
|
|
49
49
|
}
|
|
50
50
|
) : l.type === "date" ? /* @__PURE__ */ t(
|
|
51
|
-
|
|
51
|
+
m,
|
|
52
52
|
{
|
|
53
53
|
type: "date",
|
|
54
54
|
value: n ? String(n).slice(0, 10) : "",
|
|
@@ -56,7 +56,7 @@ function W({ field: l, value: n, onChange: s }) {
|
|
|
56
56
|
className: "h-7 text-[12px]"
|
|
57
57
|
}
|
|
58
58
|
) : l.type === "integer" || l.type === "bigInteger" ? /* @__PURE__ */ t(
|
|
59
|
-
|
|
59
|
+
m,
|
|
60
60
|
{
|
|
61
61
|
type: "number",
|
|
62
62
|
step: "1",
|
|
@@ -65,7 +65,7 @@ function W({ field: l, value: n, onChange: s }) {
|
|
|
65
65
|
className: "h-7 text-[12px]"
|
|
66
66
|
}
|
|
67
67
|
) : l.type === "float" || l.type === "decimal" || l.type === "double" ? /* @__PURE__ */ t(
|
|
68
|
-
|
|
68
|
+
m,
|
|
69
69
|
{
|
|
70
70
|
type: "number",
|
|
71
71
|
step: "any",
|
|
@@ -74,7 +74,7 @@ function W({ field: l, value: n, onChange: s }) {
|
|
|
74
74
|
className: "h-7 text-[12px]"
|
|
75
75
|
}
|
|
76
76
|
) : /* @__PURE__ */ t(
|
|
77
|
-
|
|
77
|
+
m,
|
|
78
78
|
{
|
|
79
79
|
value: n == null ? "" : String(n),
|
|
80
80
|
onChange: (i) => s(i.target.value || null),
|
|
@@ -83,103 +83,110 @@ function W({ field: l, value: n, onChange: s }) {
|
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
function
|
|
86
|
+
function ue({ collection: l, itemId: n, fields: s, relations: i, currentValues: f, onSuccess: p }) {
|
|
87
|
+
const L = $(), [j, h] = b(!1), [C, S] = b(!1), [k, g] = b({}), [_, I] = b({}), x = s.filter((e) => U(e, i, l)), y = s.filter(W);
|
|
88
|
+
function J() {
|
|
89
89
|
const e = {};
|
|
90
|
-
for (const
|
|
91
|
-
e[
|
|
92
|
-
|
|
90
|
+
for (const o of x)
|
|
91
|
+
e[o.field] = { include: !0, value: f[o.field] ?? null };
|
|
92
|
+
g(e);
|
|
93
93
|
const a = {};
|
|
94
|
-
for (const
|
|
95
|
-
|
|
94
|
+
for (const o of y) a[o.field] = !0;
|
|
95
|
+
I(a), h(!0);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
return JSON.stringify(a.value) !== JSON.stringify(
|
|
97
|
+
function D(e, a) {
|
|
98
|
+
return JSON.stringify(a.value) !== JSON.stringify(f[e] ?? null);
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
101
|
-
|
|
100
|
+
async function M() {
|
|
101
|
+
var e;
|
|
102
|
+
S(!0);
|
|
102
103
|
try {
|
|
103
|
-
const
|
|
104
|
-
for (const
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
if (!
|
|
108
|
-
|
|
104
|
+
const a = {}, o = [];
|
|
105
|
+
for (const d of x) {
|
|
106
|
+
const N = k[d.field];
|
|
107
|
+
if (N) {
|
|
108
|
+
if (!N.include) {
|
|
109
|
+
o.push(d.field);
|
|
109
110
|
continue;
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
D(d.field, N) && (a[d.field] = N.value);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
const c =
|
|
115
|
-
|
|
115
|
+
const c = y.filter((d) => _[d.field]).map((d) => d.field), u = await L.request(
|
|
116
|
+
q(`/items/${l}/${n}/clone`, { field_overrides: a, exclude_fields: o, include_sub_rows: c })
|
|
116
117
|
);
|
|
117
|
-
|
|
118
|
+
h(!1);
|
|
119
|
+
const F = (e = u == null ? void 0 : u.data) == null ? void 0 : e.id;
|
|
120
|
+
if (F == null) {
|
|
121
|
+
v.success("Item cloned — open it from the list");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
v.success("Item cloned"), p(F);
|
|
118
125
|
} catch {
|
|
119
|
-
|
|
126
|
+
v.error("Failed to clone item");
|
|
120
127
|
} finally {
|
|
121
|
-
|
|
128
|
+
S(!1);
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
|
-
return /* @__PURE__ */ r(
|
|
125
|
-
e ?
|
|
131
|
+
return /* @__PURE__ */ r(H, { open: j, onOpenChange: (e) => {
|
|
132
|
+
e ? J() : h(!1);
|
|
126
133
|
}, children: [
|
|
127
|
-
/* @__PURE__ */ t(
|
|
128
|
-
/* @__PURE__ */ t(
|
|
134
|
+
/* @__PURE__ */ t(K, { asChild: !0, children: /* @__PURE__ */ r(w, { size: "sm", variant: "outline", className: "gap-1.5", children: [
|
|
135
|
+
/* @__PURE__ */ t(O, { className: "h-3.5 w-3.5" }),
|
|
129
136
|
"Clone"
|
|
130
137
|
] }) }),
|
|
131
|
-
/* @__PURE__ */ r(
|
|
132
|
-
/* @__PURE__ */ t(
|
|
138
|
+
/* @__PURE__ */ r(P, { className: "flex max-h-[85vh] max-w-lg flex-col overflow-hidden", children: [
|
|
139
|
+
/* @__PURE__ */ t(Y, { className: "shrink-0 px-6 pt-6", children: /* @__PURE__ */ t(A, { className: "text-[15px]", children: "Clone item" }) }),
|
|
133
140
|
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
134
|
-
|
|
141
|
+
x.length > 0 && /* @__PURE__ */ r("div", { children: [
|
|
135
142
|
/* @__PURE__ */ t("p", { className: "mb-2 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: "Field values" }),
|
|
136
|
-
/* @__PURE__ */ t("div", { className: "space-y-2", children:
|
|
137
|
-
const a =
|
|
143
|
+
/* @__PURE__ */ t("div", { className: "space-y-2", children: x.map((e) => {
|
|
144
|
+
const a = k[e.field];
|
|
138
145
|
if (!a) return null;
|
|
139
|
-
const
|
|
146
|
+
const o = D(e.field, a);
|
|
140
147
|
return /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
141
148
|
/* @__PURE__ */ t(
|
|
142
|
-
|
|
149
|
+
B,
|
|
143
150
|
{
|
|
144
151
|
checked: a.include,
|
|
145
|
-
onCheckedChange: () =>
|
|
152
|
+
onCheckedChange: () => g((c) => ({ ...c, [e.field]: { ...c[e.field], include: !c[e.field].include } })),
|
|
146
153
|
className: "mt-1 shrink-0 scale-75"
|
|
147
154
|
}
|
|
148
155
|
),
|
|
149
|
-
/* @__PURE__ */ t(
|
|
150
|
-
/* @__PURE__ */ t("div", { className:
|
|
151
|
-
|
|
156
|
+
/* @__PURE__ */ t(z, { className: R("mt-1.5 w-32 shrink-0 truncate text-[12px]", !a.include && "text-slate-400 line-through"), children: E(e.field) }),
|
|
157
|
+
/* @__PURE__ */ t("div", { className: R("flex-1", !a.include && "pointer-events-none opacity-40"), children: /* @__PURE__ */ t(
|
|
158
|
+
Z,
|
|
152
159
|
{
|
|
153
160
|
field: e,
|
|
154
161
|
value: a.value,
|
|
155
|
-
onChange: (
|
|
162
|
+
onChange: (c) => g((u) => ({ ...u, [e.field]: { ...u[e.field], value: c } }))
|
|
156
163
|
}
|
|
157
164
|
) }),
|
|
158
|
-
|
|
165
|
+
o && a.include && /* @__PURE__ */ t(
|
|
159
166
|
"button",
|
|
160
167
|
{
|
|
161
168
|
type: "button",
|
|
162
169
|
title: "Reset to original",
|
|
163
|
-
onClick: () =>
|
|
170
|
+
onClick: () => g((c) => ({ ...c, [e.field]: { ...c[e.field], value: f[e.field] ?? null } })),
|
|
164
171
|
className: "mt-1.5 shrink-0 text-slate-400 hover:text-slate-600",
|
|
165
|
-
children: /* @__PURE__ */ t(
|
|
172
|
+
children: /* @__PURE__ */ t(T, { className: "h-3.5 w-3.5" })
|
|
166
173
|
}
|
|
167
174
|
)
|
|
168
175
|
] }, e.field);
|
|
169
176
|
}) })
|
|
170
177
|
] }),
|
|
171
|
-
|
|
178
|
+
y.length > 0 && /* @__PURE__ */ r("div", { children: [
|
|
172
179
|
/* @__PURE__ */ t("p", { className: "mb-2 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: "Sub-rows" }),
|
|
173
|
-
/* @__PURE__ */ t("div", { className: "space-y-2", children:
|
|
180
|
+
/* @__PURE__ */ t("div", { className: "space-y-2", children: y.map((e) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
174
181
|
/* @__PURE__ */ t(
|
|
175
|
-
|
|
182
|
+
B,
|
|
176
183
|
{
|
|
177
|
-
checked: !!
|
|
178
|
-
onCheckedChange: (a) =>
|
|
184
|
+
checked: !!_[e.field],
|
|
185
|
+
onCheckedChange: (a) => I((o) => ({ ...o, [e.field]: a })),
|
|
179
186
|
className: "shrink-0 scale-75"
|
|
180
187
|
}
|
|
181
188
|
),
|
|
182
|
-
/* @__PURE__ */ r(
|
|
189
|
+
/* @__PURE__ */ r(z, { className: "text-[12px]", children: [
|
|
183
190
|
"Include ",
|
|
184
191
|
/* @__PURE__ */ t("span", { className: "font-mono", children: e.field }),
|
|
185
192
|
" sub-rows"
|
|
@@ -187,16 +194,16 @@ function ce({ collection: l, itemId: n, fields: s, relations: i, currentValues:
|
|
|
187
194
|
] }, e.field)) })
|
|
188
195
|
] })
|
|
189
196
|
] }) }),
|
|
190
|
-
/* @__PURE__ */ r(
|
|
191
|
-
/* @__PURE__ */ t(
|
|
192
|
-
/* @__PURE__ */ r(
|
|
193
|
-
/* @__PURE__ */ t(
|
|
194
|
-
|
|
197
|
+
/* @__PURE__ */ r(G, { className: "shrink-0 border-t border-slate-100 px-6 py-4 dark:border-border", children: [
|
|
198
|
+
/* @__PURE__ */ t(w, { variant: "outline", size: "sm", onClick: () => h(!1), children: "Cancel" }),
|
|
199
|
+
/* @__PURE__ */ r(w, { size: "sm", disabled: C, onClick: M, children: [
|
|
200
|
+
/* @__PURE__ */ t(O, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
201
|
+
C ? "Cloning…" : "Clone"
|
|
195
202
|
] })
|
|
196
203
|
] })
|
|
197
204
|
] })
|
|
198
205
|
] });
|
|
199
206
|
}
|
|
200
207
|
export {
|
|
201
|
-
|
|
208
|
+
ue as CloneDialog
|
|
202
209
|
};
|