@vef-framework-react/form-editor 2.18.0 → 2.20.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.
Files changed (271) hide show
  1. package/dist/cjs/components/checkbox-group-field/index.cjs +1 -1
  2. package/dist/cjs/components/code-editor/index.cjs +1 -1
  3. package/dist/cjs/components/mobile/checkbox-group.cjs +1 -1
  4. package/dist/cjs/components/mobile/date-adapters.cjs +1 -1
  5. package/dist/cjs/components/mobile/date.cjs +1 -1
  6. package/dist/cjs/components/mobile/datetime.cjs +1 -1
  7. package/dist/cjs/components/mobile/definitions.cjs +1 -1
  8. package/dist/cjs/components/mobile/radio.cjs +1 -1
  9. package/dist/cjs/components/mobile/select.cjs +1 -1
  10. package/dist/cjs/components/mobile/switch.cjs +1 -1
  11. package/dist/cjs/components/radio-field/index.cjs +1 -1
  12. package/dist/cjs/components/select-field/index.cjs +1 -1
  13. package/dist/cjs/components/upload-field/index.cjs +1 -0
  14. package/dist/cjs/editor/canvas/canvas.cjs +1 -1
  15. package/dist/cjs/editor/canvas/container-drag-chip.cjs +1 -1
  16. package/dist/cjs/editor/dnd.cjs +1 -1
  17. package/dist/cjs/editor/form-config/linkage-overview.cjs +1 -1
  18. package/dist/cjs/editor/form-config/outline-tab.cjs +1 -1
  19. package/dist/cjs/editor/palette/palette-item.cjs +1 -1
  20. package/dist/cjs/editor/properties/container-properties.cjs +1 -1
  21. package/dist/cjs/editor/properties/dynamic-value-editor.cjs +1 -0
  22. package/dist/cjs/editor/properties/entries/linkage/action-editor.cjs +2 -2
  23. package/dist/cjs/editor/properties/entries/linkage/actions-editor.cjs +1 -1
  24. package/dist/cjs/editor/properties/entries/linkage/condition-editor.cjs +1 -1
  25. package/dist/cjs/editor/properties/entries/linkage/container-linkage-section.cjs +1 -1
  26. package/dist/cjs/editor/properties/entries/linkage/linkage-rules-entry.cjs +1 -1
  27. package/dist/cjs/editor/properties/entries/linkage/mutators.cjs +1 -1
  28. package/dist/cjs/editor/properties/entries/linkage/options.cjs +1 -1
  29. package/dist/cjs/editor/properties/entries/linkage/rule-list-editor.cjs +1 -1
  30. package/dist/cjs/editor/properties/entries/linkage/trigger-editor.cjs +1 -1
  31. package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -1
  32. package/dist/cjs/editor/properties/form-variables-panel.cjs +1 -1
  33. package/dist/cjs/editor/properties/option-editors.cjs +1 -1
  34. package/dist/cjs/editor/properties/properties-panel.cjs +1 -1
  35. package/dist/cjs/editor/remove-node-confirm.cjs +2 -2
  36. package/dist/cjs/editor/toolbar/toolbar.cjs +2 -2
  37. package/dist/cjs/engine/data-source-params.cjs +1 -0
  38. package/dist/cjs/engine/keys.cjs +1 -1
  39. package/dist/cjs/engine/linkage/effects.cjs +1 -1
  40. package/dist/cjs/engine/linkage/evaluator.cjs +1 -1
  41. package/dist/cjs/engine/linkage/operators.cjs +1 -1
  42. package/dist/cjs/engine/linkage/shape.cjs +1 -0
  43. package/dist/cjs/engine/linkage/source-tracking.cjs +1 -1
  44. package/dist/cjs/engine/linkage/validator.cjs +1 -1
  45. package/dist/cjs/engine/registry/defaults.cjs +1 -1
  46. package/dist/cjs/engine/schema/column-type.cjs +1 -1
  47. package/dist/cjs/engine/schema/edit-ops.cjs +1 -1
  48. package/dist/cjs/engine/schema/permission-bridge.cjs +1 -1
  49. package/dist/cjs/engine/schema/removal-impact.cjs +1 -1
  50. package/dist/cjs/index.cjs +1 -1
  51. package/dist/cjs/render/chrome/mobile-chrome.cjs +1 -1
  52. package/dist/cjs/render/chrome/pc-chrome.cjs +1 -1
  53. package/dist/cjs/render/data-source-context.cjs +0 -0
  54. package/dist/cjs/render/data-source-param-scope.cjs +1 -0
  55. package/dist/cjs/render/form-field.cjs +1 -1
  56. package/dist/cjs/render/form-renderer.cjs +1 -1
  57. package/dist/cjs/render/parts/field-shell.cjs +1 -1
  58. package/dist/cjs/render/parts/label.cjs +1 -1
  59. package/dist/cjs/render/parts/option-order.cjs +1 -0
  60. package/dist/cjs/render/subform-columns.cjs +1 -1
  61. package/dist/cjs/render/submit.cjs +1 -1
  62. package/dist/cjs/runtime/effects.cjs +1 -1
  63. package/dist/cjs/runtime/field-write.cjs +1 -1
  64. package/dist/cjs/runtime/runtime-state-controller.cjs +1 -1
  65. package/dist/cjs/store/form-store.cjs +1 -1
  66. package/dist/cjs/types/dynamic-value.cjs +1 -0
  67. package/dist/cjs/types/index.cjs +1 -1
  68. package/dist/es/components/button/index.js +1 -1
  69. package/dist/es/components/checkbox-group-field/index.js +24 -22
  70. package/dist/es/components/code-editor/code-editor-input.js +1 -1
  71. package/dist/es/components/code-editor/index.js +3 -2
  72. package/dist/es/components/containers/index.js +1 -1
  73. package/dist/es/components/date-field/index.js +1 -1
  74. package/dist/es/components/display/index.js +1 -1
  75. package/dist/es/components/field-entries.js +1 -1
  76. package/dist/es/components/mobile/alert-block.js +1 -1
  77. package/dist/es/components/mobile/button.js +1 -1
  78. package/dist/es/components/mobile/checkbox-group.js +26 -24
  79. package/dist/es/components/mobile/date-adapters.js +3 -2
  80. package/dist/es/components/mobile/date.js +36 -34
  81. package/dist/es/components/mobile/daterange.js +1 -1
  82. package/dist/es/components/mobile/datetime.js +36 -34
  83. package/dist/es/components/mobile/definitions.js +34 -32
  84. package/dist/es/components/mobile/divider.js +1 -1
  85. package/dist/es/components/mobile/input-cell.js +1 -1
  86. package/dist/es/components/mobile/number.js +1 -1
  87. package/dist/es/components/mobile/option-group.js +1 -1
  88. package/dist/es/components/mobile/paragraph.js +1 -1
  89. package/dist/es/components/mobile/picker-trigger.js +1 -1
  90. package/dist/es/components/mobile/radio.js +2 -1
  91. package/dist/es/components/mobile/scope.js +1 -1
  92. package/dist/es/components/mobile/select.js +2 -2
  93. package/dist/es/components/mobile/switch.js +17 -11
  94. package/dist/es/components/mobile/textarea.js +1 -1
  95. package/dist/es/components/mobile/textfield.js +1 -1
  96. package/dist/es/components/mobile/theme.js +1 -1
  97. package/dist/es/components/number-field/index.js +1 -1
  98. package/dist/es/components/radio-field/index.js +3 -2
  99. package/dist/es/components/select-field/index.js +14 -13
  100. package/dist/es/components/switch-field/index.js +1 -1
  101. package/dist/es/components/textarea-field/index.js +1 -1
  102. package/dist/es/components/textfield/index.js +1 -1
  103. package/dist/es/components/upload-field/index.js +105 -0
  104. package/dist/es/editor/canvas/canvas-field.js +1 -1
  105. package/dist/es/editor/canvas/canvas.js +103 -103
  106. package/dist/es/editor/canvas/container-drag-chip.js +8 -8
  107. package/dist/es/editor/canvas/drop-indicator.js +1 -1
  108. package/dist/es/editor/canvas/drop-zones.js +1 -1
  109. package/dist/es/editor/canvas/json-split-view.js +1 -1
  110. package/dist/es/editor/canvas/mobile-seed-state.js +1 -1
  111. package/dist/es/editor/canvas/phone-frame.js +1 -1
  112. package/dist/es/editor/canvas/subform-column-eligibility.js +1 -1
  113. package/dist/es/editor/canvas/subform-table-cell.js +1 -1
  114. package/dist/es/editor/canvas/use-scroll-selection-into-view.js +1 -1
  115. package/dist/es/editor/context-sources.js +1 -1
  116. package/dist/es/editor/dnd.js +18 -18
  117. package/dist/es/editor/editor-layout-context.js +1 -1
  118. package/dist/es/editor/footer/footer.js +1 -1
  119. package/dist/es/editor/form-config/form-basics-tab.js +1 -1
  120. package/dist/es/editor/form-config/form-config-drawer.js +1 -1
  121. package/dist/es/editor/form-config/linkage-overview.js +9 -9
  122. package/dist/es/editor/form-config/outline-tab.js +6 -6
  123. package/dist/es/editor/form-editor.js +1 -1
  124. package/dist/es/editor/palette/field-groups.js +1 -1
  125. package/dist/es/editor/palette/palette-group.js +1 -1
  126. package/dist/es/editor/palette/palette-item.js +71 -70
  127. package/dist/es/editor/palette/palette-panel.js +1 -1
  128. package/dist/es/editor/preview-effects.js +1 -1
  129. package/dist/es/editor/preview-runtime-context.js +1 -1
  130. package/dist/es/editor/properties/block-layout-section.js +1 -1
  131. package/dist/es/editor/properties/container-properties.js +198 -200
  132. package/dist/es/editor/properties/dynamic-value-editor.js +57 -0
  133. package/dist/es/editor/properties/entries/built-ins.js +1 -1
  134. package/dist/es/editor/properties/entries/checkbox-entry.js +1 -1
  135. package/dist/es/editor/properties/entries/coerce.js +1 -1
  136. package/dist/es/editor/properties/entries/entry-field.js +1 -1
  137. package/dist/es/editor/properties/entries/icon-entry.js +1 -1
  138. package/dist/es/editor/properties/entries/index.js +1 -1
  139. package/dist/es/editor/properties/entries/key-entry.js +1 -1
  140. package/dist/es/editor/properties/entries/linkage/action-editor.js +75 -110
  141. package/dist/es/editor/properties/entries/linkage/actions-editor.js +10 -10
  142. package/dist/es/editor/properties/entries/linkage/condition-editor.js +123 -123
  143. package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +7 -7
  144. package/dist/es/editor/properties/entries/linkage/expression-input.js +1 -1
  145. package/dist/es/editor/properties/entries/linkage/index.js +1 -1
  146. package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +60 -59
  147. package/dist/es/editor/properties/entries/linkage/mutators.js +2 -11
  148. package/dist/es/editor/properties/entries/linkage/options.js +5 -2
  149. package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +1 -1
  150. package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +29 -29
  151. package/dist/es/editor/properties/entries/linkage/styles.js +1 -1
  152. package/dist/es/editor/properties/entries/linkage/trigger-editor.js +36 -36
  153. package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +1 -1
  154. package/dist/es/editor/properties/entries/linkage/use-stable-options.js +1 -1
  155. package/dist/es/editor/properties/entries/number-entry.js +1 -1
  156. package/dist/es/editor/properties/entries/options-source/index.js +1 -1
  157. package/dist/es/editor/properties/entries/options-source/source-mutators.js +1 -1
  158. package/dist/es/editor/properties/entries/select-entry.js +1 -1
  159. package/dist/es/editor/properties/entries/text-entry.js +1 -1
  160. package/dist/es/editor/properties/form-data-sources-panel.js +7 -7
  161. package/dist/es/editor/properties/form-linkage-panel.js +1 -1
  162. package/dist/es/editor/properties/form-variables-panel.js +68 -67
  163. package/dist/es/editor/properties/option-editors.js +244 -123
  164. package/dist/es/editor/properties/panel-header.js +1 -1
  165. package/dist/es/editor/properties/properties-empty.js +1 -1
  166. package/dist/es/editor/properties/properties-header.js +1 -1
  167. package/dist/es/editor/properties/properties-panel.js +17 -17
  168. package/dist/es/editor/properties/properties-provider.js +1 -1
  169. package/dist/es/editor/properties/properties-tabs.js +1 -1
  170. package/dist/es/editor/properties/use-confirmable-kind-switch.js +1 -1
  171. package/dist/es/editor/remove-node-confirm.js +36 -29
  172. package/dist/es/editor/schema-apply.js +1 -1
  173. package/dist/es/editor/styles.js +1 -1
  174. package/dist/es/editor/toolbar/notify.js +1 -1
  175. package/dist/es/editor/toolbar/schema-io.js +1 -1
  176. package/dist/es/editor/toolbar/toolbar.js +173 -172
  177. package/dist/es/editor/use-editor-shortcuts.js +1 -1
  178. package/dist/es/editor/validation-summary.js +1 -1
  179. package/dist/es/engine/assert-never.js +1 -1
  180. package/dist/es/engine/conversion/index.js +1 -1
  181. package/dist/es/engine/data-source-params.js +38 -0
  182. package/dist/es/engine/ids.js +1 -1
  183. package/dist/es/engine/keys.js +6 -3
  184. package/dist/es/engine/linkage/cycle.js +1 -1
  185. package/dist/es/engine/linkage/default-evaluator.js +1 -1
  186. package/dist/es/engine/linkage/effects.js +38 -32
  187. package/dist/es/engine/linkage/evaluator.js +70 -60
  188. package/dist/es/engine/linkage/index.js +1 -1
  189. package/dist/es/engine/linkage/operators.js +3 -3
  190. package/dist/es/engine/linkage/shape.js +21 -0
  191. package/dist/es/engine/linkage/source-tracking.js +20 -11
  192. package/dist/es/engine/linkage/taxonomy.js +1 -1
  193. package/dist/es/engine/linkage/validator.js +187 -186
  194. package/dist/es/engine/registry/defaults-mobile.js +1 -1
  195. package/dist/es/engine/registry/defaults.js +10 -9
  196. package/dist/es/engine/registry/form-field-registry.js +1 -1
  197. package/dist/es/engine/schema/column-type.js +6 -2
  198. package/dist/es/engine/schema/edit-ops.js +9 -9
  199. package/dist/es/engine/schema/mutate.js +1 -1
  200. package/dist/es/engine/schema/nodes.js +1 -1
  201. package/dist/es/engine/schema/permission-bridge.js +4 -3
  202. package/dist/es/engine/schema/presentation.js +1 -1
  203. package/dist/es/engine/schema/reconcile.js +1 -1
  204. package/dist/es/engine/schema/removal-impact.js +60 -39
  205. package/dist/es/engine/schema/rewrite.js +1 -1
  206. package/dist/es/engine/schema/validate.js +1 -1
  207. package/dist/es/engine/schema/walk.js +1 -1
  208. package/dist/es/engine/validation.js +1 -1
  209. package/dist/es/icons.js +1 -1
  210. package/dist/es/index.js +55 -54
  211. package/dist/es/render/chrome/mobile-chrome.js +67 -66
  212. package/dist/es/render/chrome/pc-chrome.js +38 -37
  213. package/dist/es/render/chrome/subform-shell.js +1 -1
  214. package/dist/es/render/data-source-context.js +0 -0
  215. package/dist/es/render/data-source-param-scope.js +33 -0
  216. package/dist/es/render/flex-style.js +1 -1
  217. package/dist/es/render/form-field.js +5 -5
  218. package/dist/es/render/form-renderer.js +250 -237
  219. package/dist/es/render/grid-style.js +1 -1
  220. package/dist/es/render/parts/field-shell.js +29 -22
  221. package/dist/es/render/parts/label.js +12 -10
  222. package/dist/es/render/parts/option-order.js +8 -0
  223. package/dist/es/render/parts/options-status.js +1 -1
  224. package/dist/es/render/stack-style.js +1 -1
  225. package/dist/es/render/subform-columns.js +49 -48
  226. package/dist/es/render/submit.js +73 -53
  227. package/dist/es/runtime/effects.js +75 -58
  228. package/dist/es/runtime/field-write.js +15 -5
  229. package/dist/es/runtime/resolve-scope-values.js +1 -1
  230. package/dist/es/runtime/runtime-context.js +1 -1
  231. package/dist/es/runtime/runtime-state-controller.js +91 -78
  232. package/dist/es/runtime/stabilize-state-map.js +1 -1
  233. package/dist/es/store/engine-provider.js +1 -1
  234. package/dist/es/store/form-store.js +147 -111
  235. package/dist/es/types/chrome.js +1 -1
  236. package/dist/es/types/component.js +1 -1
  237. package/dist/es/types/data-source.js +1 -1
  238. package/dist/es/types/dynamic-value.js +9 -0
  239. package/dist/es/types/index.js +5 -4
  240. package/dist/es/types/linkage.js +1 -1
  241. package/dist/es/types/properties.js +1 -1
  242. package/dist/es/types/schema.js +1 -1
  243. package/dist/types/components/mobile/date-adapters.d.ts +21 -0
  244. package/dist/types/components/mobile/switch.d.ts +5 -3
  245. package/dist/types/components/upload-field/index.d.ts +2 -0
  246. package/dist/types/editor/properties/dynamic-value-editor.d.ts +23 -0
  247. package/dist/types/editor/properties/entries/linkage/mutators.d.ts +1 -8
  248. package/dist/types/editor/properties/entries/linkage/options.d.ts +16 -0
  249. package/dist/types/editor/remove-node-confirm.d.ts +6 -0
  250. package/dist/types/engine/data-source-params.d.ts +33 -0
  251. package/dist/types/engine/keys.d.ts +5 -0
  252. package/dist/types/engine/linkage/effects.d.ts +13 -3
  253. package/dist/types/engine/linkage/shape.d.ts +54 -0
  254. package/dist/types/engine/linkage/source-tracking.d.ts +20 -1
  255. package/dist/types/engine/schema/removal-impact.d.ts +23 -0
  256. package/dist/types/render/data-source-param-scope.d.ts +58 -0
  257. package/dist/types/render/parts/field-shell.d.ts +16 -1
  258. package/dist/types/render/parts/label.d.ts +14 -1
  259. package/dist/types/render/parts/option-order.d.ts +20 -0
  260. package/dist/types/render/submit.d.ts +7 -4
  261. package/dist/types/runtime/effects.d.ts +1 -0
  262. package/dist/types/runtime/field-write.d.ts +7 -1
  263. package/dist/types/runtime/runtime-state-controller.d.ts +4 -2
  264. package/dist/types/store/form-store.d.ts +15 -3
  265. package/dist/types/types/chrome.d.ts +7 -0
  266. package/dist/types/types/data-source.d.ts +26 -1
  267. package/dist/types/types/dynamic-value.d.ts +21 -0
  268. package/dist/types/types/index.d.ts +1 -0
  269. package/dist/types/types/linkage.d.ts +9 -8
  270. package/dist/types/types/schema.d.ts +48 -5
  271. package/package.json +5 -5
@@ -1,3 +1,4 @@
1
+ import { DynamicValue } from './dynamic-value';
1
2
  import { FieldOption } from './schema';
2
3
  /**
3
4
  * An RPC request describing where a selection field's options come from. The
@@ -6,6 +7,30 @@ import { FieldOption } from './schema';
6
7
  * editor never depends on a concrete `apiClient`.
7
8
  */
8
9
  export interface RemoteDataSourceRequest {
10
+ resource: string;
11
+ action: string;
12
+ version?: string;
13
+ /**
14
+ * Request parameters, each either a fixed value or an expression bound to the
15
+ * live form. Expressions are evaluated by the form runtime **before** the
16
+ * request reaches the resolver, so a {@link DataSourceResolver} always sees
17
+ * concrete values and stays transport-only.
18
+ *
19
+ * Binding a parameter is what makes a cascading select work — "the wards of
20
+ * the department picked above". The runtime keys its option cache on the
21
+ * resolved request, so a bound value changing re-resolves the options and an
22
+ * unrelated keystroke does not.
23
+ */
24
+ params?: Record<string, DynamicValue>;
25
+ }
26
+ /**
27
+ * A request whose parameters have already been evaluated — what the form
28
+ * runtime hands to a resolver or a host `api_call` handler. Splitting it from
29
+ * {@link RemoteDataSourceRequest} keeps expression evaluation the runtime's
30
+ * job: the schema type carries bindings, this one carries data, and nothing
31
+ * downstream has to know an expression ever existed.
32
+ */
33
+ export interface ResolvedDataSourceRequest {
9
34
  resource: string;
10
35
  action: string;
11
36
  version?: string;
@@ -60,7 +85,7 @@ export interface FormVariable {
60
85
  * `LinkageEvaluators` host-injection philosophy.
61
86
  */
62
87
  export interface DataSourceResolver {
63
- resolve: (request: RemoteDataSourceRequest, mapping?: RemoteOptionMapping) => Promise<FieldOption[]>;
88
+ resolve: (request: ResolvedDataSourceRequest, mapping?: RemoteOptionMapping) => Promise<FieldOption[]>;
64
89
  }
65
90
  /**
66
91
  * The no-op resolver used when a host supplies none — remote sources resolve to
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A value the schema carries either verbatim or as an expression evaluated at
3
+ * runtime against the current form values and evaluation context.
4
+ *
5
+ * One declaration serves every place the designer offers a "fixed value or
6
+ * bound value" choice — linkage action values and remote data-source request
7
+ * parameters — so the two cannot drift into different shapes and the editor
8
+ * reuses one control for both.
9
+ */
10
+ export type DynamicValue = {
11
+ kind: "literal";
12
+ value: unknown;
13
+ } | {
14
+ kind: "expression";
15
+ source: string;
16
+ };
17
+ /**
18
+ * Narrow an unknown to a {@link DynamicValue}. Used when reading values that
19
+ * crossed a serialization boundary (an imported schema).
20
+ */
21
+ export declare function isDynamicValue(value: unknown): value is DynamicValue;
@@ -1,6 +1,7 @@
1
1
  export * from './chrome';
2
2
  export * from './component';
3
3
  export * from './data-source';
4
+ export * from './dynamic-value';
4
5
  export * from './linkage';
5
6
  export * from './properties';
6
7
  export * from './schema';
@@ -1,4 +1,5 @@
1
- import { RemoteDataSourceRequest } from './data-source';
1
+ import { RemoteDataSourceRequest, ResolvedDataSourceRequest } from './data-source';
2
+ import { DynamicValue } from './dynamic-value';
2
3
  /**
3
4
  * Linkage data model.
4
5
  *
@@ -152,13 +153,7 @@ export interface FieldLinkageDefaults {
152
153
  * `navigate`). A literal carries the value verbatim; an expression is computed
153
154
  * at runtime via the injected evaluator.
154
155
  */
155
- export type LinkageActionValue = {
156
- kind: "literal";
157
- value: unknown;
158
- } | {
159
- kind: "expression";
160
- source: string;
161
- };
156
+ export type LinkageActionValue = DynamicValue;
162
157
  /**
163
158
  * Severity passed to an `alert` effect, mirroring antd's alert/message levels.
164
159
  */
@@ -291,6 +286,12 @@ export interface EffectDispatchContext {
291
286
  * Resolve a literal / expression action value against {@link values}.
292
287
  */
293
288
  resolveValue: (value: LinkageActionValue) => unknown;
289
+ /**
290
+ * Resolve an `api_call` request's bound parameters against {@link values},
291
+ * the same way the option resolver's request is resolved — so a handler
292
+ * receives plain data and never has to evaluate an expression itself.
293
+ */
294
+ resolveRequest: (request: RemoteDataSourceRequest) => ResolvedDataSourceRequest;
294
295
  }
295
296
  /**
296
297
  * Server-resolved per-field interactivity clamp. Lockstep contract: mirrors the
@@ -433,7 +433,10 @@ export interface RadioField extends FormFieldBase, KeyedNode, Validatable {
433
433
  buttonStyle?: "outline" | "solid";
434
434
  /**
435
435
  * Option layout direction. Maps to antd `Radio.Group` `orientation` on PC and
436
- * drives the flex direction on mobile. Defaults to vertical.
436
+ * drives the flex direction on mobile. Defaults to vertical — applied
437
+ * EXPLICITLY by both renderers, since antd's own default is horizontal and
438
+ * antd-mobile's is vertical, which laid the same schema out differently on
439
+ * the two devices.
437
440
  */
438
441
  direction?: "horizontal" | "vertical";
439
442
  }
@@ -445,7 +448,9 @@ export interface CheckboxGroupField extends FormFieldBase, KeyedNode, Validatabl
445
448
  helperText?: string;
446
449
  dataSource?: FieldOptionSource;
447
450
  /**
448
- * Option layout direction. antd `Checkbox.Group` has no orientation prop, so
451
+ * Option layout direction. Defaults to vertical, applied explicitly by both
452
+ * renderers (see RadioField.direction). antd `Checkbox.Group` has no
453
+ * orientation prop, so
449
454
  * the PC renderer realizes vertical layout via flex; the mobile renderer drives
450
455
  * its flex direction the same way. Defaults to vertical.
451
456
  */
@@ -523,6 +528,34 @@ export interface DateRangeField extends FormFieldBase, KeyedNode, Validatable {
523
528
  */
524
529
  allowClear?: boolean;
525
530
  }
531
+ /**
532
+ * File upload. Keyed: contributes the stored object key(s) — a string when
533
+ * `maxCount` is 1, a string array otherwise. That is the shape the approval
534
+ * backend's `upload` field kind validates, so the value needs no translation
535
+ * on the way out.
536
+ */
537
+ export interface UploadField extends FormFieldBase, KeyedNode, Validatable {
538
+ type: "upload";
539
+ helperText?: string;
540
+ /**
541
+ * How many files the field accepts. `1` (the default) makes the value a
542
+ * single key rather than a list.
543
+ */
544
+ maxCount?: number;
545
+ /**
546
+ * Land the objects under `pub/` rather than `priv/`. Requires the backend's
547
+ * `vef.storage.allow_public_uploads`.
548
+ */
549
+ public?: boolean;
550
+ /**
551
+ * `accept` attribute forwarded to the file input (e.g. `.pdf,image/*`).
552
+ */
553
+ accept?: string;
554
+ /**
555
+ * Render as a drag-and-drop area instead of a button.
556
+ */
557
+ dragger?: boolean;
558
+ }
526
559
  /**
527
560
  * Section divider. Non-keyed presentation — an optional inline title.
528
561
  */
@@ -614,6 +647,7 @@ export interface FormFieldTypeMap {
614
647
  date: DateField;
615
648
  datetime: DatetimeField;
616
649
  daterange: DateRangeField;
650
+ upload: UploadField;
617
651
  divider: DividerField;
618
652
  "alert-block": AlertBlockField;
619
653
  paragraph: ParagraphField;
@@ -817,9 +851,18 @@ export type Block = FormField | ContainerNode;
817
851
  */
818
852
  export type KeyedNodeUnion = Extract<Block, KeyedNode>;
819
853
  /**
820
- * Which device a {@link PresentationLayer} targets. PC and mobile each carry an
821
- * independent field tree and layout; the data layer (variables / data sources /
822
- * keys) is shared, so the same key binds the same value on both.
854
+ * Which device a {@link PresentationLayer} targets.
855
+ *
856
+ * PC and mobile each carry an independent field tree and layout, and the two
857
+ * designs may legitimately differ: a field can exist on one device and not the
858
+ * other, and the same field can sit in a different container or order.
859
+ *
860
+ * The DATA layer is shared, though — variables, data sources, and keys. A key
861
+ * names one value on both devices, which is what `walkUniqueRootKeyedFields`
862
+ * relies on when it folds the two trees into one field inventory deduped by
863
+ * key. So renaming a field that both devices carry renames it on both
864
+ * (`setFieldKey`); letting the two drift apart would project one field as two
865
+ * and hand the backend a phantom.
823
866
  */
824
867
  export type PresentationDevice = "pc" | "mobile";
825
868
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vef-framework-react/form-editor",
3
- "version": "2.18.0",
3
+ "version": "2.20.0",
4
4
  "private": false,
5
5
  "description": "Form editor for VEF framework",
6
6
  "keywords": [
@@ -46,10 +46,10 @@
46
46
  "@emotion/react": "^11.14.0",
47
47
  "antd-mobile": "^5.42.3",
48
48
  "lucide-react": "^1.23.0",
49
- "@vef-framework-react/core": "2.18.0",
50
- "@vef-framework-react/hooks": "2.18.0",
51
- "@vef-framework-react/components": "2.18.0",
52
- "@vef-framework-react/shared": "2.18.0"
49
+ "@vef-framework-react/components": "2.20.0",
50
+ "@vef-framework-react/core": "2.20.0",
51
+ "@vef-framework-react/hooks": "2.20.0",
52
+ "@vef-framework-react/shared": "2.20.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "react": "^19.2.7"