@nivaro/react 0.3.41 → 0.3.43
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 +733 -15
- package/dist/index.js +820 -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/nav-trail.js +107 -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,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { readGroupStructure as
|
|
4
|
-
import { lazySectionsOf as
|
|
1
|
+
import { jsxs as s, jsx as l, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, useEffect as ne } from "react";
|
|
3
|
+
import { readGroupStructure as oe } from "../../../lib/form-structure.js";
|
|
4
|
+
import { lazySectionsOf as ie, quietHiddenSectionsOf as se, lazySectionPatch as re, quietHiddenSectionPatch as de } from "../../../lib/layout-resolve.js";
|
|
5
5
|
import { titleCase as W } from "../../../lib/utils.js";
|
|
6
|
-
import { RuleWriter as
|
|
7
|
-
import { RoleConditionRow as
|
|
8
|
-
import { O2MAggFieldCombobox as
|
|
9
|
-
import { SwapConfigEditor as
|
|
10
|
-
import { IconPicker as
|
|
11
|
-
import { SectionReuseActions as
|
|
12
|
-
import { emptyTextOp as
|
|
13
|
-
import { useCollectionMeta as
|
|
14
|
-
import { useInspectorEnv as
|
|
15
|
-
import { groupFields as
|
|
16
|
-
import { GroupTranslations as
|
|
6
|
+
import { RuleWriter as ce } from "../ai-rules/RuleWriter.js";
|
|
7
|
+
import { RoleConditionRow as U } from "../editors/lock-conditions.js";
|
|
8
|
+
import { O2MAggFieldCombobox as he } from "../editors/o2m-agg-field.js";
|
|
9
|
+
import { SwapConfigEditor as pe } from "../editors/swap-config.js";
|
|
10
|
+
import { IconPicker as fe } from "../pickers/icon-picker.js";
|
|
11
|
+
import { SectionReuseActions as ue } from "../reuse/SectionReuseActions.js";
|
|
12
|
+
import { emptyTextOp as me, stickyPlan as be, rowUpdatePlan as X } from "../section-structure.js";
|
|
13
|
+
import { useCollectionMeta as ye } from "./field-context.js";
|
|
14
|
+
import { useInspectorEnv as ge, Setting as d, TextInput as N, Choice as P, Segmented as k, Toggle as y, TextArea as Y, Section as $, FieldMultiPicker as ke, ConditionBuilder as we } from "./kit.js";
|
|
15
|
+
import { groupFields as _e, asArray as w, describeField as Z, relKindOf as ve, relatedCollectionOf as xe } from "./model.js";
|
|
16
|
+
import { GroupTranslations as Ce } from "./Translations.js";
|
|
17
17
|
const T = {
|
|
18
18
|
section: "Section",
|
|
19
19
|
tab: "Tab or step",
|
|
@@ -21,52 +21,52 @@ const T = {
|
|
|
21
21
|
container: "Tabs or steps holder",
|
|
22
22
|
content: "Text block"
|
|
23
23
|
};
|
|
24
|
-
function
|
|
25
|
-
return typeof
|
|
24
|
+
function Se(t) {
|
|
25
|
+
return typeof t == "string" ? { field: t } : t && typeof t == "object" && typeof t.field == "string" ? t : null;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const { field:
|
|
29
|
-
return !o && !p ?
|
|
30
|
-
field:
|
|
27
|
+
function Ne(t) {
|
|
28
|
+
const { field: u, label: o, agg: p, agg_field: m, field_options: f } = t;
|
|
29
|
+
return !o && !p ? u : {
|
|
30
|
+
field: u,
|
|
31
31
|
...o ? { label: o } : {},
|
|
32
|
-
...p ? { agg: p, agg_field:
|
|
32
|
+
...p ? { agg: p, agg_field: m, ...f ? { field_options: f } : {} } : {}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const _ = (
|
|
36
|
-
function
|
|
37
|
-
var
|
|
38
|
-
const o =
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const _ = (t) => t.length ? JSON.stringify(t) : null;
|
|
36
|
+
function Je({ group: t, readOnly: u }) {
|
|
37
|
+
var K, z;
|
|
38
|
+
const o = ge(), { data: p } = ye(o.collection), m = (p == null ? void 0 : p.fields) ?? [], f = (p == null ? void 0 : p.relations) ?? [], n = t.label || W(t.key), i = t.type, r = (e, a, c) => o.apply([{ op: "group_update", key: t.key, patch: e }], { label: a, text: c }), L = o.bundle.groups.filter((e) => e.parent_key === t.key), Q = o.bundle.groups.filter((e) => e.type === "container" && e.key !== t.key), F = o.bundle.placements.some((e) => e.group_key === t.key), V = (t.parent_key ? ["tab"] : Object.keys(T)).filter((e) => e === i || !(F && (e === "container" || e === "content"))).map((e) => ({ value: e, label: T[e] })), v = i === "section" || i === "metadata" || i === "tab", R = ie(o.bundle.layout.conditions).includes(t.key), ee = !se(o.bundle.layout.conditions).includes(t.key), M = !!o.bundle.layout.accordion_mode, x = oe(t.swap_config), D = m.filter((e) => !e.field.startsWith("__") && e.type !== "alias").map((e) => ({ value: e.field, label: e.label || W(e.field) })).sort((e, a) => e.label.localeCompare(a.label)), j = _e(o.bundle, t.key), b = w(t.summary_fields).map(Se).filter((e) => !!e), H = (e, a, c) => r({ summary_fields: _(e.map(Ne)) }, a, c), G = w(t.visible_when), C = JSON.stringify(G), [te, J] = B(G);
|
|
39
|
+
ne(() => {
|
|
40
|
+
J(
|
|
41
41
|
(e) => JSON.stringify(e.filter((a) => a.field)) === C ? e : JSON.parse(C)
|
|
42
42
|
);
|
|
43
43
|
}, [C]);
|
|
44
|
-
const [
|
|
45
|
-
return /* @__PURE__ */ s("fieldset", { disabled:
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
44
|
+
const [le, q] = B(!1);
|
|
45
|
+
return /* @__PURE__ */ s("fieldset", { disabled: u, className: "min-w-0 space-y-5", children: [
|
|
46
|
+
/* @__PURE__ */ l(d, { k: "group.label", label: "Name", effect: "The heading people see.", children: /* @__PURE__ */ l(
|
|
47
|
+
N,
|
|
48
48
|
{
|
|
49
49
|
ariaLabel: "Name",
|
|
50
|
-
value:
|
|
50
|
+
value: t.label,
|
|
51
51
|
onChange: (e) => r({ label: e }, `Rename ${n}`, !0)
|
|
52
52
|
}
|
|
53
53
|
) }),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
54
|
+
/* @__PURE__ */ l(d, { k: "group.icon", label: "Icon", effect: "Shown before the section title.", children: /* @__PURE__ */ l(
|
|
55
|
+
fe,
|
|
56
56
|
{
|
|
57
57
|
className: "h-8 rounded-md border-slate-200 bg-white px-2.5 text-[13px] hover:bg-white dark:border-border dark:bg-background dark:hover:bg-background",
|
|
58
|
-
value:
|
|
58
|
+
value: t.icon ?? "",
|
|
59
59
|
onChange: (e) => r({ icon: e || null }, `Change the icon of ${n}`)
|
|
60
60
|
}
|
|
61
61
|
) }),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ l(
|
|
63
63
|
d,
|
|
64
64
|
{
|
|
65
65
|
k: "group.type",
|
|
66
66
|
label: "Kind",
|
|
67
|
-
effect: i === "container" && L.length ? "Move its tabs out before changing what this is." :
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
|
|
67
|
+
effect: i === "container" && L.length ? "Move its tabs out before changing what this is." : F && !t.parent_key ? "What this part of the form is. To make it a tabs holder or a text block, move its fields out first." : "What this part of the form is.",
|
|
68
|
+
children: /* @__PURE__ */ l(
|
|
69
|
+
P,
|
|
70
70
|
{
|
|
71
71
|
ariaLabel: "Kind",
|
|
72
72
|
disabled: i === "container" && L.length > 0,
|
|
@@ -75,7 +75,7 @@ function je({ group: l, readOnly: m }) {
|
|
|
75
75
|
onChange: (e) => {
|
|
76
76
|
var a;
|
|
77
77
|
return r(
|
|
78
|
-
e === "container" ? { type: e, tab_mode:
|
|
78
|
+
e === "container" ? { type: e, tab_mode: t.tab_mode ?? "tabs" } : { type: e },
|
|
79
79
|
`Make ${n} a ${(a = T[e]) == null ? void 0 : a.toLowerCase()}`
|
|
80
80
|
);
|
|
81
81
|
}
|
|
@@ -83,16 +83,16 @@ function je({ group: l, readOnly: m }) {
|
|
|
83
83
|
)
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
i === "container" && /* @__PURE__ */
|
|
86
|
+
i === "container" && /* @__PURE__ */ l(
|
|
87
87
|
d,
|
|
88
88
|
{
|
|
89
89
|
k: "group.tab_mode",
|
|
90
90
|
label: "Show its tabs as",
|
|
91
91
|
effect: "Steps walk people through in order.",
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
|
|
92
|
+
children: /* @__PURE__ */ l(
|
|
93
|
+
k,
|
|
94
94
|
{
|
|
95
|
-
value:
|
|
95
|
+
value: t.tab_mode === "steps" ? "steps" : "tabs",
|
|
96
96
|
options: [
|
|
97
97
|
{ value: "tabs", label: "Tabs" },
|
|
98
98
|
{ value: "steps", label: "Steps" }
|
|
@@ -102,17 +102,17 @@ function je({ group: l, readOnly: m }) {
|
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
i === "tab" && /* @__PURE__ */
|
|
105
|
+
i === "tab" && /* @__PURE__ */ l(
|
|
106
106
|
d,
|
|
107
107
|
{
|
|
108
108
|
k: "group.container_id",
|
|
109
109
|
label: "Sits in",
|
|
110
110
|
effect: "Tabs show inside a tabs or steps holder.",
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
-
|
|
111
|
+
children: /* @__PURE__ */ l(
|
|
112
|
+
P,
|
|
113
113
|
{
|
|
114
114
|
ariaLabel: "Sits in",
|
|
115
|
-
value:
|
|
115
|
+
value: t.parent_key ?? "",
|
|
116
116
|
options: [
|
|
117
117
|
{ value: "", label: "The form itself" },
|
|
118
118
|
...Q.map((e) => ({ value: e.key, label: e.label || W(e.key) }))
|
|
@@ -121,7 +121,7 @@ function je({ group: l, readOnly: m }) {
|
|
|
121
121
|
[
|
|
122
122
|
{
|
|
123
123
|
op: "group_move",
|
|
124
|
-
key:
|
|
124
|
+
key: t.key,
|
|
125
125
|
parent_key: e || null,
|
|
126
126
|
index: Number.MAX_SAFE_INTEGER
|
|
127
127
|
}
|
|
@@ -132,29 +132,29 @@ function je({ group: l, readOnly: m }) {
|
|
|
132
132
|
)
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
(i === "section" || i === "metadata") && /* @__PURE__ */
|
|
136
|
-
|
|
135
|
+
(i === "section" || i === "metadata") && /* @__PURE__ */ l(
|
|
136
|
+
y,
|
|
137
137
|
{
|
|
138
138
|
k: "group.is_collapsed",
|
|
139
139
|
label: "Starts collapsed",
|
|
140
140
|
effect: "The section opens folded; people unfold it.",
|
|
141
|
-
checked:
|
|
141
|
+
checked: t.is_collapsed,
|
|
142
142
|
onChange: (e) => r({ is_collapsed: e }, e ? `Collapse ${n}` : `Expand ${n}`)
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
(i === "section" || i === "metadata") && /* @__PURE__ */
|
|
146
|
-
|
|
145
|
+
(i === "section" || i === "metadata") && /* @__PURE__ */ l(
|
|
146
|
+
y,
|
|
147
147
|
{
|
|
148
148
|
k: "group.load_on_open",
|
|
149
149
|
label: "Load when opened",
|
|
150
|
-
effect:
|
|
150
|
+
effect: t.is_collapsed || M ? "Its pickers, grids and widgets load only once someone opens it; a lighter open for every record." : "Turn on Starts collapsed first: an open section loads straight away.",
|
|
151
151
|
checked: R,
|
|
152
|
-
disabled: !R && !
|
|
152
|
+
disabled: !R && !t.is_collapsed && !M,
|
|
153
153
|
onChange: (e) => o.apply(
|
|
154
154
|
[
|
|
155
155
|
{
|
|
156
156
|
op: "layout_update",
|
|
157
|
-
patch:
|
|
157
|
+
patch: re(o.bundle.layout.conditions, t.key, e)
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
160
|
{ label: e ? `Load ${n} when opened` : `Load ${n} with the form` }
|
|
@@ -162,16 +162,16 @@ function je({ group: l, readOnly: m }) {
|
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
i === "content" && /* @__PURE__ */ s(I, { children: [
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ l(
|
|
166
166
|
d,
|
|
167
167
|
{
|
|
168
168
|
k: "group.content_tone",
|
|
169
169
|
label: "Style",
|
|
170
170
|
effect: "Note and Warning are coloured boxes; Divider is a line with the text.",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
|
|
171
|
+
children: /* @__PURE__ */ l(
|
|
172
|
+
k,
|
|
173
173
|
{
|
|
174
|
-
value:
|
|
174
|
+
value: t.content_tone ?? "info",
|
|
175
175
|
options: [
|
|
176
176
|
{ value: "info", label: "Note" },
|
|
177
177
|
{ value: "warn", label: "Warning" },
|
|
@@ -182,42 +182,42 @@ function je({ group: l, readOnly: m }) {
|
|
|
182
182
|
)
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ l(d, { k: "group.content", label: "Text", effect: "The words this block shows on the form.", children: /* @__PURE__ */ l(
|
|
186
186
|
Y,
|
|
187
187
|
{
|
|
188
188
|
ariaLabel: "Text",
|
|
189
|
-
value:
|
|
189
|
+
value: t.content ?? "",
|
|
190
190
|
onChange: (e) => r({ content: e || null }, `Edit the text of ${n}`, !0)
|
|
191
191
|
}
|
|
192
192
|
) })
|
|
193
193
|
] }),
|
|
194
194
|
(i === "section" || i === "tab") && /* @__PURE__ */ s(I, { children: [
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ l(
|
|
196
196
|
d,
|
|
197
197
|
{
|
|
198
198
|
k: "group.content",
|
|
199
199
|
label: "Intro",
|
|
200
200
|
effect: "A short note at the top: what to fill in here and why. Empty shows none.",
|
|
201
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ l(
|
|
202
202
|
Y,
|
|
203
203
|
{
|
|
204
204
|
ariaLabel: "Intro",
|
|
205
|
-
value:
|
|
205
|
+
value: t.content ?? "",
|
|
206
206
|
onChange: (e) => r({ content: e || null }, `Edit the intro of ${n}`, !0)
|
|
207
207
|
}
|
|
208
208
|
)
|
|
209
209
|
}
|
|
210
210
|
),
|
|
211
|
-
!!((
|
|
211
|
+
!!((K = t.content) != null && K.trim()) && /* @__PURE__ */ l(
|
|
212
212
|
d,
|
|
213
213
|
{
|
|
214
214
|
k: "group.content_tone",
|
|
215
215
|
label: "Intro style",
|
|
216
216
|
effect: "Note is a quiet box; Warning is amber.",
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
|
|
217
|
+
children: /* @__PURE__ */ l(
|
|
218
|
+
k,
|
|
219
219
|
{
|
|
220
|
-
value:
|
|
220
|
+
value: t.content_tone === "warn" ? "warn" : "info",
|
|
221
221
|
options: [
|
|
222
222
|
{ value: "info", label: "Note" },
|
|
223
223
|
{ value: "warn", label: "Warning" }
|
|
@@ -228,17 +228,17 @@ function je({ group: l, readOnly: m }) {
|
|
|
228
228
|
}
|
|
229
229
|
)
|
|
230
230
|
] }),
|
|
231
|
-
|
|
232
|
-
/* @__PURE__ */
|
|
231
|
+
v && /* @__PURE__ */ s(I, { children: [
|
|
232
|
+
/* @__PURE__ */ l(
|
|
233
233
|
d,
|
|
234
234
|
{
|
|
235
235
|
k: "group.visibility_mode",
|
|
236
236
|
label: "Show",
|
|
237
237
|
effect: "On new records, existing ones or both.",
|
|
238
|
-
children: /* @__PURE__ */
|
|
239
|
-
|
|
238
|
+
children: /* @__PURE__ */ l(
|
|
239
|
+
k,
|
|
240
240
|
{
|
|
241
|
-
value:
|
|
241
|
+
value: t.visibility_mode ?? "always",
|
|
242
242
|
options: [
|
|
243
243
|
{ value: "always", label: "Always" },
|
|
244
244
|
{ value: "new_only", label: "New records" },
|
|
@@ -249,26 +249,26 @@ function je({ group: l, readOnly: m }) {
|
|
|
249
249
|
)
|
|
250
250
|
}
|
|
251
251
|
),
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
252
|
+
/* @__PURE__ */ l(
|
|
253
|
+
y,
|
|
254
254
|
{
|
|
255
255
|
k: "group.hide_when_empty",
|
|
256
256
|
label: "Hide when all its fields are empty",
|
|
257
257
|
effect: "The section disappears while none of its fields has a value.",
|
|
258
|
-
checked:
|
|
258
|
+
checked: t.hide_when_empty,
|
|
259
259
|
onChange: (e) => r({ hide_when_empty: e }, `Change when ${n} hides`)
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ l(
|
|
263
263
|
d,
|
|
264
264
|
{
|
|
265
265
|
k: "group.read_width",
|
|
266
266
|
label: "Width when reading",
|
|
267
267
|
effect: "On the read view, summary and detail panels. Automatic: half for a short list, full for grids.",
|
|
268
|
-
children: /* @__PURE__ */
|
|
269
|
-
|
|
268
|
+
children: /* @__PURE__ */ l(
|
|
269
|
+
k,
|
|
270
270
|
{
|
|
271
|
-
value:
|
|
271
|
+
value: t.read_width ?? "",
|
|
272
272
|
options: [
|
|
273
273
|
{ value: "", label: "Automatic" },
|
|
274
274
|
{ value: "full", label: "Full" },
|
|
@@ -280,19 +280,19 @@ function je({ group: l, readOnly: m }) {
|
|
|
280
280
|
)
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ l(
|
|
284
284
|
d,
|
|
285
285
|
{
|
|
286
286
|
k: "group.empty_text",
|
|
287
287
|
label: "When nothing is filled",
|
|
288
288
|
effect: "Shown in the read view and the PDF instead of empty values, such as “No shipping details yet”. Empty: the values show as dashes.",
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
-
|
|
289
|
+
children: /* @__PURE__ */ l(
|
|
290
|
+
N,
|
|
291
291
|
{
|
|
292
292
|
ariaLabel: "When nothing is filled",
|
|
293
293
|
value: x.emptyText ?? "",
|
|
294
294
|
placeholder: "No details yet",
|
|
295
|
-
onChange: (e) => o.apply([
|
|
295
|
+
onChange: (e) => o.apply([me(t, e)], {
|
|
296
296
|
label: `Change the empty text of ${n}`,
|
|
297
297
|
text: !0
|
|
298
298
|
})
|
|
@@ -300,45 +300,45 @@ function je({ group: l, readOnly: m }) {
|
|
|
300
300
|
)
|
|
301
301
|
}
|
|
302
302
|
),
|
|
303
|
-
i === "section" && !
|
|
304
|
-
|
|
303
|
+
i === "section" && !t.parent_key && /* @__PURE__ */ l(
|
|
304
|
+
y,
|
|
305
305
|
{
|
|
306
306
|
k: "group.sticky",
|
|
307
307
|
label: "Stick to the top",
|
|
308
308
|
effect: "Stays at the top of the form while people scroll the rest, for totals or status. One section per form; not on phones.",
|
|
309
309
|
checked: x.sticky,
|
|
310
310
|
onChange: (e) => {
|
|
311
|
-
const a =
|
|
311
|
+
const a = be(o.bundle, t.key, e);
|
|
312
312
|
a.ok && o.apply(a.ops, { label: a.label });
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
)
|
|
316
316
|
] }),
|
|
317
|
-
(i === "section" || i === "tab") && /* @__PURE__ */
|
|
317
|
+
(i === "section" || i === "tab") && /* @__PURE__ */ l($, { title: "Side by side", children: /* @__PURE__ */ l(
|
|
318
318
|
d,
|
|
319
319
|
{
|
|
320
320
|
k: "group.row_groups",
|
|
321
321
|
label: "Rows of fields",
|
|
322
322
|
effect: "Short fields that share one row under one label, like Street / City / Zip. To add one, select the fields on the form, right-click and pick Put side by side.",
|
|
323
|
-
children: x.rows.length === 0 ? /* @__PURE__ */
|
|
323
|
+
children: x.rows.length === 0 ? /* @__PURE__ */ l("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "No rows yet." }) : /* @__PURE__ */ l("div", { className: "space-y-2", children: x.rows.map((e) => /* @__PURE__ */ s("div", { className: "space-y-1", "data-row-group-setting": e.key, children: [
|
|
324
324
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
|
|
325
|
+
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(
|
|
326
|
+
N,
|
|
327
327
|
{
|
|
328
328
|
ariaLabel: `Label of the row ${e.label}`,
|
|
329
329
|
value: e.label,
|
|
330
330
|
onChange: (a) => {
|
|
331
|
-
const c = X(o.bundle,
|
|
331
|
+
const c = X(o.bundle, t.key, e.key, { label: a });
|
|
332
332
|
c.ok && o.apply(c.ops, { label: c.label, text: !0 });
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
) }),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ l(
|
|
337
337
|
"button",
|
|
338
338
|
{
|
|
339
339
|
type: "button",
|
|
340
340
|
onClick: () => {
|
|
341
|
-
const a = X(o.bundle,
|
|
341
|
+
const a = X(o.bundle, t.key, e.key, null);
|
|
342
342
|
a.ok && o.apply(a.ops, { label: a.label });
|
|
343
343
|
},
|
|
344
344
|
className: "shrink-0 rounded-md px-2 py-1 text-[12px] text-slate-600 hover:bg-muted hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",
|
|
@@ -346,27 +346,27 @@ function je({ group: l, readOnly: m }) {
|
|
|
346
346
|
}
|
|
347
347
|
)
|
|
348
348
|
] }),
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ l("p", { className: "truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: e.fields.map((a) => {
|
|
350
350
|
const c = o.bundle.placements.find(
|
|
351
|
-
(
|
|
351
|
+
(S) => S.field === a && S.group_key === t.key
|
|
352
352
|
) ?? null;
|
|
353
|
-
return Z(a,
|
|
353
|
+
return Z(a, m, f, c).label;
|
|
354
354
|
}).join(" · ") })
|
|
355
355
|
] }, e.key)) })
|
|
356
356
|
}
|
|
357
357
|
) }),
|
|
358
358
|
i === "tab" && /* @__PURE__ */ s($, { title: "As a step", children: [
|
|
359
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ l(
|
|
360
360
|
d,
|
|
361
361
|
{
|
|
362
362
|
k: "group.skip_if_filled",
|
|
363
363
|
label: "Skip as the first step when filled",
|
|
364
364
|
effect: "Opens on a later step when these fields already have values.",
|
|
365
|
-
children: /* @__PURE__ */
|
|
366
|
-
|
|
365
|
+
children: /* @__PURE__ */ l(
|
|
366
|
+
ke,
|
|
367
367
|
{
|
|
368
368
|
ariaLabel: "Skip as the first step when filled",
|
|
369
|
-
value:
|
|
369
|
+
value: w(t.skip_if_filled),
|
|
370
370
|
options: D,
|
|
371
371
|
onChange: (e) => r({ skip_if_filled: _(e) }, `Change when ${n} is skipped`)
|
|
372
372
|
}
|
|
@@ -380,65 +380,83 @@ function je({ group: l, readOnly: m }) {
|
|
|
380
380
|
label: "Only when",
|
|
381
381
|
effect: "The step shows only while every condition holds. No conditions: always.",
|
|
382
382
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
|
|
383
|
+
/* @__PURE__ */ l(
|
|
384
|
+
we,
|
|
385
385
|
{
|
|
386
|
-
value:
|
|
386
|
+
value: te,
|
|
387
387
|
fields: D,
|
|
388
388
|
onChange: (e) => {
|
|
389
|
-
|
|
389
|
+
J(e);
|
|
390
390
|
const a = e.filter((c) => c.field);
|
|
391
391
|
JSON.stringify(a) !== C && r({ visible_when: _(a) }, `Change when ${n} shows`, !0);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
|
|
395
|
+
/* @__PURE__ */ l(
|
|
396
|
+
ce,
|
|
397
397
|
{
|
|
398
398
|
layoutId: Number(o.bundle.layout.id),
|
|
399
|
-
target: { kind: "step", group:
|
|
399
|
+
target: { kind: "step", group: t.key },
|
|
400
400
|
bundle: o.bundle,
|
|
401
401
|
apply: (e, a) => o.apply(e, a),
|
|
402
|
-
disabled:
|
|
402
|
+
disabled: u
|
|
403
403
|
}
|
|
404
404
|
)
|
|
405
405
|
]
|
|
406
406
|
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ l(
|
|
409
|
+
y,
|
|
410
|
+
{
|
|
411
|
+
k: "group.rule_hint",
|
|
412
|
+
label: "Say why it is hidden",
|
|
413
|
+
effect: `While its conditions hide it, the form shows one quiet line ("${n} shows when …") with a read-only Show anyway. Off: it vanishes without a word.`,
|
|
414
|
+
checked: ee,
|
|
415
|
+
onChange: (e) => o.apply(
|
|
416
|
+
[
|
|
417
|
+
{
|
|
418
|
+
op: "layout_update",
|
|
419
|
+
patch: de(o.bundle.layout.conditions, t.key, e)
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
{ label: e ? `Say why ${n} is hidden` : `Hide ${n} without a word` }
|
|
423
|
+
)
|
|
424
|
+
}
|
|
407
425
|
)
|
|
408
426
|
] }),
|
|
409
|
-
|
|
410
|
-
/* @__PURE__ */
|
|
427
|
+
v && /* @__PURE__ */ s($, { title: "Who", children: [
|
|
428
|
+
/* @__PURE__ */ l(
|
|
411
429
|
d,
|
|
412
430
|
{
|
|
413
431
|
k: "group.hidden_for_roles",
|
|
414
432
|
label: "Hidden for",
|
|
415
433
|
effect: "People in these roles do not see it. Admins always do.",
|
|
416
|
-
children: /* @__PURE__ */
|
|
417
|
-
|
|
434
|
+
children: /* @__PURE__ */ l(
|
|
435
|
+
U,
|
|
418
436
|
{
|
|
419
|
-
roleIds:
|
|
437
|
+
roleIds: w(t.hidden_for_roles),
|
|
420
438
|
onRoleIdsChange: (e) => r({ hidden_for_roles: _(e) }, `Change who sees ${n}`)
|
|
421
439
|
}
|
|
422
440
|
)
|
|
423
441
|
}
|
|
424
442
|
),
|
|
425
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ l(
|
|
426
444
|
d,
|
|
427
445
|
{
|
|
428
446
|
k: "group.locked_for_roles",
|
|
429
447
|
label: "Read-only for",
|
|
430
448
|
effect: "People in these roles cannot change it; the server drops their writes. Admins are exempt.",
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
|
|
449
|
+
children: /* @__PURE__ */ l(
|
|
450
|
+
U,
|
|
433
451
|
{
|
|
434
|
-
roleIds:
|
|
452
|
+
roleIds: w(t.locked_for_roles),
|
|
435
453
|
onRoleIdsChange: (e) => r({ locked_for_roles: _(e) }, `Change who can edit ${n}`)
|
|
436
454
|
}
|
|
437
455
|
)
|
|
438
456
|
}
|
|
439
457
|
)
|
|
440
458
|
] }),
|
|
441
|
-
|
|
459
|
+
v && /* @__PURE__ */ s($, { title: "When collapsed", children: [
|
|
442
460
|
/* @__PURE__ */ s(
|
|
443
461
|
d,
|
|
444
462
|
{
|
|
@@ -450,32 +468,32 @@ function je({ group: l, readOnly: m }) {
|
|
|
450
468
|
"Place fields in ",
|
|
451
469
|
n,
|
|
452
470
|
" first."
|
|
453
|
-
] }) : /* @__PURE__ */
|
|
454
|
-
const a = b.find((h) => h.field === e), c =
|
|
471
|
+
] }) : /* @__PURE__ */ l("div", { className: "space-y-1.5", children: j.map((e) => {
|
|
472
|
+
const a = b.find((h) => h.field === e), c = ve(e, f) === "O2M", S = o.bundle.placements.find((h) => h.field === e) ?? null, O = Z(e, m, f, S).label, E = (h, g, ae) => H(
|
|
455
473
|
b.map((A) => A.field === e ? { ...A, ...h } : A),
|
|
456
|
-
|
|
457
|
-
|
|
474
|
+
g,
|
|
475
|
+
ae
|
|
458
476
|
);
|
|
459
477
|
return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
460
478
|
/* @__PURE__ */ s("label", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
461
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ l(
|
|
462
480
|
"input",
|
|
463
481
|
{
|
|
464
482
|
type: "checkbox",
|
|
465
483
|
checked: !!a,
|
|
466
|
-
onChange: (h) =>
|
|
467
|
-
h.target.checked ? [...b, c ? { field: e, agg: "count" } : { field: e }] : b.filter((
|
|
484
|
+
onChange: (h) => H(
|
|
485
|
+
h.target.checked ? [...b, c ? { field: e, agg: "count" } : { field: e }] : b.filter((g) => g.field !== e),
|
|
468
486
|
`Change the summary of ${n}`
|
|
469
487
|
),
|
|
470
488
|
className: "h-3.5 w-3.5 accent-nvr-cyan"
|
|
471
489
|
}
|
|
472
490
|
),
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
c && /* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ l("span", { className: "flex-1 truncate", children: O }),
|
|
492
|
+
c && /* @__PURE__ */ l("span", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "list" })
|
|
475
493
|
] }),
|
|
476
494
|
a && /* @__PURE__ */ s("div", { className: "space-y-1 pl-5", children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
495
|
+
/* @__PURE__ */ l("div", { "data-setting": "group.summary_fields.label", children: /* @__PURE__ */ l(
|
|
496
|
+
N,
|
|
479
497
|
{
|
|
480
498
|
ariaLabel: `Label for ${O}`,
|
|
481
499
|
value: a.label ?? "",
|
|
@@ -488,8 +506,8 @@ function je({ group: l, readOnly: m }) {
|
|
|
488
506
|
}
|
|
489
507
|
) }),
|
|
490
508
|
c && /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
|
|
509
|
+
/* @__PURE__ */ l("div", { className: "flex-1", "data-setting": "group.summary_fields.agg", children: /* @__PURE__ */ l(
|
|
510
|
+
P,
|
|
493
511
|
{
|
|
494
512
|
ariaLabel: "Show",
|
|
495
513
|
value: a.agg ?? "count",
|
|
@@ -506,18 +524,18 @@ function je({ group: l, readOnly: m }) {
|
|
|
506
524
|
)
|
|
507
525
|
}
|
|
508
526
|
) }),
|
|
509
|
-
(a.agg ?? "count") !== "count" && /* @__PURE__ */
|
|
527
|
+
(a.agg ?? "count") !== "count" && /* @__PURE__ */ l(
|
|
510
528
|
"div",
|
|
511
529
|
{
|
|
512
530
|
className: "flex-1",
|
|
513
531
|
"data-setting": "group.summary_fields.agg_field",
|
|
514
|
-
children: /* @__PURE__ */
|
|
515
|
-
|
|
532
|
+
children: /* @__PURE__ */ l(
|
|
533
|
+
he,
|
|
516
534
|
{
|
|
517
|
-
relatedCollection:
|
|
535
|
+
relatedCollection: xe(e, f),
|
|
518
536
|
value: a.agg_field ?? "",
|
|
519
|
-
onChange: (h,
|
|
520
|
-
{ agg_field: h, field_options:
|
|
537
|
+
onChange: (h, g) => E(
|
|
538
|
+
{ agg_field: h, field_options: g },
|
|
521
539
|
`Change the summary of ${n}`
|
|
522
540
|
)
|
|
523
541
|
}
|
|
@@ -542,33 +560,33 @@ function je({ group: l, readOnly: m }) {
|
|
|
542
560
|
]
|
|
543
561
|
}
|
|
544
562
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
|
|
563
|
+
/* @__PURE__ */ l(
|
|
564
|
+
y,
|
|
547
565
|
{
|
|
548
566
|
k: "group.summary_hide_empty",
|
|
549
567
|
label: "Leave out empty values",
|
|
550
568
|
effect: "Fields without a value are left out of the summary line.",
|
|
551
|
-
checked:
|
|
569
|
+
checked: t.summary_hide_empty,
|
|
552
570
|
onChange: (e) => r({ summary_hide_empty: e }, `Change the summary of ${n}`)
|
|
553
571
|
}
|
|
554
572
|
)
|
|
555
573
|
] }),
|
|
556
|
-
|
|
557
|
-
|
|
574
|
+
v && /* @__PURE__ */ l(
|
|
575
|
+
pe,
|
|
558
576
|
{
|
|
559
|
-
group: { id:
|
|
560
|
-
allFields:
|
|
577
|
+
group: { id: t.id ?? 0, swap_config: t.swap_config },
|
|
578
|
+
allFields: m.map((e) => ({ field: e.field, type: e.type ?? void 0 })),
|
|
561
579
|
onGroupSettings: (e, a) => r(a, `Change the field swap of ${n}`)
|
|
562
580
|
}
|
|
563
581
|
),
|
|
564
|
-
!
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
582
|
+
!u && /* @__PURE__ */ l(ue, { bundle: o.bundle, collection: o.collection, group: t }),
|
|
583
|
+
/* @__PURE__ */ l(Ce, { group: t }),
|
|
584
|
+
/* @__PURE__ */ l(
|
|
567
585
|
"div",
|
|
568
586
|
{
|
|
569
587
|
"data-setting": "group.delete",
|
|
570
588
|
className: "border-t border-slate-200 pt-3 dark:border-border",
|
|
571
|
-
children:
|
|
589
|
+
children: le ? /* @__PURE__ */ s("div", { className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[12px] text-red-900 dark:border-red-800/60 dark:bg-red-950/30 dark:text-red-100", children: [
|
|
572
590
|
/* @__PURE__ */ s("p", { children: [
|
|
573
591
|
"Delete ",
|
|
574
592
|
n,
|
|
@@ -577,22 +595,22 @@ function je({ group: l, readOnly: m }) {
|
|
|
577
595
|
". Undo brings it back."
|
|
578
596
|
] }),
|
|
579
597
|
/* @__PURE__ */ s("div", { className: "flex gap-2", children: [
|
|
580
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ l(
|
|
581
599
|
"button",
|
|
582
600
|
{
|
|
583
601
|
type: "button",
|
|
584
|
-
onClick: () => o.apply([{ op: "group_remove", key:
|
|
602
|
+
onClick: () => o.apply([{ op: "group_remove", key: t.key, placements: "ungroup" }], {
|
|
585
603
|
label: `Delete ${n}`
|
|
586
604
|
}),
|
|
587
605
|
className: "rounded-md bg-red-600 px-2.5 py-1 text-[12px] font-medium text-white hover:bg-red-700",
|
|
588
606
|
children: "Delete"
|
|
589
607
|
}
|
|
590
608
|
),
|
|
591
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ l(
|
|
592
610
|
"button",
|
|
593
611
|
{
|
|
594
612
|
type: "button",
|
|
595
|
-
onClick: () =>
|
|
613
|
+
onClick: () => q(!1),
|
|
596
614
|
className: "rounded-md px-2.5 py-1 text-[12px] hover:bg-red-100 dark:hover:bg-red-900/40",
|
|
597
615
|
children: "Keep"
|
|
598
616
|
}
|
|
@@ -602,11 +620,11 @@ function je({ group: l, readOnly: m }) {
|
|
|
602
620
|
"button",
|
|
603
621
|
{
|
|
604
622
|
type: "button",
|
|
605
|
-
onClick: () =>
|
|
623
|
+
onClick: () => q(!0),
|
|
606
624
|
className: "text-[12px] text-red-600 hover:underline dark:text-red-400",
|
|
607
625
|
children: [
|
|
608
626
|
"Delete ",
|
|
609
|
-
((
|
|
627
|
+
((z = T[i]) == null ? void 0 : z.toLowerCase()) ?? "section"
|
|
610
628
|
]
|
|
611
629
|
}
|
|
612
630
|
)
|
|
@@ -615,5 +633,5 @@ function je({ group: l, readOnly: m }) {
|
|
|
615
633
|
] });
|
|
616
634
|
}
|
|
617
635
|
export {
|
|
618
|
-
|
|
636
|
+
Je as GroupInspector
|
|
619
637
|
};
|