@vef-framework-react/form-editor 2.27.0 → 2.29.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/editor/canvas/canvas.cjs +1 -1
- package/dist/cjs/editor/canvas/json-split-view.cjs +1 -1
- package/dist/cjs/editor/canvas/subform-table-cell.cjs +1 -1
- package/dist/cjs/editor/code-set-catalog.cjs +1 -0
- package/dist/cjs/editor/form-editor.cjs +1 -1
- package/dist/cjs/editor/preview-runtime-context.cjs +1 -1
- package/dist/cjs/editor/properties/entries/options-source/code-set-source.cjs +1 -0
- package/dist/cjs/editor/properties/entries/options-source/index.cjs +1 -1
- package/dist/cjs/editor/properties/entries/options-source/source-mutators.cjs +1 -1
- package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -1
- package/dist/cjs/engine/code-sets.cjs +1 -0
- package/dist/cjs/engine/schema/validate.cjs +1 -1
- package/dist/cjs/engine/validation.cjs +1 -1
- package/dist/cjs/render/code-set-context.cjs +1 -0
- package/dist/cjs/render/data-source-context.cjs +1 -1
- package/dist/cjs/render/form-renderer.cjs +1 -1
- package/dist/cjs/render/subform-columns.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 +1 -1
- 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 +1 -1
- package/dist/es/editor/canvas/canvas-field.js +1 -1
- package/dist/es/editor/canvas/canvas.js +269 -256
- package/dist/es/editor/canvas/container-drag-chip.js +1 -1
- 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 +7 -6
- 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 +45 -48
- package/dist/es/editor/canvas/use-scroll-selection-into-view.js +1 -1
- package/dist/es/editor/code-set-catalog.js +19 -0
- package/dist/es/editor/context-sources.js +1 -1
- package/dist/es/editor/data-source-apis.js +1 -1
- package/dist/es/editor/dnd.js +1 -1
- 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 +1 -1
- package/dist/es/editor/form-config/outline-tab.js +1 -1
- package/dist/es/editor/form-editor.js +110 -105
- package/dist/es/editor/host-validation.js +1 -1
- package/dist/es/editor/issue-location.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 +3 -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 +1 -1
- 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 +1 -1
- package/dist/es/editor/properties/entries/linkage/actions-editor.js +1 -1
- package/dist/es/editor/properties/entries/linkage/condition-editor.js +1 -1
- package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +1 -1
- 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 +1 -1
- package/dist/es/editor/properties/entries/linkage/mutators.js +1 -1
- 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 +1 -1
- package/dist/es/editor/properties/entries/linkage/styles.js +1 -1
- package/dist/es/editor/properties/entries/linkage/trigger-editor.js +1 -1
- 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/code-set-source.js +47 -0
- package/dist/es/editor/properties/entries/options-source/index.js +65 -53
- package/dist/es/editor/properties/entries/options-source/source-mutators.js +6 -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 +1 -1
- 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 +1 -1
- 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/remote-option-source-editor.js +1 -1
- package/dist/es/editor/properties/remote-request-editor.js +1 -1
- package/dist/es/editor/properties/system-variables-panel.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 +1 -1
- 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/code-sets.js +12 -0
- package/dist/es/engine/conversion/index.js +1 -1
- package/dist/es/engine/data-source-params.js +1 -1
- 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 +1 -1
- package/dist/es/engine/linkage/index.js +1 -1
- package/dist/es/engine/linkage/operators.js +1 -1
- package/dist/es/engine/linkage/scope.js +1 -1
- package/dist/es/engine/linkage/shape.js +1 -1
- 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 +1 -1
- package/dist/es/engine/option-mapping.js +1 -1
- package/dist/es/engine/registry/defaults-mobile.js +1 -1
- package/dist/es/engine/registry/defaults.js +1 -1
- 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 +1 -1
- 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 +6 -1
- package/dist/es/engine/schema/walk.js +1 -1
- package/dist/es/engine/validation.js +3 -1
- package/dist/es/icons.js +1 -1
- package/dist/es/index.js +1 -1
- 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/code-set-context.js +52 -0
- package/dist/es/render/data-source-context.js +57 -44
- package/dist/es/render/data-source-param-scope.js +1 -1
- package/dist/es/render/flex-style.js +1 -1
- package/dist/es/render/form-field.js +1 -1
- package/dist/es/render/form-renderer.js +293 -287
- 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/option-order.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 +45 -44
- package/dist/es/render/submit.js +1 -1
- package/dist/es/runtime/effects.js +1 -1
- 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 +1 -1
- package/dist/es/types/index.js +1 -1
- 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/editor/code-set-catalog.d.ts +15 -0
- package/dist/types/editor/form-editor.d.ts +15 -2
- package/dist/types/editor/preview-runtime-context.d.ts +2 -1
- package/dist/types/editor/properties/entries/options-source/code-set-source.d.ts +12 -0
- package/dist/types/editor/properties/entries/options-source/index.d.ts +3 -3
- package/dist/types/engine/code-sets.d.ts +8 -0
- package/dist/types/engine/validation.d.ts +1 -1
- package/dist/types/render/code-set-context.d.ts +38 -0
- package/dist/types/render/data-source-context.d.ts +4 -3
- package/dist/types/render/form-renderer.d.ts +8 -1
- package/dist/types/render/subform-columns.d.ts +16 -2
- package/dist/types/types/data-source.d.ts +29 -0
- package/dist/types/types/schema.d.ts +19 -4
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { Label as e } from "./label.js";
|
|
3
3
|
import { Fragment as t, jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
4
4
|
import { css as i } from "@emotion/react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { css as n } from "@emotion/react";
|
|
4
4
|
import { globalCssVars as r } from "@vef-framework-react/components";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
//#region src/render/parts/option-order.ts
|
|
3
3
|
function e(e, t) {
|
|
4
4
|
let n = new Map(t.map((e, t) => [e.value, t]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { errorTextCss as e, helperTextCss as t } from "./field-shell.js";
|
|
3
3
|
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
4
4
|
//#region src/render/parts/options-status.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { DEFAULT_GAP_SCALE as e } from "../types/schema.js";
|
|
3
3
|
//#region src/render/stack-style.ts
|
|
4
4
|
var t = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { isContainerNode as e } from "../engine/schema/walk.js";
|
|
3
3
|
import { isKeyedField as t, isValidatableField as n } from "../engine/keys.js";
|
|
4
4
|
import { validateKeyedFieldValue as r } from "./submit.js";
|
|
@@ -6,23 +6,24 @@ import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
|
6
6
|
import { createEditableColumn as a, filterOptionByLabel as o } from "@vef-framework-react/components";
|
|
7
7
|
import { DEFAULT_DATETIME_FORMAT as s, DEFAULT_DATE_FORMAT as c } from "@vef-framework-react/shared";
|
|
8
8
|
//#region src/render/subform-columns.tsx
|
|
9
|
-
function l(e) {
|
|
10
|
-
|
|
9
|
+
function l(e, t) {
|
|
10
|
+
let n = [];
|
|
11
|
+
return e?.kind === "static" ? n = e.options : e?.kind === "codeSet" && (n = t?.[e.codeSet] ?? []), n.map((e) => ({
|
|
11
12
|
label: e.label,
|
|
12
13
|
value: String(e.value)
|
|
13
|
-
}))
|
|
14
|
+
}));
|
|
14
15
|
}
|
|
15
16
|
function u(e) {
|
|
16
17
|
return n(e) && e.validate?.required === !0;
|
|
17
18
|
}
|
|
18
|
-
function d(n) {
|
|
19
|
+
function d(n, d) {
|
|
19
20
|
if (e(n) || !t(n)) return null;
|
|
20
|
-
let
|
|
21
|
+
let f = n.label ?? n.key, p = n.columnWidth, m = { onChange: ({ value: e }) => r(n, u(n), e) };
|
|
21
22
|
switch (n.type) {
|
|
22
23
|
case "textfield": return a(n.key, {
|
|
23
|
-
title:
|
|
24
|
-
width:
|
|
25
|
-
validators:
|
|
24
|
+
title: f,
|
|
25
|
+
width: p,
|
|
26
|
+
validators: m,
|
|
26
27
|
renderEditor: (e) => /* @__PURE__ */ i(e.Input, {
|
|
27
28
|
noWrapper: !0,
|
|
28
29
|
maxLength: n.maxLength,
|
|
@@ -30,9 +31,9 @@ function d(n) {
|
|
|
30
31
|
})
|
|
31
32
|
});
|
|
32
33
|
case "textarea": return a(n.key, {
|
|
33
|
-
title:
|
|
34
|
-
width:
|
|
35
|
-
validators:
|
|
34
|
+
title: f,
|
|
35
|
+
width: p,
|
|
36
|
+
validators: m,
|
|
36
37
|
renderEditor: (e) => /* @__PURE__ */ i(e.TextArea, {
|
|
37
38
|
noWrapper: !0,
|
|
38
39
|
maxLength: n.maxLength,
|
|
@@ -40,9 +41,9 @@ function d(n) {
|
|
|
40
41
|
})
|
|
41
42
|
});
|
|
42
43
|
case "number": return a(n.key, {
|
|
43
|
-
title:
|
|
44
|
-
width:
|
|
45
|
-
validators:
|
|
44
|
+
title: f,
|
|
45
|
+
width: p,
|
|
46
|
+
validators: m,
|
|
46
47
|
renderEditor: (e) => /* @__PURE__ */ i(e.InputNumber, {
|
|
47
48
|
noWrapper: !0,
|
|
48
49
|
max: n.max,
|
|
@@ -53,46 +54,46 @@ function d(n) {
|
|
|
53
54
|
})
|
|
54
55
|
});
|
|
55
56
|
case "select": return a(n.key, {
|
|
56
|
-
title:
|
|
57
|
-
width:
|
|
58
|
-
validators:
|
|
57
|
+
title: f,
|
|
58
|
+
width: p,
|
|
59
|
+
validators: m,
|
|
59
60
|
renderEditor: (e) => /* @__PURE__ */ i(e.Select, {
|
|
60
61
|
noWrapper: !0,
|
|
61
62
|
allowClear: n.allowClear,
|
|
62
63
|
filterOption: o,
|
|
63
|
-
options: l(n.dataSource),
|
|
64
|
+
options: l(n.dataSource, d),
|
|
64
65
|
placeholder: n.placeholder,
|
|
65
66
|
showSearch: n.showSearch
|
|
66
67
|
})
|
|
67
68
|
});
|
|
68
69
|
case "radio": return a(n.key, {
|
|
69
|
-
title:
|
|
70
|
-
width:
|
|
71
|
-
validators:
|
|
70
|
+
title: f,
|
|
71
|
+
width: p,
|
|
72
|
+
validators: m,
|
|
72
73
|
renderEditor: (e) => /* @__PURE__ */ i(e.Radio, {
|
|
73
74
|
noWrapper: !0,
|
|
74
|
-
options: l(n.dataSource)
|
|
75
|
+
options: l(n.dataSource, d)
|
|
75
76
|
})
|
|
76
77
|
});
|
|
77
78
|
case "checkbox-group": return a(n.key, {
|
|
78
|
-
title:
|
|
79
|
-
width:
|
|
80
|
-
validators:
|
|
79
|
+
title: f,
|
|
80
|
+
width: p,
|
|
81
|
+
validators: m,
|
|
81
82
|
renderEditor: (e) => /* @__PURE__ */ i(e.CheckboxGroup, {
|
|
82
83
|
noWrapper: !0,
|
|
83
|
-
options: l(n.dataSource)
|
|
84
|
+
options: l(n.dataSource, d)
|
|
84
85
|
})
|
|
85
86
|
});
|
|
86
87
|
case "switch": return a(n.key, {
|
|
87
|
-
title:
|
|
88
|
-
width:
|
|
89
|
-
validators:
|
|
88
|
+
title: f,
|
|
89
|
+
width: p,
|
|
90
|
+
validators: m,
|
|
90
91
|
renderEditor: (e) => /* @__PURE__ */ i(e.Bool, { noWrapper: !0 })
|
|
91
92
|
});
|
|
92
93
|
case "date": return a(n.key, {
|
|
93
|
-
title:
|
|
94
|
-
width:
|
|
95
|
-
validators:
|
|
94
|
+
title: f,
|
|
95
|
+
width: p,
|
|
96
|
+
validators: m,
|
|
96
97
|
renderEditor: (e) => /* @__PURE__ */ i(e.DatePicker, {
|
|
97
98
|
noWrapper: !0,
|
|
98
99
|
format: c,
|
|
@@ -100,9 +101,9 @@ function d(n) {
|
|
|
100
101
|
})
|
|
101
102
|
});
|
|
102
103
|
case "datetime": return a(n.key, {
|
|
103
|
-
title:
|
|
104
|
-
width:
|
|
105
|
-
validators:
|
|
104
|
+
title: f,
|
|
105
|
+
width: p,
|
|
106
|
+
validators: m,
|
|
106
107
|
renderEditor: (e) => /* @__PURE__ */ i(e.DatePicker, {
|
|
107
108
|
noWrapper: !0,
|
|
108
109
|
showTime: !0,
|
|
@@ -111,22 +112,22 @@ function d(n) {
|
|
|
111
112
|
})
|
|
112
113
|
});
|
|
113
114
|
case "daterange": return a(n.key, {
|
|
114
|
-
title:
|
|
115
|
-
width:
|
|
116
|
-
validators:
|
|
115
|
+
title: f,
|
|
116
|
+
width: p,
|
|
117
|
+
validators: m,
|
|
117
118
|
renderEditor: (e) => /* @__PURE__ */ i(e.DateRangePicker, {
|
|
118
119
|
noWrapper: !0,
|
|
119
120
|
format: c
|
|
120
121
|
})
|
|
121
122
|
});
|
|
122
123
|
default: return a(n.key, {
|
|
123
|
-
title:
|
|
124
|
-
width:
|
|
124
|
+
title: f,
|
|
125
|
+
width: p
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
function f(e) {
|
|
129
|
-
return e.map((e) => d(e)).filter((e) => e !== null);
|
|
129
|
+
function f(e, t) {
|
|
130
|
+
return e.map((e) => d(e, t)).filter((e) => e !== null);
|
|
130
131
|
}
|
|
131
132
|
//#endregion
|
|
132
|
-
export { f as buildSubformColumns };
|
|
133
|
+
export { f as buildSubformColumns, l as columnOptions };
|
package/dist/es/render/submit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { containerBodies as e } from "../engine/schema/nodes.js";
|
|
3
3
|
import { isContainerNode as t, isLeafField as n, nodeLabel as r, walkNodes as i } from "../engine/schema/walk.js";
|
|
4
4
|
import { isKeyedField as a, isKeyedNode as o, isValidatableField as s } from "../engine/keys.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { isRootScope as e, walkFields as t } from "../engine/schema/walk.js";
|
|
3
3
|
import { resolveRequestParams as n } from "../engine/data-source-params.js";
|
|
4
4
|
import { resolveLinkageEvaluators as r } from "../engine/linkage/default-evaluator.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { getFieldPermission as e, isWritableFieldPermission as t } from "../engine/linkage/evaluator.js";
|
|
3
3
|
import { isDeepEqual as n } from "@vef-framework-react/shared";
|
|
4
4
|
//#region src/runtime/field-write.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
//#region src/runtime/resolve-scope-values.ts
|
|
3
3
|
function e(e, t) {
|
|
4
4
|
if (t === "") return e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { emptyRuntimeState as e } from "../engine/linkage/evaluator.js";
|
|
3
3
|
import { createContextWithSelector as t } from "@vef-framework-react/core";
|
|
4
4
|
//#region src/runtime/runtime-context.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { isRootScope as e, walkFields as t } from "../engine/schema/walk.js";
|
|
3
3
|
import { isKeyedField as n } from "../engine/keys.js";
|
|
4
4
|
import { evaluateRuntimeStates as r } from "../engine/linkage/evaluator.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { isDeepEqual as e } from "@vef-framework-react/shared";
|
|
3
3
|
//#region src/runtime/stabilize-state-map.ts
|
|
4
4
|
function t(t, n) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { jsx as e } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { createContext as t, use as n, useCallback as r, useSyncExternalStore as i } from "react";
|
|
4
4
|
//#region src/store/engine-provider.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { createId as e, idPrefixForType as t } from "../engine/ids.js";
|
|
3
3
|
import { createEmptySchema as n } from "../engine/schema/nodes.js";
|
|
4
4
|
import { countFields as r, findField as i, findNode as a, findScope as o, scopeEquals as s, walkFields as c, walkNodes as l } from "../engine/schema/walk.js";
|
package/dist/es/types/chrome.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
//#region src/types/data-source.ts
|
|
3
3
|
var e = { resolve: () => Promise.resolve([]) };
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
//#region src/types/dynamic-value.ts
|
|
3
3
|
function e(e) {
|
|
4
4
|
if (typeof e != "object" || !e) return !1;
|
package/dist/es/types/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
|
2
2
|
import { defineContainerDefinition as e, defineFieldDefinition as t } from "./component.js";
|
|
3
3
|
import { noopDataSourceResolver as n } from "./data-source.js";
|
|
4
4
|
import { isDynamicValue as r } from "./dynamic-value.js";
|
package/dist/es/types/linkage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.29.0 made by Venus | 2026-10-15T10:11:53.444Z */
|
package/dist/es/types/schema.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CodeSetDescriptor } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Publishes the host's data-dictionary catalog to the `codeSet` option-source
|
|
5
|
+
* editors, which offer it as a picker. Design-time metadata only — the runtime
|
|
6
|
+
* reads the code set key stored in the schema, never this catalog.
|
|
7
|
+
*/
|
|
8
|
+
export declare function CodeSetCatalogProvider({ codeSets, children }: {
|
|
9
|
+
codeSets: CodeSetDescriptor[] | undefined;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The host's data-dictionary catalog, empty when none was provided.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCodeSetCatalog(): CodeSetDescriptor[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, Ref } from 'react';
|
|
2
2
|
import { DeviceRegistries, FormFieldRegistry } from '../engine/registry/form-field-registry';
|
|
3
3
|
import { EditorDeviceMode, EditorViewMode } from '../store/form-store';
|
|
4
|
-
import { DataSourceApi, DataSourceResolver, EvaluationContext, FormSchema, LinkageContextSource, LinkageEvaluators } from '../types';
|
|
4
|
+
import { CodeSetDescriptor, CodeSetQueryFn, DataSourceApi, DataSourceResolver, EvaluationContext, FormSchema, LinkageContextSource, LinkageEvaluators } from '../types';
|
|
5
5
|
import { SchemaValidator } from './host-validation';
|
|
6
6
|
import { ToolbarBrand, Toolbar } from './toolbar/toolbar';
|
|
7
7
|
import { PalettePanel } from './palette/palette-panel';
|
|
@@ -60,6 +60,19 @@ export interface FormEditorProviderProps {
|
|
|
60
60
|
* it does a hand-typed one.
|
|
61
61
|
*/
|
|
62
62
|
dataSourceApis?: DataSourceApi[];
|
|
63
|
+
/**
|
|
64
|
+
* Loads the data dictionaries `codeSet` option sources read, forwarded to the
|
|
65
|
+
* canvas and the live preview so a dictionary-backed select shows its real
|
|
66
|
+
* entries while designing. Defaults to the application's
|
|
67
|
+
* `AppContext.codeSetQueryFn`.
|
|
68
|
+
*/
|
|
69
|
+
codeSetQueryFn?: CodeSetQueryFn;
|
|
70
|
+
/**
|
|
71
|
+
* The host's catalog of data dictionaries. The `codeSet` option-source editor
|
|
72
|
+
* then offers a searchable picker — "性别 · sys.user.gender" — instead of a
|
|
73
|
+
* key typed by hand. Design-time only: a pick stores the key alone.
|
|
74
|
+
*/
|
|
75
|
+
codeSets?: CodeSetDescriptor[];
|
|
63
76
|
/**
|
|
64
77
|
* Host evaluation scope (`$user` / `$node` / `$applicant` / `$globals`,
|
|
65
78
|
* variable overrides), forwarded to the live preview so host-context
|
|
@@ -104,7 +117,7 @@ export interface FormEditorProviderProps {
|
|
|
104
117
|
* render; updating them afterwards has no effect (editor state is bootstrapped
|
|
105
118
|
* once per mount — use {@link FormEditorApi.setSchema} to replace the schema).
|
|
106
119
|
*/
|
|
107
|
-
export declare function FormEditorProvider({ apiRef, children, contextSources, dataSourceApis, dataSourceResolver, evaluators, evaluationContext, initialSchema, onSchemaChange, registries: registriesProp, registry: registryProp, validate }: FormEditorProviderProps): ReactElement;
|
|
120
|
+
export declare function FormEditorProvider({ apiRef, children, codeSetQueryFn, codeSets, contextSources, dataSourceApis, dataSourceResolver, evaluators, evaluationContext, initialSchema, onSchemaChange, registries: registriesProp, registry: registryProp, validate }: FormEditorProviderProps): ReactElement;
|
|
108
121
|
export interface FormEditorShellProps {
|
|
109
122
|
children: ReactNode;
|
|
110
123
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DataSourceResolver, EvaluationContext, LinkageEvaluators } from '../types';
|
|
2
|
+
import { CodeSetQueryFn, DataSourceResolver, EvaluationContext, LinkageEvaluators } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Host-injected runtime capabilities the editor's live preview (and JSON split
|
|
5
5
|
* render) need so the in-designer `FormRenderer` behaves like the deployed form:
|
|
@@ -11,6 +11,7 @@ import { DataSourceResolver, EvaluationContext, LinkageEvaluators } from '../typ
|
|
|
11
11
|
export interface PreviewRuntime {
|
|
12
12
|
evaluators?: LinkageEvaluators;
|
|
13
13
|
dataSourceResolver?: DataSourceResolver;
|
|
14
|
+
codeSetQueryFn?: CodeSetQueryFn;
|
|
14
15
|
evaluationContext?: EvaluationContext;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Editor for a `codeSet` option source: a searchable picker over the host's
|
|
4
|
+
* data-dictionary catalog, or — when the host offers none — the key typed by
|
|
5
|
+
* hand. A typed key is committed on blur / Enter rather than per keystroke:
|
|
6
|
+
* every committed key is a dictionary the canvas loads, and the prefixes of a
|
|
7
|
+
* key being typed are not dictionaries.
|
|
8
|
+
*/
|
|
9
|
+
export declare function CodeSetSource({ codeSet, onChange }: {
|
|
10
|
+
codeSet: string;
|
|
11
|
+
onChange: (codeSet: string) => void;
|
|
12
|
+
}): ReactElement;
|
|
@@ -2,8 +2,8 @@ import { FC } from 'react';
|
|
|
2
2
|
import { EntryComponentProps } from '../../../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Editor for a selection field's option source. A segmented control switches
|
|
5
|
-
* between an inline static list, a reference to a form-global data source,
|
|
6
|
-
*
|
|
7
|
-
* resolved at runtime by `useFieldOptions`.
|
|
5
|
+
* between an inline static list, a reference to a form-global data source, an
|
|
6
|
+
* inline remote request, and a host data dictionary — the four arms of
|
|
7
|
+
* {@link FieldOptionSource}, all resolved at runtime by `useFieldOptions`.
|
|
8
8
|
*/
|
|
9
9
|
export declare const OptionsSourceEntry: FC<EntryComponentProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PresentationLayer } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The code set keys a presentation's selection fields read, subform templates
|
|
4
|
+
* included, de-duplicated and sorted: the one batched dictionary load a form
|
|
5
|
+
* issues. Sorted, they are also the query key `useCodeSetQuery` builds for the
|
|
6
|
+
* same dictionaries, so the two share one cache entry.
|
|
7
|
+
*/
|
|
8
|
+
export declare function collectCodeSets(layer: PresentationLayer): string[];
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
/**
|
|
22
22
|
* Stable machine-readable identifiers for every issue the validators emit.
|
|
23
23
|
*/
|
|
24
|
-
export type ValidationIssueCode = "schema_not_object" | "id_required" | "duplicate_id" | "version_unsupported" | "presentation_not_object" | "variables_invalid" | "data_sources_invalid" | "block_not_object" | "children_not_array" | "tabs_empty" | "tab_malformed" | "type_required" | "unknown_field_type" | "key_required" | "stray_key" | "stray_key_on_container" | "duplicate_key" | "key_invalid_charset" | "span_invalid" | "flex_invalid" | "column_width_invalid" | "stack_invalid" | "gap_invalid" | "columns_invalid" | "variant_invalid" | "subform_variant_invalid" | "title_invalid" | "display_text_invalid" | "rows_bound_invalid" | "subform_table_column" | "validate_malformed" | "validate_range_invalid" | "pattern_invalid" | "data_source_invalid" | "data_source_ref_unknown" | "request_malformed" | "request_incomplete" | "linkage_malformed" | "rules_not_array" | "rule_malformed" | "trigger_malformed" | "trigger_kind_invalid" | "trigger_requires_keyed_leaf" | "condition_malformed" | "condition_kind_invalid" | "logic_invalid" | "condition_group_empty" | "operator_invalid" | "source_key_empty" | "source_key_unresolved" | "source_scope_unknown" | "source_empty" | "actions_not_array" | "actions_empty" | "action_malformed" | "action_unknown_type" | "state_action_on_edge_trigger" | "state_action_on_form_scope" | "action_requires_keyed_leaf" | "defaults_requires_keyed_leaf" | "defaults_on_form_scope" | "default_hidden_unreachable" | "target_key_empty" | "target_key_unresolved" | "variable_empty" | "data_source_id_empty" | "value_malformed" | "alert_level_invalid" | "retrigger_invalid" | "retrigger_ignored" | "self_reference" | "cycle_detected";
|
|
24
|
+
export type ValidationIssueCode = "schema_not_object" | "id_required" | "duplicate_id" | "version_unsupported" | "presentation_not_object" | "variables_invalid" | "data_sources_invalid" | "block_not_object" | "children_not_array" | "tabs_empty" | "tab_malformed" | "type_required" | "unknown_field_type" | "key_required" | "stray_key" | "stray_key_on_container" | "duplicate_key" | "key_invalid_charset" | "span_invalid" | "flex_invalid" | "column_width_invalid" | "stack_invalid" | "gap_invalid" | "columns_invalid" | "variant_invalid" | "subform_variant_invalid" | "title_invalid" | "display_text_invalid" | "rows_bound_invalid" | "subform_table_column" | "validate_malformed" | "validate_range_invalid" | "pattern_invalid" | "data_source_invalid" | "data_source_ref_unknown" | "code_set_empty" | "request_malformed" | "request_incomplete" | "linkage_malformed" | "rules_not_array" | "rule_malformed" | "trigger_malformed" | "trigger_kind_invalid" | "trigger_requires_keyed_leaf" | "condition_malformed" | "condition_kind_invalid" | "logic_invalid" | "condition_group_empty" | "operator_invalid" | "source_key_empty" | "source_key_unresolved" | "source_scope_unknown" | "source_empty" | "actions_not_array" | "actions_empty" | "action_malformed" | "action_unknown_type" | "state_action_on_edge_trigger" | "state_action_on_form_scope" | "action_requires_keyed_leaf" | "defaults_requires_keyed_leaf" | "defaults_on_form_scope" | "default_hidden_unreachable" | "target_key_empty" | "target_key_unresolved" | "variable_empty" | "data_source_id_empty" | "value_malformed" | "alert_level_invalid" | "retrigger_invalid" | "retrigger_ignored" | "self_reference" | "cycle_detected";
|
|
25
25
|
export type ValidationSeverity = "error" | "warning";
|
|
26
26
|
/**
|
|
27
27
|
* Any diagnostic about a schema the editor can show: its own
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { CodeSetQueryFn, FieldOption } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* The state of a form's batched dictionary load.
|
|
5
|
+
*/
|
|
6
|
+
export interface CodeSetState {
|
|
7
|
+
/**
|
|
8
|
+
* Each loaded code set's options, keyed by code set; absent until the load
|
|
9
|
+
* succeeds.
|
|
10
|
+
*/
|
|
11
|
+
options?: Readonly<Record<string, FieldOption[]>>;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Loads the code sets a form reads in one batched call and publishes them to
|
|
17
|
+
* its `codeSet` option sources. `queryFn` falls back to the application's
|
|
18
|
+
* `AppContext.codeSetQueryFn`; without either, or without a code set to load,
|
|
19
|
+
* nothing is fetched and every `codeSet` source resolves to an empty list.
|
|
20
|
+
*
|
|
21
|
+
* The load runs in a sibling that mounts only when there is something to
|
|
22
|
+
* fetch: it is a TanStack query, and a form that reads no dictionary must not
|
|
23
|
+
* need a `QueryClient` above it. Keeping it a sibling also keeps `children` in
|
|
24
|
+
* the same tree position whether it is mounted or not, so the form below never
|
|
25
|
+
* remounts.
|
|
26
|
+
*/
|
|
27
|
+
export declare function CodeSetProvider({ children, codeSets, queryFn }: {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* The code set keys to load, sorted (see `collectCodeSets`).
|
|
31
|
+
*/
|
|
32
|
+
codeSets: readonly string[];
|
|
33
|
+
queryFn?: CodeSetQueryFn;
|
|
34
|
+
}): ReactElement;
|
|
35
|
+
/**
|
|
36
|
+
* The form's dictionary load, as `useFieldOptions` reads it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useCodeSetState(): CodeSetState;
|
|
@@ -32,9 +32,10 @@ export interface FieldOptionsResult {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Resolve a selection field's options. Static (and `ref`-to-static) sources
|
|
35
|
-
* return synchronously from the schema; `
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* return synchronously from the schema; a `codeSet` source reads the form's
|
|
36
|
+
* batched dictionary load (`CodeSetProvider`); `remote` (and `ref`-to-remote)
|
|
37
|
+
* sources fetch through the host-injected resolver, exposing a `loading` flag
|
|
38
|
+
* while the request is in flight. The previously resolved options are kept while a
|
|
38
39
|
* refresh is in flight (and after a failure), so a `refresh_data_source` effect
|
|
39
40
|
* does not blank every consuming select until the new response lands. A stale
|
|
40
41
|
* request is ignored if the source changes first.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, Ref } from 'react';
|
|
2
2
|
import { RuntimeFormValues } from '../runtime/types';
|
|
3
|
-
import { DataSourceResolver, EvaluationContext, FieldPermission, FormSchema, LinkageEvaluators, PresentationDevice } from '../types';
|
|
3
|
+
import { CodeSetQueryFn, DataSourceResolver, EvaluationContext, FieldPermission, FormSchema, LinkageEvaluators, PresentationDevice } from '../types';
|
|
4
4
|
export interface FormRendererProps {
|
|
5
5
|
schema: FormSchema;
|
|
6
6
|
/**
|
|
@@ -36,6 +36,13 @@ export interface FormRendererProps {
|
|
|
36
36
|
* (empty options) when omitted — static / ref-to-static sources never need it.
|
|
37
37
|
*/
|
|
38
38
|
dataSourceResolver?: DataSourceResolver;
|
|
39
|
+
/**
|
|
40
|
+
* Loads the data dictionaries `codeSet` option sources read — every one the
|
|
41
|
+
* form references, in one call. Defaults to the application's
|
|
42
|
+
* `AppContext.codeSetQueryFn`; without either, a `codeSet` source has no
|
|
43
|
+
* options.
|
|
44
|
+
*/
|
|
45
|
+
codeSetQueryFn?: CodeSetQueryFn;
|
|
39
46
|
/**
|
|
40
47
|
* Host-supplied evaluation scope. `$vars` here merges over (and overrides) the
|
|
41
48
|
* schema's variable defaults; `$user` / `$node` / `$applicant` / `$globals`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditableColumn } from '@vef-framework-react/components';
|
|
2
|
-
import { Block } from '../types';
|
|
2
|
+
import { Block, FieldOption, FieldOptionSource } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* A subform row is a flat record keyed by the template fields' `key`s. The
|
|
5
5
|
* `table` variant edits it through the components `EditableTable`, one column
|
|
@@ -8,9 +8,23 @@ import { Block } from '../types';
|
|
|
8
8
|
* foundation, so the editors bind to the row's draft form directly.
|
|
9
9
|
*/
|
|
10
10
|
type Row = Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* The loaded options of the form's data dictionaries, keyed by code set.
|
|
13
|
+
*/
|
|
14
|
+
export type CodeSetOptions = Readonly<Record<string, FieldOption[]>> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A column's options: an inline static list, or a data dictionary the form has
|
|
17
|
+
* already loaded in its batched code-set call. A remote / `ref` data source
|
|
18
|
+
* needs the async resolver and renders with no options for now (a documented
|
|
19
|
+
* follow-up); the column still edits the value.
|
|
20
|
+
*/
|
|
21
|
+
export declare function columnOptions(source: FieldOptionSource | undefined, codeSets: CodeSetOptions): Array<{
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}>;
|
|
11
25
|
/**
|
|
12
26
|
* Build the `EditableTable` columns for a subform template, one per keyed leaf
|
|
13
27
|
* field in document order. Non-keyed blocks are dropped.
|
|
14
28
|
*/
|
|
15
|
-
export declare function buildSubformColumns(template: Block[]): Array<EditableColumn<Row>>;
|
|
29
|
+
export declare function buildSubformColumns(template: Block[], codeSets?: CodeSetOptions): Array<EditableColumn<Row>>;
|
|
16
30
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataOption, QueryFunction } from '@vef-framework-react/core';
|
|
1
2
|
import { DynamicValue } from './dynamic-value';
|
|
2
3
|
import { FieldOption } from './schema';
|
|
3
4
|
/**
|
|
@@ -157,3 +158,31 @@ export interface DataSourceResolver {
|
|
|
157
158
|
* returns a benign result.
|
|
158
159
|
*/
|
|
159
160
|
export declare const noopDataSourceResolver: DataSourceResolver;
|
|
161
|
+
/**
|
|
162
|
+
* Loads host data dictionaries (code sets) in one call: given a list of code
|
|
163
|
+
* set keys, it answers each key's entries. The same contract as the
|
|
164
|
+
* application's `AppContext.codeSetQueryFn`, which is the default wherever a
|
|
165
|
+
* form takes one — and, run through TanStack Query under the same query key as
|
|
166
|
+
* `useCodeSetQuery`, a dictionary loaded anywhere in the application is not
|
|
167
|
+
* fetched again for a form.
|
|
168
|
+
*/
|
|
169
|
+
export type CodeSetQueryFn = QueryFunction<Record<string, DataOption[]>, string[]>;
|
|
170
|
+
/**
|
|
171
|
+
* One data dictionary a host offers in the designer's picker for `codeSet`
|
|
172
|
+
* option sources. Design-time only: a pick stores the key alone, so the
|
|
173
|
+
* runtime and a backend projection never need this catalog.
|
|
174
|
+
*/
|
|
175
|
+
export interface CodeSetDescriptor {
|
|
176
|
+
/**
|
|
177
|
+
* The code set key the schema stores, e.g. `"sys.user.gender"`.
|
|
178
|
+
*/
|
|
179
|
+
codeSet: string;
|
|
180
|
+
/**
|
|
181
|
+
* Display name in the picker, e.g. `"性别"`.
|
|
182
|
+
*/
|
|
183
|
+
name: string;
|
|
184
|
+
/**
|
|
185
|
+
* Picker group heading for a long catalog, e.g. `"人事"`.
|
|
186
|
+
*/
|
|
187
|
+
group?: string;
|
|
188
|
+
}
|