@nivaro/react 0.2.53 → 0.2.54
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 +1 -1
- package/dist/index.d.ts +113 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +4058 -3942
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { jsxs as s, jsx as t, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { titleCase as
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { useState as G, useEffect as V } from "react";
|
|
3
|
+
import { titleCase as L } from "../../../lib/utils.js";
|
|
4
|
+
import { RuleWriter as Z } from "../ai-rules/RuleWriter.js";
|
|
4
5
|
import { RoleConditionRow as K } from "../editors/lock-conditions.js";
|
|
5
|
-
import { O2MAggFieldCombobox as
|
|
6
|
-
import { SwapConfigEditor as
|
|
7
|
-
import { IconPicker as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { O2MAggFieldCombobox as ee } from "../editors/o2m-agg-field.js";
|
|
7
|
+
import { SwapConfigEditor as te } from "../editors/swap-config.js";
|
|
8
|
+
import { IconPicker as le } from "../pickers/icon-picker.js";
|
|
9
|
+
import { SectionReuseActions as ae } from "../reuse/SectionReuseActions.js";
|
|
10
|
+
import { useCollectionMeta as ne } from "./field-context.js";
|
|
11
|
+
import { useInspectorEnv as oe, Setting as d, TextInput as B, Choice as A, Segmented as g, Toggle as E, TextArea as H, Section as I, FieldMultiPicker as ie, ConditionBuilder as se } from "./kit.js";
|
|
12
|
+
import { groupFields as re, asArray as y, relKindOf as de, describeField as ce, relatedCollectionOf as he } from "./model.js";
|
|
13
|
+
import { GroupTranslations as fe } from "./Translations.js";
|
|
11
14
|
const C = {
|
|
12
15
|
section: "Section",
|
|
13
16
|
tab: "Tab or step",
|
|
@@ -15,30 +18,30 @@ const C = {
|
|
|
15
18
|
container: "Tabs or steps holder",
|
|
16
19
|
content: "Text block"
|
|
17
20
|
};
|
|
18
|
-
function
|
|
21
|
+
function pe(l) {
|
|
19
22
|
return typeof l == "string" ? { field: l } : l && typeof l == "object" && typeof l.field == "string" ? l : null;
|
|
20
23
|
}
|
|
21
|
-
function
|
|
22
|
-
const { field:
|
|
23
|
-
return !
|
|
24
|
-
field:
|
|
25
|
-
...
|
|
26
|
-
...h ? { agg: h, agg_field:
|
|
24
|
+
function me(l) {
|
|
25
|
+
const { field: p, label: i, agg: h, agg_field: u, field_options: m } = l;
|
|
26
|
+
return !i && !h ? p : {
|
|
27
|
+
field: p,
|
|
28
|
+
...i ? { label: i } : {},
|
|
29
|
+
...h ? { agg: h, agg_field: u, ...m ? { field_options: m } : {} } : {}
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(e) => JSON.stringify(e.filter((n) => n.field)) ===
|
|
32
|
+
const _ = (l) => l.length ? JSON.stringify(l) : null;
|
|
33
|
+
function Te({ group: l, readOnly: p }) {
|
|
34
|
+
var j, J;
|
|
35
|
+
const i = oe(), { data: h } = ne(i.collection), u = (h == null ? void 0 : h.fields) ?? [], m = (h == null ? void 0 : h.relations) ?? [], a = l.label || L(l.key), r = l.type, o = (e, n, f) => i.apply([{ op: "group_update", key: l.key, patch: e }], { label: n, text: f }), x = i.bundle.groups.filter((e) => e.parent_key === l.key), q = i.bundle.groups.filter((e) => e.type === "container" && e.key !== l.key), O = i.bundle.placements.some((e) => e.group_key === l.key), U = (l.parent_key ? ["tab"] : Object.keys(C)).filter((e) => e === r || !(O && (e === "container" || e === "content"))).map((e) => ({ value: e, label: C[e] })), k = r === "section" || r === "metadata" || r === "tab", W = u.filter((e) => !e.field.startsWith("__") && e.type !== "alias").map((e) => ({ value: e.field, label: e.label || L(e.field) })).sort((e, n) => e.label.localeCompare(n.label)), F = re(i.bundle, l.key), v = y(l.summary_fields).map(pe).filter((e) => !!e), M = (e, n, f) => o({ summary_fields: _(e.map(me)) }, n, f), R = y(l.visible_when), w = JSON.stringify(R), [X, D] = G(R);
|
|
36
|
+
V(() => {
|
|
37
|
+
D(
|
|
38
|
+
(e) => JSON.stringify(e.filter((n) => n.field)) === w ? e : JSON.parse(w)
|
|
36
39
|
);
|
|
37
|
-
}, [
|
|
38
|
-
const [
|
|
39
|
-
return /* @__PURE__ */ s("fieldset", { disabled:
|
|
40
|
+
}, [w]);
|
|
41
|
+
const [Y, P] = G(!1);
|
|
42
|
+
return /* @__PURE__ */ s("fieldset", { disabled: p, className: "min-w-0 space-y-5", children: [
|
|
40
43
|
/* @__PURE__ */ t(d, { k: "group.label", label: "Name", effect: "The heading people see.", children: /* @__PURE__ */ t(
|
|
41
|
-
|
|
44
|
+
B,
|
|
42
45
|
{
|
|
43
46
|
ariaLabel: "Name",
|
|
44
47
|
value: l.label,
|
|
@@ -46,7 +49,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
46
49
|
}
|
|
47
50
|
) }),
|
|
48
51
|
/* @__PURE__ */ t(d, { k: "group.icon", label: "Icon", effect: "Shown before the section title.", children: /* @__PURE__ */ t(
|
|
49
|
-
|
|
52
|
+
le,
|
|
50
53
|
{
|
|
51
54
|
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",
|
|
52
55
|
value: l.icon ?? "",
|
|
@@ -58,14 +61,14 @@ function ve({ group: l, readOnly: y }) {
|
|
|
58
61
|
{
|
|
59
62
|
k: "group.type",
|
|
60
63
|
label: "Kind",
|
|
61
|
-
effect: r === "container" && x.length ? "Move its tabs out before changing what this is." :
|
|
64
|
+
effect: r === "container" && x.length ? "Move its tabs out before changing what this is." : O && !l.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.",
|
|
62
65
|
children: /* @__PURE__ */ t(
|
|
63
|
-
|
|
66
|
+
A,
|
|
64
67
|
{
|
|
65
68
|
ariaLabel: "Kind",
|
|
66
69
|
disabled: r === "container" && x.length > 0,
|
|
67
70
|
value: r,
|
|
68
|
-
options:
|
|
71
|
+
options: U,
|
|
69
72
|
onChange: (e) => {
|
|
70
73
|
var n;
|
|
71
74
|
return o(
|
|
@@ -84,7 +87,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
84
87
|
label: "Show its tabs as",
|
|
85
88
|
effect: "Steps walk people through in order.",
|
|
86
89
|
children: /* @__PURE__ */ t(
|
|
87
|
-
|
|
90
|
+
g,
|
|
88
91
|
{
|
|
89
92
|
value: l.tab_mode === "steps" ? "steps" : "tabs",
|
|
90
93
|
options: [
|
|
@@ -103,15 +106,15 @@ function ve({ group: l, readOnly: y }) {
|
|
|
103
106
|
label: "Sits in",
|
|
104
107
|
effect: "Tabs show inside a tabs or steps holder.",
|
|
105
108
|
children: /* @__PURE__ */ t(
|
|
106
|
-
|
|
109
|
+
A,
|
|
107
110
|
{
|
|
108
111
|
ariaLabel: "Sits in",
|
|
109
112
|
value: l.parent_key ?? "",
|
|
110
113
|
options: [
|
|
111
114
|
{ value: "", label: "The form itself" },
|
|
112
|
-
...
|
|
115
|
+
...q.map((e) => ({ value: e.key, label: e.label || L(e.key) }))
|
|
113
116
|
],
|
|
114
|
-
onChange: (e) =>
|
|
117
|
+
onChange: (e) => i.apply(
|
|
115
118
|
[
|
|
116
119
|
{
|
|
117
120
|
op: "group_move",
|
|
@@ -127,7 +130,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
127
130
|
}
|
|
128
131
|
),
|
|
129
132
|
(r === "section" || r === "metadata") && /* @__PURE__ */ t(
|
|
130
|
-
|
|
133
|
+
E,
|
|
131
134
|
{
|
|
132
135
|
k: "group.is_collapsed",
|
|
133
136
|
label: "Starts collapsed",
|
|
@@ -136,7 +139,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
136
139
|
onChange: (e) => o({ is_collapsed: e }, e ? `Collapse ${a}` : `Expand ${a}`)
|
|
137
140
|
}
|
|
138
141
|
),
|
|
139
|
-
r === "content" && /* @__PURE__ */ s(
|
|
142
|
+
r === "content" && /* @__PURE__ */ s(T, { children: [
|
|
140
143
|
/* @__PURE__ */ t(
|
|
141
144
|
d,
|
|
142
145
|
{
|
|
@@ -144,7 +147,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
144
147
|
label: "Style",
|
|
145
148
|
effect: "Note and Warning are coloured boxes; Divider is a line with the text.",
|
|
146
149
|
children: /* @__PURE__ */ t(
|
|
147
|
-
|
|
150
|
+
g,
|
|
148
151
|
{
|
|
149
152
|
value: l.content_tone ?? "info",
|
|
150
153
|
options: [
|
|
@@ -158,7 +161,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
158
161
|
}
|
|
159
162
|
),
|
|
160
163
|
/* @__PURE__ */ t(d, { k: "group.content", label: "Text", effect: "The words this block shows on the form.", children: /* @__PURE__ */ t(
|
|
161
|
-
|
|
164
|
+
H,
|
|
162
165
|
{
|
|
163
166
|
ariaLabel: "Text",
|
|
164
167
|
value: l.content ?? "",
|
|
@@ -166,7 +169,44 @@ function ve({ group: l, readOnly: y }) {
|
|
|
166
169
|
}
|
|
167
170
|
) })
|
|
168
171
|
] }),
|
|
169
|
-
|
|
172
|
+
(r === "section" || r === "tab") && /* @__PURE__ */ s(T, { children: [
|
|
173
|
+
/* @__PURE__ */ t(
|
|
174
|
+
d,
|
|
175
|
+
{
|
|
176
|
+
k: "group.content",
|
|
177
|
+
label: "Intro",
|
|
178
|
+
effect: "A short note at the top: what to fill in here and why. Empty shows none.",
|
|
179
|
+
children: /* @__PURE__ */ t(
|
|
180
|
+
H,
|
|
181
|
+
{
|
|
182
|
+
ariaLabel: "Intro",
|
|
183
|
+
value: l.content ?? "",
|
|
184
|
+
onChange: (e) => o({ content: e || null }, `Edit the intro of ${a}`, !0)
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
!!((j = l.content) != null && j.trim()) && /* @__PURE__ */ t(
|
|
190
|
+
d,
|
|
191
|
+
{
|
|
192
|
+
k: "group.content_tone",
|
|
193
|
+
label: "Intro style",
|
|
194
|
+
effect: "Note is a quiet box; Warning is amber.",
|
|
195
|
+
children: /* @__PURE__ */ t(
|
|
196
|
+
g,
|
|
197
|
+
{
|
|
198
|
+
value: l.content_tone === "warn" ? "warn" : "info",
|
|
199
|
+
options: [
|
|
200
|
+
{ value: "info", label: "Note" },
|
|
201
|
+
{ value: "warn", label: "Warning" }
|
|
202
|
+
],
|
|
203
|
+
onChange: (e) => o({ content_tone: e }, `Change the intro style of ${a}`)
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] }),
|
|
209
|
+
k && /* @__PURE__ */ s(T, { children: [
|
|
170
210
|
/* @__PURE__ */ t(
|
|
171
211
|
d,
|
|
172
212
|
{
|
|
@@ -174,7 +214,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
174
214
|
label: "Show",
|
|
175
215
|
effect: "On new records, existing ones or both.",
|
|
176
216
|
children: /* @__PURE__ */ t(
|
|
177
|
-
|
|
217
|
+
g,
|
|
178
218
|
{
|
|
179
219
|
value: l.visibility_mode ?? "always",
|
|
180
220
|
options: [
|
|
@@ -188,7 +228,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
188
228
|
}
|
|
189
229
|
),
|
|
190
230
|
/* @__PURE__ */ t(
|
|
191
|
-
|
|
231
|
+
E,
|
|
192
232
|
{
|
|
193
233
|
k: "group.hide_when_empty",
|
|
194
234
|
label: "Hide when all its fields are empty",
|
|
@@ -204,7 +244,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
204
244
|
label: "Width when reading",
|
|
205
245
|
effect: "On the read view, summary and detail panels. Automatic: half for a short list, full for grids.",
|
|
206
246
|
children: /* @__PURE__ */ t(
|
|
207
|
-
|
|
247
|
+
g,
|
|
208
248
|
{
|
|
209
249
|
value: l.read_width ?? "",
|
|
210
250
|
options: [
|
|
@@ -219,7 +259,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
219
259
|
}
|
|
220
260
|
)
|
|
221
261
|
] }),
|
|
222
|
-
r === "tab" && /* @__PURE__ */ s(
|
|
262
|
+
r === "tab" && /* @__PURE__ */ s(I, { title: "As a step", children: [
|
|
223
263
|
/* @__PURE__ */ t(
|
|
224
264
|
d,
|
|
225
265
|
{
|
|
@@ -227,38 +267,50 @@ function ve({ group: l, readOnly: y }) {
|
|
|
227
267
|
label: "Skip as the first step when filled",
|
|
228
268
|
effect: "Opens on a later step when these fields already have values.",
|
|
229
269
|
children: /* @__PURE__ */ t(
|
|
230
|
-
|
|
270
|
+
ie,
|
|
231
271
|
{
|
|
232
272
|
ariaLabel: "Skip as the first step when filled",
|
|
233
|
-
value:
|
|
234
|
-
options:
|
|
235
|
-
onChange: (e) => o({ skip_if_filled:
|
|
273
|
+
value: y(l.skip_if_filled),
|
|
274
|
+
options: W,
|
|
275
|
+
onChange: (e) => o({ skip_if_filled: _(e) }, `Change when ${a} is skipped`)
|
|
236
276
|
}
|
|
237
277
|
)
|
|
238
278
|
}
|
|
239
279
|
),
|
|
240
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ s(
|
|
241
281
|
d,
|
|
242
282
|
{
|
|
243
283
|
k: "group.visible_when",
|
|
244
284
|
label: "Only when",
|
|
245
285
|
effect: "The step shows only while every condition holds. No conditions: always.",
|
|
246
|
-
children:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ t(
|
|
288
|
+
se,
|
|
289
|
+
{
|
|
290
|
+
value: X,
|
|
291
|
+
fields: W,
|
|
292
|
+
onChange: (e) => {
|
|
293
|
+
D(e);
|
|
294
|
+
const n = e.filter((f) => f.field);
|
|
295
|
+
JSON.stringify(n) !== w && o({ visible_when: _(n) }, `Change when ${a} shows`, !0);
|
|
296
|
+
}
|
|
255
297
|
}
|
|
256
|
-
|
|
257
|
-
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ t(
|
|
300
|
+
Z,
|
|
301
|
+
{
|
|
302
|
+
layoutId: Number(i.bundle.layout.id),
|
|
303
|
+
target: { kind: "step", group: l.key },
|
|
304
|
+
bundle: i.bundle,
|
|
305
|
+
apply: (e, n) => i.apply(e, n),
|
|
306
|
+
disabled: p
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
]
|
|
258
310
|
}
|
|
259
311
|
)
|
|
260
312
|
] }),
|
|
261
|
-
|
|
313
|
+
k && /* @__PURE__ */ s(I, { title: "Who", children: [
|
|
262
314
|
/* @__PURE__ */ t(
|
|
263
315
|
d,
|
|
264
316
|
{
|
|
@@ -268,8 +320,8 @@ function ve({ group: l, readOnly: y }) {
|
|
|
268
320
|
children: /* @__PURE__ */ t(
|
|
269
321
|
K,
|
|
270
322
|
{
|
|
271
|
-
roleIds:
|
|
272
|
-
onRoleIdsChange: (e) => o({ hidden_for_roles:
|
|
323
|
+
roleIds: y(l.hidden_for_roles),
|
|
324
|
+
onRoleIdsChange: (e) => o({ hidden_for_roles: _(e) }, `Change who sees ${a}`)
|
|
273
325
|
}
|
|
274
326
|
)
|
|
275
327
|
}
|
|
@@ -283,14 +335,14 @@ function ve({ group: l, readOnly: y }) {
|
|
|
283
335
|
children: /* @__PURE__ */ t(
|
|
284
336
|
K,
|
|
285
337
|
{
|
|
286
|
-
roleIds:
|
|
287
|
-
onRoleIdsChange: (e) => o({ locked_for_roles:
|
|
338
|
+
roleIds: y(l.locked_for_roles),
|
|
339
|
+
onRoleIdsChange: (e) => o({ locked_for_roles: _(e) }, `Change who can edit ${a}`)
|
|
288
340
|
}
|
|
289
341
|
)
|
|
290
342
|
}
|
|
291
343
|
)
|
|
292
344
|
] }),
|
|
293
|
-
|
|
345
|
+
k && /* @__PURE__ */ s(I, { title: "When collapsed", children: [
|
|
294
346
|
/* @__PURE__ */ t(
|
|
295
347
|
d,
|
|
296
348
|
{
|
|
@@ -302,10 +354,10 @@ function ve({ group: l, readOnly: y }) {
|
|
|
302
354
|
a,
|
|
303
355
|
" first."
|
|
304
356
|
] }) : /* @__PURE__ */ t("div", { className: "space-y-1.5", children: F.map((e) => {
|
|
305
|
-
const n =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
357
|
+
const n = v.find((c) => c.field === e), f = de(e, m) === "O2M", z = i.bundle.placements.find((c) => c.field === e) ?? null, N = ce(e, u, m, z).label, S = (c, b, Q) => M(
|
|
358
|
+
v.map(($) => $.field === e ? { ...$, ...c } : $),
|
|
359
|
+
b,
|
|
360
|
+
Q
|
|
309
361
|
);
|
|
310
362
|
return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
311
363
|
/* @__PURE__ */ s("label", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
@@ -314,8 +366,8 @@ function ve({ group: l, readOnly: y }) {
|
|
|
314
366
|
{
|
|
315
367
|
type: "checkbox",
|
|
316
368
|
checked: !!n,
|
|
317
|
-
onChange: (
|
|
318
|
-
|
|
369
|
+
onChange: (c) => M(
|
|
370
|
+
c.target.checked ? [...v, f ? { field: e, agg: "count" } : { field: e }] : v.filter((b) => b.field !== e),
|
|
319
371
|
`Change the summary of ${a}`
|
|
320
372
|
),
|
|
321
373
|
className: "h-3.5 w-3.5 accent-nvr-cyan"
|
|
@@ -326,13 +378,13 @@ function ve({ group: l, readOnly: y }) {
|
|
|
326
378
|
] }),
|
|
327
379
|
n && /* @__PURE__ */ s("div", { className: "space-y-1 pl-5", children: [
|
|
328
380
|
/* @__PURE__ */ t("div", { "data-setting": "group.summary_fields.label", children: /* @__PURE__ */ t(
|
|
329
|
-
|
|
381
|
+
B,
|
|
330
382
|
{
|
|
331
383
|
ariaLabel: `Label for ${N}`,
|
|
332
384
|
value: n.label ?? "",
|
|
333
385
|
placeholder: `Label (${N})`,
|
|
334
|
-
onChange: (
|
|
335
|
-
{ label:
|
|
386
|
+
onChange: (c) => S(
|
|
387
|
+
{ label: c || null },
|
|
336
388
|
`Change the summary of ${a}`,
|
|
337
389
|
!0
|
|
338
390
|
)
|
|
@@ -340,7 +392,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
340
392
|
) }),
|
|
341
393
|
f && /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
|
|
342
394
|
/* @__PURE__ */ t("div", { className: "flex-1", "data-setting": "group.summary_fields.agg", children: /* @__PURE__ */ t(
|
|
343
|
-
|
|
395
|
+
A,
|
|
344
396
|
{
|
|
345
397
|
ariaLabel: "Show",
|
|
346
398
|
value: n.agg ?? "count",
|
|
@@ -351,8 +403,8 @@ function ve({ group: l, readOnly: y }) {
|
|
|
351
403
|
{ value: "min", label: "Smallest" },
|
|
352
404
|
{ value: "max", label: "Largest" }
|
|
353
405
|
],
|
|
354
|
-
onChange: (
|
|
355
|
-
|
|
406
|
+
onChange: (c) => S(
|
|
407
|
+
c === "count" ? { agg: c, agg_field: void 0, field_options: void 0 } : { agg: c },
|
|
356
408
|
`Change the summary of ${a}`
|
|
357
409
|
)
|
|
358
410
|
}
|
|
@@ -363,12 +415,12 @@ function ve({ group: l, readOnly: y }) {
|
|
|
363
415
|
className: "flex-1",
|
|
364
416
|
"data-setting": "group.summary_fields.agg_field",
|
|
365
417
|
children: /* @__PURE__ */ t(
|
|
366
|
-
|
|
418
|
+
ee,
|
|
367
419
|
{
|
|
368
|
-
relatedCollection:
|
|
420
|
+
relatedCollection: he(e, m),
|
|
369
421
|
value: n.agg_field ?? "",
|
|
370
|
-
onChange: (
|
|
371
|
-
{ agg_field:
|
|
422
|
+
onChange: (c, b) => S(
|
|
423
|
+
{ agg_field: c, field_options: b },
|
|
372
424
|
`Change the summary of ${a}`
|
|
373
425
|
)
|
|
374
426
|
}
|
|
@@ -382,7 +434,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
382
434
|
}
|
|
383
435
|
),
|
|
384
436
|
/* @__PURE__ */ t(
|
|
385
|
-
|
|
437
|
+
E,
|
|
386
438
|
{
|
|
387
439
|
k: "group.summary_hide_empty",
|
|
388
440
|
label: "Leave out empty values",
|
|
@@ -392,20 +444,22 @@ function ve({ group: l, readOnly: y }) {
|
|
|
392
444
|
}
|
|
393
445
|
)
|
|
394
446
|
] }),
|
|
395
|
-
|
|
396
|
-
|
|
447
|
+
k && /* @__PURE__ */ t(
|
|
448
|
+
te,
|
|
397
449
|
{
|
|
398
450
|
group: { id: l.id ?? 0, swap_config: l.swap_config },
|
|
399
|
-
allFields:
|
|
451
|
+
allFields: u.map((e) => ({ field: e.field, type: e.type ?? void 0 })),
|
|
400
452
|
onGroupSettings: (e, n) => o(n, `Change the field swap of ${a}`)
|
|
401
453
|
}
|
|
402
454
|
),
|
|
455
|
+
!p && /* @__PURE__ */ t(ae, { bundle: i.bundle, collection: i.collection, group: l }),
|
|
456
|
+
/* @__PURE__ */ t(fe, { group: l }),
|
|
403
457
|
/* @__PURE__ */ t(
|
|
404
458
|
"div",
|
|
405
459
|
{
|
|
406
460
|
"data-setting": "group.delete",
|
|
407
461
|
className: "border-t border-slate-200 pt-3 dark:border-border",
|
|
408
|
-
children:
|
|
462
|
+
children: Y ? /* @__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: [
|
|
409
463
|
/* @__PURE__ */ s("p", { children: [
|
|
410
464
|
"Delete ",
|
|
411
465
|
a,
|
|
@@ -418,7 +472,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
418
472
|
"button",
|
|
419
473
|
{
|
|
420
474
|
type: "button",
|
|
421
|
-
onClick: () =>
|
|
475
|
+
onClick: () => i.apply([{ op: "group_remove", key: l.key, placements: "ungroup" }], {
|
|
422
476
|
label: `Delete ${a}`
|
|
423
477
|
}),
|
|
424
478
|
className: "rounded-md bg-red-600 px-2.5 py-1 text-[12px] font-medium text-white hover:bg-red-700",
|
|
@@ -429,7 +483,7 @@ function ve({ group: l, readOnly: y }) {
|
|
|
429
483
|
"button",
|
|
430
484
|
{
|
|
431
485
|
type: "button",
|
|
432
|
-
onClick: () =>
|
|
486
|
+
onClick: () => P(!1),
|
|
433
487
|
className: "rounded-md px-2.5 py-1 text-[12px] hover:bg-red-100 dark:hover:bg-red-900/40",
|
|
434
488
|
children: "Keep"
|
|
435
489
|
}
|
|
@@ -439,11 +493,11 @@ function ve({ group: l, readOnly: y }) {
|
|
|
439
493
|
"button",
|
|
440
494
|
{
|
|
441
495
|
type: "button",
|
|
442
|
-
onClick: () =>
|
|
496
|
+
onClick: () => P(!0),
|
|
443
497
|
className: "text-[12px] text-red-600 hover:underline dark:text-red-400",
|
|
444
498
|
children: [
|
|
445
499
|
"Delete ",
|
|
446
|
-
((
|
|
500
|
+
((J = C[r]) == null ? void 0 : J.toLowerCase()) ?? "section"
|
|
447
501
|
]
|
|
448
502
|
}
|
|
449
503
|
)
|
|
@@ -452,5 +506,5 @@ function ve({ group: l, readOnly: y }) {
|
|
|
452
506
|
] });
|
|
453
507
|
}
|
|
454
508
|
export {
|
|
455
|
-
|
|
509
|
+
Te as GroupInspector
|
|
456
510
|
};
|