@nivaro/react 0.3.41 → 0.3.42
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/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +644 -15
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronsUpDown as _, Check as y, Pencil as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
2
|
+
import { ChevronsUpDown as _, Check as y, Pencil as ke, X as ve, Plus as _e } from "lucide-react";
|
|
3
|
+
import { useState as c } from "react";
|
|
4
|
+
import { describeCascadeFilter as ye } from "../../../lib/config-sentences.js";
|
|
5
|
+
import { cn as u } from "../../../lib/utils.js";
|
|
6
|
+
import { ConfigReadBack as we } from "../../ConfigReadBack.js";
|
|
5
7
|
import { Button as ee } from "../../ui/button.js";
|
|
6
|
-
import { Command as
|
|
8
|
+
import { Command as w, CommandInput as C, CommandList as S, CommandEmpty as M, CommandGroup as P, CommandItem as O } from "../../ui/command.js";
|
|
7
9
|
import { Input as te } from "../../ui/input.js";
|
|
8
|
-
import { Popover as E, PopoverTrigger as
|
|
9
|
-
import { Switch as
|
|
10
|
-
import { useCollectionBody as
|
|
11
|
-
import { tintCard as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
rules:
|
|
15
|
-
m2oFields:
|
|
16
|
-
relatedCollection:
|
|
17
|
-
|
|
10
|
+
import { Popover as E, PopoverTrigger as j, PopoverContent as F } from "../../ui/popover.js";
|
|
11
|
+
import { Switch as b } from "../../ui/switch.js";
|
|
12
|
+
import { useCollectionBody as Ce } from "../collection-meta.js";
|
|
13
|
+
import { tintCard as B } from "../panel-style.js";
|
|
14
|
+
const A = "h-[18px] w-8 border-0 data-[state=checked]:bg-nvr-cyan data-[state=unchecked]:bg-slate-300 dark:data-[state=unchecked]:bg-slate-600 [&>span]:mx-0.5 [&>span]:h-3.5 [&>span]:w-3.5 [&>span]:bg-white [&>span]:shadow-sm [&>span]:data-[state=checked]:translate-x-3.5";
|
|
15
|
+
function ze({
|
|
16
|
+
rules: d,
|
|
17
|
+
m2oFields: m,
|
|
18
|
+
relatedCollection: i,
|
|
19
|
+
fieldLabel: ae,
|
|
20
|
+
onChange: p
|
|
18
21
|
}) {
|
|
19
22
|
var Y, Z;
|
|
20
|
-
const [
|
|
21
|
-
function re() {
|
|
22
|
-
k(null), B(""), R(""), X(!0), J(!1), Q(!0), N(!0);
|
|
23
|
-
}
|
|
23
|
+
const [L, N] = c(!1), [I, k] = c(null), [h, T] = c(""), [f, R] = c(""), [ne, z] = c(!1), [le, $] = c(!1), [se, D] = c(!1), [re, G] = c(!1), [g, H] = c(""), [x, U] = c(""), { data: r } = Ce(i), v = ((Y = r == null ? void 0 : r.fields) == null ? void 0 : Y.map((t) => t.field)) ?? [], [W, X] = c(!0), [q, J] = c(!1), [K, Q] = c(!0);
|
|
24
24
|
function ce() {
|
|
25
|
+
k(null), T(""), R(""), X(!0), J(!1), Q(!0), N(!0);
|
|
26
|
+
}
|
|
27
|
+
function de() {
|
|
25
28
|
N(!1);
|
|
26
29
|
}
|
|
27
30
|
function V(t) {
|
|
28
|
-
return ((
|
|
31
|
+
return ((r == null ? void 0 : r.relations) ?? []).some((l) => l.one_field === t && !!l.junction_field);
|
|
29
32
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
32
|
-
const t =
|
|
33
|
-
|
|
34
|
-
...
|
|
33
|
+
function ie() {
|
|
34
|
+
if (!h.trim() || !f.trim()) return;
|
|
35
|
+
const t = f.trim();
|
|
36
|
+
p([
|
|
37
|
+
...d,
|
|
35
38
|
{
|
|
36
|
-
parent_field:
|
|
39
|
+
parent_field: h.trim(),
|
|
37
40
|
filter_column: t,
|
|
38
41
|
clear_on_parent_change: W,
|
|
39
42
|
clear_on_unavailable: q,
|
|
@@ -42,18 +45,18 @@ function Re({
|
|
|
42
45
|
}
|
|
43
46
|
]), N(!1);
|
|
44
47
|
}
|
|
45
|
-
function
|
|
46
|
-
N(!1), H(
|
|
48
|
+
function oe(t) {
|
|
49
|
+
N(!1), H(d[t].parent_field), U(d[t].filter_column), k(t);
|
|
47
50
|
}
|
|
48
|
-
function
|
|
51
|
+
function me() {
|
|
49
52
|
k(null);
|
|
50
53
|
}
|
|
51
|
-
function
|
|
52
|
-
if (I === null || !g.trim() || !
|
|
53
|
-
const t =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(s,
|
|
54
|
+
function pe() {
|
|
55
|
+
if (I === null || !g.trim() || !x.trim()) return;
|
|
56
|
+
const t = x.trim();
|
|
57
|
+
p(
|
|
58
|
+
d.map(
|
|
59
|
+
(s, l) => l === I ? {
|
|
57
60
|
...s,
|
|
58
61
|
parent_field: g.trim(),
|
|
59
62
|
filter_column: t,
|
|
@@ -62,84 +65,84 @@ function Re({
|
|
|
62
65
|
)
|
|
63
66
|
), k(null);
|
|
64
67
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
68
|
+
function he(t) {
|
|
69
|
+
p(d.filter((s, l) => l !== t));
|
|
67
70
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
...
|
|
71
|
+
function fe(t, s) {
|
|
72
|
+
p(
|
|
73
|
+
d.map(
|
|
74
|
+
(l, o) => o === t ? {
|
|
75
|
+
...l,
|
|
73
76
|
clear_on_parent_change: s,
|
|
74
|
-
clear_on_unavailable:
|
|
75
|
-
} :
|
|
77
|
+
clear_on_unavailable: l.clear_on_unavailable ?? !1
|
|
78
|
+
} : l
|
|
76
79
|
)
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
82
|
function xe(t, s) {
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
function fe(t, s) {
|
|
83
|
-
i(c.map((n, d) => d === t ? { ...n, show_all_if_no_parent: s } : n));
|
|
83
|
+
p(d.map((l, o) => o === t ? { ...l, clear_on_unavailable: s } : l));
|
|
84
84
|
}
|
|
85
85
|
function ue(t, s) {
|
|
86
|
-
|
|
86
|
+
p(d.map((l, o) => o === t ? { ...l, show_all_if_no_parent: s } : l));
|
|
87
|
+
}
|
|
88
|
+
function be(t, s) {
|
|
89
|
+
p(d.map((l, o) => o === t ? { ...l, upstream: s } : l));
|
|
87
90
|
}
|
|
88
91
|
return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
89
|
-
|
|
90
|
-
const
|
|
92
|
+
d.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2", children: d.map((t, s) => {
|
|
93
|
+
const l = m.find((n) => n.field === t.parent_field), o = (l == null ? void 0 : l.label) ?? t.parent_field, ge = (l == null ? void 0 : l.kind) === "M2M";
|
|
91
94
|
return I === s ? /* @__PURE__ */ a(
|
|
92
95
|
"div",
|
|
93
96
|
{
|
|
94
|
-
className:
|
|
97
|
+
className: u(B, "space-y-3 p-3 ring-nvr-cyan/40 dark:ring-nvr-cyan/30"),
|
|
95
98
|
children: [
|
|
96
99
|
/* @__PURE__ */ a("div", { children: [
|
|
97
100
|
/* @__PURE__ */ e("p", { className: "mb-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Parent field" }),
|
|
98
|
-
/* @__PURE__ */ a(E, { open:
|
|
99
|
-
/* @__PURE__ */ e(
|
|
101
|
+
/* @__PURE__ */ a(E, { open: se, onOpenChange: D, children: [
|
|
102
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ a(
|
|
100
103
|
"button",
|
|
101
104
|
{
|
|
102
105
|
type: "button",
|
|
103
106
|
className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-[13px] text-slate-700 hover:bg-muted dark:border-border dark:bg-background dark:text-foreground",
|
|
104
107
|
children: [
|
|
105
108
|
(() => {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
const n = m.find((Ne) => Ne.field === g);
|
|
110
|
+
return n ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
111
|
+
n.label,
|
|
112
|
+
n.kind === "M2M" && /* @__PURE__ */ e("span", { className: "rounded px-1 py-0.5 text-[11px] font-semibold bg-amber-100 text-amber-700 dark:bg-amber-400/15 dark:text-amber-300", children: "M2M" })
|
|
110
113
|
] }) : /* @__PURE__ */ e("span", { className: "text-slate-400", children: "Parent field…" });
|
|
111
114
|
})(),
|
|
112
115
|
/* @__PURE__ */ e(_, { className: "h-3 w-3 text-slate-400" })
|
|
113
116
|
]
|
|
114
117
|
}
|
|
115
118
|
) }),
|
|
116
|
-
/* @__PURE__ */ e(F, { className: "w-56 p-0", align: "start", children: /* @__PURE__ */ a(
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */ a(
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
/* @__PURE__ */ e(P, { children:
|
|
119
|
+
/* @__PURE__ */ e(F, { className: "w-56 p-0", align: "start", children: /* @__PURE__ */ a(w, { children: [
|
|
120
|
+
/* @__PURE__ */ e(C, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
|
|
121
|
+
/* @__PURE__ */ a(S, { children: [
|
|
122
|
+
/* @__PURE__ */ e(M, { className: "py-3 text-center text-[12px] text-slate-400", children: "No relation fields" }),
|
|
123
|
+
/* @__PURE__ */ e(P, { children: m.map((n) => /* @__PURE__ */ a(
|
|
121
124
|
O,
|
|
122
125
|
{
|
|
123
|
-
value:
|
|
126
|
+
value: n.label,
|
|
124
127
|
onSelect: () => {
|
|
125
|
-
H(
|
|
128
|
+
H(n.field), D(!1);
|
|
126
129
|
},
|
|
127
130
|
className: "text-[12px]",
|
|
128
131
|
children: [
|
|
129
132
|
/* @__PURE__ */ e(
|
|
130
133
|
y,
|
|
131
134
|
{
|
|
132
|
-
className:
|
|
135
|
+
className: u(
|
|
133
136
|
"mr-1.5 h-3 w-3 shrink-0",
|
|
134
|
-
g ===
|
|
137
|
+
g === n.field ? "opacity-100" : "opacity-0"
|
|
135
138
|
)
|
|
136
139
|
}
|
|
137
140
|
),
|
|
138
|
-
/* @__PURE__ */ e("span", { className: "flex-1", children:
|
|
139
|
-
|
|
141
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: n.label }),
|
|
142
|
+
n.kind === "M2M" && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded px-1 py-0.5 text-[11px] font-semibold bg-amber-100 text-amber-700 dark:bg-amber-400/15 dark:text-amber-300", children: "M2M" })
|
|
140
143
|
]
|
|
141
144
|
},
|
|
142
|
-
|
|
145
|
+
n.field
|
|
143
146
|
)) })
|
|
144
147
|
] })
|
|
145
148
|
] }) })
|
|
@@ -148,10 +151,10 @@ function Re({
|
|
|
148
151
|
/* @__PURE__ */ a("div", { "data-setting": "field.cascade_filters.filter_column", children: [
|
|
149
152
|
/* @__PURE__ */ a("p", { className: "mb-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
150
153
|
"Filter column on",
|
|
151
|
-
|
|
154
|
+
i ? ` ${i}` : " related table"
|
|
152
155
|
] }),
|
|
153
|
-
v.length > 0 ? /* @__PURE__ */ a(E, { open:
|
|
154
|
-
/* @__PURE__ */ e(
|
|
156
|
+
v.length > 0 ? /* @__PURE__ */ a(E, { open: re, onOpenChange: G, children: [
|
|
157
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ a(
|
|
155
158
|
"button",
|
|
156
159
|
{
|
|
157
160
|
type: "button",
|
|
@@ -160,54 +163,54 @@ function Re({
|
|
|
160
163
|
/* @__PURE__ */ e(
|
|
161
164
|
"span",
|
|
162
165
|
{
|
|
163
|
-
className:
|
|
164
|
-
children:
|
|
166
|
+
className: x ? "font-mono text-slate-700" : "text-slate-400",
|
|
167
|
+
children: x || "Select column…"
|
|
165
168
|
}
|
|
166
169
|
),
|
|
167
170
|
/* @__PURE__ */ e(_, { className: "h-3 w-3 text-slate-400" })
|
|
168
171
|
]
|
|
169
172
|
}
|
|
170
173
|
) }),
|
|
171
|
-
/* @__PURE__ */ e(F, { className: "w-52 p-0", align: "start", children: /* @__PURE__ */ a(
|
|
174
|
+
/* @__PURE__ */ e(F, { className: "w-52 p-0", align: "start", children: /* @__PURE__ */ a(w, { children: [
|
|
172
175
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
176
|
+
C,
|
|
174
177
|
{
|
|
175
178
|
placeholder: "Search columns…",
|
|
176
179
|
className: "h-8 text-[12px]"
|
|
177
180
|
}
|
|
178
181
|
),
|
|
179
|
-
/* @__PURE__ */ a(
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
/* @__PURE__ */ e(P, { children: v.map((
|
|
182
|
+
/* @__PURE__ */ a(S, { children: [
|
|
183
|
+
/* @__PURE__ */ e(M, { className: "py-3 text-center text-[12px] text-slate-400", children: "No columns" }),
|
|
184
|
+
/* @__PURE__ */ e(P, { children: v.map((n) => /* @__PURE__ */ a(
|
|
182
185
|
O,
|
|
183
186
|
{
|
|
184
|
-
value:
|
|
187
|
+
value: n,
|
|
185
188
|
onSelect: () => {
|
|
186
|
-
U(
|
|
189
|
+
U(n), G(!1);
|
|
187
190
|
},
|
|
188
191
|
className: "font-mono text-[12px]",
|
|
189
192
|
children: [
|
|
190
193
|
/* @__PURE__ */ e(
|
|
191
194
|
y,
|
|
192
195
|
{
|
|
193
|
-
className:
|
|
196
|
+
className: u(
|
|
194
197
|
"mr-1.5 h-3 w-3 shrink-0",
|
|
195
|
-
|
|
198
|
+
x === n ? "opacity-100" : "opacity-0"
|
|
196
199
|
)
|
|
197
200
|
}
|
|
198
201
|
),
|
|
199
|
-
|
|
202
|
+
n
|
|
200
203
|
]
|
|
201
204
|
},
|
|
202
|
-
|
|
205
|
+
n
|
|
203
206
|
)) })
|
|
204
207
|
] })
|
|
205
208
|
] }) })
|
|
206
209
|
] }) : /* @__PURE__ */ e(
|
|
207
210
|
te,
|
|
208
211
|
{
|
|
209
|
-
value:
|
|
210
|
-
onChange: (
|
|
212
|
+
value: x,
|
|
213
|
+
onChange: (n) => U(n.target.value),
|
|
211
214
|
placeholder: "e.g. division_id",
|
|
212
215
|
className: "h-8 font-mono text-[12px]"
|
|
213
216
|
}
|
|
@@ -219,7 +222,7 @@ function Re({
|
|
|
219
222
|
"button",
|
|
220
223
|
{
|
|
221
224
|
type: "button",
|
|
222
|
-
onClick:
|
|
225
|
+
onClick: me,
|
|
223
226
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-muted",
|
|
224
227
|
children: "Cancel"
|
|
225
228
|
}
|
|
@@ -228,8 +231,8 @@ function Re({
|
|
|
228
231
|
ee,
|
|
229
232
|
{
|
|
230
233
|
size: "sm",
|
|
231
|
-
disabled: !g || !
|
|
232
|
-
onClick:
|
|
234
|
+
disabled: !g || !x.trim(),
|
|
235
|
+
onClick: pe,
|
|
233
236
|
className: "h-7 px-3 py-1.5 text-[12px]",
|
|
234
237
|
children: "Save"
|
|
235
238
|
}
|
|
@@ -238,36 +241,36 @@ function Re({
|
|
|
238
241
|
]
|
|
239
242
|
},
|
|
240
243
|
s
|
|
241
|
-
) : /* @__PURE__ */ a("div", { className:
|
|
244
|
+
) : /* @__PURE__ */ a("div", { className: u(B, "space-y-2 p-3"), children: [
|
|
242
245
|
/* @__PURE__ */ a(
|
|
243
246
|
"div",
|
|
244
247
|
{
|
|
245
248
|
className: "flex items-center gap-1.5",
|
|
246
249
|
"data-setting": "field.cascade_filters.parent_field",
|
|
247
250
|
children: [
|
|
248
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children:
|
|
249
|
-
|
|
251
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: o }),
|
|
252
|
+
ge && /* @__PURE__ */ e("span", { className: "rounded px-1 py-0.5 text-[11px] font-semibold bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400", children: "M2M" }),
|
|
250
253
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
251
254
|
/* @__PURE__ */ e(
|
|
252
255
|
"button",
|
|
253
256
|
{
|
|
254
257
|
type: "button",
|
|
255
|
-
onClick: () =>
|
|
258
|
+
onClick: () => oe(s),
|
|
256
259
|
"aria-label": "Edit filter",
|
|
257
260
|
"data-tip": "Edit filter",
|
|
258
261
|
className: "inline-flex h-6 w-6 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-200/60 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-foreground",
|
|
259
|
-
children: /* @__PURE__ */ e(
|
|
262
|
+
children: /* @__PURE__ */ e(ke, { className: "h-3 w-3" })
|
|
260
263
|
}
|
|
261
264
|
),
|
|
262
265
|
/* @__PURE__ */ e(
|
|
263
266
|
"button",
|
|
264
267
|
{
|
|
265
268
|
type: "button",
|
|
266
|
-
onClick: () =>
|
|
269
|
+
onClick: () => he(s),
|
|
267
270
|
"aria-label": "Remove filter",
|
|
268
271
|
"data-tip": "Remove filter",
|
|
269
272
|
className: "inline-flex h-6 w-6 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-200/60 hover:text-red-600 dark:hover:bg-muted dark:hover:text-red-400",
|
|
270
|
-
children: /* @__PURE__ */ e(
|
|
273
|
+
children: /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" })
|
|
271
274
|
}
|
|
272
275
|
)
|
|
273
276
|
]
|
|
@@ -286,11 +289,11 @@ function Re({
|
|
|
286
289
|
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: "Clear on parent change" }),
|
|
287
290
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
288
291
|
/* @__PURE__ */ e(
|
|
289
|
-
|
|
292
|
+
b,
|
|
290
293
|
{
|
|
291
294
|
checked: t.clear_on_parent_change,
|
|
292
|
-
onCheckedChange: (
|
|
293
|
-
className:
|
|
295
|
+
onCheckedChange: (n) => fe(s, n),
|
|
296
|
+
className: A
|
|
294
297
|
}
|
|
295
298
|
)
|
|
296
299
|
]
|
|
@@ -305,11 +308,11 @@ function Re({
|
|
|
305
308
|
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: "Clear if value unavailable" }),
|
|
306
309
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
307
310
|
/* @__PURE__ */ e(
|
|
308
|
-
|
|
311
|
+
b,
|
|
309
312
|
{
|
|
310
313
|
checked: t.clear_on_unavailable ?? !1,
|
|
311
|
-
onCheckedChange: (
|
|
312
|
-
className:
|
|
314
|
+
onCheckedChange: (n) => xe(s, n),
|
|
315
|
+
className: A
|
|
313
316
|
}
|
|
314
317
|
)
|
|
315
318
|
]
|
|
@@ -324,11 +327,11 @@ function Re({
|
|
|
324
327
|
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: "Show all options if parent not set" }),
|
|
325
328
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
326
329
|
/* @__PURE__ */ e(
|
|
327
|
-
|
|
330
|
+
b,
|
|
328
331
|
{
|
|
329
332
|
checked: t.show_all_if_no_parent ?? !0,
|
|
330
|
-
onCheckedChange: (
|
|
331
|
-
className:
|
|
333
|
+
onCheckedChange: (n) => ue(s, n),
|
|
334
|
+
className: A
|
|
332
335
|
}
|
|
333
336
|
)
|
|
334
337
|
]
|
|
@@ -350,47 +353,69 @@ function Re({
|
|
|
350
353
|
),
|
|
351
354
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
352
355
|
/* @__PURE__ */ e(
|
|
353
|
-
|
|
356
|
+
b,
|
|
354
357
|
{
|
|
355
358
|
checked: t.upstream ?? !1,
|
|
356
|
-
onCheckedChange: (
|
|
357
|
-
className:
|
|
359
|
+
onCheckedChange: (n) => be(s, n),
|
|
360
|
+
className: A
|
|
358
361
|
}
|
|
359
362
|
)
|
|
360
363
|
]
|
|
361
364
|
}
|
|
365
|
+
),
|
|
366
|
+
/* @__PURE__ */ e(
|
|
367
|
+
we,
|
|
368
|
+
{
|
|
369
|
+
kind: "cascade-filter",
|
|
370
|
+
sentences: ye(
|
|
371
|
+
t,
|
|
372
|
+
{ field: "__picker", relatedCollection: i },
|
|
373
|
+
{
|
|
374
|
+
fields: {
|
|
375
|
+
__picker: ae ?? "This picker",
|
|
376
|
+
...Object.fromEntries(m.map((n) => [n.field, n.label]))
|
|
377
|
+
},
|
|
378
|
+
relatedFields: i ? {
|
|
379
|
+
[i]: Object.fromEntries(
|
|
380
|
+
((r == null ? void 0 : r.fields) ?? []).filter((n) => n.label).map((n) => [n.field, n.label])
|
|
381
|
+
)
|
|
382
|
+
} : void 0,
|
|
383
|
+
collections: i && (r != null && r.display_name) ? { [i]: String(r.display_name) } : void 0
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
}
|
|
362
387
|
)
|
|
363
388
|
] }, s);
|
|
364
389
|
}) }),
|
|
365
|
-
!
|
|
390
|
+
!L && /* @__PURE__ */ a(
|
|
366
391
|
"button",
|
|
367
392
|
{
|
|
368
393
|
type: "button",
|
|
369
|
-
onClick:
|
|
394
|
+
onClick: ce,
|
|
370
395
|
className: "flex items-center gap-1 text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan",
|
|
371
396
|
children: [
|
|
372
|
-
/* @__PURE__ */ e(
|
|
373
|
-
|
|
397
|
+
/* @__PURE__ */ e(_e, { className: "h-3 w-3" }),
|
|
398
|
+
d.length > 0 ? "Add another filter" : "Add cascade filter"
|
|
374
399
|
]
|
|
375
400
|
}
|
|
376
401
|
),
|
|
377
|
-
|
|
402
|
+
L && /* @__PURE__ */ a(
|
|
378
403
|
"div",
|
|
379
404
|
{
|
|
380
|
-
className:
|
|
405
|
+
className: u(B, "space-y-3 p-3"),
|
|
381
406
|
style: { transition: "opacity 150ms ease-out" },
|
|
382
407
|
children: [
|
|
383
408
|
/* @__PURE__ */ a("div", { children: [
|
|
384
409
|
/* @__PURE__ */ e("p", { className: "mb-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Parent field" }),
|
|
385
410
|
/* @__PURE__ */ a(E, { open: le, onOpenChange: $, children: [
|
|
386
|
-
/* @__PURE__ */ e(
|
|
411
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ a(
|
|
387
412
|
"button",
|
|
388
413
|
{
|
|
389
414
|
type: "button",
|
|
390
415
|
className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-[13px] text-slate-700 hover:bg-muted dark:border-border dark:bg-background dark:text-foreground",
|
|
391
416
|
children: [
|
|
392
417
|
(() => {
|
|
393
|
-
const t =
|
|
418
|
+
const t = m.find((s) => s.field === h);
|
|
394
419
|
return t ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
395
420
|
t.label,
|
|
396
421
|
t.kind === "M2M" && /* @__PURE__ */ e("span", { className: "rounded px-1 py-0.5 text-[11px] font-semibold bg-amber-100 text-amber-700 dark:bg-amber-400/15 dark:text-amber-300", children: "M2M" })
|
|
@@ -400,25 +425,25 @@ function Re({
|
|
|
400
425
|
]
|
|
401
426
|
}
|
|
402
427
|
) }),
|
|
403
|
-
/* @__PURE__ */ e(F, { className: "w-56 p-0", align: "start", children: /* @__PURE__ */ a(
|
|
404
|
-
/* @__PURE__ */ e(
|
|
405
|
-
/* @__PURE__ */ a(
|
|
406
|
-
/* @__PURE__ */ e(
|
|
407
|
-
/* @__PURE__ */ e(P, { children:
|
|
428
|
+
/* @__PURE__ */ e(F, { className: "w-56 p-0", align: "start", children: /* @__PURE__ */ a(w, { children: [
|
|
429
|
+
/* @__PURE__ */ e(C, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
|
|
430
|
+
/* @__PURE__ */ a(S, { children: [
|
|
431
|
+
/* @__PURE__ */ e(M, { className: "py-3 text-center text-[12px] text-slate-400", children: "No relation fields" }),
|
|
432
|
+
/* @__PURE__ */ e(P, { children: m.map((t) => /* @__PURE__ */ a(
|
|
408
433
|
O,
|
|
409
434
|
{
|
|
410
435
|
value: t.label,
|
|
411
436
|
onSelect: () => {
|
|
412
|
-
|
|
437
|
+
T(t.field), $(!1);
|
|
413
438
|
},
|
|
414
439
|
className: "text-[12px]",
|
|
415
440
|
children: [
|
|
416
441
|
/* @__PURE__ */ e(
|
|
417
442
|
y,
|
|
418
443
|
{
|
|
419
|
-
className:
|
|
444
|
+
className: u(
|
|
420
445
|
"mr-1.5 h-3 w-3 shrink-0",
|
|
421
|
-
|
|
446
|
+
h === t.field ? "opacity-100" : "opacity-0"
|
|
422
447
|
)
|
|
423
448
|
}
|
|
424
449
|
),
|
|
@@ -431,44 +456,44 @@ function Re({
|
|
|
431
456
|
] })
|
|
432
457
|
] }) })
|
|
433
458
|
] }),
|
|
434
|
-
|
|
459
|
+
h && ((Z = m.find((t) => t.field === h)) == null ? void 0 : Z.kind) === "M2M" && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-amber-600 dark:text-amber-400", children: "M2M parent: the first staged selection's value is used as the filter." })
|
|
435
460
|
] }),
|
|
436
461
|
/* @__PURE__ */ a("div", { "data-setting": "field.cascade_filters.filter_column", children: [
|
|
437
462
|
/* @__PURE__ */ a("p", { className: "mb-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
438
463
|
"Filter column on",
|
|
439
|
-
|
|
464
|
+
i ? ` ${i}` : " related table"
|
|
440
465
|
] }),
|
|
441
|
-
v.length > 0 ? /* @__PURE__ */ a(E, { open:
|
|
442
|
-
/* @__PURE__ */ e(
|
|
466
|
+
v.length > 0 ? /* @__PURE__ */ a(E, { open: ne, onOpenChange: z, children: [
|
|
467
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ a(
|
|
443
468
|
"button",
|
|
444
469
|
{
|
|
445
470
|
type: "button",
|
|
446
471
|
className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-[13px] hover:bg-muted dark:border-border dark:bg-background",
|
|
447
472
|
children: [
|
|
448
|
-
/* @__PURE__ */ e("span", { className:
|
|
473
|
+
/* @__PURE__ */ e("span", { className: f ? "font-mono text-slate-700" : "text-slate-400", children: f || "Select column…" }),
|
|
449
474
|
/* @__PURE__ */ e(_, { className: "h-3 w-3 text-slate-400" })
|
|
450
475
|
]
|
|
451
476
|
}
|
|
452
477
|
) }),
|
|
453
|
-
/* @__PURE__ */ e(F, { className: "w-52 p-0", align: "start", children: /* @__PURE__ */ a(
|
|
454
|
-
/* @__PURE__ */ e(
|
|
455
|
-
/* @__PURE__ */ a(
|
|
456
|
-
/* @__PURE__ */ e(
|
|
478
|
+
/* @__PURE__ */ e(F, { className: "w-52 p-0", align: "start", children: /* @__PURE__ */ a(w, { children: [
|
|
479
|
+
/* @__PURE__ */ e(C, { placeholder: "Search columns…", className: "h-8 text-[12px]" }),
|
|
480
|
+
/* @__PURE__ */ a(S, { children: [
|
|
481
|
+
/* @__PURE__ */ e(M, { className: "py-3 text-center text-[12px] text-slate-400", children: "No columns" }),
|
|
457
482
|
/* @__PURE__ */ e(P, { children: v.map((t) => /* @__PURE__ */ a(
|
|
458
483
|
O,
|
|
459
484
|
{
|
|
460
485
|
value: t,
|
|
461
486
|
onSelect: () => {
|
|
462
|
-
R(t),
|
|
487
|
+
R(t), z(!1);
|
|
463
488
|
},
|
|
464
489
|
className: "font-mono text-[12px]",
|
|
465
490
|
children: [
|
|
466
491
|
/* @__PURE__ */ e(
|
|
467
492
|
y,
|
|
468
493
|
{
|
|
469
|
-
className:
|
|
494
|
+
className: u(
|
|
470
495
|
"mr-1.5 h-3 w-3 shrink-0",
|
|
471
|
-
|
|
496
|
+
f === t ? "opacity-100" : "opacity-0"
|
|
472
497
|
)
|
|
473
498
|
}
|
|
474
499
|
),
|
|
@@ -482,7 +507,7 @@ function Re({
|
|
|
482
507
|
] }) : /* @__PURE__ */ e(
|
|
483
508
|
te,
|
|
484
509
|
{
|
|
485
|
-
value:
|
|
510
|
+
value: f,
|
|
486
511
|
onChange: (t) => R(t.target.value),
|
|
487
512
|
placeholder: "e.g. division_id",
|
|
488
513
|
className: "h-8 font-mono text-[12px]"
|
|
@@ -492,7 +517,7 @@ function Re({
|
|
|
492
517
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
493
518
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
494
519
|
/* @__PURE__ */ e(
|
|
495
|
-
|
|
520
|
+
b,
|
|
496
521
|
{
|
|
497
522
|
checked: W,
|
|
498
523
|
onCheckedChange: X,
|
|
@@ -503,7 +528,7 @@ function Re({
|
|
|
503
528
|
] }),
|
|
504
529
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
505
530
|
/* @__PURE__ */ e(
|
|
506
|
-
|
|
531
|
+
b,
|
|
507
532
|
{
|
|
508
533
|
checked: q,
|
|
509
534
|
onCheckedChange: J,
|
|
@@ -514,7 +539,7 @@ function Re({
|
|
|
514
539
|
] }),
|
|
515
540
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
516
541
|
/* @__PURE__ */ e(
|
|
517
|
-
|
|
542
|
+
b,
|
|
518
543
|
{
|
|
519
544
|
checked: K,
|
|
520
545
|
onCheckedChange: Q,
|
|
@@ -530,7 +555,7 @@ function Re({
|
|
|
530
555
|
"button",
|
|
531
556
|
{
|
|
532
557
|
type: "button",
|
|
533
|
-
onClick:
|
|
558
|
+
onClick: de,
|
|
534
559
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-muted",
|
|
535
560
|
children: "Cancel"
|
|
536
561
|
}
|
|
@@ -539,8 +564,8 @@ function Re({
|
|
|
539
564
|
ee,
|
|
540
565
|
{
|
|
541
566
|
size: "sm",
|
|
542
|
-
disabled: !
|
|
543
|
-
onClick:
|
|
567
|
+
disabled: !h || !f.trim(),
|
|
568
|
+
onClick: ie,
|
|
544
569
|
className: "h-7 px-3 py-1.5 text-[12px]",
|
|
545
570
|
children: "Save"
|
|
546
571
|
}
|
|
@@ -552,5 +577,5 @@ function Re({
|
|
|
552
577
|
] });
|
|
553
578
|
}
|
|
554
579
|
export {
|
|
555
|
-
|
|
580
|
+
ze as CascadeFiltersEditor
|
|
556
581
|
};
|