@vef-framework-react/form-editor 2.18.0 → 2.19.0
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/cjs/components/mobile/definitions.cjs +1 -1
- package/dist/cjs/components/upload-field/index.cjs +1 -0
- package/dist/cjs/editor/canvas/canvas.cjs +1 -1
- package/dist/cjs/editor/canvas/container-drag-chip.cjs +1 -1
- package/dist/cjs/editor/dnd.cjs +1 -1
- package/dist/cjs/editor/form-config/linkage-overview.cjs +1 -1
- package/dist/cjs/editor/form-config/outline-tab.cjs +1 -1
- package/dist/cjs/editor/properties/dynamic-value-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/action-editor.cjs +2 -2
- package/dist/cjs/editor/properties/entries/linkage/actions-editor.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/condition-editor.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/container-linkage-section.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/linkage-rules-entry.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/mutators.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/rule-list-editor.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/trigger-editor.cjs +1 -1
- package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -1
- package/dist/cjs/editor/properties/option-editors.cjs +1 -1
- package/dist/cjs/editor/properties/properties-panel.cjs +1 -1
- package/dist/cjs/editor/toolbar/toolbar.cjs +1 -1
- package/dist/cjs/engine/data-source-params.cjs +1 -0
- package/dist/cjs/engine/linkage/evaluator.cjs +1 -1
- package/dist/cjs/engine/linkage/operators.cjs +1 -1
- package/dist/cjs/engine/linkage/validator.cjs +1 -1
- package/dist/cjs/engine/registry/defaults.cjs +1 -1
- package/dist/cjs/engine/schema/edit-ops.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/render/data-source-context.cjs +0 -0
- package/dist/cjs/render/data-source-param-scope.cjs +1 -0
- package/dist/cjs/render/form-field.cjs +1 -1
- package/dist/cjs/render/form-renderer.cjs +1 -1
- package/dist/cjs/runtime/effects.cjs +1 -1
- package/dist/cjs/types/dynamic-value.cjs +1 -0
- package/dist/cjs/types/index.cjs +1 -1
- package/dist/es/components/button/index.js +1 -1
- package/dist/es/components/checkbox-group-field/index.js +1 -1
- package/dist/es/components/code-editor/code-editor-input.js +1 -1
- package/dist/es/components/code-editor/index.js +1 -1
- package/dist/es/components/containers/index.js +1 -1
- package/dist/es/components/date-field/index.js +1 -1
- package/dist/es/components/display/index.js +1 -1
- package/dist/es/components/field-entries.js +1 -1
- package/dist/es/components/mobile/alert-block.js +1 -1
- package/dist/es/components/mobile/button.js +1 -1
- package/dist/es/components/mobile/checkbox-group.js +1 -1
- package/dist/es/components/mobile/date-adapters.js +1 -1
- package/dist/es/components/mobile/date.js +1 -1
- package/dist/es/components/mobile/daterange.js +1 -1
- package/dist/es/components/mobile/datetime.js +1 -1
- package/dist/es/components/mobile/definitions.js +34 -32
- package/dist/es/components/mobile/divider.js +1 -1
- package/dist/es/components/mobile/input-cell.js +1 -1
- package/dist/es/components/mobile/number.js +1 -1
- package/dist/es/components/mobile/option-group.js +1 -1
- package/dist/es/components/mobile/paragraph.js +1 -1
- package/dist/es/components/mobile/picker-trigger.js +1 -1
- package/dist/es/components/mobile/radio.js +1 -1
- package/dist/es/components/mobile/scope.js +1 -1
- package/dist/es/components/mobile/select.js +1 -1
- package/dist/es/components/mobile/switch.js +1 -1
- package/dist/es/components/mobile/textarea.js +1 -1
- package/dist/es/components/mobile/textfield.js +1 -1
- package/dist/es/components/mobile/theme.js +1 -1
- package/dist/es/components/number-field/index.js +1 -1
- package/dist/es/components/radio-field/index.js +1 -1
- package/dist/es/components/select-field/index.js +1 -1
- package/dist/es/components/switch-field/index.js +1 -1
- package/dist/es/components/textarea-field/index.js +1 -1
- package/dist/es/components/textfield/index.js +1 -1
- package/dist/es/components/upload-field/index.js +104 -0
- package/dist/es/editor/canvas/canvas-field.js +1 -1
- package/dist/es/editor/canvas/canvas.js +103 -103
- package/dist/es/editor/canvas/container-drag-chip.js +8 -8
- package/dist/es/editor/canvas/drop-indicator.js +1 -1
- package/dist/es/editor/canvas/drop-zones.js +1 -1
- package/dist/es/editor/canvas/json-split-view.js +1 -1
- package/dist/es/editor/canvas/mobile-seed-state.js +1 -1
- package/dist/es/editor/canvas/phone-frame.js +1 -1
- package/dist/es/editor/canvas/subform-column-eligibility.js +1 -1
- package/dist/es/editor/canvas/subform-table-cell.js +1 -1
- package/dist/es/editor/canvas/use-scroll-selection-into-view.js +1 -1
- package/dist/es/editor/context-sources.js +1 -1
- package/dist/es/editor/dnd.js +18 -18
- package/dist/es/editor/editor-layout-context.js +1 -1
- package/dist/es/editor/footer/footer.js +1 -1
- package/dist/es/editor/form-config/form-basics-tab.js +1 -1
- package/dist/es/editor/form-config/form-config-drawer.js +1 -1
- package/dist/es/editor/form-config/linkage-overview.js +9 -9
- package/dist/es/editor/form-config/outline-tab.js +6 -6
- package/dist/es/editor/form-editor.js +1 -1
- package/dist/es/editor/palette/field-groups.js +1 -1
- package/dist/es/editor/palette/palette-group.js +1 -1
- package/dist/es/editor/palette/palette-item.js +1 -1
- package/dist/es/editor/palette/palette-panel.js +1 -1
- package/dist/es/editor/preview-effects.js +1 -1
- package/dist/es/editor/preview-runtime-context.js +1 -1
- package/dist/es/editor/properties/block-layout-section.js +1 -1
- package/dist/es/editor/properties/container-properties.js +1 -1
- package/dist/es/editor/properties/dynamic-value-editor.js +57 -0
- package/dist/es/editor/properties/entries/built-ins.js +1 -1
- package/dist/es/editor/properties/entries/checkbox-entry.js +1 -1
- package/dist/es/editor/properties/entries/coerce.js +1 -1
- package/dist/es/editor/properties/entries/entry-field.js +1 -1
- package/dist/es/editor/properties/entries/icon-entry.js +1 -1
- package/dist/es/editor/properties/entries/index.js +1 -1
- package/dist/es/editor/properties/entries/key-entry.js +1 -1
- package/dist/es/editor/properties/entries/linkage/action-editor.js +75 -110
- package/dist/es/editor/properties/entries/linkage/actions-editor.js +10 -10
- package/dist/es/editor/properties/entries/linkage/condition-editor.js +87 -87
- package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +7 -7
- package/dist/es/editor/properties/entries/linkage/expression-input.js +1 -1
- package/dist/es/editor/properties/entries/linkage/index.js +1 -1
- package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +24 -24
- package/dist/es/editor/properties/entries/linkage/mutators.js +2 -11
- package/dist/es/editor/properties/entries/linkage/options.js +1 -1
- package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +1 -1
- package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +29 -29
- package/dist/es/editor/properties/entries/linkage/styles.js +1 -1
- package/dist/es/editor/properties/entries/linkage/trigger-editor.js +13 -13
- package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +1 -1
- package/dist/es/editor/properties/entries/linkage/use-stable-options.js +1 -1
- package/dist/es/editor/properties/entries/number-entry.js +1 -1
- package/dist/es/editor/properties/entries/options-source/index.js +1 -1
- package/dist/es/editor/properties/entries/options-source/source-mutators.js +1 -1
- package/dist/es/editor/properties/entries/select-entry.js +1 -1
- package/dist/es/editor/properties/entries/text-entry.js +1 -1
- package/dist/es/editor/properties/form-data-sources-panel.js +7 -7
- package/dist/es/editor/properties/form-linkage-panel.js +1 -1
- package/dist/es/editor/properties/form-variables-panel.js +1 -1
- package/dist/es/editor/properties/option-editors.js +225 -121
- package/dist/es/editor/properties/panel-header.js +1 -1
- package/dist/es/editor/properties/properties-empty.js +1 -1
- package/dist/es/editor/properties/properties-header.js +1 -1
- package/dist/es/editor/properties/properties-panel.js +17 -17
- package/dist/es/editor/properties/properties-provider.js +1 -1
- package/dist/es/editor/properties/properties-tabs.js +1 -1
- package/dist/es/editor/properties/use-confirmable-kind-switch.js +1 -1
- package/dist/es/editor/remove-node-confirm.js +1 -1
- package/dist/es/editor/schema-apply.js +1 -1
- package/dist/es/editor/styles.js +1 -1
- package/dist/es/editor/toolbar/notify.js +1 -1
- package/dist/es/editor/toolbar/schema-io.js +1 -1
- package/dist/es/editor/toolbar/toolbar.js +7 -7
- package/dist/es/editor/use-editor-shortcuts.js +1 -1
- package/dist/es/editor/validation-summary.js +1 -1
- package/dist/es/engine/assert-never.js +1 -1
- package/dist/es/engine/conversion/index.js +1 -1
- package/dist/es/engine/data-source-params.js +38 -0
- package/dist/es/engine/ids.js +1 -1
- package/dist/es/engine/keys.js +1 -1
- package/dist/es/engine/linkage/cycle.js +1 -1
- package/dist/es/engine/linkage/default-evaluator.js +1 -1
- package/dist/es/engine/linkage/effects.js +1 -1
- package/dist/es/engine/linkage/evaluator.js +22 -22
- package/dist/es/engine/linkage/index.js +1 -1
- package/dist/es/engine/linkage/operators.js +2 -2
- package/dist/es/engine/linkage/source-tracking.js +1 -1
- package/dist/es/engine/linkage/taxonomy.js +1 -1
- package/dist/es/engine/linkage/validator.js +94 -94
- package/dist/es/engine/registry/defaults-mobile.js +1 -1
- package/dist/es/engine/registry/defaults.js +10 -9
- package/dist/es/engine/registry/form-field-registry.js +1 -1
- package/dist/es/engine/schema/column-type.js +1 -1
- package/dist/es/engine/schema/edit-ops.js +9 -9
- package/dist/es/engine/schema/mutate.js +1 -1
- package/dist/es/engine/schema/nodes.js +1 -1
- package/dist/es/engine/schema/permission-bridge.js +1 -1
- package/dist/es/engine/schema/presentation.js +1 -1
- package/dist/es/engine/schema/reconcile.js +1 -1
- package/dist/es/engine/schema/removal-impact.js +1 -1
- package/dist/es/engine/schema/rewrite.js +1 -1
- package/dist/es/engine/schema/validate.js +1 -1
- package/dist/es/engine/schema/walk.js +1 -1
- package/dist/es/engine/validation.js +1 -1
- package/dist/es/icons.js +1 -1
- package/dist/es/index.js +55 -54
- package/dist/es/render/chrome/mobile-chrome.js +1 -1
- package/dist/es/render/chrome/pc-chrome.js +1 -1
- package/dist/es/render/chrome/subform-shell.js +1 -1
- package/dist/es/render/data-source-context.js +0 -0
- package/dist/es/render/data-source-param-scope.js +34 -0
- package/dist/es/render/flex-style.js +1 -1
- package/dist/es/render/form-field.js +5 -5
- package/dist/es/render/form-renderer.js +308 -300
- package/dist/es/render/grid-style.js +1 -1
- package/dist/es/render/parts/field-shell.js +1 -1
- package/dist/es/render/parts/label.js +1 -1
- package/dist/es/render/parts/options-status.js +1 -1
- package/dist/es/render/stack-style.js +1 -1
- package/dist/es/render/subform-columns.js +1 -1
- package/dist/es/render/submit.js +1 -1
- package/dist/es/runtime/effects.js +49 -47
- package/dist/es/runtime/field-write.js +1 -1
- package/dist/es/runtime/resolve-scope-values.js +1 -1
- package/dist/es/runtime/runtime-context.js +1 -1
- package/dist/es/runtime/runtime-state-controller.js +1 -1
- package/dist/es/runtime/stabilize-state-map.js +1 -1
- package/dist/es/store/engine-provider.js +1 -1
- package/dist/es/store/form-store.js +1 -1
- package/dist/es/types/chrome.js +1 -1
- package/dist/es/types/component.js +1 -1
- package/dist/es/types/data-source.js +1 -1
- package/dist/es/types/dynamic-value.js +9 -0
- package/dist/es/types/index.js +5 -4
- package/dist/es/types/linkage.js +1 -1
- package/dist/es/types/properties.js +1 -1
- package/dist/es/types/schema.js +1 -1
- package/dist/types/components/upload-field/index.d.ts +2 -0
- package/dist/types/editor/properties/dynamic-value-editor.d.ts +23 -0
- package/dist/types/editor/properties/entries/linkage/mutators.d.ts +1 -8
- package/dist/types/engine/data-source-params.d.ts +33 -0
- package/dist/types/render/data-source-param-scope.d.ts +48 -0
- package/dist/types/types/data-source.d.ts +26 -1
- package/dist/types/types/dynamic-value.d.ts +21 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/linkage.d.ts +9 -8
- package/dist/types/types/schema.d.ts +29 -0
- package/package.json +5 -5
|
@@ -1,181 +1,175 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.19.0 made by Venus | 2026-09-01T08:49:01.461Z */
|
|
2
2
|
import { EditorIcon as e } from "../../../../icons.js";
|
|
3
3
|
import { sanitizeKey as t } from "../../../../engine/keys.js";
|
|
4
4
|
import { isEffectAction as n } from "../../../../engine/linkage/taxonomy.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { Button as
|
|
5
|
+
import { NO_COMPLETION_SETUP as r } from "./expression-input.js";
|
|
6
|
+
import { actionCardCss as i, actionDeleteCss as a, actionHeaderCss as o, actionRetriggerCss as s, actionRetriggerLabelCss as c, apiFieldsCss as l, codeEditorWrapperCss as u, defaultHintCss as d, defaultTextCss as f, selectStyle as p } from "./styles.js";
|
|
7
|
+
import { DynamicValueEditor as m } from "../../dynamic-value-editor.js";
|
|
8
|
+
import { createActionFor as h } from "./mutators.js";
|
|
9
|
+
import { alertLevelOptions as g, isLinkageActionType as _ } from "./options.js";
|
|
10
|
+
import { Fragment as v, jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { Button as x, CodeEditor as S, Input as C, Select as w, Switch as T } from "@vef-framework-react/components";
|
|
12
12
|
//#region src/editor/properties/entries/linkage/action-editor.tsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
label: "字面量"
|
|
16
|
-
}, {
|
|
17
|
-
value: "expression",
|
|
18
|
-
label: "表达式"
|
|
19
|
-
}], j = ({ action: t, availableActions: i, canRemove: a, dataSourceOptions: o, isConditionTrigger: s, targetOptions: c, onChange: h, onRemove: g }) => /* @__PURE__ */ C("div", {
|
|
20
|
-
css: u,
|
|
13
|
+
var E = ({ action: t, availableActions: r, canRemove: l, dataSourceOptions: u, isConditionTrigger: m, targetOptions: g, onChange: v, onRemove: S }) => /* @__PURE__ */ b("div", {
|
|
14
|
+
css: i,
|
|
21
15
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
css:
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
-
options:
|
|
26
|
-
style:
|
|
16
|
+
/* @__PURE__ */ b("div", {
|
|
17
|
+
css: o,
|
|
18
|
+
children: [/* @__PURE__ */ y(w, {
|
|
19
|
+
options: r,
|
|
20
|
+
style: p,
|
|
27
21
|
value: t.type,
|
|
28
22
|
onChange: (e) => {
|
|
29
|
-
if (!
|
|
30
|
-
let n =
|
|
31
|
-
|
|
23
|
+
if (!_(e)) return;
|
|
24
|
+
let n = h(e);
|
|
25
|
+
v(t.id === void 0 ? n : {
|
|
32
26
|
...n,
|
|
33
27
|
id: t.id
|
|
34
28
|
});
|
|
35
29
|
}
|
|
36
|
-
}),
|
|
30
|
+
}), l ? /* @__PURE__ */ y(x, {
|
|
37
31
|
"aria-label": "删除动作",
|
|
38
|
-
css:
|
|
39
|
-
icon: /* @__PURE__ */
|
|
32
|
+
css: a,
|
|
33
|
+
icon: /* @__PURE__ */ y(e, { name: "x" }),
|
|
40
34
|
size: "small",
|
|
41
35
|
type: "text",
|
|
42
|
-
onClick:
|
|
36
|
+
onClick: S
|
|
43
37
|
}) : null]
|
|
44
38
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ y(D, {
|
|
46
40
|
action: t,
|
|
47
|
-
dataSourceOptions:
|
|
48
|
-
targetOptions:
|
|
49
|
-
onChange:
|
|
41
|
+
dataSourceOptions: u,
|
|
42
|
+
targetOptions: g,
|
|
43
|
+
onChange: v
|
|
50
44
|
}),
|
|
51
|
-
|
|
52
|
-
css:
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
css:
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
css:
|
|
45
|
+
m && n(t) && /* @__PURE__ */ b("div", {
|
|
46
|
+
css: s,
|
|
47
|
+
children: [/* @__PURE__ */ b("div", {
|
|
48
|
+
css: f,
|
|
49
|
+
children: [/* @__PURE__ */ y("span", {
|
|
50
|
+
css: c,
|
|
57
51
|
children: "重复触发"
|
|
58
|
-
}), /* @__PURE__ */
|
|
59
|
-
css:
|
|
52
|
+
}), /* @__PURE__ */ y("span", {
|
|
53
|
+
css: d,
|
|
60
54
|
children: "条件持续满足期间,依赖字段每次变化都重新触发;关闭(默认)则仅在条件首次满足时触发一次。"
|
|
61
55
|
})]
|
|
62
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ y(T, {
|
|
63
57
|
"aria-label": "重复触发",
|
|
64
58
|
checked: t.retrigger === "always",
|
|
65
59
|
size: "small",
|
|
66
60
|
onChange: (e) => {
|
|
67
61
|
if (e) {
|
|
68
|
-
|
|
62
|
+
v({
|
|
69
63
|
...t,
|
|
70
64
|
retrigger: "always"
|
|
71
65
|
});
|
|
72
66
|
return;
|
|
73
67
|
}
|
|
74
68
|
let n = { ...t };
|
|
75
|
-
delete n.retrigger,
|
|
69
|
+
delete n.retrigger, v(n);
|
|
76
70
|
}
|
|
77
71
|
})]
|
|
78
72
|
})
|
|
79
73
|
]
|
|
80
74
|
});
|
|
81
|
-
function
|
|
75
|
+
function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
82
76
|
switch (e.type) {
|
|
83
|
-
case "assign": return /* @__PURE__ */
|
|
77
|
+
case "assign": return /* @__PURE__ */ y(m, {
|
|
84
78
|
expressionPlaceholder: "field.A + field.B",
|
|
85
79
|
literalPlaceholder: "赋值内容",
|
|
86
80
|
value: e.value,
|
|
87
|
-
onChange: (t) =>
|
|
81
|
+
onChange: (t) => a({
|
|
88
82
|
...e,
|
|
89
83
|
value: t
|
|
90
84
|
})
|
|
91
85
|
});
|
|
92
|
-
case "set_field": return /* @__PURE__ */
|
|
93
|
-
options:
|
|
86
|
+
case "set_field": return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(w, {
|
|
87
|
+
options: i,
|
|
94
88
|
placeholder: "选择目标字段",
|
|
95
|
-
style:
|
|
89
|
+
style: p,
|
|
96
90
|
value: e.targetKey.length > 0 ? e.targetKey : void 0,
|
|
97
|
-
onChange: (t) =>
|
|
91
|
+
onChange: (t) => a({
|
|
98
92
|
...e,
|
|
99
93
|
targetKey: String(t)
|
|
100
94
|
})
|
|
101
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ y(m, {
|
|
102
96
|
expressionPlaceholder: "field.A",
|
|
103
97
|
literalPlaceholder: "写入的值",
|
|
104
98
|
value: e.value,
|
|
105
|
-
onChange: (t) =>
|
|
99
|
+
onChange: (t) => a({
|
|
106
100
|
...e,
|
|
107
101
|
value: t
|
|
108
102
|
})
|
|
109
103
|
})] });
|
|
110
|
-
case "set_variable": return /* @__PURE__ */
|
|
104
|
+
case "set_variable": return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(C, {
|
|
111
105
|
placeholder: "变量名($vars.名称)",
|
|
112
106
|
value: e.variable,
|
|
113
|
-
onChange: (n) =>
|
|
107
|
+
onChange: (n) => a({
|
|
114
108
|
...e,
|
|
115
109
|
variable: t(n.target.value)
|
|
116
110
|
})
|
|
117
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ y(m, {
|
|
118
112
|
expressionPlaceholder: "$vars.count + 1",
|
|
119
113
|
literalPlaceholder: "写入的值",
|
|
120
114
|
value: e.value,
|
|
121
|
-
onChange: (t) =>
|
|
115
|
+
onChange: (t) => a({
|
|
122
116
|
...e,
|
|
123
117
|
value: t
|
|
124
118
|
})
|
|
125
119
|
})] });
|
|
126
|
-
case "refresh_data_source": return /* @__PURE__ */
|
|
120
|
+
case "refresh_data_source": return /* @__PURE__ */ y(w, {
|
|
127
121
|
notFoundContent: "请先在表单「数据源」中创建",
|
|
128
122
|
options: n,
|
|
129
123
|
placeholder: "选择数据源",
|
|
130
|
-
style:
|
|
124
|
+
style: p,
|
|
131
125
|
value: e.dataSourceId.length > 0 ? e.dataSourceId : void 0,
|
|
132
|
-
onChange: (t) =>
|
|
126
|
+
onChange: (t) => a({
|
|
133
127
|
...e,
|
|
134
128
|
dataSourceId: String(t)
|
|
135
129
|
})
|
|
136
130
|
});
|
|
137
|
-
case "alert": return /* @__PURE__ */
|
|
138
|
-
options:
|
|
139
|
-
style:
|
|
131
|
+
case "alert": return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(w, {
|
|
132
|
+
options: g,
|
|
133
|
+
style: p,
|
|
140
134
|
value: e.level ?? "info",
|
|
141
|
-
onChange: (t) =>
|
|
135
|
+
onChange: (t) => a({
|
|
142
136
|
...e,
|
|
143
|
-
level:
|
|
137
|
+
level: O(t)
|
|
144
138
|
})
|
|
145
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ y(m, {
|
|
146
140
|
expressionPlaceholder: "field.name + ' 已保存'",
|
|
147
141
|
literalPlaceholder: "提示内容",
|
|
148
142
|
value: e.message,
|
|
149
|
-
onChange: (t) =>
|
|
143
|
+
onChange: (t) => a({
|
|
150
144
|
...e,
|
|
151
145
|
message: t
|
|
152
146
|
})
|
|
153
147
|
})] });
|
|
154
|
-
case "navigate": return /* @__PURE__ */
|
|
148
|
+
case "navigate": return /* @__PURE__ */ y(m, {
|
|
155
149
|
expressionPlaceholder: "'/orders/' + field.id",
|
|
156
150
|
literalPlaceholder: "目标路径,如 /orders",
|
|
157
151
|
value: e.to,
|
|
158
|
-
onChange: (t) =>
|
|
152
|
+
onChange: (t) => a({
|
|
159
153
|
...e,
|
|
160
154
|
to: t
|
|
161
155
|
})
|
|
162
156
|
});
|
|
163
|
-
case "api_call": return /* @__PURE__ */
|
|
164
|
-
css:
|
|
165
|
-
children: [/* @__PURE__ */
|
|
157
|
+
case "api_call": return /* @__PURE__ */ b("div", {
|
|
158
|
+
css: l,
|
|
159
|
+
children: [/* @__PURE__ */ y(C, {
|
|
166
160
|
placeholder: "资源 (resource)",
|
|
167
161
|
value: e.request.resource,
|
|
168
|
-
onChange: (t) =>
|
|
162
|
+
onChange: (t) => a({
|
|
169
163
|
...e,
|
|
170
164
|
request: {
|
|
171
165
|
...e.request,
|
|
172
166
|
resource: t.target.value
|
|
173
167
|
}
|
|
174
168
|
})
|
|
175
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ y(C, {
|
|
176
170
|
placeholder: "动作 (action)",
|
|
177
171
|
value: e.request.action,
|
|
178
|
-
onChange: (t) =>
|
|
172
|
+
onChange: (t) => a({
|
|
179
173
|
...e,
|
|
180
174
|
request: {
|
|
181
175
|
...e.request,
|
|
@@ -184,18 +178,18 @@ function M({ action: e, dataSourceOptions: n, targetOptions: r, onChange: i }) {
|
|
|
184
178
|
})
|
|
185
179
|
})]
|
|
186
180
|
});
|
|
187
|
-
case "script": return /* @__PURE__ */
|
|
188
|
-
css:
|
|
189
|
-
children: /* @__PURE__ */ S
|
|
181
|
+
case "script": return /* @__PURE__ */ y("div", {
|
|
182
|
+
css: u,
|
|
183
|
+
children: /* @__PURE__ */ y(S, {
|
|
190
184
|
showLineNumbers: !0,
|
|
191
|
-
basicSetupOptions:
|
|
185
|
+
basicSetupOptions: r,
|
|
192
186
|
language: "javascript",
|
|
193
187
|
minHeight: 90,
|
|
194
188
|
showFoldGutter: !1,
|
|
195
189
|
size: "small",
|
|
196
190
|
value: e.source,
|
|
197
191
|
placeholder: "if (field.A === \"x\") return { hidden: true };\nreturn { value: field.B + field.C };",
|
|
198
|
-
onChange: (t) =>
|
|
192
|
+
onChange: (t) => a({
|
|
199
193
|
...e,
|
|
200
194
|
source: t
|
|
201
195
|
})
|
|
@@ -204,37 +198,8 @@ function M({ action: e, dataSourceOptions: n, targetOptions: r, onChange: i }) {
|
|
|
204
198
|
default: return null;
|
|
205
199
|
}
|
|
206
200
|
}
|
|
207
|
-
function
|
|
208
|
-
return /* @__PURE__ */ C("div", {
|
|
209
|
-
css: b,
|
|
210
|
-
children: [/* @__PURE__ */ S(D, {
|
|
211
|
-
options: [...A],
|
|
212
|
-
value: n.kind,
|
|
213
|
-
onChange: (e) => {
|
|
214
|
-
(e === "literal" || e === "expression") && r(i(n, e));
|
|
215
|
-
}
|
|
216
|
-
}), n.kind === "literal" ? /* @__PURE__ */ S(E, {
|
|
217
|
-
placeholder: t,
|
|
218
|
-
value: a(n.value),
|
|
219
|
-
onChange: (e) => r({
|
|
220
|
-
kind: "literal",
|
|
221
|
-
value: e.target.value
|
|
222
|
-
})
|
|
223
|
-
}) : /* @__PURE__ */ S("div", {
|
|
224
|
-
css: g,
|
|
225
|
-
children: /* @__PURE__ */ S(o, {
|
|
226
|
-
placeholder: e,
|
|
227
|
-
value: n.source,
|
|
228
|
-
onChange: (e) => r({
|
|
229
|
-
kind: "expression",
|
|
230
|
-
source: e
|
|
231
|
-
})
|
|
232
|
-
})
|
|
233
|
-
})]
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
function P(e) {
|
|
201
|
+
function O(e) {
|
|
237
202
|
return e === "success" || e === "warning" || e === "error" ? e : "info";
|
|
238
203
|
}
|
|
239
204
|
//#endregion
|
|
240
|
-
export {
|
|
205
|
+
export { E as ActionEditor };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.19.0 made by Venus | 2026-09-01T08:49:01.461Z */
|
|
2
2
|
import { EditorIcon as e } from "../../../../icons.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { actionsListCss as t, addInlineButtonCss as n, sectionCss as r, sectionLabelCss as i } from "./styles.js";
|
|
4
|
+
import { createActionFor as a } from "./mutators.js";
|
|
5
|
+
import { actionOptionsFor as o } from "./options.js";
|
|
6
6
|
import { ActionEditor as s } from "./action-editor.js";
|
|
7
7
|
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
8
8
|
import { Button as u } from "@vef-framework-react/components";
|
|
9
9
|
import { useMemo as d } from "react";
|
|
10
10
|
//#region src/editor/properties/entries/linkage/actions-editor.tsx
|
|
11
11
|
var f = ({ actions: f, allowStateActions: p, dataSourceOptions: m, isContainerTarget: h = !1, isTargetKeyed: g, targetOptions: _, triggerKind: v, onChange: y }) => {
|
|
12
|
-
let b = d(() =>
|
|
12
|
+
let b = d(() => o({
|
|
13
13
|
triggerKind: v,
|
|
14
14
|
isTargetKeyed: g,
|
|
15
15
|
allowStateActions: p,
|
|
@@ -25,14 +25,14 @@ var f = ({ actions: f, allowStateActions: p, dataSourceOptions: m, isContainerTa
|
|
|
25
25
|
y(f.filter((t, n) => n !== e));
|
|
26
26
|
};
|
|
27
27
|
return /* @__PURE__ */ l("div", {
|
|
28
|
-
css:
|
|
28
|
+
css: r,
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ c("span", {
|
|
31
|
-
css:
|
|
31
|
+
css: i,
|
|
32
32
|
children: "THEN"
|
|
33
33
|
}),
|
|
34
34
|
/* @__PURE__ */ c("div", {
|
|
35
|
-
css:
|
|
35
|
+
css: t,
|
|
36
36
|
children: f.map((e, t) => /* @__PURE__ */ c(s, {
|
|
37
37
|
action: e,
|
|
38
38
|
availableActions: b,
|
|
@@ -45,14 +45,14 @@ var f = ({ actions: f, allowStateActions: p, dataSourceOptions: m, isContainerTa
|
|
|
45
45
|
}, e.id ?? t))
|
|
46
46
|
}),
|
|
47
47
|
/* @__PURE__ */ c(u, {
|
|
48
|
-
css:
|
|
48
|
+
css: n,
|
|
49
49
|
disabled: b.length === 0,
|
|
50
50
|
icon: /* @__PURE__ */ c(e, { name: "plus" }),
|
|
51
51
|
size: "small",
|
|
52
52
|
type: "dashed",
|
|
53
53
|
onClick: () => {
|
|
54
54
|
let e = b[0]?.value;
|
|
55
|
-
e && y([...f,
|
|
55
|
+
e && y([...f, a(e)]);
|
|
56
56
|
},
|
|
57
57
|
children: "新增动作"
|
|
58
58
|
})
|