@nivaro/react 0.3.41 → 0.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +644 -15
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as V } from "@tanstack/react-query";
|
|
3
|
-
import { X as
|
|
4
|
-
import { useNivaroClient as
|
|
3
|
+
import { X as W } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as j } from "../../../context.js";
|
|
5
5
|
import { get as E } from "../../../lib/commands.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
6
|
+
import { cn as G, titleCase as Q } from "../../../lib/utils.js";
|
|
7
|
+
import { FieldSourceBody as H } from "../../ConfigReadBack.js";
|
|
8
|
+
import { fieldSourcesFor as X } from "../../item-edit/field-sources.js";
|
|
9
|
+
import { FieldRuleWriter as z } from "../ai-rules/FieldRuleWriter.js";
|
|
10
|
+
import { RuleWriter as J } from "../ai-rules/RuleWriter.js";
|
|
11
|
+
import { ValidationSuggest as U } from "../ai-rules/ValidationSuggest.js";
|
|
12
|
+
import { FieldDefaultValueControl as Y } from "../editors/field-default-value.js";
|
|
13
|
+
import { RoleConditionRow as Z, PipelineStateConditionRow as ee } from "../editors/lock-conditions.js";
|
|
14
|
+
import { useLayoutEditorHost as le } from "../host.js";
|
|
15
|
+
import { tintCard as te } from "../panel-style.js";
|
|
16
|
+
import { RecommendedToggle as oe, PersonalDefaultToggle as ie, PersonalDefaultInlineToggle as ae, ConfirmChangeSetting as ne, RepeatLastToggle as re } from "./BehaviourSettings.js";
|
|
17
|
+
import { useFieldCtx as de } from "./field-context.js";
|
|
18
|
+
import { Toggle as v, Setting as m, Segmented as se, AddButton as ce, Section as S, TextInput as T, Choice as L } from "./kit.js";
|
|
19
|
+
import { lockConditionsOf as ue, layoutGrids as fe, asObject as me, defaultValuesOf as pe, withDefaultValue as he, lockConditionsColumn as ye } from "./model.js";
|
|
20
|
+
const P = /* @__PURE__ */ new Set([
|
|
19
21
|
"inline-table",
|
|
20
22
|
"inline-grid",
|
|
21
23
|
"list-o2m",
|
|
@@ -25,87 +27,98 @@ const L = /* @__PURE__ */ new Set([
|
|
|
25
27
|
"o2m",
|
|
26
28
|
"relation-path"
|
|
27
29
|
]);
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
+
function be(t, i) {
|
|
31
|
+
const f = j();
|
|
30
32
|
return V({
|
|
31
|
-
queryKey: ["layout-editor", "field-rows",
|
|
32
|
-
queryFn: () =>
|
|
33
|
-
E(`/field-config/${
|
|
34
|
-
).then((
|
|
35
|
-
enabled: !!
|
|
33
|
+
queryKey: ["layout-editor", "field-rows", t, i ?? null],
|
|
34
|
+
queryFn: () => f.request(
|
|
35
|
+
E(`/field-config/${t}`, i ? { layout_id: i } : void 0)
|
|
36
|
+
).then((p) => Array.isArray(p.data) ? p.data : []),
|
|
37
|
+
enabled: !!t,
|
|
36
38
|
staleTime: 6e4
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
g.map((d, h) => h === e ? { ...d, ...
|
|
41
|
+
function qe() {
|
|
42
|
+
const t = de(), { info: i, ov: f, opts: p, env: s, row: u } = t, a = i.label, y = s.bundle.layout, b = u.field.startsWith("__") || i.isPath, g = ue(u), _ = (e, o) => t.setPlacement({ lock_conditions: ye(e) }, o), w = (e, o, n) => _(
|
|
43
|
+
g.map((d, h) => h === e ? { ...d, ...o } : d),
|
|
42
44
|
n
|
|
43
|
-
), x =
|
|
45
|
+
), x = fe(s.bundle, t.globals, t.relations), N = !b && i.relKind !== "M2M" && i.relKind !== "O2M" && !P.has(i.iface ?? "") && x.length > 0, r = me(f.apply_to_lines), $ = x.find((e) => e.field === r.grid) ?? null, { data: K = [] } = be(N ? $ == null ? void 0 : $.childCollection : null), F = K.filter(
|
|
44
46
|
(e) => e.field !== "id" && !e.field.startsWith("__") && !e.field.includes(".") && !["alias", "o2m", "m2m"].includes(e.type ?? "")
|
|
45
|
-
),
|
|
47
|
+
), M = (e, o) => t.setOverride("apply_to_lines", e ?? void 0, o), I = le().isAdmin && !b && !i.relKind && !P.has(i.iface ?? "") && i.type !== "alias" && i.computedType !== "virtual", O = b ? null : X(t.globals, t.relations, s.collection)[u.field] ?? null, q = pe(y), A = typeof p.max_values == "number" ? p.max_values : null;
|
|
46
48
|
return /* @__PURE__ */ c("div", { className: "space-y-5", children: [
|
|
49
|
+
O && /* @__PURE__ */ c(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
"data-setting": "field.source",
|
|
53
|
+
className: "rounded-md border border-slate-200 bg-slate-50 p-2.5 dark:border-border dark:bg-muted/40",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ l("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: "Where the value comes from" }),
|
|
56
|
+
/* @__PURE__ */ l(H, { source: O })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
47
60
|
/* @__PURE__ */ l(
|
|
48
|
-
|
|
61
|
+
v,
|
|
49
62
|
{
|
|
50
63
|
k: "field.required",
|
|
51
64
|
label: "Required",
|
|
52
65
|
effect: "The form will not save without a value.",
|
|
53
|
-
checked:
|
|
54
|
-
onChange: (e) =>
|
|
66
|
+
checked: f.required === !0,
|
|
67
|
+
onChange: (e) => t.setOverride(
|
|
55
68
|
"required",
|
|
56
69
|
e ? !0 : void 0,
|
|
57
|
-
e ? `Make ${
|
|
70
|
+
e ? `Make ${a} required` : `Make ${a} optional`
|
|
58
71
|
)
|
|
59
72
|
}
|
|
60
73
|
),
|
|
61
|
-
/* @__PURE__ */ l(
|
|
74
|
+
/* @__PURE__ */ l(oe, {}),
|
|
62
75
|
/* @__PURE__ */ l(
|
|
63
|
-
|
|
76
|
+
v,
|
|
64
77
|
{
|
|
65
78
|
k: "field.readonly",
|
|
66
79
|
label: "Read-only",
|
|
67
80
|
effect: "Shown but not editable on this form.",
|
|
68
|
-
checked:
|
|
69
|
-
onChange: (e) =>
|
|
81
|
+
checked: f.readonly === !0,
|
|
82
|
+
onChange: (e) => t.setOverride(
|
|
70
83
|
"readonly",
|
|
71
84
|
e ? !0 : void 0,
|
|
72
|
-
e ? `Make ${
|
|
85
|
+
e ? `Make ${a} read-only` : `Make ${a} editable`
|
|
73
86
|
)
|
|
74
87
|
}
|
|
75
88
|
),
|
|
76
|
-
/* @__PURE__ */ l(le, {}),
|
|
77
|
-
/* @__PURE__ */ l(te, {}),
|
|
78
89
|
/* @__PURE__ */ l(ie, {}),
|
|
79
|
-
/* @__PURE__ */ l(
|
|
90
|
+
/* @__PURE__ */ l(ae, {}),
|
|
91
|
+
/* @__PURE__ */ l(ne, {}),
|
|
92
|
+
/* @__PURE__ */ l(re, {}),
|
|
80
93
|
(i.computedType === "rollup" || i.computedType === "write") && /* @__PURE__ */ l(
|
|
81
|
-
|
|
94
|
+
v,
|
|
82
95
|
{
|
|
83
96
|
k: "field.editable_computed",
|
|
84
97
|
label: "Allow manual entry",
|
|
85
98
|
effect: "Lets people type over the calculated value here; the next recalculation still overwrites it.",
|
|
86
|
-
checked:
|
|
87
|
-
onChange: (e) =>
|
|
99
|
+
checked: f.editable_computed === !0,
|
|
100
|
+
onChange: (e) => t.setOverride(
|
|
88
101
|
"editable_computed",
|
|
89
102
|
e ? !0 : void 0,
|
|
90
|
-
e ? `Allow typing into ${
|
|
103
|
+
e ? `Allow typing into ${a}` : `Keep ${a} calculated only`
|
|
91
104
|
)
|
|
92
105
|
}
|
|
93
106
|
),
|
|
94
107
|
/* @__PURE__ */ l(
|
|
95
|
-
|
|
108
|
+
m,
|
|
96
109
|
{
|
|
97
110
|
k: "field.lock_conditions",
|
|
98
111
|
label: "Read-only when",
|
|
99
112
|
effect: "Locks the field while any of these holds. No conditions: always editable.",
|
|
100
113
|
children: /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
101
|
-
g.map((e,
|
|
114
|
+
g.map((e, o) => /* @__PURE__ */ c(
|
|
102
115
|
"div",
|
|
103
116
|
{
|
|
104
|
-
className:
|
|
117
|
+
className: G(te, "space-y-3 p-3"),
|
|
105
118
|
children: [
|
|
106
119
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
107
120
|
/* @__PURE__ */ l("div", { className: "flex-1", "data-setting": "field.lock_conditions.type", children: /* @__PURE__ */ l(
|
|
108
|
-
|
|
121
|
+
se,
|
|
109
122
|
{
|
|
110
123
|
value: e.type,
|
|
111
124
|
options: [
|
|
@@ -114,9 +127,9 @@ function Le() {
|
|
|
114
127
|
],
|
|
115
128
|
onChange: (n) => _(
|
|
116
129
|
g.map(
|
|
117
|
-
(d, h) => h ===
|
|
130
|
+
(d, h) => h === o ? n === "role" ? { type: "role", role_ids: [] } : { type: "pipeline_state", state_keys: [] } : d
|
|
118
131
|
),
|
|
119
|
-
`Change a lock condition of ${
|
|
132
|
+
`Change a lock condition of ${a}`
|
|
120
133
|
)
|
|
121
134
|
}
|
|
122
135
|
) }),
|
|
@@ -126,126 +139,126 @@ function Le() {
|
|
|
126
139
|
type: "button",
|
|
127
140
|
"aria-label": "Remove condition",
|
|
128
141
|
onClick: () => _(
|
|
129
|
-
g.filter((n, d) => d !==
|
|
130
|
-
`Remove a lock condition from ${
|
|
142
|
+
g.filter((n, d) => d !== o),
|
|
143
|
+
`Remove a lock condition from ${a}`
|
|
131
144
|
),
|
|
132
145
|
"data-tip": "Remove condition",
|
|
133
146
|
className: "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-100 hover:text-red-600 dark:hover:bg-muted dark:hover:text-red-400",
|
|
134
|
-
children: /* @__PURE__ */ l(
|
|
147
|
+
children: /* @__PURE__ */ l(W, { className: "h-3.5 w-3.5" })
|
|
135
148
|
}
|
|
136
149
|
)
|
|
137
150
|
] }),
|
|
138
151
|
e.type === "role" ? /* @__PURE__ */ l("div", { "data-setting": "field.lock_conditions.role_ids", children: /* @__PURE__ */ l(
|
|
139
|
-
|
|
152
|
+
Z,
|
|
140
153
|
{
|
|
141
154
|
roleIds: e.role_ids ?? [],
|
|
142
|
-
onRoleIdsChange: (n) => w(
|
|
155
|
+
onRoleIdsChange: (n) => w(o, { role_ids: n }, `Change the roles that lock ${a}`)
|
|
143
156
|
}
|
|
144
157
|
) }) : /* @__PURE__ */ l(
|
|
145
|
-
|
|
158
|
+
ee,
|
|
146
159
|
{
|
|
147
160
|
collection: s.collection,
|
|
148
161
|
pipelineId: e.pipeline_id,
|
|
149
162
|
stateKeys: e.state_keys ?? [],
|
|
150
163
|
onPipelineChange: (n) => w(
|
|
151
|
-
|
|
164
|
+
o,
|
|
152
165
|
{ pipeline_id: n, state_keys: [] },
|
|
153
|
-
`Change the pipeline that locks ${
|
|
166
|
+
`Change the pipeline that locks ${a}`
|
|
154
167
|
),
|
|
155
|
-
onStateKeysChange: (n) => w(
|
|
168
|
+
onStateKeysChange: (n) => w(o, { state_keys: n }, `Change the states that lock ${a}`)
|
|
156
169
|
}
|
|
157
170
|
)
|
|
158
171
|
]
|
|
159
172
|
},
|
|
160
|
-
|
|
173
|
+
o
|
|
161
174
|
)),
|
|
162
175
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
163
176
|
/* @__PURE__ */ l(
|
|
164
|
-
|
|
177
|
+
ce,
|
|
165
178
|
{
|
|
166
179
|
onClick: () => _(
|
|
167
180
|
[...g, { type: "pipeline_state", state_keys: [] }],
|
|
168
|
-
`Add a lock condition to ${
|
|
181
|
+
`Add a lock condition to ${a}`
|
|
169
182
|
),
|
|
170
183
|
children: "+ Add condition"
|
|
171
184
|
}
|
|
172
185
|
),
|
|
173
|
-
!
|
|
174
|
-
|
|
186
|
+
!b && /* @__PURE__ */ l(
|
|
187
|
+
J,
|
|
175
188
|
{
|
|
176
189
|
layoutId: Number(y.id),
|
|
177
|
-
target: { kind: "lock", field:
|
|
190
|
+
target: { kind: "lock", field: u.field },
|
|
178
191
|
bundle: s.bundle,
|
|
179
|
-
apply: (e,
|
|
180
|
-
disabled:
|
|
192
|
+
apply: (e, o) => s.apply(e, o),
|
|
193
|
+
disabled: t.readOnly
|
|
181
194
|
}
|
|
182
195
|
)
|
|
183
196
|
] })
|
|
184
197
|
] })
|
|
185
198
|
}
|
|
186
199
|
),
|
|
187
|
-
!
|
|
188
|
-
|
|
200
|
+
!b && i.relKind !== "O2M" && /* @__PURE__ */ c(
|
|
201
|
+
m,
|
|
189
202
|
{
|
|
190
203
|
k: "field.default_value",
|
|
191
204
|
label: "Default for new records",
|
|
192
205
|
effect: "Filled in when someone creates a record on this form.",
|
|
193
206
|
children: [
|
|
194
207
|
/* @__PURE__ */ l("div", { onBlurCapture: () => s.flush(), children: /* @__PURE__ */ l(
|
|
195
|
-
|
|
208
|
+
Y,
|
|
196
209
|
{
|
|
197
|
-
value: q[
|
|
198
|
-
onChange: (e,
|
|
210
|
+
value: q[u.field],
|
|
211
|
+
onChange: (e, o) => s.apply(
|
|
199
212
|
[
|
|
200
213
|
{
|
|
201
214
|
op: "layout_update",
|
|
202
|
-
patch: { default_values:
|
|
215
|
+
patch: { default_values: he(y, u.field, e) }
|
|
203
216
|
}
|
|
204
217
|
],
|
|
205
|
-
{ label: `Change the default of ${
|
|
218
|
+
{ label: `Change the default of ${a}`, text: o }
|
|
206
219
|
),
|
|
207
220
|
isM2O: i.relKind === "M2O",
|
|
208
221
|
isM2M: i.relKind === "M2M",
|
|
209
222
|
relatedCollection: i.relatedCollection,
|
|
210
|
-
settings: { options:
|
|
223
|
+
settings: { options: t.globalOptions, interface: i.iface },
|
|
211
224
|
abstractType: i.type
|
|
212
225
|
}
|
|
213
226
|
) }),
|
|
214
227
|
/* @__PURE__ */ l("div", { className: "pt-1", children: /* @__PURE__ */ l(
|
|
215
|
-
|
|
228
|
+
z,
|
|
216
229
|
{
|
|
217
230
|
layoutId: Number(y.id),
|
|
218
|
-
field:
|
|
219
|
-
disabled:
|
|
231
|
+
field: u.field,
|
|
232
|
+
disabled: t.readOnly
|
|
220
233
|
}
|
|
221
234
|
) })
|
|
222
235
|
]
|
|
223
236
|
}
|
|
224
237
|
),
|
|
225
238
|
I && /* @__PURE__ */ l(
|
|
226
|
-
|
|
239
|
+
m,
|
|
227
240
|
{
|
|
228
241
|
k: "field.validation_rules",
|
|
229
242
|
label: "Checks",
|
|
230
243
|
scope: "field",
|
|
231
244
|
effect: "Learned from the values stored today, each with how many existing values it would refuse.",
|
|
232
245
|
children: /* @__PURE__ */ l(
|
|
233
|
-
|
|
246
|
+
U,
|
|
234
247
|
{
|
|
235
248
|
layoutId: Number(y.id),
|
|
236
|
-
field:
|
|
237
|
-
disabled:
|
|
238
|
-
onApply: (e,
|
|
239
|
-
const h = d.columns.validation_rules,
|
|
240
|
-
return { ...d, columns: { ...d.columns, validation_rules: [...
|
|
249
|
+
field: u.field,
|
|
250
|
+
disabled: t.readOnly,
|
|
251
|
+
onApply: (e, o, n) => t.proposeGlobal("field.validation_rules", e.length, n, (d) => {
|
|
252
|
+
const h = d.columns.validation_rules, R = Array.isArray(h) ? h : o, B = (k, C) => k.type === C.type && String(k.value ?? "") === String(C.value ?? ""), D = e.filter((k) => !R.some((C) => B(C, k)));
|
|
253
|
+
return { ...d, columns: { ...d.columns, validation_rules: [...R, ...D] } };
|
|
241
254
|
})
|
|
242
255
|
}
|
|
243
256
|
)
|
|
244
257
|
}
|
|
245
258
|
),
|
|
246
|
-
i.relKind === "M2M" && /* @__PURE__ */ c(
|
|
259
|
+
i.relKind === "M2M" && /* @__PURE__ */ c(S, { title: "How many", children: [
|
|
247
260
|
/* @__PURE__ */ l(
|
|
248
|
-
|
|
261
|
+
m,
|
|
249
262
|
{
|
|
250
263
|
k: "field.max_values",
|
|
251
264
|
label: "Most values",
|
|
@@ -258,39 +271,39 @@ function Le() {
|
|
|
258
271
|
value: A == null ? "" : String(A),
|
|
259
272
|
placeholder: "No limit",
|
|
260
273
|
onChange: (e) => {
|
|
261
|
-
const
|
|
262
|
-
|
|
274
|
+
const o = e === "" ? void 0 : Math.max(1, Math.round(Number(e)));
|
|
275
|
+
o !== void 0 && Number.isNaN(o) || t.setOption("max_values", o, `Limit how many ${a} can be picked`, !0);
|
|
263
276
|
}
|
|
264
277
|
}
|
|
265
278
|
)
|
|
266
279
|
}
|
|
267
280
|
),
|
|
268
281
|
A != null && /* @__PURE__ */ l(
|
|
269
|
-
|
|
282
|
+
v,
|
|
270
283
|
{
|
|
271
284
|
k: "field.max_values_enforce_on_write",
|
|
272
285
|
label: "Refuse more on the server too",
|
|
273
286
|
effect: "Imports, the API and other forms cannot store more than the limit.",
|
|
274
287
|
enforced: !0,
|
|
275
|
-
checked:
|
|
276
|
-
onChange: (e) =>
|
|
288
|
+
checked: p.enforce_on_write === !0,
|
|
289
|
+
onChange: (e) => t.setOption(
|
|
277
290
|
"enforce_on_write",
|
|
278
291
|
e ? !0 : void 0,
|
|
279
|
-
e ? `Enforce the limit of ${
|
|
292
|
+
e ? `Enforce the limit of ${a} on the server` : `Stop enforcing the limit of ${a}`
|
|
280
293
|
)
|
|
281
294
|
}
|
|
282
295
|
)
|
|
283
296
|
] }),
|
|
284
|
-
|
|
297
|
+
N && /* @__PURE__ */ c(S, { title: "Apply to lines", children: [
|
|
285
298
|
/* @__PURE__ */ l("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "A button beside the field copies its value into one column of every line of a grid." }),
|
|
286
299
|
/* @__PURE__ */ l(
|
|
287
|
-
|
|
300
|
+
m,
|
|
288
301
|
{
|
|
289
302
|
k: "field.apply_to_lines.grid",
|
|
290
303
|
label: "Grid",
|
|
291
304
|
effect: "The grid whose lines get the value.",
|
|
292
305
|
children: /* @__PURE__ */ l(
|
|
293
|
-
|
|
306
|
+
L,
|
|
294
307
|
{
|
|
295
308
|
ariaLabel: "Grid",
|
|
296
309
|
value: r.grid ?? "",
|
|
@@ -298,37 +311,37 @@ function Le() {
|
|
|
298
311
|
{ value: "", label: "Off" },
|
|
299
312
|
...x.map((e) => ({ value: e.field, label: e.label }))
|
|
300
313
|
],
|
|
301
|
-
onChange: (e) =>
|
|
314
|
+
onChange: (e) => M(
|
|
302
315
|
e ? { grid: e, target: "", ...r.label ? { label: r.label } : {} } : null,
|
|
303
|
-
e ? `Copy ${
|
|
316
|
+
e ? `Copy ${a} into lines` : `Stop copying ${a} into lines`
|
|
304
317
|
)
|
|
305
318
|
}
|
|
306
319
|
)
|
|
307
320
|
}
|
|
308
321
|
),
|
|
309
322
|
/* @__PURE__ */ l(
|
|
310
|
-
|
|
323
|
+
m,
|
|
311
324
|
{
|
|
312
325
|
k: "field.apply_to_lines.target",
|
|
313
326
|
label: "Column",
|
|
314
327
|
effect: "The column of each line that receives the value.",
|
|
315
328
|
children: /* @__PURE__ */ l(
|
|
316
|
-
|
|
329
|
+
L,
|
|
317
330
|
{
|
|
318
331
|
ariaLabel: "Column",
|
|
319
332
|
disabled: !r.grid,
|
|
320
333
|
value: r.target ?? "",
|
|
321
334
|
options: [
|
|
322
335
|
{ value: "", label: r.grid ? "Pick a column…" : "Pick a grid first" },
|
|
323
|
-
...
|
|
336
|
+
...F.map((e) => ({ value: e.field, label: e.label || Q(e.field) }))
|
|
324
337
|
],
|
|
325
|
-
onChange: (e) =>
|
|
338
|
+
onChange: (e) => M({ ...r, target: e }, `Copy ${a} into a column`)
|
|
326
339
|
}
|
|
327
340
|
)
|
|
328
341
|
}
|
|
329
342
|
),
|
|
330
343
|
/* @__PURE__ */ l(
|
|
331
|
-
|
|
344
|
+
m,
|
|
332
345
|
{
|
|
333
346
|
k: "field.apply_to_lines.label",
|
|
334
347
|
label: "Button label",
|
|
@@ -341,11 +354,11 @@ function Le() {
|
|
|
341
354
|
value: r.label ?? "",
|
|
342
355
|
placeholder: "Apply to lines",
|
|
343
356
|
onChange: (e) => {
|
|
344
|
-
const { label:
|
|
345
|
-
|
|
357
|
+
const { label: o, ...n } = r;
|
|
358
|
+
t.setOverride(
|
|
346
359
|
"apply_to_lines",
|
|
347
360
|
e ? { ...n, label: e } : n,
|
|
348
|
-
`Rename the apply-to-lines button of ${
|
|
361
|
+
`Rename the apply-to-lines button of ${a}`,
|
|
349
362
|
!0
|
|
350
363
|
);
|
|
351
364
|
}
|
|
@@ -355,22 +368,22 @@ function Le() {
|
|
|
355
368
|
)
|
|
356
369
|
] }),
|
|
357
370
|
s.layoutType === "addendum" && /* @__PURE__ */ l(
|
|
358
|
-
|
|
371
|
+
v,
|
|
359
372
|
{
|
|
360
373
|
k: "field.prefill_from_parent",
|
|
361
374
|
label: "Prefill from the record",
|
|
362
375
|
effect: "A new addendum starts with the record's current value.",
|
|
363
|
-
checked:
|
|
364
|
-
onChange: (e) =>
|
|
376
|
+
checked: f.prefill_from_parent !== !1,
|
|
377
|
+
onChange: (e) => t.setOverride(
|
|
365
378
|
"prefill_from_parent",
|
|
366
379
|
e ? void 0 : !1,
|
|
367
|
-
e ? `Prefill ${
|
|
380
|
+
e ? `Prefill ${a} from the record` : `Start ${a} empty on addendums`
|
|
368
381
|
)
|
|
369
382
|
}
|
|
370
383
|
)
|
|
371
384
|
] });
|
|
372
385
|
}
|
|
373
386
|
export {
|
|
374
|
-
|
|
375
|
-
|
|
387
|
+
qe as RulesTab,
|
|
388
|
+
be as useFieldRows
|
|
376
389
|
};
|