@nivaro/react 0.3.57 → 0.3.59
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/RelationField.js +110 -80
- package/dist/full.css +1 -1
- package/dist/hooks/useRelationOptions.js +1 -0
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +37 -2
- package/dist/index.js +523 -520
- package/dist/shared/components/CollectionBrowserView.js +2693 -2619
- package/dist/shared/components/DataTable.js +538 -495
- package/dist/shared/components/ItemEditForm.js +4559 -4386
- package/dist/shared/components/PageRenderer.js +537 -508
- package/dist/shared/components/ProfileView.js +716 -715
- package/dist/shared/components/QueryTable.js +74 -74
- package/dist/shared/components/RecordReadView.js +367 -364
- package/dist/shared/components/ReportView.js +64 -39
- package/dist/shared/components/WidgetSlot.js +543 -520
- package/dist/shared/components/alerts/AlertManagerView.js +324 -317
- package/dist/shared/components/alerts/types.js +37 -14
- package/dist/shared/components/cbv/row-focus.js +19 -0
- package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
- package/dist/shared/components/integrations/console/SignalCard.js +59 -59
- package/dist/shared/components/integrations/console/tone.js +52 -30
- package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
- package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
- package/dist/shared/components/item-edit/FieldRow.js +175 -173
- package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
- package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
- package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
- package/dist/shared/components/item-edit/PlanGrid.js +973 -894
- package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
- package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
- package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
- package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
- package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
- package/dist/shared/components/item-edit/line-midair.js +82 -75
- package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
- package/dist/shared/components/item-edit/related-missing.js +45 -0
- package/dist/shared/components/item-edit/save-outcome.js +9 -7
- package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
- package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
- package/dist/shared/components/panels/ItemLockBanner.js +213 -211
- package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
- package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
- package/dist/shared/components/panels/RevisionsPanel.js +316 -299
- package/dist/shared/components/panels/TaskPanel.js +265 -249
- package/dist/shared/components/panels/landing-state.js +27 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
- package/dist/shared/components/profile/AiMemoryCard.js +12 -10
- package/dist/shared/components/queue/OwnerAvatars.js +80 -41
- package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
- package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
- package/dist/shared/components/queue/group-sums.js +27 -0
- package/dist/shared/components/queue/live-state-aspect.js +9 -5
- package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
- package/dist/shared/lib/back-closes.js +25 -0
- package/dist/shared/lib/display-prefs.js +60 -52
- package/dist/shared/lib/draft-store.js +71 -48
- package/dist/shared/lib/expression.js +53 -53
- package/dist/shared/lib/form-usage-beacon.js +7 -7
- package/dist/shared/lib/list-page-memory.js +63 -0
- package/dist/shared/lib/live.js +44 -44
- package/dist/shared/lib/money-input.js +45 -0
- package/dist/shared/lib/own-writes.js +76 -28
- package/dist/shared/lib/request-gate.js +110 -109
- package/dist/shared/lib/sanitize-html.js +10 -6
- package/dist/shared/lib/staged-row-labels.js +18 -0
- package/dist/shared/lib/validation-rules.js +34 -19
- package/package.json +1 -1
|
@@ -1,104 +1,105 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { RotateCcw as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { titleCase as
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { FieldRenderer as
|
|
7
|
-
function
|
|
1
|
+
import { jsx as l, jsxs as i, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { RotateCcw as B, Loader2 as F } from "lucide-react";
|
|
3
|
+
import { useState as k, useMemo as j, useEffect as L } from "react";
|
|
4
|
+
import { titleCase as R, cn as G } from "../../lib/utils.js";
|
|
5
|
+
import { Dialog as H, DialogContent as M, DialogHeader as O, DialogTitle as V, DialogDescription as q, DialogBody as J, DialogFooter as K } from "../ui/dialog.js";
|
|
6
|
+
import { FieldRenderer as P } from "./FieldRenderer.js";
|
|
7
|
+
function _({
|
|
8
8
|
open: p,
|
|
9
9
|
onOpenChange: u,
|
|
10
10
|
columns: o,
|
|
11
11
|
rows: d,
|
|
12
|
-
relations:
|
|
13
|
-
collection:
|
|
12
|
+
relations: w,
|
|
13
|
+
collection: D,
|
|
14
14
|
cascadeFilters: f,
|
|
15
|
-
onApply:
|
|
15
|
+
onApply: C,
|
|
16
|
+
onEditIntent: h
|
|
16
17
|
}) {
|
|
17
|
-
const [
|
|
18
|
+
const [N, x] = k({}), [n, g] = k(/* @__PURE__ */ new Set()), [s, b] = k(!1), v = j(() => {
|
|
18
19
|
const e = {};
|
|
19
20
|
for (const a of o) {
|
|
20
21
|
if (d.length === 0) {
|
|
21
22
|
e[a.field] = { value: null, varies: !1 };
|
|
22
23
|
continue;
|
|
23
24
|
}
|
|
24
|
-
const t = d[0][a.field] ?? null, c = d.every((
|
|
25
|
+
const t = d[0][a.field] ?? null, c = d.every((y) => String(y[a.field] ?? "") === String(t ?? ""));
|
|
25
26
|
e[a.field] = { value: c ? t : null, varies: !c };
|
|
26
27
|
}
|
|
27
28
|
return e;
|
|
28
29
|
}, [o, d]);
|
|
29
|
-
|
|
30
|
+
L(() => {
|
|
30
31
|
var a;
|
|
31
32
|
if (!p) return;
|
|
32
33
|
const e = {};
|
|
33
|
-
for (const t of o) e[t.field] = ((a =
|
|
34
|
-
|
|
34
|
+
for (const t of o) e[t.field] = ((a = v[t.field]) == null ? void 0 : a.value) ?? null;
|
|
35
|
+
x(e), g(/* @__PURE__ */ new Set()), b(!1);
|
|
35
36
|
}, [p]);
|
|
36
|
-
const
|
|
37
|
-
h((t) => ({ ...t, [e]: a })),
|
|
38
|
-
},
|
|
39
|
-
|
|
37
|
+
const $ = (e, a) => {
|
|
38
|
+
h == null || h(), x((t) => ({ ...t, [e]: a })), g((t) => /* @__PURE__ */ new Set([...t, e]));
|
|
39
|
+
}, S = (e) => {
|
|
40
|
+
x((a) => {
|
|
40
41
|
var t;
|
|
41
|
-
return { ...a, [e]: ((t =
|
|
42
|
-
}),
|
|
42
|
+
return { ...a, [e]: ((t = v[e]) == null ? void 0 : t.value) ?? null };
|
|
43
|
+
}), g((a) => {
|
|
43
44
|
const t = new Set(a);
|
|
44
45
|
return t.delete(e), t;
|
|
45
46
|
});
|
|
46
47
|
}, r = d.length, m = r === 1 ? "line" : "lines";
|
|
47
|
-
async function
|
|
48
|
-
if (
|
|
48
|
+
async function T() {
|
|
49
|
+
if (n.size === 0 || s) return;
|
|
49
50
|
const e = {};
|
|
50
|
-
for (const a of
|
|
51
|
-
|
|
51
|
+
for (const a of n) e[a] = N[a] ?? null;
|
|
52
|
+
b(!0);
|
|
52
53
|
try {
|
|
53
|
-
await
|
|
54
|
+
await C(e), u(!1);
|
|
54
55
|
} finally {
|
|
55
|
-
|
|
56
|
+
b(!1);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
return /* @__PURE__ */ l(
|
|
59
|
-
|
|
59
|
+
return /* @__PURE__ */ l(H, { open: p, onOpenChange: (e) => !s && u(e), children: /* @__PURE__ */ i(
|
|
60
|
+
M,
|
|
60
61
|
{
|
|
61
62
|
className: "max-w-3xl dark:bg-card",
|
|
62
63
|
"data-o2m-editing": "",
|
|
63
64
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
64
65
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ i(O, { children: [
|
|
67
|
+
/* @__PURE__ */ i(V, { children: [
|
|
67
68
|
"Edit ",
|
|
68
69
|
r,
|
|
69
70
|
" selected ",
|
|
70
71
|
m
|
|
71
72
|
] }),
|
|
72
|
-
/* @__PURE__ */ l(
|
|
73
|
+
/* @__PURE__ */ l(q, { children: "Only the fields you change here are written. Fields left as prefilled keep each line's own value." })
|
|
73
74
|
] }),
|
|
74
|
-
/* @__PURE__ */ l(
|
|
75
|
+
/* @__PURE__ */ l(J, { className: "max-h-[60vh] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ l("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "This table has no columns that can be edited in bulk." }) : /* @__PURE__ */ l(
|
|
75
76
|
"div",
|
|
76
77
|
{
|
|
77
78
|
className: "grid items-start gap-x-4 gap-y-3",
|
|
78
79
|
style: { gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))" },
|
|
79
80
|
children: o.map((e) => {
|
|
80
|
-
const a = e.label ||
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
const a = e.label || R(e.field), t = v[e.field], c = n.has(e.field), y = t != null && t.varies ? { ...e, placeholder: "(varies)", sort: e.sort ?? 0 } : { ...e, sort: e.sort ?? 0 };
|
|
82
|
+
return /* @__PURE__ */ i(
|
|
82
83
|
"div",
|
|
83
84
|
{
|
|
84
|
-
className:
|
|
85
|
+
className: G(
|
|
85
86
|
"flex min-w-0 flex-col gap-1 rounded-md p-1.5 -m-1.5 transition-colors",
|
|
86
87
|
c && "bg-amber-50/70 dark:bg-amber-400/10"
|
|
87
88
|
),
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: [
|
|
90
91
|
/* @__PURE__ */ l("span", { className: "truncate", children: a }),
|
|
91
|
-
c ? /* @__PURE__ */
|
|
92
|
+
c ? /* @__PURE__ */ i(A, { children: [
|
|
92
93
|
/* @__PURE__ */ l("span", { className: "rounded bg-amber-100 px-1 py-px text-[9px] normal-case tracking-normal text-amber-700 dark:bg-amber-400/20 dark:text-amber-300", children: "will apply" }),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ i(
|
|
94
95
|
"button",
|
|
95
96
|
{
|
|
96
97
|
type: "button",
|
|
97
|
-
onClick: () =>
|
|
98
|
+
onClick: () => S(e.field),
|
|
98
99
|
className: "ml-auto inline-flex items-center gap-0.5 rounded px-1 text-[10px] normal-case tracking-normal text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",
|
|
99
100
|
"data-tip": "Leave this field as each line has it",
|
|
100
101
|
children: [
|
|
101
|
-
/* @__PURE__ */ l(
|
|
102
|
+
/* @__PURE__ */ l(B, { className: "h-2.5 w-2.5", "aria-hidden": "true" }),
|
|
102
103
|
"keep"
|
|
103
104
|
]
|
|
104
105
|
}
|
|
@@ -113,13 +114,13 @@ function X({
|
|
|
113
114
|
) : null
|
|
114
115
|
] }),
|
|
115
116
|
/* @__PURE__ */ l(
|
|
116
|
-
|
|
117
|
+
P,
|
|
117
118
|
{
|
|
118
|
-
field:
|
|
119
|
-
value:
|
|
120
|
-
onChange: (
|
|
121
|
-
relations:
|
|
122
|
-
collection:
|
|
119
|
+
field: y,
|
|
120
|
+
value: N[e.field] ?? null,
|
|
121
|
+
onChange: (z) => $(e.field, z),
|
|
122
|
+
relations: w,
|
|
123
|
+
collection: D,
|
|
123
124
|
itemId: "new",
|
|
124
125
|
cascadeFilter: f == null ? void 0 : f[e.field]
|
|
125
126
|
}
|
|
@@ -131,8 +132,8 @@ function X({
|
|
|
131
132
|
})
|
|
132
133
|
}
|
|
133
134
|
) }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children:
|
|
135
|
+
/* @__PURE__ */ i(K, { className: "items-center", children: [
|
|
136
|
+
/* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children: n.size === 0 ? "Change a field to enable Apply" : `${n.size} ${n.size === 1 ? "field" : "fields"} → ${r} ${m}` }),
|
|
136
137
|
/* @__PURE__ */ l(
|
|
137
138
|
"button",
|
|
138
139
|
{
|
|
@@ -143,15 +144,15 @@ function X({
|
|
|
143
144
|
children: "Cancel"
|
|
144
145
|
}
|
|
145
146
|
),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ i(
|
|
147
148
|
"button",
|
|
148
149
|
{
|
|
149
150
|
type: "button",
|
|
150
|
-
disabled: s ||
|
|
151
|
-
onClick: () => void
|
|
151
|
+
disabled: s || n.size === 0 || r === 0,
|
|
152
|
+
onClick: () => void T(),
|
|
152
153
|
className: "inline-flex items-center gap-1.5 rounded bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-50",
|
|
153
154
|
children: [
|
|
154
|
-
s && /* @__PURE__ */ l(
|
|
155
|
+
s && /* @__PURE__ */ l(F, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }),
|
|
155
156
|
s ? "Applying…" : `Apply to ${r} ${m}`
|
|
156
157
|
]
|
|
157
158
|
}
|
|
@@ -162,5 +163,5 @@ function X({
|
|
|
162
163
|
) });
|
|
163
164
|
}
|
|
164
165
|
export {
|
|
165
|
-
|
|
166
|
+
_ as GridBulkEditDialog
|
|
166
167
|
};
|