@nivaro/react 0.3.36 → 0.3.37
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/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +11 -10
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
1
|
+
import { jsxs as h, jsx as n, Fragment as C } from "react/jsx-runtime";
|
|
2
2
|
import { X as S } from "lucide-react";
|
|
3
3
|
import { useMemo as N } from "react";
|
|
4
|
-
import { validateExpression as
|
|
5
|
-
import { displayFormulaOf as
|
|
4
|
+
import { validateExpression as O } from "../../../lib/expression.js";
|
|
5
|
+
import { displayFormulaOf as R, textRulesOf as T, counterOf as M, confirmChangeOf as L } from "../../../lib/placement-behaviour.js";
|
|
6
6
|
import { cn as F } from "../../../lib/utils.js";
|
|
7
|
-
import { RoleConditionRow as
|
|
8
|
-
import { useColumnFacts as
|
|
7
|
+
import { RoleConditionRow as P, PipelineStateConditionRow as $ } from "../editors/lock-conditions.js";
|
|
8
|
+
import { useColumnFacts as A, columnOf as D } from "../inspect/inspect-api.js";
|
|
9
9
|
import { effectText as I, tintCard as W } from "../panel-style.js";
|
|
10
|
-
import { isRelational as
|
|
11
|
-
import { useFieldCtx as
|
|
12
|
-
import { useInspectorEnv as
|
|
10
|
+
import { isRelational as K } from "./applies.js";
|
|
11
|
+
import { useFieldCtx as g } from "./field-context.js";
|
|
12
|
+
import { useInspectorEnv as j, Setting as p, TextInput as _, TextArea as q, Segmented as k, DraftInput as E, AddButton as H, Toggle as v } from "./kit.js";
|
|
13
13
|
const U = "rounded p-0.5 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground";
|
|
14
|
-
function z(
|
|
15
|
-
if (
|
|
16
|
-
const s =
|
|
17
|
-
return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(
|
|
14
|
+
function z(l) {
|
|
15
|
+
if (K(l)) return !1;
|
|
16
|
+
const s = l.iface ?? "";
|
|
17
|
+
return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(l.type) || /textarea|rich|wysiwyg|markdown/i.test(s);
|
|
18
18
|
}
|
|
19
|
-
function w(
|
|
20
|
-
const
|
|
21
|
-
return !s.startsWith("__") && !
|
|
19
|
+
function w(l, s, o = {}) {
|
|
20
|
+
const c = o.allowM2M === !0 && l.relKind === "M2M";
|
|
21
|
+
return !s.startsWith("__") && !l.isPath && (c || l.type !== "alias" && l.relKind !== "M2M") && l.relKind !== "O2M" && l.computedType !== "virtual" && l.computedType !== "read";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
function oe() {
|
|
24
|
+
const l = g(), { ov: s, info: o, env: c, row: i } = l, d = o.label, f = T(s), u = (r, a, e) => l.setOverride("text_rules", r.length ? r : void 0, a, e), t = (r, a, e, m) => u(
|
|
25
|
+
f.map((y, b) => b === r ? { ...y, ...a } : y),
|
|
26
26
|
e,
|
|
27
27
|
m
|
|
28
28
|
);
|
|
@@ -33,92 +33,92 @@ function le() {
|
|
|
33
33
|
label: "Label and help by state or role",
|
|
34
34
|
effect: "Different words in a workflow state or for a role: “Requested date” becomes “Delivered date” once Completed. The first rule that matches wins; the record page, read view and PDF follow it.",
|
|
35
35
|
children: [
|
|
36
|
-
|
|
36
|
+
f.map((r, a) => /* @__PURE__ */ h(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
|
-
"data-text-rule":
|
|
39
|
+
"data-text-rule": a,
|
|
40
40
|
className: F(W, "space-y-2 px-2.5 py-2"),
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ n("div", { className: "flex-1", children: /* @__PURE__ */ n(
|
|
44
44
|
k,
|
|
45
45
|
{
|
|
46
|
-
value:
|
|
46
|
+
value: r.type,
|
|
47
47
|
options: [
|
|
48
48
|
{ value: "pipeline_state", label: "In a state" },
|
|
49
49
|
{ value: "role", label: "For a role" }
|
|
50
50
|
],
|
|
51
51
|
onChange: (e) => t(
|
|
52
|
-
|
|
52
|
+
a,
|
|
53
53
|
e === "role" ? {
|
|
54
54
|
type: "role",
|
|
55
55
|
role_ids: [],
|
|
56
56
|
state_keys: void 0,
|
|
57
57
|
pipeline_id: void 0
|
|
58
58
|
} : { type: "pipeline_state", state_keys: [], role_ids: void 0 },
|
|
59
|
-
`Change when ${
|
|
59
|
+
`Change when ${d} reads differently`
|
|
60
60
|
)
|
|
61
61
|
}
|
|
62
62
|
) }),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
66
66
|
type: "button",
|
|
67
67
|
"aria-label": "Remove this rule",
|
|
68
68
|
"data-tip": "Remove this rule",
|
|
69
69
|
className: U,
|
|
70
|
-
onClick: () =>
|
|
71
|
-
|
|
72
|
-
`Remove a label rule from ${
|
|
70
|
+
onClick: () => u(
|
|
71
|
+
f.filter((e, m) => m !== a),
|
|
72
|
+
`Remove a label rule from ${d}`
|
|
73
73
|
),
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ n(S, { className: "h-3.5 w-3.5" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }),
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
r.type === "role" ? /* @__PURE__ */ n(
|
|
79
|
+
P,
|
|
80
80
|
{
|
|
81
|
-
roleIds:
|
|
82
|
-
onRoleIdsChange: (e) => t(
|
|
81
|
+
roleIds: r.role_ids ?? [],
|
|
82
|
+
onRoleIdsChange: (e) => t(a, { role_ids: e }, `Change the roles for ${d}`)
|
|
83
83
|
}
|
|
84
|
-
) : /* @__PURE__ */
|
|
84
|
+
) : /* @__PURE__ */ n(
|
|
85
85
|
$,
|
|
86
86
|
{
|
|
87
|
-
collection:
|
|
88
|
-
pipelineId:
|
|
89
|
-
stateKeys:
|
|
90
|
-
onPipelineChange: (e) => t(
|
|
91
|
-
onStateKeysChange: (e) => t(
|
|
87
|
+
collection: c.collection,
|
|
88
|
+
pipelineId: r.pipeline_id,
|
|
89
|
+
stateKeys: r.state_keys ?? [],
|
|
90
|
+
onPipelineChange: (e) => t(a, { pipeline_id: e, state_keys: [] }, `Change the pipeline for ${d}`),
|
|
91
|
+
onStateKeysChange: (e) => t(a, { state_keys: e }, `Change the states for ${d}`)
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ n(
|
|
95
95
|
_,
|
|
96
96
|
{
|
|
97
97
|
ariaLabel: "Label in this case",
|
|
98
|
-
value:
|
|
99
|
-
placeholder: `Label (${
|
|
100
|
-
onChange: (e) => t(
|
|
98
|
+
value: r.label ?? "",
|
|
99
|
+
placeholder: `Label (${d})`,
|
|
100
|
+
onChange: (e) => t(a, { label: e || void 0 }, `Change a label rule of ${d}`, !0)
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ n(
|
|
104
104
|
_,
|
|
105
105
|
{
|
|
106
106
|
ariaLabel: "Help text in this case",
|
|
107
|
-
value:
|
|
107
|
+
value: r.note ?? "",
|
|
108
108
|
placeholder: "Help text (unchanged when empty)",
|
|
109
|
-
onChange: (e) => t(
|
|
109
|
+
onChange: (e) => t(a, { note: e || void 0 }, `Change a help rule of ${d}`, !0)
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
]
|
|
113
113
|
},
|
|
114
|
-
|
|
114
|
+
a
|
|
115
115
|
)),
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ n(
|
|
117
117
|
H,
|
|
118
118
|
{
|
|
119
|
-
onClick: () =>
|
|
120
|
-
[...
|
|
121
|
-
`Add a label rule to ${
|
|
119
|
+
onClick: () => u(
|
|
120
|
+
[...f, { type: "pipeline_state", state_keys: [] }],
|
|
121
|
+
`Add a label rule to ${d}`
|
|
122
122
|
),
|
|
123
123
|
children: "+ Add a rule"
|
|
124
124
|
}
|
|
@@ -128,25 +128,25 @@ function le() {
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
function re() {
|
|
131
|
-
const
|
|
132
|
-
if (!z(
|
|
133
|
-
const
|
|
131
|
+
const l = g(), { ov: s, info: o, env: c, row: i } = l, { data: d } = A(c.collection), f = D(d, i.field);
|
|
132
|
+
if (!z(o) || i.field.startsWith("__")) return null;
|
|
133
|
+
const u = o.label, t = M(s), r = (f == null ? void 0 : f.max_length) != null && f.max_length > 0 ? f.max_length : null, a = (e, m, y) => l.setOverride("counter", e, m, y);
|
|
134
134
|
return /* @__PURE__ */ h("div", { "data-setting": "field.counter", className: "space-y-3", children: [
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ n(
|
|
136
136
|
v,
|
|
137
137
|
{
|
|
138
138
|
k: "field.counter.on",
|
|
139
139
|
label: "Counter and limit",
|
|
140
|
-
effect:
|
|
140
|
+
effect: r ? `Counts as people type. The limit starts at the column size (${r.toLocaleString()} characters); past it the form will not save.` : "Counts as people type; past a limit the form will not save.",
|
|
141
141
|
checked: !!t,
|
|
142
|
-
onChange: (e) =>
|
|
143
|
-
e ? { unit: "characters", ...
|
|
144
|
-
e ? `Count the characters of ${
|
|
142
|
+
onChange: (e) => a(
|
|
143
|
+
e ? { unit: "characters", ...r ? { limit: r } : {} } : void 0,
|
|
144
|
+
e ? `Count the characters of ${u}` : `Stop counting ${u}`
|
|
145
145
|
)
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
t && /* @__PURE__ */ h(C, { children: [
|
|
149
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ n(p, { k: "field.counter.unit", label: "Count", effect: "Characters or words.", children: /* @__PURE__ */ n(
|
|
150
150
|
k,
|
|
151
151
|
{
|
|
152
152
|
value: t.unit,
|
|
@@ -154,33 +154,33 @@ function re() {
|
|
|
154
154
|
{ value: "characters", label: "Characters" },
|
|
155
155
|
{ value: "words", label: "Words" }
|
|
156
156
|
],
|
|
157
|
-
onChange: (e) =>
|
|
157
|
+
onChange: (e) => a(
|
|
158
158
|
{
|
|
159
159
|
unit: e,
|
|
160
|
-
...e === "words" ? {} : t.limit != null ? { limit: t.limit } :
|
|
160
|
+
...e === "words" ? {} : t.limit != null ? { limit: t.limit } : r ? { limit: r } : {}
|
|
161
161
|
},
|
|
162
|
-
`Count the ${e} of ${
|
|
162
|
+
`Count the ${e} of ${u}`
|
|
163
163
|
)
|
|
164
164
|
}
|
|
165
165
|
) }),
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ n(
|
|
167
167
|
p,
|
|
168
168
|
{
|
|
169
169
|
k: "field.counter.limit",
|
|
170
170
|
label: "Limit",
|
|
171
|
-
effect: t.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${
|
|
172
|
-
children: /* @__PURE__ */
|
|
171
|
+
effect: t.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${r ? `; the column holds ${r.toLocaleString()}` : ""}.`,
|
|
172
|
+
children: /* @__PURE__ */ n(
|
|
173
173
|
_,
|
|
174
174
|
{
|
|
175
175
|
type: "number",
|
|
176
176
|
ariaLabel: "Limit",
|
|
177
177
|
value: t.limit == null ? "" : String(t.limit),
|
|
178
|
-
placeholder: t.unit === "characters" &&
|
|
178
|
+
placeholder: t.unit === "characters" && r ? String(r) : "No limit",
|
|
179
179
|
onChange: (e) => {
|
|
180
180
|
const m = e === "" ? void 0 : Math.max(1, Math.floor(Number(e)));
|
|
181
|
-
m !== void 0 && !Number.isFinite(m) ||
|
|
181
|
+
m !== void 0 && !Number.isFinite(m) || a(
|
|
182
182
|
{ unit: t.unit, ...m ? { limit: m } : {} },
|
|
183
|
-
`Set the limit of ${
|
|
183
|
+
`Set the limit of ${u}`,
|
|
184
184
|
!0
|
|
185
185
|
);
|
|
186
186
|
}
|
|
@@ -192,11 +192,11 @@ function re() {
|
|
|
192
192
|
] });
|
|
193
193
|
}
|
|
194
194
|
function ie() {
|
|
195
|
-
var
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const i = s.required === !0 || s.required === void 0 && !!((
|
|
199
|
-
return /* @__PURE__ */
|
|
195
|
+
var d;
|
|
196
|
+
const l = g(), { ov: s, info: o, row: c } = l;
|
|
197
|
+
if (c.field.startsWith("__")) return null;
|
|
198
|
+
const i = s.required === !0 || s.required === void 0 && !!((d = o.global) != null && d.required);
|
|
199
|
+
return /* @__PURE__ */ n(
|
|
200
200
|
v,
|
|
201
201
|
{
|
|
202
202
|
k: "field.recommended",
|
|
@@ -204,51 +204,51 @@ function ie() {
|
|
|
204
204
|
effect: i ? "Required already wins; switch Required off to make this a recommendation." : "An amber marker and a reminder on save listing what is still empty. Saving is never blocked.",
|
|
205
205
|
checked: s.recommended === !0 && !i,
|
|
206
206
|
disabled: i,
|
|
207
|
-
onChange: (
|
|
207
|
+
onChange: (f) => l.setOverride(
|
|
208
208
|
"recommended",
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
f ? !0 : void 0,
|
|
210
|
+
f ? `Recommend ${o.label}` : `Stop recommending ${o.label}`
|
|
211
211
|
)
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
215
|
function se() {
|
|
216
|
-
const
|
|
217
|
-
if (!w(
|
|
218
|
-
const
|
|
216
|
+
const l = g(), { ov: s, info: o, env: c, row: i } = l;
|
|
217
|
+
if (!w(o, i.field)) return null;
|
|
218
|
+
const d = o.label, f = L(s), u = s.confirm_change && typeof s.confirm_change == "object" ? s.confirm_change : {}, t = typeof u.pipeline_id == "string" ? u.pipeline_id : void 0, r = (a, e) => l.setOverride("confirm_change", a, e);
|
|
219
219
|
return /* @__PURE__ */ h("div", { "data-setting": "field.confirm_change", className: "space-y-3", children: [
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ n(
|
|
221
221
|
v,
|
|
222
222
|
{
|
|
223
223
|
k: "field.confirm_change.on",
|
|
224
224
|
label: "Confirm changes on saved records",
|
|
225
225
|
effect: "Changing it on an existing record asks “Are you sure?” and a short reason, kept with the change in the history. New records are not asked.",
|
|
226
|
-
checked: !!
|
|
227
|
-
onChange: (
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
checked: !!f,
|
|
227
|
+
onChange: (a) => r(
|
|
228
|
+
a ? { state_keys: [] } : void 0,
|
|
229
|
+
a ? `Confirm changes to ${d}` : `Stop confirming changes to ${d}`
|
|
230
230
|
)
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
|
-
|
|
233
|
+
f && /* @__PURE__ */ n(
|
|
234
234
|
p,
|
|
235
235
|
{
|
|
236
236
|
k: "field.confirm_change.states",
|
|
237
237
|
label: "Only in these states",
|
|
238
|
-
effect:
|
|
239
|
-
children: /* @__PURE__ */
|
|
238
|
+
effect: f.state_keys.length ? "Asked only while the record is in a ticked state." : "No state ticked: asked in every state.",
|
|
239
|
+
children: /* @__PURE__ */ n(
|
|
240
240
|
$,
|
|
241
241
|
{
|
|
242
|
-
collection:
|
|
242
|
+
collection: c.collection,
|
|
243
243
|
pipelineId: t,
|
|
244
|
-
stateKeys:
|
|
245
|
-
onPipelineChange: (
|
|
246
|
-
{ ...
|
|
247
|
-
`Change the pipeline that confirms ${
|
|
244
|
+
stateKeys: f.state_keys,
|
|
245
|
+
onPipelineChange: (a) => r(
|
|
246
|
+
{ ...a ? { pipeline_id: a } : {}, state_keys: [] },
|
|
247
|
+
`Change the pipeline that confirms ${d}`
|
|
248
248
|
),
|
|
249
|
-
onStateKeysChange: (
|
|
250
|
-
{ ...t ? { pipeline_id: t } : {}, state_keys:
|
|
251
|
-
`Change the states that confirm ${
|
|
249
|
+
onStateKeysChange: (a) => r(
|
|
250
|
+
{ ...t ? { pipeline_id: t } : {}, state_keys: a },
|
|
251
|
+
`Change the states that confirm ${d}`
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
)
|
|
@@ -257,35 +257,52 @@ function se() {
|
|
|
257
257
|
] });
|
|
258
258
|
}
|
|
259
259
|
function ce() {
|
|
260
|
-
const
|
|
261
|
-
return !w(
|
|
260
|
+
const l = g(), { ov: s, info: o, row: c } = l;
|
|
261
|
+
return !w(o, c.field) || o.computedType ? null : /* @__PURE__ */ n(
|
|
262
262
|
v,
|
|
263
263
|
{
|
|
264
264
|
k: "field.repeat_last",
|
|
265
265
|
label: "Repeat last value",
|
|
266
266
|
effect: "A “Repeat last” button beside the label fills in what this person entered on their previous record here.",
|
|
267
267
|
checked: s.repeat_last === !0,
|
|
268
|
-
onChange: (i) =>
|
|
268
|
+
onChange: (i) => l.setOverride(
|
|
269
269
|
"repeat_last",
|
|
270
270
|
i ? !0 : void 0,
|
|
271
|
-
i ? `Offer to repeat the last ${
|
|
271
|
+
i ? `Offer to repeat the last ${o.label}` : `Stop offering to repeat ${o.label}`
|
|
272
272
|
)
|
|
273
273
|
}
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
function de() {
|
|
277
|
-
const
|
|
278
|
-
return !w(
|
|
277
|
+
const l = g(), { ov: s, info: o, row: c } = l;
|
|
278
|
+
return !w(o, c.field, { allowM2M: !0 }) || o.computedType ? null : /* @__PURE__ */ n(
|
|
279
279
|
v,
|
|
280
280
|
{
|
|
281
281
|
k: "field.personal_default",
|
|
282
282
|
label: "Personal default",
|
|
283
283
|
effect: "On this form, people can save their own starting value for this field, and new records start with it.",
|
|
284
284
|
checked: s.personal_default === !0,
|
|
285
|
-
onChange: (i) =>
|
|
285
|
+
onChange: (i) => l.setOverride(
|
|
286
286
|
"personal_default",
|
|
287
287
|
i ? !0 : void 0,
|
|
288
|
-
i ? `Allow personal defaults for ${
|
|
288
|
+
i ? `Allow personal defaults for ${o.label}` : `Stop personal defaults for ${o.label}`
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
function fe() {
|
|
294
|
+
const l = g(), { ov: s, info: o } = l;
|
|
295
|
+
return s.personal_default !== !0 ? null : /* @__PURE__ */ n(
|
|
296
|
+
v,
|
|
297
|
+
{
|
|
298
|
+
k: "field.personal_default_inline",
|
|
299
|
+
label: "Make default on the form",
|
|
300
|
+
effect: "People can save, update and clear their default right beside this field. Off: they manage it only on their profile (My defaults); the form still fills it in.",
|
|
301
|
+
checked: s.personal_default_inline !== !1,
|
|
302
|
+
onChange: (c) => l.setOverride(
|
|
303
|
+
"personal_default_inline",
|
|
304
|
+
c ? void 0 : !1,
|
|
305
|
+
c ? `Offer Make default on the form for ${o.label}` : `Keep ${o.label}'s default to the profile`
|
|
289
306
|
)
|
|
290
307
|
}
|
|
291
308
|
);
|
|
@@ -298,11 +315,11 @@ const B = [
|
|
|
298
315
|
{ value: "percent", label: "Percent" }
|
|
299
316
|
];
|
|
300
317
|
function ue({
|
|
301
|
-
row:
|
|
318
|
+
row: l,
|
|
302
319
|
fields: s
|
|
303
320
|
}) {
|
|
304
|
-
const
|
|
305
|
-
const e =
|
|
321
|
+
const o = j(), c = N(() => {
|
|
322
|
+
const e = l.overrides;
|
|
306
323
|
if (typeof e == "string")
|
|
307
324
|
try {
|
|
308
325
|
return JSON.parse(e) ?? {};
|
|
@@ -310,24 +327,24 @@ function ue({
|
|
|
310
327
|
return {};
|
|
311
328
|
}
|
|
312
329
|
return e && typeof e == "object" ? e : {};
|
|
313
|
-
}, [
|
|
314
|
-
const
|
|
315
|
-
for (const x of Object.keys(
|
|
316
|
-
|
|
330
|
+
}, [l.overrides]), i = R(c) ?? { expr: "", format: "", currency: null }, d = typeof c.label == "string" ? c.label : "", f = { field: l.field, group_key: l.group_key }, u = (e, m, y) => {
|
|
331
|
+
const b = { ...c, ...e };
|
|
332
|
+
for (const x of Object.keys(b)) b[x] === void 0 && delete b[x];
|
|
333
|
+
o.apply([{ op: "update_placement", at: f, patch: { overrides: b } }], {
|
|
317
334
|
label: m,
|
|
318
|
-
text:
|
|
335
|
+
text: y
|
|
319
336
|
});
|
|
320
|
-
}, t = i.expr.trim() ?
|
|
321
|
-
|
|
322
|
-
),
|
|
337
|
+
}, t = i.expr.trim() ? O(i.expr, s) : null, r = new Set(
|
|
338
|
+
o.bundle.placements.filter((e) => !e.field.startsWith("__")).map((e) => e.field)
|
|
339
|
+
), a = t != null && t.ok ? t.tokens.filter((e) => !r.has(e.split(".")[0])) : [];
|
|
323
340
|
return /* @__PURE__ */ h("div", { className: "space-y-5", children: [
|
|
324
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ n(p, { k: "display_formula.label", label: "Label", effect: "What the form calls the value.", children: /* @__PURE__ */ n(
|
|
325
342
|
_,
|
|
326
343
|
{
|
|
327
344
|
ariaLabel: "Label",
|
|
328
|
-
value:
|
|
345
|
+
value: d,
|
|
329
346
|
placeholder: "Remaining",
|
|
330
|
-
onChange: (e) =>
|
|
347
|
+
onChange: (e) => u({ label: e || void 0 }, "Rename the formula", !0)
|
|
331
348
|
}
|
|
332
349
|
) }),
|
|
333
350
|
/* @__PURE__ */ h(
|
|
@@ -338,21 +355,21 @@ function ue({
|
|
|
338
355
|
effect: /* @__PURE__ */ h(C, { children: [
|
|
339
356
|
"Fields in double braces, for example",
|
|
340
357
|
" ",
|
|
341
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ n("code", { className: "font-mono text-[11.5px]", children: "{{budget}} - {{committed}}" }),
|
|
342
359
|
". Worked out on the page from what is on the form; never saved."
|
|
343
360
|
] }),
|
|
344
361
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
362
|
+
/* @__PURE__ */ n(
|
|
363
|
+
q,
|
|
347
364
|
{
|
|
348
365
|
ariaLabel: "Formula",
|
|
349
366
|
rows: 3,
|
|
350
367
|
mono: !0,
|
|
351
368
|
value: i.expr,
|
|
352
|
-
onChange: (e) =>
|
|
369
|
+
onChange: (e) => u({ display_formula: { ...i, expr: e } }, "Change the formula", !0)
|
|
353
370
|
}
|
|
354
371
|
),
|
|
355
|
-
t && !t.ok && /* @__PURE__ */
|
|
372
|
+
t && !t.ok && /* @__PURE__ */ n(
|
|
356
373
|
"p",
|
|
357
374
|
{
|
|
358
375
|
role: "alert",
|
|
@@ -364,31 +381,31 @@ function ue({
|
|
|
364
381
|
(t == null ? void 0 : t.ok) && t.unknownTokens.length > 0 && /* @__PURE__ */ h("p", { "data-formula-unknown": "", className: "text-[12px] text-amber-700 dark:text-amber-300", children: [
|
|
365
382
|
"Not fields of this collection:",
|
|
366
383
|
" ",
|
|
367
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ n("span", { className: "font-mono", children: t.unknownTokens.join(", ") })
|
|
368
385
|
] }),
|
|
369
|
-
(t == null ? void 0 : t.ok) && !t.unknownTokens.length &&
|
|
386
|
+
(t == null ? void 0 : t.ok) && !t.unknownTokens.length && a.length > 0 && /* @__PURE__ */ h("p", { "data-formula-offform": "", className: I, children: [
|
|
370
387
|
"Not on this form, so they read as empty here:",
|
|
371
388
|
" ",
|
|
372
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ n("span", { className: "font-mono", children: a.join(", ") })
|
|
373
390
|
] })
|
|
374
391
|
]
|
|
375
392
|
}
|
|
376
393
|
),
|
|
377
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ n(p, { k: "display_formula.format", label: "Show as", effect: "How the number is written.", children: /* @__PURE__ */ n(
|
|
378
395
|
k,
|
|
379
396
|
{
|
|
380
397
|
value: i.format,
|
|
381
398
|
options: B,
|
|
382
|
-
onChange: (e) =>
|
|
399
|
+
onChange: (e) => u({ display_formula: { ...i, format: e } }, "Change how the formula shows")
|
|
383
400
|
}
|
|
384
401
|
) }),
|
|
385
|
-
i.format === "currency" && /* @__PURE__ */
|
|
402
|
+
i.format === "currency" && /* @__PURE__ */ n(
|
|
386
403
|
p,
|
|
387
404
|
{
|
|
388
405
|
k: "display_formula.currency",
|
|
389
406
|
label: "Currency",
|
|
390
407
|
effect: "Three-letter code, for example USD.",
|
|
391
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ n(
|
|
392
409
|
E,
|
|
393
410
|
{
|
|
394
411
|
ariaLabel: "Currency",
|
|
@@ -397,7 +414,7 @@ function ue({
|
|
|
397
414
|
placeholder: "USD",
|
|
398
415
|
onCommit: (e) => {
|
|
399
416
|
const m = e.trim().toUpperCase();
|
|
400
|
-
m && !/^[A-Z]{3}$/.test(m) ||
|
|
417
|
+
m && !/^[A-Z]{3}$/.test(m) || u(
|
|
401
418
|
{ display_formula: { ...i, currency: m || null } },
|
|
402
419
|
"Change the currency of the formula",
|
|
403
420
|
!0
|
|
@@ -413,9 +430,10 @@ export {
|
|
|
413
430
|
se as ConfirmChangeSetting,
|
|
414
431
|
re as CounterSetting,
|
|
415
432
|
ue as DisplayFormulaSettings,
|
|
433
|
+
fe as PersonalDefaultInlineToggle,
|
|
416
434
|
de as PersonalDefaultToggle,
|
|
417
435
|
ie as RecommendedToggle,
|
|
418
436
|
ce as RepeatLastToggle,
|
|
419
|
-
|
|
437
|
+
oe as TextRulesSetting,
|
|
420
438
|
z as takesText
|
|
421
439
|
};
|