@nivaro/react 0.3.40 → 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.
Files changed (99) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +645 -16
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/PickerExcludedRows.js +3 -3
  20. package/dist/shared/components/ProfileView.js +776 -1003
  21. package/dist/shared/components/RecentRecordsRail.js +34 -16
  22. package/dist/shared/components/RecordReadView.js +500 -477
  23. package/dist/shared/components/Skeletons.js +199 -0
  24. package/dist/shared/components/SlowNotice.js +63 -0
  25. package/dist/shared/components/Term.js +23 -0
  26. package/dist/shared/components/WidgetSlot.js +350 -353
  27. package/dist/shared/components/access/PermissionSummary.js +106 -0
  28. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  29. package/dist/shared/components/chat/ChatPanel.js +902 -886
  30. package/dist/shared/components/chat/MemberPaging.js +70 -0
  31. package/dist/shared/components/chat/RoomParts.js +147 -117
  32. package/dist/shared/components/chat/ScreenClip.js +73 -69
  33. package/dist/shared/components/chat/chat-core.js +449 -396
  34. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  35. package/dist/shared/components/help-videos/api.js +2 -5
  36. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  37. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  38. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  39. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  40. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  41. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  42. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  43. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  44. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  45. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  46. package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
  47. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  48. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  49. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  50. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  51. package/dist/shared/components/item-edit/field-sources.js +33 -0
  52. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  53. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  54. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  55. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  56. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  57. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  58. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  59. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  60. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  61. package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
  62. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  63. package/dist/shared/components/list/InlineEdit.js +363 -0
  64. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  65. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  66. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  67. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  68. package/dist/shared/components/notifications/changes-lines.js +24 -0
  69. package/dist/shared/components/notifications/why-lines.js +64 -0
  70. package/dist/shared/components/panels/CommentPanel.js +316 -281
  71. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  72. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  73. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  74. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  75. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  76. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  77. package/dist/shared/components/profile/PersonProfile.js +57 -52
  78. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  79. package/dist/shared/hooks/useSlowReason.js +39 -0
  80. package/dist/shared/lib/activity-sentence.js +670 -0
  81. package/dist/shared/lib/config-sentences.js +418 -0
  82. package/dist/shared/lib/core-glossary.js +229 -0
  83. package/dist/shared/lib/error-hints.js +159 -0
  84. package/dist/shared/lib/error-message.js +105 -0
  85. package/dist/shared/lib/error-toast.js +22 -0
  86. package/dist/shared/lib/field-comments.js +25 -0
  87. package/dist/shared/lib/filter-sentence.js +261 -0
  88. package/dist/shared/lib/glossary.js +55 -48
  89. package/dist/shared/lib/idle-reload.js +138 -0
  90. package/dist/shared/lib/layout-resolve.js +42 -29
  91. package/dist/shared/lib/list-inline-edit.js +190 -0
  92. package/dist/shared/lib/list-link.js +147 -0
  93. package/dist/shared/lib/prefetch.js +259 -106
  94. package/dist/shared/lib/record-ref.js +72 -0
  95. package/dist/shared/lib/reload-holds.js +25 -0
  96. package/dist/shared/lib/safe-error.js +52 -24
  97. package/dist/shared/lib/skeleton-shapes.js +72 -0
  98. package/dist/shared/lib/slow-reason.js +63 -0
  99. 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 Ne, X as ke, Plus as ve } from "lucide-react";
3
- import { useState as r } from "react";
4
- import { cn as h } from "../../../lib/utils.js";
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 C, CommandInput as w, CommandList as M, CommandEmpty as S, CommandGroup as P, CommandItem as O } from "../../ui/command.js";
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 A, PopoverContent as F } from "../../ui/popover.js";
9
- import { Switch as x } from "../../ui/switch.js";
10
- import { useCollectionBody as _e } from "../collection-meta.js";
11
- import { tintCard as L } from "../panel-style.js";
12
- const j = "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";
13
- function Re({
14
- rules: c,
15
- m2oFields: f,
16
- relatedCollection: b,
17
- onChange: i
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 [z, N] = r(!1), [I, k] = r(null), [o, B] = r(""), [m, R] = r(""), [ae, T] = r(!1), [le, $] = r(!1), [ne, D] = r(!1), [se, G] = r(!1), [g, H] = r(""), [p, U] = r(""), { data: u } = _e(b), v = ((Y = u == null ? void 0 : u.fields) == null ? void 0 : Y.map((t) => t.field)) ?? [], [W, X] = r(!0), [q, J] = r(!1), [K, Q] = r(!0);
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 ((u == null ? void 0 : u.relations) ?? []).some((n) => n.one_field === t && !!n.junction_field);
31
+ return ((r == null ? void 0 : r.relations) ?? []).some((l) => l.one_field === t && !!l.junction_field);
29
32
  }
30
- function de() {
31
- if (!o.trim() || !m.trim()) return;
32
- const t = m.trim();
33
- i([
34
- ...c,
33
+ function ie() {
34
+ if (!h.trim() || !f.trim()) return;
35
+ const t = f.trim();
36
+ p([
37
+ ...d,
35
38
  {
36
- parent_field: o.trim(),
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 ie(t) {
46
- N(!1), H(c[t].parent_field), U(c[t].filter_column), k(t);
48
+ function oe(t) {
49
+ N(!1), H(d[t].parent_field), U(d[t].filter_column), k(t);
47
50
  }
48
- function oe() {
51
+ function me() {
49
52
  k(null);
50
53
  }
51
- function me() {
52
- if (I === null || !g.trim() || !p.trim()) return;
53
- const t = p.trim();
54
- i(
55
- c.map(
56
- (s, n) => n === I ? {
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 pe(t) {
66
- i(c.filter((s, n) => n !== t));
68
+ function he(t) {
69
+ p(d.filter((s, l) => l !== t));
67
70
  }
68
- function he(t, s) {
69
- i(
70
- c.map(
71
- (n, d) => d === t ? {
72
- ...n,
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: n.clear_on_unavailable ?? !1
75
- } : n
77
+ clear_on_unavailable: l.clear_on_unavailable ?? !1
78
+ } : l
76
79
  )
77
80
  );
78
81
  }
79
82
  function xe(t, s) {
80
- i(c.map((n, d) => d === t ? { ...n, clear_on_unavailable: s } : n));
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
- i(c.map((n, d) => d === t ? { ...n, upstream: s } : n));
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
- c.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2", children: c.map((t, s) => {
90
- const n = f.find((l) => l.field === t.parent_field), d = (n == null ? void 0 : n.label) ?? t.parent_field, be = (n == null ? void 0 : n.kind) === "M2M";
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: h(L, "space-y-3 p-3 ring-nvr-cyan/40 dark:ring-nvr-cyan/30"),
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: ne, onOpenChange: D, children: [
99
- /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ a(
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 l = f.find((ge) => ge.field === g);
107
- return l ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
108
- l.label,
109
- l.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" })
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(C, { children: [
117
- /* @__PURE__ */ e(w, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
118
- /* @__PURE__ */ a(M, { children: [
119
- /* @__PURE__ */ e(S, { className: "py-3 text-center text-[12px] text-slate-400", children: "No relation fields" }),
120
- /* @__PURE__ */ e(P, { children: f.map((l) => /* @__PURE__ */ a(
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: l.label,
126
+ value: n.label,
124
127
  onSelect: () => {
125
- H(l.field), D(!1);
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: h(
135
+ className: u(
133
136
  "mr-1.5 h-3 w-3 shrink-0",
134
- g === l.field ? "opacity-100" : "opacity-0"
137
+ g === n.field ? "opacity-100" : "opacity-0"
135
138
  )
136
139
  }
137
140
  ),
138
- /* @__PURE__ */ e("span", { className: "flex-1", children: l.label }),
139
- l.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" })
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
- l.field
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
- b ? ` ${b}` : " related table"
154
+ i ? ` ${i}` : " related table"
152
155
  ] }),
153
- v.length > 0 ? /* @__PURE__ */ a(E, { open: se, onOpenChange: G, children: [
154
- /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ a(
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: p ? "font-mono text-slate-700" : "text-slate-400",
164
- children: p || "Select column…"
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(C, { children: [
174
+ /* @__PURE__ */ e(F, { className: "w-52 p-0", align: "start", children: /* @__PURE__ */ a(w, { children: [
172
175
  /* @__PURE__ */ e(
173
- w,
176
+ C,
174
177
  {
175
178
  placeholder: "Search columns…",
176
179
  className: "h-8 text-[12px]"
177
180
  }
178
181
  ),
179
- /* @__PURE__ */ a(M, { children: [
180
- /* @__PURE__ */ e(S, { className: "py-3 text-center text-[12px] text-slate-400", children: "No columns" }),
181
- /* @__PURE__ */ e(P, { children: v.map((l) => /* @__PURE__ */ a(
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: l,
187
+ value: n,
185
188
  onSelect: () => {
186
- U(l), G(!1);
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: h(
196
+ className: u(
194
197
  "mr-1.5 h-3 w-3 shrink-0",
195
- p === l ? "opacity-100" : "opacity-0"
198
+ x === n ? "opacity-100" : "opacity-0"
196
199
  )
197
200
  }
198
201
  ),
199
- l
202
+ n
200
203
  ]
201
204
  },
202
- l
205
+ n
203
206
  )) })
204
207
  ] })
205
208
  ] }) })
206
209
  ] }) : /* @__PURE__ */ e(
207
210
  te,
208
211
  {
209
- value: p,
210
- onChange: (l) => U(l.target.value),
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: oe,
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 || !p.trim(),
232
- onClick: me,
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: h(L, "space-y-2 p-3"), children: [
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: d }),
249
- be && /* @__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" }),
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: () => ie(s),
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(Ne, { className: "h-3 w-3" })
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: () => pe(s),
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(ke, { className: "h-3.5 w-3.5" })
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
- x,
292
+ b,
290
293
  {
291
294
  checked: t.clear_on_parent_change,
292
- onCheckedChange: (l) => he(s, l),
293
- className: j
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
- x,
311
+ b,
309
312
  {
310
313
  checked: t.clear_on_unavailable ?? !1,
311
- onCheckedChange: (l) => xe(s, l),
312
- className: j
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
- x,
330
+ b,
328
331
  {
329
332
  checked: t.show_all_if_no_parent ?? !0,
330
- onCheckedChange: (l) => fe(s, l),
331
- className: j
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
- x,
356
+ b,
354
357
  {
355
358
  checked: t.upstream ?? !1,
356
- onCheckedChange: (l) => ue(s, l),
357
- className: j
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
- !z && /* @__PURE__ */ a(
390
+ !L && /* @__PURE__ */ a(
366
391
  "button",
367
392
  {
368
393
  type: "button",
369
- onClick: re,
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(ve, { className: "h-3 w-3" }),
373
- c.length > 0 ? "Add another filter" : "Add cascade filter"
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
- z && /* @__PURE__ */ a(
402
+ L && /* @__PURE__ */ a(
378
403
  "div",
379
404
  {
380
- className: h(L, "space-y-3 p-3"),
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(A, { asChild: !0, children: /* @__PURE__ */ a(
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 = f.find((s) => s.field === o);
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(C, { children: [
404
- /* @__PURE__ */ e(w, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
405
- /* @__PURE__ */ a(M, { children: [
406
- /* @__PURE__ */ e(S, { className: "py-3 text-center text-[12px] text-slate-400", children: "No relation fields" }),
407
- /* @__PURE__ */ e(P, { children: f.map((t) => /* @__PURE__ */ a(
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
- B(t.field), $(!1);
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: h(
444
+ className: u(
420
445
  "mr-1.5 h-3 w-3 shrink-0",
421
- o === t.field ? "opacity-100" : "opacity-0"
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
- o && ((Z = f.find((t) => t.field === o)) == 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." })
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
- b ? ` ${b}` : " related table"
464
+ i ? ` ${i}` : " related table"
440
465
  ] }),
441
- v.length > 0 ? /* @__PURE__ */ a(E, { open: ae, onOpenChange: T, children: [
442
- /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ a(
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: m ? "font-mono text-slate-700" : "text-slate-400", children: m || "Select column…" }),
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(C, { children: [
454
- /* @__PURE__ */ e(w, { placeholder: "Search columns…", className: "h-8 text-[12px]" }),
455
- /* @__PURE__ */ a(M, { children: [
456
- /* @__PURE__ */ e(S, { className: "py-3 text-center text-[12px] text-slate-400", children: "No columns" }),
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), T(!1);
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: h(
494
+ className: u(
470
495
  "mr-1.5 h-3 w-3 shrink-0",
471
- m === t ? "opacity-100" : "opacity-0"
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: m,
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
- x,
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
- x,
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
- x,
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: ce,
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: !o || !m.trim(),
543
- onClick: de,
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
- Re as CascadeFiltersEditor
580
+ ze as CascadeFiltersEditor
556
581
  };