@nivaro/react 0.2.54 → 0.2.55
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +339 -2
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as j } from "@tanstack/react-query";
|
|
3
3
|
import { X as B } from "lucide-react";
|
|
4
4
|
import { useNivaroClient as E } from "../../../context.js";
|
|
@@ -11,9 +11,10 @@ import { FieldDefaultValueControl as z } from "../editors/field-default-value.js
|
|
|
11
11
|
import { RoleConditionRow as J, PipelineStateConditionRow as U } from "../editors/lock-conditions.js";
|
|
12
12
|
import { useLayoutEditorHost as Y } from "../host.js";
|
|
13
13
|
import { tintCard as Z } from "../panel-style.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { RecommendedToggle as ee, ConfirmChangeSetting as te, RepeatLastToggle as le } from "./BehaviourSettings.js";
|
|
15
|
+
import { useFieldCtx as ie } from "./field-context.js";
|
|
16
|
+
import { Toggle as g, Setting as f, Segmented as oe, AddButton as ae, Section as R, TextInput as S, Choice as T } from "./kit.js";
|
|
17
|
+
import { lockConditionsOf as ne, layoutGrids as re, asObject as de, defaultValuesOf as se, withDefaultValue as ce, lockConditionsColumn as ue } from "./model.js";
|
|
17
18
|
const L = /* @__PURE__ */ new Set([
|
|
18
19
|
"inline-table",
|
|
19
20
|
"inline-grid",
|
|
@@ -24,7 +25,7 @@ const L = /* @__PURE__ */ new Set([
|
|
|
24
25
|
"o2m",
|
|
25
26
|
"relation-path"
|
|
26
27
|
]);
|
|
27
|
-
function
|
|
28
|
+
function pe(a, i) {
|
|
28
29
|
const u = E();
|
|
29
30
|
return j({
|
|
30
31
|
queryKey: ["layout-editor", "field-rows", a, i ?? null],
|
|
@@ -35,16 +36,16 @@ function se(a, i) {
|
|
|
35
36
|
staleTime: 6e4
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
const a =
|
|
40
|
-
b.map((d, h) => h === e ? { ...d, ...
|
|
39
|
+
function Se() {
|
|
40
|
+
const a = ie(), { info: i, ov: u, opts: m, env: s, row: p } = a, o = i.label, y = s.bundle.layout, v = p.field.startsWith("__") || i.isPath, b = ne(p), _ = (e, l) => a.setPlacement({ lock_conditions: ue(e) }, l), w = (e, l, n) => _(
|
|
41
|
+
b.map((d, h) => h === e ? { ...d, ...l } : d),
|
|
41
42
|
n
|
|
42
|
-
), x =
|
|
43
|
+
), x = re(s.bundle, a.globals, a.relations), M = !v && i.relKind !== "M2M" && i.relKind !== "O2M" && !L.has(i.iface ?? "") && x.length > 0, r = de(u.apply_to_lines), $ = x.find((e) => e.field === r.grid) ?? null, { data: K = [] } = pe(M ? $ == null ? void 0 : $.childCollection : null), P = K.filter(
|
|
43
44
|
(e) => e.field !== "id" && !e.field.startsWith("__") && !e.field.includes(".") && !["alias", "o2m", "m2m"].includes(e.type ?? "")
|
|
44
|
-
), N = (e,
|
|
45
|
+
), N = (e, l) => a.setOverride("apply_to_lines", e ?? void 0, l), I = Y().isAdmin && !v && !i.relKind && !L.has(i.iface ?? "") && i.type !== "alias" && i.computedType !== "virtual", q = se(y), A = typeof m.max_values == "number" ? m.max_values : null;
|
|
45
46
|
return /* @__PURE__ */ c("div", { className: "space-y-5", children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
g,
|
|
48
49
|
{
|
|
49
50
|
k: "field.required",
|
|
50
51
|
label: "Required",
|
|
@@ -57,8 +58,9 @@ function Me() {
|
|
|
57
58
|
)
|
|
58
59
|
}
|
|
59
60
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
61
|
+
/* @__PURE__ */ t(ee, {}),
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
g,
|
|
62
64
|
{
|
|
63
65
|
k: "field.readonly",
|
|
64
66
|
label: "Read-only",
|
|
@@ -71,8 +73,10 @@ function Me() {
|
|
|
71
73
|
)
|
|
72
74
|
}
|
|
73
75
|
),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
/* @__PURE__ */ t(te, {}),
|
|
77
|
+
/* @__PURE__ */ t(le, {}),
|
|
78
|
+
(i.computedType === "rollup" || i.computedType === "write") && /* @__PURE__ */ t(
|
|
79
|
+
g,
|
|
76
80
|
{
|
|
77
81
|
k: "field.editable_computed",
|
|
78
82
|
label: "Allow manual entry",
|
|
@@ -85,21 +89,21 @@ function Me() {
|
|
|
85
89
|
)
|
|
86
90
|
}
|
|
87
91
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ t(
|
|
89
93
|
f,
|
|
90
94
|
{
|
|
91
95
|
k: "field.lock_conditions",
|
|
92
96
|
label: "Read-only when",
|
|
93
97
|
effect: "Locks the field while any of these holds. No conditions: always editable.",
|
|
94
98
|
children: /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
95
|
-
b.map((e,
|
|
99
|
+
b.map((e, l) => /* @__PURE__ */ c(
|
|
96
100
|
"div",
|
|
97
101
|
{
|
|
98
102
|
className: D(Z, "space-y-3 p-3"),
|
|
99
103
|
children: [
|
|
100
104
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
105
|
+
/* @__PURE__ */ t("div", { className: "flex-1", "data-setting": "field.lock_conditions.type", children: /* @__PURE__ */ t(
|
|
106
|
+
oe,
|
|
103
107
|
{
|
|
104
108
|
value: e.type,
|
|
105
109
|
options: [
|
|
@@ -108,54 +112,54 @@ function Me() {
|
|
|
108
112
|
],
|
|
109
113
|
onChange: (n) => _(
|
|
110
114
|
b.map(
|
|
111
|
-
(d, h) => h ===
|
|
115
|
+
(d, h) => h === l ? n === "role" ? { type: "role", role_ids: [] } : { type: "pipeline_state", state_keys: [] } : d
|
|
112
116
|
),
|
|
113
117
|
`Change a lock condition of ${o}`
|
|
114
118
|
)
|
|
115
119
|
}
|
|
116
120
|
) }),
|
|
117
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ t(
|
|
118
122
|
"button",
|
|
119
123
|
{
|
|
120
124
|
type: "button",
|
|
121
125
|
"aria-label": "Remove condition",
|
|
122
126
|
onClick: () => _(
|
|
123
|
-
b.filter((n, d) => d !==
|
|
127
|
+
b.filter((n, d) => d !== l),
|
|
124
128
|
`Remove a lock condition from ${o}`
|
|
125
129
|
),
|
|
126
130
|
"data-tip": "Remove condition",
|
|
127
131
|
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",
|
|
128
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" })
|
|
129
133
|
}
|
|
130
134
|
)
|
|
131
135
|
] }),
|
|
132
|
-
e.type === "role" ? /* @__PURE__ */
|
|
136
|
+
e.type === "role" ? /* @__PURE__ */ t("div", { "data-setting": "field.lock_conditions.role_ids", children: /* @__PURE__ */ t(
|
|
133
137
|
J,
|
|
134
138
|
{
|
|
135
139
|
roleIds: e.role_ids ?? [],
|
|
136
|
-
onRoleIdsChange: (n) => w(
|
|
140
|
+
onRoleIdsChange: (n) => w(l, { role_ids: n }, `Change the roles that lock ${o}`)
|
|
137
141
|
}
|
|
138
|
-
) }) : /* @__PURE__ */
|
|
142
|
+
) }) : /* @__PURE__ */ t(
|
|
139
143
|
U,
|
|
140
144
|
{
|
|
141
145
|
collection: s.collection,
|
|
142
146
|
pipelineId: e.pipeline_id,
|
|
143
147
|
stateKeys: e.state_keys ?? [],
|
|
144
148
|
onPipelineChange: (n) => w(
|
|
145
|
-
|
|
149
|
+
l,
|
|
146
150
|
{ pipeline_id: n, state_keys: [] },
|
|
147
151
|
`Change the pipeline that locks ${o}`
|
|
148
152
|
),
|
|
149
|
-
onStateKeysChange: (n) => w(
|
|
153
|
+
onStateKeysChange: (n) => w(l, { state_keys: n }, `Change the states that lock ${o}`)
|
|
150
154
|
}
|
|
151
155
|
)
|
|
152
156
|
]
|
|
153
157
|
},
|
|
154
|
-
|
|
158
|
+
l
|
|
155
159
|
)),
|
|
156
160
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
161
|
+
/* @__PURE__ */ t(
|
|
162
|
+
ae,
|
|
159
163
|
{
|
|
160
164
|
onClick: () => _(
|
|
161
165
|
[...b, { type: "pipeline_state", state_keys: [] }],
|
|
@@ -164,13 +168,13 @@ function Me() {
|
|
|
164
168
|
children: "+ Add condition"
|
|
165
169
|
}
|
|
166
170
|
),
|
|
167
|
-
!
|
|
171
|
+
!v && /* @__PURE__ */ t(
|
|
168
172
|
H,
|
|
169
173
|
{
|
|
170
174
|
layoutId: Number(y.id),
|
|
171
175
|
target: { kind: "lock", field: p.field },
|
|
172
176
|
bundle: s.bundle,
|
|
173
|
-
apply: (e,
|
|
177
|
+
apply: (e, l) => s.apply(e, l),
|
|
174
178
|
disabled: a.readOnly
|
|
175
179
|
}
|
|
176
180
|
)
|
|
@@ -178,25 +182,25 @@ function Me() {
|
|
|
178
182
|
] })
|
|
179
183
|
}
|
|
180
184
|
),
|
|
181
|
-
!
|
|
185
|
+
!v && i.relKind !== "O2M" && /* @__PURE__ */ c(
|
|
182
186
|
f,
|
|
183
187
|
{
|
|
184
188
|
k: "field.default_value",
|
|
185
189
|
label: "Default for new records",
|
|
186
190
|
effect: "Filled in when someone creates a record on this form.",
|
|
187
191
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ t("div", { onBlurCapture: () => s.flush(), children: /* @__PURE__ */ t(
|
|
189
193
|
z,
|
|
190
194
|
{
|
|
191
195
|
value: q[p.field],
|
|
192
|
-
onChange: (e,
|
|
196
|
+
onChange: (e, l) => s.apply(
|
|
193
197
|
[
|
|
194
198
|
{
|
|
195
199
|
op: "layout_update",
|
|
196
|
-
patch: { default_values:
|
|
200
|
+
patch: { default_values: ce(y, p.field, e) }
|
|
197
201
|
}
|
|
198
202
|
],
|
|
199
|
-
{ label: `Change the default of ${o}`, text:
|
|
203
|
+
{ label: `Change the default of ${o}`, text: l }
|
|
200
204
|
),
|
|
201
205
|
isM2O: i.relKind === "M2O",
|
|
202
206
|
isM2M: i.relKind === "M2M",
|
|
@@ -205,7 +209,7 @@ function Me() {
|
|
|
205
209
|
abstractType: i.type
|
|
206
210
|
}
|
|
207
211
|
) }),
|
|
208
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ t("div", { className: "pt-1", children: /* @__PURE__ */ t(
|
|
209
213
|
Q,
|
|
210
214
|
{
|
|
211
215
|
layoutId: Number(y.id),
|
|
@@ -216,21 +220,21 @@ function Me() {
|
|
|
216
220
|
]
|
|
217
221
|
}
|
|
218
222
|
),
|
|
219
|
-
I && /* @__PURE__ */
|
|
223
|
+
I && /* @__PURE__ */ t(
|
|
220
224
|
f,
|
|
221
225
|
{
|
|
222
226
|
k: "field.validation_rules",
|
|
223
227
|
label: "Checks",
|
|
224
228
|
scope: "field",
|
|
225
229
|
effect: "Learned from the values stored today, each with how many existing values it would refuse.",
|
|
226
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ t(
|
|
227
231
|
X,
|
|
228
232
|
{
|
|
229
233
|
layoutId: Number(y.id),
|
|
230
234
|
field: p.field,
|
|
231
235
|
disabled: a.readOnly,
|
|
232
|
-
onApply: (e,
|
|
233
|
-
const h = d.columns.validation_rules, O = Array.isArray(h) ? h :
|
|
236
|
+
onApply: (e, l, n) => a.proposeGlobal("field.validation_rules", e.length, n, (d) => {
|
|
237
|
+
const h = d.columns.validation_rules, O = Array.isArray(h) ? h : l, F = (k, C) => k.type === C.type && String(k.value ?? "") === String(C.value ?? ""), V = e.filter((k) => !O.some((C) => F(C, k)));
|
|
234
238
|
return { ...d, columns: { ...d.columns, validation_rules: [...O, ...V] } };
|
|
235
239
|
})
|
|
236
240
|
}
|
|
@@ -238,13 +242,13 @@ function Me() {
|
|
|
238
242
|
}
|
|
239
243
|
),
|
|
240
244
|
i.relKind === "M2M" && /* @__PURE__ */ c(R, { title: "How many", children: [
|
|
241
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ t(
|
|
242
246
|
f,
|
|
243
247
|
{
|
|
244
248
|
k: "field.max_values",
|
|
245
249
|
label: "Most values",
|
|
246
250
|
effect: "Empty: no limit. 1 makes it a single pick.",
|
|
247
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ t(
|
|
248
252
|
S,
|
|
249
253
|
{
|
|
250
254
|
type: "number",
|
|
@@ -252,15 +256,15 @@ function Me() {
|
|
|
252
256
|
value: A == null ? "" : String(A),
|
|
253
257
|
placeholder: "No limit",
|
|
254
258
|
onChange: (e) => {
|
|
255
|
-
const
|
|
256
|
-
|
|
259
|
+
const l = e === "" ? void 0 : Math.max(1, Math.round(Number(e)));
|
|
260
|
+
l !== void 0 && Number.isNaN(l) || a.setOption("max_values", l, `Limit how many ${o} can be picked`, !0);
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
)
|
|
260
264
|
}
|
|
261
265
|
),
|
|
262
|
-
A != null && /* @__PURE__ */
|
|
263
|
-
|
|
266
|
+
A != null && /* @__PURE__ */ t(
|
|
267
|
+
g,
|
|
264
268
|
{
|
|
265
269
|
k: "field.max_values_enforce_on_write",
|
|
266
270
|
label: "Refuse more on the server too",
|
|
@@ -276,14 +280,14 @@ function Me() {
|
|
|
276
280
|
)
|
|
277
281
|
] }),
|
|
278
282
|
M && /* @__PURE__ */ c(R, { title: "Apply to lines", children: [
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ t("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." }),
|
|
284
|
+
/* @__PURE__ */ t(
|
|
281
285
|
f,
|
|
282
286
|
{
|
|
283
287
|
k: "field.apply_to_lines.grid",
|
|
284
288
|
label: "Grid",
|
|
285
289
|
effect: "The grid whose lines get the value.",
|
|
286
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ t(
|
|
287
291
|
T,
|
|
288
292
|
{
|
|
289
293
|
ariaLabel: "Grid",
|
|
@@ -300,13 +304,13 @@ function Me() {
|
|
|
300
304
|
)
|
|
301
305
|
}
|
|
302
306
|
),
|
|
303
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ t(
|
|
304
308
|
f,
|
|
305
309
|
{
|
|
306
310
|
k: "field.apply_to_lines.target",
|
|
307
311
|
label: "Column",
|
|
308
312
|
effect: "The column of each line that receives the value.",
|
|
309
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ t(
|
|
310
314
|
T,
|
|
311
315
|
{
|
|
312
316
|
ariaLabel: "Column",
|
|
@@ -321,13 +325,13 @@ function Me() {
|
|
|
321
325
|
)
|
|
322
326
|
}
|
|
323
327
|
),
|
|
324
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ t(
|
|
325
329
|
f,
|
|
326
330
|
{
|
|
327
331
|
k: "field.apply_to_lines.label",
|
|
328
332
|
label: "Button label",
|
|
329
333
|
effect: "The words on the button.",
|
|
330
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ t(
|
|
331
335
|
S,
|
|
332
336
|
{
|
|
333
337
|
ariaLabel: "Button label",
|
|
@@ -335,7 +339,7 @@ function Me() {
|
|
|
335
339
|
value: r.label ?? "",
|
|
336
340
|
placeholder: "Apply to lines",
|
|
337
341
|
onChange: (e) => {
|
|
338
|
-
const { label:
|
|
342
|
+
const { label: l, ...n } = r;
|
|
339
343
|
a.setOverride(
|
|
340
344
|
"apply_to_lines",
|
|
341
345
|
e ? { ...n, label: e } : n,
|
|
@@ -348,8 +352,8 @@ function Me() {
|
|
|
348
352
|
}
|
|
349
353
|
)
|
|
350
354
|
] }),
|
|
351
|
-
s.layoutType === "addendum" && /* @__PURE__ */
|
|
352
|
-
|
|
355
|
+
s.layoutType === "addendum" && /* @__PURE__ */ t(
|
|
356
|
+
g,
|
|
353
357
|
{
|
|
354
358
|
k: "field.prefill_from_parent",
|
|
355
359
|
label: "Prefill from the record",
|
|
@@ -365,6 +369,6 @@ function Me() {
|
|
|
365
369
|
] });
|
|
366
370
|
}
|
|
367
371
|
export {
|
|
368
|
-
|
|
369
|
-
|
|
372
|
+
Se as RulesTab,
|
|
373
|
+
pe as useFieldRows
|
|
370
374
|
};
|