@nivaro/react 0.3.9 → 0.3.11
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/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +103 -4
- package/dist/index.js +512 -501
- package/dist/shared/components/CollectionBrowserView.js +1632 -1564
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +4386 -4142
- 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 +527 -479
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- 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/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/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2287 -2275
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- 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/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1026 -957
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- 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/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/presence-live.js +54 -35
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { jsxs as g, jsx as s, Fragment as
|
|
1
|
+
import { jsxs as g, jsx as s, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as S } from "@tanstack/react-query";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as d, useEffect as C, useMemo as N } from "react";
|
|
4
4
|
import { MultiPick as x } from "../CollectionBrowserView.js";
|
|
5
|
-
const
|
|
6
|
-
function
|
|
5
|
+
const b = (t) => Array.isArray(t) ? t : t ? [t] : [];
|
|
6
|
+
function O({
|
|
7
7
|
def: t,
|
|
8
|
-
selected:
|
|
9
|
-
onChange:
|
|
10
|
-
badge:
|
|
8
|
+
selected: a,
|
|
9
|
+
onChange: k,
|
|
10
|
+
badge: p
|
|
11
11
|
}) {
|
|
12
|
-
const [
|
|
13
|
-
queryKey: ["queue-quick-facet", t.key,
|
|
14
|
-
queryFn: () => l ? l(
|
|
15
|
-
enabled: !!l && (
|
|
12
|
+
const [h, i] = d(!1), [y, c] = d(""), l = t.loadOptions, { data: u = [], isLoading: e } = S({
|
|
13
|
+
queryKey: ["queue-quick-facet", t.key, y],
|
|
14
|
+
queryFn: () => l ? l(y) : Promise.resolve([]),
|
|
15
|
+
enabled: !!l && (h || a.length > 0),
|
|
16
16
|
staleTime: 6e4
|
|
17
|
-
}), r =
|
|
18
|
-
const
|
|
19
|
-
return [...u, ...
|
|
20
|
-
}, [u,
|
|
17
|
+
}), r = N(() => {
|
|
18
|
+
const o = new Set(u.map((n) => n.value));
|
|
19
|
+
return [...u, ...a.filter((n) => !o.has(n)).map((n) => ({ label: n, value: n }))];
|
|
20
|
+
}, [u, a]);
|
|
21
21
|
return /* @__PURE__ */ s(
|
|
22
22
|
x,
|
|
23
23
|
{
|
|
24
24
|
label: t.placeholder,
|
|
25
25
|
options: r,
|
|
26
|
-
selected:
|
|
27
|
-
onChange: (
|
|
26
|
+
selected: a,
|
|
27
|
+
onChange: (o) => k(o.map(String)),
|
|
28
28
|
loading: e,
|
|
29
|
-
badge:
|
|
29
|
+
badge: p,
|
|
30
30
|
onSearch: c,
|
|
31
|
-
onOpenChange: (
|
|
32
|
-
|
|
31
|
+
onOpenChange: (o) => {
|
|
32
|
+
o && i(!0);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
function Q({
|
|
38
38
|
defs: t,
|
|
39
|
-
values:
|
|
40
|
-
seededKeys:
|
|
41
|
-
onApply:
|
|
42
|
-
onClear:
|
|
39
|
+
values: a,
|
|
40
|
+
seededKeys: k,
|
|
41
|
+
onApply: p,
|
|
42
|
+
onClear: h,
|
|
43
43
|
right: i
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const y = JSON.stringify(t.map((e) => [e.key, b(a[e.key])])), [c, l] = d({});
|
|
46
|
+
C(() => {
|
|
47
47
|
const e = {};
|
|
48
|
-
for (const r of t) e[r.key] =
|
|
48
|
+
for (const r of t) e[r.key] = b(a[r.key]);
|
|
49
49
|
l(e);
|
|
50
|
-
}, [
|
|
50
|
+
}, [y]);
|
|
51
51
|
const u = t.some(
|
|
52
|
-
(e) => JSON.stringify(c[e.key] ?? []) !== JSON.stringify(
|
|
52
|
+
(e) => JSON.stringify(c[e.key] ?? []) !== JSON.stringify(b(a[e.key]))
|
|
53
53
|
);
|
|
54
54
|
return t.length === 0 && !i ? null : /* @__PURE__ */ g(
|
|
55
55
|
"div",
|
|
@@ -58,28 +58,30 @@ function Q({
|
|
|
58
58
|
"data-queue-quick-filters": !0,
|
|
59
59
|
children: [
|
|
60
60
|
t.map((e) => {
|
|
61
|
-
const r = c[e.key] ?? [],
|
|
61
|
+
const r = c[e.key] ?? [], o = e.restricted ? {
|
|
62
62
|
label: "restricted",
|
|
63
63
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
64
64
|
title: `Options limited to your restricted ${e.placeholder} scope`
|
|
65
|
-
} :
|
|
66
|
-
label: "default",
|
|
65
|
+
} : k.has(e.key) && r.length > 0 ? {
|
|
66
|
+
label: "your default",
|
|
67
67
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
68
68
|
title: `Pre-selected from your default ${e.placeholder} scope — adjust freely`
|
|
69
|
-
} : null, n = (
|
|
70
|
-
|
|
69
|
+
} : null, n = (m) => {
|
|
70
|
+
l((q) => ({ ...q, [e.key]: m })), m.length === 0 && b(a[e.key]).length > 0 && p({ [e.key]: e.multi || e.type === "combobox" ? [] : "" });
|
|
71
|
+
};
|
|
72
|
+
return e.loadOptions ? /* @__PURE__ */ s(O, { def: e, selected: r, onChange: n, badge: o }, e.key) : /* @__PURE__ */ s(
|
|
71
73
|
x,
|
|
72
74
|
{
|
|
73
75
|
label: e.placeholder,
|
|
74
76
|
options: e.options ?? [],
|
|
75
77
|
selected: r,
|
|
76
|
-
onChange: (
|
|
77
|
-
badge:
|
|
78
|
+
onChange: (m) => n(m.map(String)),
|
|
79
|
+
badge: o
|
|
78
80
|
},
|
|
79
81
|
e.key
|
|
80
82
|
);
|
|
81
83
|
}),
|
|
82
|
-
t.length > 0 && /* @__PURE__ */ g(
|
|
84
|
+
t.length > 0 && /* @__PURE__ */ g(f, { children: [
|
|
83
85
|
/* @__PURE__ */ s(
|
|
84
86
|
"button",
|
|
85
87
|
{
|
|
@@ -87,10 +89,10 @@ function Q({
|
|
|
87
89
|
onClick: () => {
|
|
88
90
|
const e = {};
|
|
89
91
|
for (const r of t) {
|
|
90
|
-
const
|
|
91
|
-
e[r.key] = r.multi || r.type === "combobox" ?
|
|
92
|
+
const o = c[r.key] ?? [];
|
|
93
|
+
e[r.key] = r.multi || r.type === "combobox" ? o : o[0] ?? "";
|
|
92
94
|
}
|
|
93
|
-
|
|
95
|
+
p(e);
|
|
94
96
|
},
|
|
95
97
|
className: `h-6 rounded px-2.5 text-[11px] font-semibold text-white transition-[filter] hover:brightness-110 ${u ? "bg-nvr-cyan" : "bg-nvr-cyan opacity-60"}`,
|
|
96
98
|
"data-queue-quick-apply": !0,
|
|
@@ -101,7 +103,7 @@ function Q({
|
|
|
101
103
|
"button",
|
|
102
104
|
{
|
|
103
105
|
type: "button",
|
|
104
|
-
onClick:
|
|
106
|
+
onClick: h,
|
|
105
107
|
className: "h-6 rounded border border-slate-200 px-2 text-[11px] text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
|
|
106
108
|
"data-queue-quick-clear": !0,
|
|
107
109
|
children: "Clear"
|