@zeng-alt/formkit-form-builder 1.3.0 → 2.0.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 (231) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +323 -137
  3. package/dist/builder.css +1 -1
  4. package/dist/builder.es.js +7916 -42625
  5. package/dist/builder.es.js.map +1 -0
  6. package/dist/builder.umd.js +61 -90
  7. package/dist/chunks/AiPrompt-CWUhBDH4.js +174 -0
  8. package/dist/chunks/AiPrompt-CWUhBDH4.js.map +1 -0
  9. package/dist/chunks/BadgeEditor-B1kB2DXg.js +133 -0
  10. package/dist/chunks/BadgeEditor-B1kB2DXg.js.map +1 -0
  11. package/dist/chunks/BuilderPreview-CKL5bqCP.js +142 -0
  12. package/dist/chunks/BuilderPreview-CKL5bqCP.js.map +1 -0
  13. package/dist/chunks/ButtonGroupEditor-C5pChDFz.js +55 -0
  14. package/dist/chunks/ButtonGroupEditor-C5pChDFz.js.map +1 -0
  15. package/dist/chunks/CardEditor-Bsbriwvu.js +61 -0
  16. package/dist/chunks/CardEditor-Bsbriwvu.js.map +1 -0
  17. package/dist/chunks/CheckboxEditor-CxNEvn_Y.js +23 -0
  18. package/dist/chunks/CheckboxEditor-CxNEvn_Y.js.map +1 -0
  19. package/dist/chunks/CollapseEditor-CUFTdj0V.js +36 -0
  20. package/dist/chunks/CollapseEditor-CUFTdj0V.js.map +1 -0
  21. package/dist/chunks/ColorEditor-Bo9QkLsR.js +17 -0
  22. package/dist/chunks/ColorEditor-Bo9QkLsR.js.map +1 -0
  23. package/dist/chunks/DataTableContainerPreview-phlGcigM.js +403 -0
  24. package/dist/chunks/DataTableContainerPreview-phlGcigM.js.map +1 -0
  25. package/dist/chunks/DataTableEditor-BTDWXdtk.js +473 -0
  26. package/dist/chunks/DataTableEditor-BTDWXdtk.js.map +1 -0
  27. package/dist/chunks/DataTableFieldPicker-qWxGmVxr.js +1579 -0
  28. package/dist/chunks/DataTableFieldPicker-qWxGmVxr.js.map +1 -0
  29. package/dist/chunks/DataTableRowCellInput-BLTM3I21.js +195 -0
  30. package/dist/chunks/DataTableRowCellInput-BLTM3I21.js.map +1 -0
  31. package/dist/chunks/DataTableSearchField-PU89hniM.js +81 -0
  32. package/dist/chunks/DataTableSearchField-PU89hniM.js.map +1 -0
  33. package/dist/chunks/DateLikeEditor-ZkCbMhpE.js +74 -0
  34. package/dist/chunks/DateLikeEditor-ZkCbMhpE.js.map +1 -0
  35. package/dist/chunks/DateTimeEditor-C-jZKTT5.js +73 -0
  36. package/dist/chunks/DateTimeEditor-C-jZKTT5.js.map +1 -0
  37. package/dist/chunks/EditorSection-BR3qdK2c.js +23 -0
  38. package/dist/chunks/EditorSection-BR3qdK2c.js.map +1 -0
  39. package/dist/chunks/EditsLayout-fueCrxZM.js +22 -0
  40. package/dist/chunks/EditsLayout-fueCrxZM.js.map +1 -0
  41. package/dist/chunks/ExprEditModal-CeXiPStM.js +540 -0
  42. package/dist/chunks/ExprEditModal-CeXiPStM.js.map +1 -0
  43. package/dist/chunks/FileEditor-BXELd_SD.js +35 -0
  44. package/dist/chunks/FileEditor-BXELd_SD.js.map +1 -0
  45. package/dist/chunks/FormRenderer-BwykpB3h.js +2625 -0
  46. package/dist/chunks/FormRenderer-BwykpB3h.js.map +1 -0
  47. package/dist/chunks/GroupEditor-DchDUDDY.js +13 -0
  48. package/dist/chunks/GroupEditor-DchDUDDY.js.map +1 -0
  49. package/dist/chunks/HistoryPanel-1p0-Obef.js +104 -0
  50. package/dist/chunks/HistoryPanel-1p0-Obef.js.map +1 -0
  51. package/dist/chunks/ImportExportModal-CTqkyp1s.js +266 -0
  52. package/dist/chunks/ImportExportModal-CTqkyp1s.js.map +1 -0
  53. package/dist/chunks/InlineEditableText-BO-dT5rp.js +68 -0
  54. package/dist/chunks/InlineEditableText-BO-dT5rp.js.map +1 -0
  55. package/dist/chunks/InputGroupEditor-D_5giZtN.js +13 -0
  56. package/dist/chunks/InputGroupEditor-D_5giZtN.js.map +1 -0
  57. package/dist/chunks/IssuesPanel-CW5bdwvC.js +82 -0
  58. package/dist/chunks/IssuesPanel-CW5bdwvC.js.map +1 -0
  59. package/dist/chunks/JsCodeEditor-CIPxhwZa.js +751 -0
  60. package/dist/chunks/JsCodeEditor-CIPxhwZa.js.map +1 -0
  61. package/dist/chunks/JsonTextarea-C3mnRwtG.js +54 -0
  62. package/dist/chunks/JsonTextarea-C3mnRwtG.js.map +1 -0
  63. package/dist/chunks/ListEditor-C1hn5yOi.js +25 -0
  64. package/dist/chunks/ListEditor-C1hn5yOi.js.map +1 -0
  65. package/dist/chunks/NaiveAlertEditor-DACimYS1.js +67 -0
  66. package/dist/chunks/NaiveAlertEditor-DACimYS1.js.map +1 -0
  67. package/dist/chunks/NaiveAutoCompleteEditor-CtCvPe7H.js +122 -0
  68. package/dist/chunks/NaiveAutoCompleteEditor-CtCvPe7H.js.map +1 -0
  69. package/dist/chunks/NaiveAvatarEditor-CmDUodoa.js +36 -0
  70. package/dist/chunks/NaiveAvatarEditor-CmDUodoa.js.map +1 -0
  71. package/dist/chunks/NaiveBackTopEditor-Iq-li1JT.js +69 -0
  72. package/dist/chunks/NaiveBackTopEditor-Iq-li1JT.js.map +1 -0
  73. package/dist/chunks/NaiveBasicSection-wNyhGLou.js +184 -0
  74. package/dist/chunks/NaiveBasicSection-wNyhGLou.js.map +1 -0
  75. package/dist/chunks/NaiveBlockquoteEditor-BfqWqKwF.js +13 -0
  76. package/dist/chunks/NaiveBlockquoteEditor-BfqWqKwF.js.map +1 -0
  77. package/dist/chunks/NaiveButtonEditor-B4Rp2T7n.js +168 -0
  78. package/dist/chunks/NaiveButtonEditor-B4Rp2T7n.js.map +1 -0
  79. package/dist/chunks/NaiveCascaderEditor-BtD6KRXl.js +26 -0
  80. package/dist/chunks/NaiveCascaderEditor-BtD6KRXl.js.map +1 -0
  81. package/dist/chunks/NaiveDividerEditor-B1dPteDV.js +52 -0
  82. package/dist/chunks/NaiveDividerEditor-B1dPteDV.js.map +1 -0
  83. package/dist/chunks/NaiveH1Editor-Can7c9mh.js +14 -0
  84. package/dist/chunks/NaiveH1Editor-Can7c9mh.js.map +1 -0
  85. package/dist/chunks/NaiveH2Editor-BRKeEVf4.js +14 -0
  86. package/dist/chunks/NaiveH2Editor-BRKeEVf4.js.map +1 -0
  87. package/dist/chunks/NaiveH3Editor-DCdyd3-n.js +14 -0
  88. package/dist/chunks/NaiveH3Editor-DCdyd3-n.js.map +1 -0
  89. package/dist/chunks/NaiveH4Editor-COFS6udv.js +14 -0
  90. package/dist/chunks/NaiveH4Editor-COFS6udv.js.map +1 -0
  91. package/dist/chunks/NaiveH5Editor-CQEe6s1O.js +14 -0
  92. package/dist/chunks/NaiveH5Editor-CQEe6s1O.js.map +1 -0
  93. package/dist/chunks/NaiveH6Editor-DHGzIUAl.js +14 -0
  94. package/dist/chunks/NaiveH6Editor-DHGzIUAl.js.map +1 -0
  95. package/dist/chunks/NaiveHeaderEditor-Cy02AmLI.js +12 -0
  96. package/dist/chunks/NaiveHeaderEditor-Cy02AmLI.js.map +1 -0
  97. package/dist/chunks/NaiveImageEditor-WyVYLNbT.js +201 -0
  98. package/dist/chunks/NaiveImageEditor-WyVYLNbT.js.map +1 -0
  99. package/dist/chunks/NaiveLiEditor-CC65rrna.js +13 -0
  100. package/dist/chunks/NaiveLiEditor-CC65rrna.js.map +1 -0
  101. package/dist/chunks/NaiveLinkEditor-DkjFrzEE.js +38 -0
  102. package/dist/chunks/NaiveLinkEditor-DkjFrzEE.js.map +1 -0
  103. package/dist/chunks/NaiveMentionEditor-BupocM2c.js +23 -0
  104. package/dist/chunks/NaiveMentionEditor-BupocM2c.js.map +1 -0
  105. package/dist/chunks/NaiveOlEditor-DYFqg6Sp.js +16 -0
  106. package/dist/chunks/NaiveOlEditor-DYFqg6Sp.js.map +1 -0
  107. package/dist/chunks/NaiveParagraphEditor-B3Ju6ZNI.js +104 -0
  108. package/dist/chunks/NaiveParagraphEditor-B3Ju6ZNI.js.map +1 -0
  109. package/dist/chunks/NaiveProgressEditor-CwpsZG2z.js +119 -0
  110. package/dist/chunks/NaiveProgressEditor-CwpsZG2z.js.map +1 -0
  111. package/dist/chunks/NaiveQrCodeEditor-YWWAozHe.js +77 -0
  112. package/dist/chunks/NaiveQrCodeEditor-YWWAozHe.js.map +1 -0
  113. package/dist/chunks/NaiveRateEditor-BVY1QiXv.js +44 -0
  114. package/dist/chunks/NaiveRateEditor-BVY1QiXv.js.map +1 -0
  115. package/dist/chunks/NaiveSwitchEditor-BP1v-oZf.js +17 -0
  116. package/dist/chunks/NaiveSwitchEditor-BP1v-oZf.js.map +1 -0
  117. package/dist/chunks/NaiveTextEditor-C38l4Q-j.js +107 -0
  118. package/dist/chunks/NaiveTextEditor-C38l4Q-j.js.map +1 -0
  119. package/dist/chunks/NaiveTransferEditor-BRH_5ioX.js +19 -0
  120. package/dist/chunks/NaiveTransferEditor-BRH_5ioX.js.map +1 -0
  121. package/dist/chunks/NaiveTreeSelectEditor-jX2DrMcT.js +26 -0
  122. package/dist/chunks/NaiveTreeSelectEditor-jX2DrMcT.js.map +1 -0
  123. package/dist/chunks/NaiveUlEditor-CMKofBid.js +16 -0
  124. package/dist/chunks/NaiveUlEditor-CMKofBid.js.map +1 -0
  125. package/dist/chunks/NumberEditor-0P2Li_GH.js +40 -0
  126. package/dist/chunks/NumberEditor-0P2Li_GH.js.map +1 -0
  127. package/dist/chunks/NumberInput-DU-FiLxW.js +37 -0
  128. package/dist/chunks/NumberInput-DU-FiLxW.js.map +1 -0
  129. package/dist/chunks/OptionsLayoutSection-C9gVadRA.js +21 -0
  130. package/dist/chunks/OptionsLayoutSection-C9gVadRA.js.map +1 -0
  131. package/dist/chunks/OptionsSourceTabs-3fsum0OI.js +628 -0
  132. package/dist/chunks/OptionsSourceTabs-3fsum0OI.js.map +1 -0
  133. package/dist/chunks/OptionsTagsSection-vKkxlWLw.js +31 -0
  134. package/dist/chunks/OptionsTagsSection-vKkxlWLw.js.map +1 -0
  135. package/dist/chunks/PasswordEditor-Igld1ak6.js +29 -0
  136. package/dist/chunks/PasswordEditor-Igld1ak6.js.map +1 -0
  137. package/dist/chunks/PlaceholderSection-BKOS-7Qu.js +26 -0
  138. package/dist/chunks/PlaceholderSection-BKOS-7Qu.js.map +1 -0
  139. package/dist/chunks/RadioEditor-CyJhILjI.js +23 -0
  140. package/dist/chunks/RadioEditor-CyJhILjI.js.map +1 -0
  141. package/dist/chunks/RangeEditor-PGOnGfuV.js +86 -0
  142. package/dist/chunks/RangeEditor-PGOnGfuV.js.map +1 -0
  143. package/dist/chunks/RichText-DqcMtoil.js +424 -0
  144. package/dist/chunks/RichText-DqcMtoil.js.map +1 -0
  145. package/dist/chunks/RichTextEditor-EfA6m9w2.js +81 -0
  146. package/dist/chunks/RichTextEditor-EfA6m9w2.js.map +1 -0
  147. package/dist/chunks/SelectEditor-mJ_zUivj.js +21 -0
  148. package/dist/chunks/SelectEditor-mJ_zUivj.js.map +1 -0
  149. package/dist/chunks/SelectInput-DY4Oi2Lp.js +31 -0
  150. package/dist/chunks/SelectInput-DY4Oi2Lp.js.map +1 -0
  151. package/dist/chunks/SignatureEditor-BNttg68X.js +52 -0
  152. package/dist/chunks/SignatureEditor-BNttg68X.js.map +1 -0
  153. package/dist/chunks/SignaturePad-qhmoMg1E.js +170 -0
  154. package/dist/chunks/SignaturePad-qhmoMg1E.js.map +1 -0
  155. package/dist/chunks/StepsEditor-C8U-ext8.js +63 -0
  156. package/dist/chunks/StepsEditor-C8U-ext8.js.map +1 -0
  157. package/dist/chunks/SubmitEditor-B9R984q8.js +168 -0
  158. package/dist/chunks/SubmitEditor-B9R984q8.js.map +1 -0
  159. package/dist/chunks/SwitchInput-DQrSTyW0.js +34 -0
  160. package/dist/chunks/SwitchInput-DQrSTyW0.js.map +1 -0
  161. package/dist/chunks/TabsEditor-DepUhmsz.js +100 -0
  162. package/dist/chunks/TabsEditor-DepUhmsz.js.map +1 -0
  163. package/dist/chunks/TagsInput-DeG3Om1R.js +36 -0
  164. package/dist/chunks/TagsInput-DeG3Om1R.js.map +1 -0
  165. package/dist/chunks/TemplatePickerModal-DPkdJJJs.js +440 -0
  166. package/dist/chunks/TemplatePickerModal-DPkdJJJs.js.map +1 -0
  167. package/dist/chunks/TextInput-D1EMeBPf.js +53 -0
  168. package/dist/chunks/TextInput-D1EMeBPf.js.map +1 -0
  169. package/dist/chunks/TextLikeEditor-Du0nHQWQ.js +56 -0
  170. package/dist/chunks/TextLikeEditor-Du0nHQWQ.js.map +1 -0
  171. package/dist/chunks/ToggleInput-DoZPwM0A.js +51 -0
  172. package/dist/chunks/ToggleInput-DoZPwM0A.js.map +1 -0
  173. package/dist/chunks/_plugin-vue_export-helper-BxNYtmDu.js +8 -0
  174. package/dist/chunks/axios-agM_iOnv.js +1589 -0
  175. package/dist/chunks/axios-agM_iOnv.js.map +1 -0
  176. package/dist/chunks/bind-runtime-CRyrBYCi.js +58 -0
  177. package/dist/chunks/bind-runtime-CRyrBYCi.js.map +1 -0
  178. package/dist/chunks/canvas-locate-CxDD4bDp.js +64 -0
  179. package/dist/chunks/canvas-locate-CxDD4bDp.js.map +1 -0
  180. package/dist/chunks/context-4zkSHwVA.js +2510 -0
  181. package/dist/chunks/context-4zkSHwVA.js.map +1 -0
  182. package/dist/chunks/create-form-builder-state-CoXaJhWO.js +358 -0
  183. package/dist/chunks/create-form-builder-state-CoXaJhWO.js.map +1 -0
  184. package/dist/chunks/date-family-BYkr1OaE.js +75 -0
  185. package/dist/chunks/date-family-BYkr1OaE.js.map +1 -0
  186. package/dist/chunks/evaluator-DqNftI0d.js +139 -0
  187. package/dist/chunks/evaluator-DqNftI0d.js.map +1 -0
  188. package/dist/chunks/expr-parse-u7_CxMWg.js +463 -0
  189. package/dist/chunks/expr-parse-u7_CxMWg.js.map +1 -0
  190. package/dist/chunks/expr-source-BRPYrxuB.js +118 -0
  191. package/dist/chunks/expr-source-BRPYrxuB.js.map +1 -0
  192. package/dist/chunks/form-builder-plugin-BCbiWZKT.js +280 -0
  193. package/dist/chunks/form-builder-plugin-BCbiWZKT.js.map +1 -0
  194. package/dist/chunks/form-fields-DjLk8iH2.js +877 -0
  195. package/dist/chunks/form-fields-DjLk8iH2.js.map +1 -0
  196. package/dist/chunks/form-layout-Dm4QeYrL.js +69 -0
  197. package/dist/chunks/form-layout-Dm4QeYrL.js.map +1 -0
  198. package/dist/chunks/grid-C8xMKll5.js +137 -0
  199. package/dist/chunks/grid-C8xMKll5.js.map +1 -0
  200. package/dist/chunks/keys-D4DlFgJT.js +61 -0
  201. package/dist/chunks/keys-D4DlFgJT.js.map +1 -0
  202. package/dist/chunks/media-family-B4Wijm18.js +178 -0
  203. package/dist/chunks/media-family-B4Wijm18.js.map +1 -0
  204. package/dist/chunks/misc-family-CQJhCKco.js +133 -0
  205. package/dist/chunks/misc-family-CQJhCKco.js.map +1 -0
  206. package/dist/chunks/rich-text-toolbar-CQidmjGI.js +32 -0
  207. package/dist/chunks/rich-text-toolbar-CQidmjGI.js.map +1 -0
  208. package/dist/chunks/rolldown-runtime-DMoxecvO.js +11 -0
  209. package/dist/chunks/schema-adapter-_sLPmdLy.js +2089 -0
  210. package/dist/chunks/schema-adapter-_sLPmdLy.js.map +1 -0
  211. package/dist/chunks/selection-family-T_wZGrXc.js +249 -0
  212. package/dist/chunks/selection-family-T_wZGrXc.js.map +1 -0
  213. package/dist/chunks/use-ai-prompt-focus-39DHK41R.js +14 -0
  214. package/dist/chunks/use-ai-prompt-focus-39DHK41R.js.map +1 -0
  215. package/dist/chunks/use-bind-events-C-H7jhW_.js +89 -0
  216. package/dist/chunks/use-bind-events-C-H7jhW_.js.map +1 -0
  217. package/dist/chunks/use-config-DTr8dhzM.js +16 -0
  218. package/dist/chunks/use-config-DTr8dhzM.js.map +1 -0
  219. package/dist/chunks/use-dictionary-BAN34x49.js +26 -0
  220. package/dist/chunks/use-dictionary-BAN34x49.js.map +1 -0
  221. package/dist/chunks/use-dynamic-options-DbGSz-3_.js +29 -0
  222. package/dist/chunks/use-dynamic-options-DbGSz-3_.js.map +1 -0
  223. package/dist/chunks/use-schema-render-data-DagOPKiy.js +33 -0
  224. package/dist/chunks/use-schema-render-data-DagOPKiy.js.map +1 -0
  225. package/dist/chunks/utils-DlUMv2vG.js +53 -0
  226. package/dist/chunks/utils-DlUMv2vG.js.map +1 -0
  227. package/dist/index.d.ts +244 -1079
  228. package/dist/renderer.d.ts +632 -0
  229. package/dist/renderer.es.js +6 -0
  230. package/dist/renderer.umd.js +34 -0
  231. package/package.json +39 -24
package/dist/index.d.ts CHANGED
@@ -1,64 +1,34 @@
1
- import { AllowedComponentProps } from 'vue';
2
- import { Attrs } from 'vue';
3
1
  import { AxiosInstance } from 'axios';
4
- import { Breakpoints } from 'naive-ui/es/config-provider/src/internal-interface';
5
2
  import { Component } from 'vue';
6
- import { ComponentCustomProperties } from 'vue';
7
- import { ComponentCustomProps } from 'vue';
8
- import { ComponentInternalInstance } from 'vue';
9
- import { ComponentOptionsBase } from 'vue';
10
3
  import { ComponentOptionsMixin } from 'vue';
11
4
  import { ComponentProvideOptions } from 'vue';
12
- import { ComponentPublicInstance } from 'vue';
13
- import { ComputedOptions } from 'vue';
14
5
  import { ComputedRef } from 'vue';
15
6
  import { ConfigProviderProps } from 'naive-ui';
16
- import { CreateComponentPublicInstanceWithMixins } from 'vue';
17
7
  import { createInput } from '@formkit/vue';
18
- import { DebuggerEvent } from 'vue';
19
8
  import { defaultConfig } from '@formkit/vue';
20
9
  import { DefineComponent } from 'vue';
21
- import { ExtractPropTypes } from 'vue';
22
10
  import { FormKitConfig } from '@formkit/core';
23
11
  import { FormKitContext } from '@formkit/core';
24
12
  import { FormKitNode } from '@formkit/core';
25
13
  import { FormKitPlugin } from '@formkit/core';
26
14
  import { FormKitProps } from '@formkit/core';
27
15
  import { FormKitSchemaFormKit } from '@formkit/core';
28
- import { GlobalComponentConfig } from 'naive-ui';
29
- import { GlobalComponents } from 'vue';
30
- import { GlobalDirectives } from 'vue';
31
- import { GlobalIconConfig } from 'naive-ui';
32
- import { GlobalTheme } from 'naive-ui';
33
- import { GlobalThemeOverrides } from 'naive-ui';
34
- import { Hljs } from 'naive-ui/es/_mixins';
35
- import { Katex } from 'naive-ui/es/config-provider/src/katex';
36
- import { MethodOptions } from 'vue';
37
- import { NDateLocale } from 'naive-ui';
38
- import { nextTick } from 'vue';
39
- import { NLocale } from 'naive-ui';
40
- import { OnCleanup } from '@vue/reactivity';
41
16
  import { Plugin as Plugin_2 } from 'vue';
42
- import { PropType } from 'vue';
43
17
  import { PublicProps } from 'vue';
44
18
  import { Ref } from 'vue';
45
- import { RtlProp } from 'naive-ui/es/config-provider/src/internal-interface';
46
- import { Slot } from 'vue';
47
- import { VNodeProps } from 'vue';
48
- import { WatchOptions } from 'vue';
49
- import { WatchStopHandle } from 'vue';
50
-
51
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
52
- "update:modelValue": (value: FormDefinition) => any;
19
+ import { ShallowRef } from 'vue';
20
+
21
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
22
+ "update:modelValue": (value: FormDefinition) => any;
53
23
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
54
- "onUpdate:modelValue"?: ((value: FormDefinition) => any) | undefined;
24
+ "onUpdate:modelValue"?: ((value: FormDefinition) => any) | undefined;
55
25
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
56
26
 
57
- declare const __VLS_component_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_base_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
58
28
 
59
- declare const __VLS_component_3: DefineComponent<__VLS_Props_5, {
29
+ declare const __VLS_base_3: DefineComponent<__VLS_Props_5, {
60
30
  submit: () => void | undefined;
61
- reset: () => void | undefined;
31
+ reset: () => FormKitNode<unknown> | undefined;
62
32
  validate: () => Promise<boolean>;
63
33
  loading: Ref<boolean, boolean>;
64
34
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -74,16 +44,57 @@ declare const __VLS_component_3: DefineComponent<__VLS_Props_5, {
74
44
  dataStructure: "flat" | "nested";
75
45
  actionsJustify: "start" | "center" | "end" | "space-between";
76
46
  interactiveContainers: boolean;
77
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
78
- formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<FormKitTypedProps>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
79
- P: {};
80
- B: {};
81
- D: {};
82
- C: {};
83
- M: {};
84
- Defaults: {};
85
- }, Readonly<FormKitTypedProps>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
86
- }, any>;
47
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
48
+
49
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
50
+
51
+ declare const __VLS_export_2: __VLS_WithSlots_2<typeof __VLS_base_2, __VLS_Slots_2>;
52
+
53
+ declare const __VLS_export_3: DefineComponent<__VLS_Props_3, {
54
+ open: () => void;
55
+ close: () => void;
56
+ validate: () => Promise<boolean>;
57
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
58
+ submit: (formData: ModelValue, id: string | undefined, version: number | undefined) => any;
59
+ "update:show": (value: boolean) => any;
60
+ }, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
61
+ onSubmit?: ((formData: ModelValue, id: string | undefined, version: number | undefined) => any) | undefined;
62
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
63
+ }>, {
64
+ disabled: boolean;
65
+ actions: boolean;
66
+ formClass: string;
67
+ interactiveContainers: boolean;
68
+ showDataPanel: boolean;
69
+ resetOnSubmit: boolean;
70
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
71
+
72
+ declare const __VLS_export_4: DefineComponent<__VLS_Props_4, {
73
+ open: () => void;
74
+ close: () => void;
75
+ reset: () => void;
76
+ validate: () => Promise<boolean>;
77
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
78
+ submit: (formData: ModelValue_2, id: string | undefined, version: number | undefined) => any;
79
+ "update:show": (value: boolean) => any;
80
+ }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
81
+ onSubmit?: ((formData: ModelValue_2, id: string | undefined, version: number | undefined) => any) | undefined;
82
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
83
+ }>, {
84
+ disabled: boolean;
85
+ title: string;
86
+ actions: boolean;
87
+ formClass: string;
88
+ interactiveContainers: boolean;
89
+ showDataPanel: boolean;
90
+ initialData: ModelValue_2;
91
+ resetOnSubmit: boolean;
92
+ dataPanelWidth: string;
93
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
94
+
95
+ declare const __VLS_export_5: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
96
+
97
+ declare const __VLS_export_6: __VLS_WithSlots_3<typeof __VLS_base_3, __VLS_Slots_3>;
87
98
 
88
99
  declare type __VLS_Props = {
89
100
  /** 表单定义:v-model 双向绑定,预载已有表单并实时吐出编辑结果 */
@@ -183,89 +194,43 @@ declare type __VLS_Props_5 = {
183
194
  disabled?: boolean;
184
195
  } & Omit<Partial<ConfigProviderProps>, 'theme'>;
185
196
 
186
- declare function __VLS_template(): {
187
- attrs: Partial<{}>;
188
- slots: Readonly<{
189
- /** 整个顶栏(含默认内容) */
190
- header?: () => unknown;
191
- /** 顶栏左侧区(清除 / 预览),不传则用默认 */
192
- 'header-left'?: () => unknown;
193
- /** 顶栏中间区(AI 提示),不传则用默认 */
194
- 'header-center'?: () => unknown;
195
- /** 顶栏右侧区(undo/redo / 主题),不传则用默认 */
196
- 'header-right'?: () => unknown;
197
- /** 画布空状态,不传则用默认 NEmpty */
198
- empty?: () => unknown;
199
- /** 右侧操作列(导入导出 / 语言切换),不传则用默认 */
200
- toolbar?: () => unknown;
201
- }> & {
202
- /** 整个顶栏(含默认内容) */
203
- header?: () => unknown;
204
- /** 顶栏左侧区(清除 / 预览),不传则用默认 */
205
- 'header-left'?: () => unknown;
206
- /** 顶栏中间区(AI 提示),不传则用默认 */
207
- 'header-center'?: () => unknown;
208
- /** 顶栏右侧区(undo/redo / 主题),不传则用默认 */
209
- 'header-right'?: () => unknown;
210
- /** 画布空状态,不传则用默认 NEmpty */
211
- empty?: () => unknown;
212
- /** 右侧操作列(导入导出 / 语言切换),不传则用默认 */
213
- toolbar?: () => unknown;
214
- };
215
- refs: {};
216
- rootEl: any;
197
+ declare type __VLS_Slots = {
198
+ /** 整个顶栏(含默认内容) */
199
+ header?: () => unknown;
200
+ /** 顶栏左侧区(清除 / 预览),不传则用默认 */
201
+ 'header-left'?: () => unknown;
202
+ /** 顶栏中间区(AI 提示),不传则用默认 */
203
+ 'header-center'?: () => unknown;
204
+ /** 顶栏右侧区(undo/redo / 主题),不传则用默认 */
205
+ 'header-right'?: () => unknown;
206
+ /** 画布空状态,不传则用默认 NEmpty */
207
+ empty?: () => unknown;
208
+ /** 右侧操作列(导入导出 / 语言切换),不传则用默认 */
209
+ toolbar?: () => unknown;
217
210
  };
218
211
 
219
- declare function __VLS_template_2(): {
220
- attrs: Partial<{}>;
221
- slots: {
222
- default?(_: {}): any;
223
- };
224
- refs: {};
225
- rootEl: any;
212
+ declare type __VLS_Slots_2 = {
213
+ default?: () => unknown;
226
214
  };
227
215
 
228
- declare function __VLS_template_3(): {
229
- attrs: Partial<{}>;
230
- slots: Readonly<{
231
- /** 自定义操作区(覆盖默认提交/重置两按钮)。作用域提供 submit / reset / loading */
232
- actions?: (props: FormActionsScope) => unknown;
233
- }> & {
234
- /** 自定义操作区(覆盖默认提交/重置两按钮)。作用域提供 submit / reset / loading */
235
- actions?: (props: FormActionsScope) => unknown;
236
- };
237
- refs: {
238
- formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<FormKitTypedProps>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
239
- P: {};
240
- B: {};
241
- D: {};
242
- C: {};
243
- M: {};
244
- Defaults: {};
245
- }, Readonly<FormKitTypedProps>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
246
- };
247
- rootEl: any;
216
+ declare type __VLS_Slots_3 = {
217
+ /** 自定义操作区(覆盖默认提交/重置两按钮)。作用域提供 submit / reset / loading */
218
+ actions?: (props: FormActionsScope) => unknown;
248
219
  };
249
220
 
250
- declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
251
-
252
- declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
253
-
254
- declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
255
-
256
- declare type __VLS_WithTemplateSlots<T, S> = T & {
221
+ declare type __VLS_WithSlots<T, S> = T & {
257
222
  new (): {
258
223
  $slots: S;
259
224
  };
260
225
  };
261
226
 
262
- declare type __VLS_WithTemplateSlots_2<T, S> = T & {
227
+ declare type __VLS_WithSlots_2<T, S> = T & {
263
228
  new (): {
264
229
  $slots: S;
265
230
  };
266
231
  };
267
232
 
268
- declare type __VLS_WithTemplateSlots_3<T, S> = T & {
233
+ declare type __VLS_WithSlots_3<T, S> = T & {
269
234
  new (): {
270
235
  $slots: S;
271
236
  };
@@ -274,7 +239,8 @@ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
274
239
  declare interface BaseNode {
275
240
  /** 稳定唯一 id(前端生成,用于树操作 / 选中 / 绑定) */
276
241
  id: string;
277
- /** 画布 DnD 身份(映射 legacy schema 的 __key;非画布场景可省略) */
242
+ /** 画布 DnD 身份(映射 legacy schema 的 __key;非画布场景可省略)。
243
+ * 仅前端使用,交给后端前用 toPortableDefinition() 剥离(见 src/dsl/portable.ts)。 */
278
244
  key?: string;
279
245
  /** 字段名(提交到后端的数据 key);容器 / 布局 / 静态节点可不填 */
280
246
  name?: string;
@@ -290,9 +256,7 @@ declare interface BaseNode {
290
256
  props?: Record<string, unknown>;
291
257
  /** 条件显示:布尔表达式 AST */
292
258
  visibleIf?: Expr;
293
- /** 布局信息(colspan / rowspan) */
294
- layout?: NodeLayout;
295
- /** 原始 outerClass(含 pt-2 等附加类;与 layout 同时保留保证往返无损) */
259
+ /** 原始 outerClass(col-span-N / row-span-N 与任意附加类,宽度唯一来源) */
296
260
  outerClass?: string;
297
261
  events?: EventBinding[];
298
262
  /** 任意业务元数据,Java 原样透传 */
@@ -301,449 +265,13 @@ declare interface BaseNode {
301
265
 
302
266
  export declare function buildElementSchemaLibrary(): Record<string, Component>;
303
267
 
304
- export declare const BuilderPreview: DefineComponent<__VLS_Props_3, {
305
- open: () => void;
306
- close: () => void;
307
- validate: () => Promise<boolean>;
308
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
309
- submit: (formData: ModelValue, id: string | undefined, version: number | undefined) => any;
310
- "update:show": (value: boolean) => any;
311
- }, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
312
- onSubmit?: ((formData: ModelValue, id: string | undefined, version: number | undefined) => any) | undefined;
313
- "onUpdate:show"?: ((value: boolean) => any) | undefined;
314
- }>, {
315
- disabled: boolean;
316
- actions: boolean;
317
- formClass: string;
318
- interactiveContainers: boolean;
319
- showDataPanel: boolean;
320
- resetOnSubmit: boolean;
321
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
322
- rendererRef: ({
323
- $: ComponentInternalInstance;
324
- $data: {};
325
- $props: {
326
- readonly definition?: FormDefinition | undefined;
327
- readonly schema?: FormKitSchemaFormKit[] | undefined;
328
- readonly dataStructure?: "flat" | "nested" | undefined;
329
- readonly modelValue?: {
330
- [x: string]: unknown;
331
- } | undefined;
332
- readonly actions?: boolean | undefined;
333
- readonly submitLabel?: string | undefined;
334
- readonly resetLabel?: string | undefined;
335
- readonly submitAttrs?: Record<string, unknown> | undefined;
336
- readonly resetAttrs?: Record<string, unknown> | undefined;
337
- readonly actionsJustify?: "start" | "center" | "end" | "space-between" | undefined;
338
- readonly formClass?: string | undefined;
339
- readonly formName?: string | undefined;
340
- readonly labelPosition?: "top" | "left" | undefined;
341
- readonly labelWidth?: number | undefined;
342
- readonly schemaLibrary?: Record<string, Component> | undefined;
343
- readonly interactiveContainers?: boolean | undefined;
344
- readonly config?: FormBuilderConfig | undefined;
345
- readonly theme?: BuilderTheme | undefined;
346
- readonly http?: AxiosInstance | undefined;
347
- readonly disabled?: boolean | undefined;
348
- readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
349
- readonly tag?: string | undefined;
350
- readonly bordered?: boolean | undefined;
351
- readonly namespace?: string | undefined;
352
- readonly inlineThemeDisabled?: boolean | undefined;
353
- readonly abstract?: boolean | undefined;
354
- readonly as?: string | undefined;
355
- readonly locale?: {
356
- name: string;
357
- global: {
358
- undo: string;
359
- redo: string;
360
- confirm: string;
361
- clear: string;
362
- };
363
- Popconfirm: {
364
- positiveText: string;
365
- negativeText: string;
366
- };
367
- Cascader: {
368
- placeholder: string;
369
- loading: string;
370
- loadingRequiredMessage: (label: string) => string;
371
- };
372
- Time: {
373
- dateFormat: string;
374
- dateTimeFormat: string;
375
- };
376
- DatePicker: {
377
- yearFormat: string;
378
- monthFormat: string;
379
- dayFormat: string;
380
- yearTypeFormat: string;
381
- monthTypeFormat: string;
382
- dateFormat: string;
383
- dateTimeFormat: string;
384
- quarterFormat: string;
385
- weekFormat: string;
386
- clear: string;
387
- now: string;
388
- confirm: string;
389
- selectTime: string;
390
- selectDate: string;
391
- datePlaceholder: string;
392
- datetimePlaceholder: string;
393
- monthPlaceholder: string;
394
- yearPlaceholder: string;
395
- quarterPlaceholder: string;
396
- weekPlaceholder: string;
397
- startDatePlaceholder: string;
398
- endDatePlaceholder: string;
399
- startDatetimePlaceholder: string;
400
- endDatetimePlaceholder: string;
401
- startMonthPlaceholder: string;
402
- endMonthPlaceholder: string;
403
- monthBeforeYear: boolean;
404
- firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
405
- today: string;
406
- };
407
- DataTable: {
408
- checkTableAll: string;
409
- uncheckTableAll: string;
410
- confirm: string;
411
- clear: string;
412
- };
413
- LegacyTransfer: {
414
- sourceTitle: string;
415
- targetTitle: string;
416
- };
417
- Transfer: {
418
- selectAll: string;
419
- unselectAll: string;
420
- clearAll: string;
421
- total: (num: number) => string;
422
- selected: (num: number) => string;
423
- };
424
- Empty: {
425
- description: string;
426
- };
427
- Select: {
428
- placeholder: string;
429
- };
430
- TimePicker: {
431
- placeholder: string;
432
- positiveText: string;
433
- negativeText: string;
434
- now: string;
435
- clear: string;
436
- };
437
- Pagination: {
438
- goto: string;
439
- selectionSuffix: string;
440
- };
441
- DynamicTags: {
442
- add: string;
443
- };
444
- Log: {
445
- loading: string;
446
- };
447
- Input: {
448
- placeholder: string;
449
- };
450
- InputNumber: {
451
- placeholder: string;
452
- };
453
- DynamicInput: {
454
- create: string;
455
- };
456
- ThemeEditor: {
457
- title: string;
458
- clearAllVars: string;
459
- clearSearch: string;
460
- filterCompName: string;
461
- filterVarName: string;
462
- import: string;
463
- export: string;
464
- restore: string;
465
- };
466
- Image: {
467
- tipPrevious: string;
468
- tipNext: string;
469
- tipCounterclockwise: string;
470
- tipClockwise: string;
471
- tipZoomOut: string;
472
- tipZoomIn: string;
473
- tipDownload: string;
474
- tipClose: string;
475
- tipOriginalSize: string;
476
- };
477
- Heatmap: {
478
- less: string;
479
- more: string;
480
- monthFormat: string;
481
- weekdayFormat: string;
482
- };
483
- } | null | undefined;
484
- readonly clsPrefix?: string | undefined;
485
- readonly dateLocale?: NDateLocale | null | undefined;
486
- readonly rtl?: RtlProp | undefined;
487
- readonly hljs?: Hljs | undefined;
488
- readonly katex?: any;
489
- readonly componentOptions?: GlobalComponentConfig | undefined;
490
- readonly icons?: GlobalIconConfig | undefined;
491
- readonly breakpoints?: Breakpoints;
492
- readonly preflightStyleDisabled?: boolean | undefined;
493
- readonly styleMountTarget?: ParentNode | null | undefined;
494
- readonly onSubmit?: ((formData: {
495
- [x: string]: unknown;
496
- }, id: string | undefined, version: number | undefined) => any) | undefined;
497
- readonly "onUpdate:modelValue"?: ((value: {
498
- [x: string]: unknown;
499
- }) => any) | undefined;
500
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
501
- $attrs: Attrs;
502
- $refs: {
503
- [x: string]: unknown;
504
- } & {
505
- formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<{
506
- type?: string;
507
- name?: string;
508
- actions?: boolean;
509
- formClass?: string;
510
- disabled?: boolean;
511
- modelValue?: {
512
- [x: string]: unknown;
513
- };
514
- 'onUpdate:modelValue'?: (value: {
515
- [x: string]: unknown;
516
- }) => void;
517
- onSubmit?: (formData: {
518
- [x: string]: unknown;
519
- }) => void;
520
- }>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
521
- P: {};
522
- B: {};
523
- D: {};
524
- C: {};
525
- M: {};
526
- Defaults: {};
527
- }, Readonly<{
528
- type?: string;
529
- name?: string;
530
- actions?: boolean;
531
- formClass?: string;
532
- disabled?: boolean;
533
- modelValue?: {
534
- [x: string]: unknown;
535
- };
536
- 'onUpdate:modelValue'?: (value: {
537
- [x: string]: unknown;
538
- }) => void;
539
- onSubmit?: (formData: {
540
- [x: string]: unknown;
541
- }) => void;
542
- }>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
543
- };
544
- $slots: Readonly<{
545
- [name: string]: Slot<any> | undefined;
546
- }>;
547
- $root: ComponentPublicInstance | null;
548
- $parent: ComponentPublicInstance | null;
549
- $host: Element | null;
550
- $emit: ((event: "submit", formData: {
551
- [x: string]: unknown;
552
- }, id: string | undefined, version: number | undefined) => void) & ((event: "update:modelValue", value: {
553
- [x: string]: unknown;
554
- }) => void);
555
- $el: any;
556
- $options: ComponentOptionsBase<Readonly<{
557
- definition?: FormDefinition;
558
- schema?: FormKitSchemaFormKit[];
559
- dataStructure?: "flat" | "nested";
560
- modelValue?: {
561
- [x: string]: unknown;
562
- };
563
- actions?: boolean;
564
- submitLabel?: string;
565
- resetLabel?: string;
566
- submitAttrs?: Record<string, unknown>;
567
- resetAttrs?: Record<string, unknown>;
568
- actionsJustify?: "start" | "center" | "end" | "space-between";
569
- formClass?: string;
570
- formName?: string;
571
- labelPosition?: "top" | "left";
572
- labelWidth?: number;
573
- schemaLibrary?: Record<string, Component>;
574
- interactiveContainers?: boolean;
575
- config?: FormBuilderConfig;
576
- theme?: BuilderTheme;
577
- http?: AxiosInstance;
578
- disabled?: boolean;
579
- } & Omit<Partial<Partial<ExtractPropTypes< {
580
- readonly abstract: BooleanConstructor;
581
- readonly bordered: {
582
- readonly type: PropType<boolean | undefined>;
583
- readonly default: undefined;
584
- };
585
- readonly clsPrefix: StringConstructor;
586
- readonly locale: PropType<NLocale | null>;
587
- readonly dateLocale: PropType<NDateLocale | null>;
588
- readonly namespace: StringConstructor;
589
- readonly rtl: PropType<RtlProp>;
590
- readonly tag: {
591
- readonly type: StringConstructor;
592
- readonly default: "div";
593
- };
594
- readonly hljs: PropType<Hljs>;
595
- readonly katex: PropType<Katex>;
596
- readonly theme: PropType<GlobalTheme | null>;
597
- readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
598
- readonly componentOptions: PropType<GlobalComponentConfig>;
599
- readonly icons: PropType<GlobalIconConfig>;
600
- readonly breakpoints: PropType<Breakpoints>;
601
- readonly preflightStyleDisabled: BooleanConstructor;
602
- readonly styleMountTarget: PropType<ParentNode | null>;
603
- readonly inlineThemeDisabled: {
604
- readonly type: BooleanConstructor;
605
- readonly default: undefined;
606
- };
607
- readonly as: {
608
- readonly type: PropType<string | undefined>;
609
- readonly validator: () => boolean;
610
- readonly default: undefined;
611
- };
612
- }>>>, "theme">> & Readonly<{
613
- onSubmit?: ((formData: {
614
- [x: string]: unknown;
615
- }, id: string | undefined, version: number | undefined) => any) | undefined;
616
- "onUpdate:modelValue"?: ((value: {
617
- [x: string]: unknown;
618
- }) => any) | undefined;
619
- }>, {
620
- submit: () => void | undefined;
621
- reset: () => void | undefined;
622
- validate: () => Promise<boolean>;
623
- loading: Ref<boolean, boolean>;
624
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
625
- submit: (formData: {
626
- [x: string]: unknown;
627
- }, id: string | undefined, version: number | undefined) => any;
628
- "update:modelValue": (value: {
629
- [x: string]: unknown;
630
- }) => any;
631
- }, string, {
632
- disabled: boolean;
633
- actions: boolean;
634
- formClass: string;
635
- dataStructure: "flat" | "nested";
636
- actionsJustify: "start" | "center" | "end" | "space-between";
637
- interactiveContainers: boolean;
638
- }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
639
- beforeCreate?: (() => void) | (() => void)[];
640
- created?: (() => void) | (() => void)[];
641
- beforeMount?: (() => void) | (() => void)[];
642
- mounted?: (() => void) | (() => void)[];
643
- beforeUpdate?: (() => void) | (() => void)[];
644
- updated?: (() => void) | (() => void)[];
645
- activated?: (() => void) | (() => void)[];
646
- deactivated?: (() => void) | (() => void)[];
647
- beforeDestroy?: (() => void) | (() => void)[];
648
- beforeUnmount?: (() => void) | (() => void)[];
649
- destroyed?: (() => void) | (() => void)[];
650
- unmounted?: (() => void) | (() => void)[];
651
- renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
652
- renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
653
- errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
654
- };
655
- $forceUpdate: () => void;
656
- $nextTick: typeof nextTick;
657
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
658
- } & Readonly<{
659
- disabled: boolean;
660
- actions: boolean;
661
- formClass: string;
662
- dataStructure: "flat" | "nested";
663
- actionsJustify: "start" | "center" | "end" | "space-between";
664
- interactiveContainers: boolean;
665
- }> & Omit<Readonly<{
666
- definition?: FormDefinition;
667
- schema?: FormKitSchemaFormKit[];
668
- dataStructure?: "flat" | "nested";
669
- modelValue?: {
670
- [x: string]: unknown;
671
- };
672
- actions?: boolean;
673
- submitLabel?: string;
674
- resetLabel?: string;
675
- submitAttrs?: Record<string, unknown>;
676
- resetAttrs?: Record<string, unknown>;
677
- actionsJustify?: "start" | "center" | "end" | "space-between";
678
- formClass?: string;
679
- formName?: string;
680
- labelPosition?: "top" | "left";
681
- labelWidth?: number;
682
- schemaLibrary?: Record<string, Component>;
683
- interactiveContainers?: boolean;
684
- config?: FormBuilderConfig;
685
- theme?: BuilderTheme;
686
- http?: AxiosInstance;
687
- disabled?: boolean;
688
- } & Omit<Partial<Partial<ExtractPropTypes< {
689
- readonly abstract: BooleanConstructor;
690
- readonly bordered: {
691
- readonly type: PropType<boolean | undefined>;
692
- readonly default: undefined;
693
- };
694
- readonly clsPrefix: StringConstructor;
695
- readonly locale: PropType<NLocale | null>;
696
- readonly dateLocale: PropType<NDateLocale | null>;
697
- readonly namespace: StringConstructor;
698
- readonly rtl: PropType<RtlProp>;
699
- readonly tag: {
700
- readonly type: StringConstructor;
701
- readonly default: "div";
702
- };
703
- readonly hljs: PropType<Hljs>;
704
- readonly katex: PropType<Katex>;
705
- readonly theme: PropType<GlobalTheme | null>;
706
- readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
707
- readonly componentOptions: PropType<GlobalComponentConfig>;
708
- readonly icons: PropType<GlobalIconConfig>;
709
- readonly breakpoints: PropType<Breakpoints>;
710
- readonly preflightStyleDisabled: BooleanConstructor;
711
- readonly styleMountTarget: PropType<ParentNode | null>;
712
- readonly inlineThemeDisabled: {
713
- readonly type: BooleanConstructor;
714
- readonly default: undefined;
715
- };
716
- readonly as: {
717
- readonly type: PropType<string | undefined>;
718
- readonly validator: () => boolean;
719
- readonly default: undefined;
720
- };
721
- }>>>, "theme">> & Readonly<{
722
- onSubmit?: ((formData: {
723
- [x: string]: unknown;
724
- }, id: string | undefined, version: number | undefined) => any) | undefined;
725
- "onUpdate:modelValue"?: ((value: {
726
- [x: string]: unknown;
727
- }) => any) | undefined;
728
- }>, "submit" | "reset" | "loading" | "validate" | ("disabled" | "actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
729
- submit: () => void | undefined;
730
- reset: () => void | undefined;
731
- validate: () => Promise<boolean>;
732
- loading: boolean;
733
- } & {} & ComponentCustomProperties & {} & {
734
- $slots: Readonly<{
735
- actions?: (props: FormActionsScope) => unknown;
736
- }> & {
737
- actions?: (props: FormActionsScope) => unknown;
738
- };
739
- }) | null;
740
- }, any>;
268
+ export declare const BuilderPreview: typeof __VLS_export_3;
741
269
 
742
270
  export declare type BuilderTheme = 'light' | 'dark';
743
271
 
744
272
  export declare function buildFormkitInputs(): Record<string, ReturnType<typeof createInput>>;
745
273
 
746
- export declare const CanvasActionsBar: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
274
+ export declare const CanvasActionsBar: typeof __VLS_export_5;
747
275
 
748
276
  declare interface CanvasUiState {
749
277
  canvasView: Ref<CanvasView>;
@@ -756,6 +284,10 @@ declare interface ChildrenConvertCtx {
756
284
  children?: (sc?: SchemaNode[]) => FormNode[];
757
285
  }
758
286
 
287
+ /** 遍历 DSL 定义收集用到的全部元素类型,去重;容器(含数据表格)按其 children
288
+ * 递归展开——数据表格的列本身就是普通 DSL 字段节点,一并收集在内。 */
289
+ export declare function collectElementTypes(definition: FormDefinition): string[];
290
+
759
291
  declare type ContainerDataShape = 'object' | 'array' | 'arrayOfObjects' | 'objectOfObjects' | 'none';
760
292
 
761
293
  declare type ContainerDefinition = {
@@ -775,7 +307,6 @@ declare type ContainerDefinition = {
775
307
 
776
308
  declare type ContainerFormatCtx = {
777
309
  key?: string;
778
- isPlaceholder: boolean;
779
310
  format: (node: FormKitSchemaFormKit, index: number) => FormKitSchemaFormKit;
780
311
  };
781
312
 
@@ -786,8 +317,6 @@ export declare interface ContainerNode extends BaseNode {
786
317
  children: FormNode[];
787
318
  }
788
319
 
789
- export declare type ContainerRenderer<T> = (node: ContainerNode, ctx: RenderContext<T>, children?: T[]) => T;
790
-
791
320
  declare interface ContainerSpec {
792
321
  /** 数据结构(用户记法 → 语义名):
793
322
  * object({}) 单对象:children 是对象字段(group 原生;card/inputGroup 壳 + group 包一层)
@@ -807,18 +336,24 @@ declare interface ContainerSpec {
807
336
  /** 创建独立的 FormBuilder 状态实例。 */
808
337
  export declare function createFormBuilderState(): FormBuilderState;
809
338
 
810
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
339
+ /** 增量转换投影:持有本实例的 WeakMap 缓存(节点转换 + group 包裹各一份),
340
+ * `toSchema` / `toOutputSchema` 与公开的 dslToSchema / dslToOutputSchema 语义等价,
341
+ * 区别是同一个节点引用命中缓存时直接复用上次的 schema 对象(含冻结),配合不可变
342
+ * 的 DSL 编辑路径实现增量渲染。每个使用方(设计器状态实例、每个 FormRenderer 实例)
343
+ * 应各自持有一个 projector,不共享,否则不同调用方的编辑历史会互相污染缓存。 */
344
+ declare function createSchemaProjector(): {
345
+ toSchema: (form: FormDefinition) => FormKitSchemaFormKit[];
346
+ toOutputSchema: (form: FormDefinition) => FormKitSchemaFormKit[];
347
+ };
348
+
349
+ declare const _default: typeof __VLS_export;
811
350
  export { _default as FormBuilder }
812
351
  export { _default as FormKitFormBuilder }
813
352
 
814
- declare const _default_2: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
353
+ declare const _default_2: typeof __VLS_export_2;
815
354
  export { _default_2 as BuilderProvider }
816
355
  export { _default_2 as FormBuilderProvider }
817
356
 
818
- declare const _default_3: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
819
- export { _default_3 as FormRenderer }
820
- export { _default_3 as FormSchemaRenderer }
821
-
822
357
  declare type DefSnapshot = FormDefinition;
823
358
 
824
359
  /** 字典定义(分页搜索返回的一行) */
@@ -833,6 +368,12 @@ declare interface DictionaryOption {
833
368
  value: string | number;
834
369
  }
835
370
 
371
+ /**
372
+ * @public
373
+ * 分页字典查询参数:FormBuilderConfig.fetchDictionaryPage 的入参形状,是公共 API
374
+ * 的一部分(宿主实现该回调时对齐这个结构),仓库内部没有代码按名字导入它,
375
+ * knip 会误判为死代码——用 @public 标记精确豁免,而不是整体放宽规则。
376
+ */
836
377
  declare interface DictionaryPageQuery {
837
378
  /** 按 code 模糊过滤 */
838
379
  code?: string;
@@ -842,6 +383,7 @@ declare interface DictionaryPageQuery {
842
383
  pageSize: number;
843
384
  }
844
385
 
386
+ /** @public 分页字典查询结果:FormBuilderConfig.fetchDictionaryPage 的返回形状,理由同 DictionaryPageQuery */
845
387
  declare interface DictionaryPageResult {
846
388
  pageNum: number;
847
389
  pageSize: number;
@@ -849,13 +391,17 @@ declare interface DictionaryPageResult {
849
391
  data: DictionaryDefinition[];
850
392
  }
851
393
 
852
- /** 公开 API:将 DSL 转为含 Group 包裹的 FormKit schema,子节点嵌套为 JSON object 数据 */
394
+ /** 公开 API:将 DSL 转为含 Group 包裹的 FormKit schema,子节点嵌套为 JSON object 数据。
395
+ * 同 dslToSchema:不缓存、不冻结。 */
853
396
  export declare function dslToOutputSchema(form: FormDefinition): FormKitSchemaFormKit[];
854
397
 
398
+ /** 公开 API:DSL → FormKit schema。每次调用都重新转换整棵树,不缓存、不冻结、
399
+ * 返回全新对象——外部调用方(reactive() 包裹 + 原地修改、或改写返回结果)不会
400
+ * 互相污染,也不会因为命中过期缓存而拿到旧结果。渲染增量场景请用
401
+ * createSchemaProjector()。 */
855
402
  export declare function dslToSchema(form: FormDefinition): FormKitSchemaFormKit[];
856
403
 
857
404
  export declare interface DslToSchemaCtx {
858
- form?: FormDefinition;
859
405
  children?: SchemaNode[];
860
406
  }
861
407
 
@@ -881,6 +427,9 @@ export declare interface ElementCatalogEntry {
881
427
  schema: ElementTemplate;
882
428
  /** 容器元素的数据结构规格(list/card/group/inputGroup/buttonGroup/tabs;字段/静态/纯布局缺省) */
883
429
  container?: ContainerSpec;
430
+ /** 右侧面板「事件」分组可绑定的事件 key 列表(取自 elements/definitions/bind-events.ts
431
+ * 的常量);缺省或空数组表示该元素不可绑定事件,外层不显示「事件」分组 */
432
+ bindEvents?: readonly string[];
884
433
  }
885
434
 
886
435
  export declare type ElementCategory = NodeCategory;
@@ -946,10 +495,10 @@ export declare interface ElementTypeDef {
946
495
  }>;
947
496
  icon?: string;
948
497
  tooltipKey?: string;
498
+ /** 见 ElementCatalogEntry.bindEvents,注册时原样透传 */
499
+ bindEvents?: readonly string[];
949
500
  }
950
501
 
951
- declare type ElEvent = 'click' | 'dblclick' | 'mouseenter' | 'mouseleave' | 'keydown' | 'keyup' | 'keypress' | 'submit';
952
-
953
502
  declare interface EventBinding {
954
503
  event: FormEvent;
955
504
  handler: string;
@@ -981,16 +530,24 @@ export declare interface FieldNode extends BaseNode {
981
530
  value?: FieldValue;
982
531
  /** 表达式字符串(如 "$price * $count"),由运行时 watch 求值并写入 FormKit node */
983
532
  expr?: string;
533
+ /** 条件必填:为真时按必填校验(等同临时加一条 required 规则,JSON-safe,方便后端对接)。
534
+ * 字段已有静态 required 规则时静态规则优先,条件必填不生效(编辑器给出提示)。 */
535
+ requiredIf?: Expr;
536
+ /** 条件禁用:为真时禁用该字段,与表单级/字段静态 disabled 叠加(任一为真即禁用)。 */
537
+ disabledIf?: Expr;
538
+ /** 条件只读:为真时原生支持只读的类型(见 READONLY_CAPABLE_TYPES)真只读,
539
+ * 其余退化为禁用,判断口径与表单级 readonly 共用同一份集合,不另起一套。 */
540
+ readonlyIf?: Expr;
984
541
  validation?: ValidationRule[];
985
542
  /** select / radio / checkbox 等选项(静态数组,或 { dynamic, code } 动态字典) */
986
543
  options?: OptionItem[] | DynamicOptionSource;
987
544
  }
988
545
 
989
- export declare type FieldRenderer<T> = (node: FieldNode, ctx: RenderContext<T>, children?: T[]) => T;
990
-
991
546
  /** 字段值:静态值 */
992
547
  declare type FieldValue = StaticValue;
993
548
 
549
+ declare const FORM_EVENTS: readonly ["click", "change", "input", "focus", "blur"];
550
+
994
551
  /** #actions 槽作用域:可由外部自定义操作区按钮,复用表单提交/重置 */
995
552
  declare type FormActionsScope = {
996
553
  submit: () => void;
@@ -1061,460 +618,24 @@ export declare interface FormDefinition {
1061
618
  meta?: Record<string, unknown>;
1062
619
  }
1063
620
 
1064
- export declare const FormDefinitionPreview: DefineComponent<__VLS_Props_4, {
1065
- open: () => void;
1066
- close: () => void;
1067
- reset: () => void;
1068
- validate: () => Promise<boolean>;
1069
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
1070
- submit: (formData: ModelValue_2, id: string | undefined, version: number | undefined) => any;
1071
- "update:show": (value: boolean) => any;
1072
- }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
1073
- onSubmit?: ((formData: ModelValue_2, id: string | undefined, version: number | undefined) => any) | undefined;
1074
- "onUpdate:show"?: ((value: boolean) => any) | undefined;
1075
- }>, {
1076
- disabled: boolean;
1077
- title: string;
1078
- actions: boolean;
1079
- formClass: string;
1080
- interactiveContainers: boolean;
1081
- showDataPanel: boolean;
1082
- initialData: ModelValue_2;
1083
- resetOnSubmit: boolean;
1084
- dataPanelWidth: string;
1085
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
1086
- rendererRef: ({
1087
- $: ComponentInternalInstance;
1088
- $data: {};
1089
- $props: {
1090
- readonly definition?: FormDefinition | undefined;
1091
- readonly schema?: FormKitSchemaFormKit[] | undefined;
1092
- readonly dataStructure?: "flat" | "nested" | undefined;
1093
- readonly modelValue?: {
1094
- [x: string]: unknown;
1095
- } | undefined;
1096
- readonly actions?: boolean | undefined;
1097
- readonly submitLabel?: string | undefined;
1098
- readonly resetLabel?: string | undefined;
1099
- readonly submitAttrs?: Record<string, unknown> | undefined;
1100
- readonly resetAttrs?: Record<string, unknown> | undefined;
1101
- readonly actionsJustify?: "start" | "center" | "end" | "space-between" | undefined;
1102
- readonly formClass?: string | undefined;
1103
- readonly formName?: string | undefined;
1104
- readonly labelPosition?: "top" | "left" | undefined;
1105
- readonly labelWidth?: number | undefined;
1106
- readonly schemaLibrary?: Record<string, Component> | undefined;
1107
- readonly interactiveContainers?: boolean | undefined;
1108
- readonly config?: FormBuilderConfig | undefined;
1109
- readonly theme?: BuilderTheme | undefined;
1110
- readonly http?: AxiosInstance | undefined;
1111
- readonly disabled?: boolean | undefined;
1112
- readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
1113
- readonly tag?: string | undefined;
1114
- readonly bordered?: boolean | undefined;
1115
- readonly namespace?: string | undefined;
1116
- readonly inlineThemeDisabled?: boolean | undefined;
1117
- readonly abstract?: boolean | undefined;
1118
- readonly as?: string | undefined;
1119
- readonly locale?: {
1120
- name: string;
1121
- global: {
1122
- undo: string;
1123
- redo: string;
1124
- confirm: string;
1125
- clear: string;
1126
- };
1127
- Popconfirm: {
1128
- positiveText: string;
1129
- negativeText: string;
1130
- };
1131
- Cascader: {
1132
- placeholder: string;
1133
- loading: string;
1134
- loadingRequiredMessage: (label: string) => string;
1135
- };
1136
- Time: {
1137
- dateFormat: string;
1138
- dateTimeFormat: string;
1139
- };
1140
- DatePicker: {
1141
- yearFormat: string;
1142
- monthFormat: string;
1143
- dayFormat: string;
1144
- yearTypeFormat: string;
1145
- monthTypeFormat: string;
1146
- dateFormat: string;
1147
- dateTimeFormat: string;
1148
- quarterFormat: string;
1149
- weekFormat: string;
1150
- clear: string;
1151
- now: string;
1152
- confirm: string;
1153
- selectTime: string;
1154
- selectDate: string;
1155
- datePlaceholder: string;
1156
- datetimePlaceholder: string;
1157
- monthPlaceholder: string;
1158
- yearPlaceholder: string;
1159
- quarterPlaceholder: string;
1160
- weekPlaceholder: string;
1161
- startDatePlaceholder: string;
1162
- endDatePlaceholder: string;
1163
- startDatetimePlaceholder: string;
1164
- endDatetimePlaceholder: string;
1165
- startMonthPlaceholder: string;
1166
- endMonthPlaceholder: string;
1167
- monthBeforeYear: boolean;
1168
- firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
1169
- today: string;
1170
- };
1171
- DataTable: {
1172
- checkTableAll: string;
1173
- uncheckTableAll: string;
1174
- confirm: string;
1175
- clear: string;
1176
- };
1177
- LegacyTransfer: {
1178
- sourceTitle: string;
1179
- targetTitle: string;
1180
- };
1181
- Transfer: {
1182
- selectAll: string;
1183
- unselectAll: string;
1184
- clearAll: string;
1185
- total: (num: number) => string;
1186
- selected: (num: number) => string;
1187
- };
1188
- Empty: {
1189
- description: string;
1190
- };
1191
- Select: {
1192
- placeholder: string;
1193
- };
1194
- TimePicker: {
1195
- placeholder: string;
1196
- positiveText: string;
1197
- negativeText: string;
1198
- now: string;
1199
- clear: string;
1200
- };
1201
- Pagination: {
1202
- goto: string;
1203
- selectionSuffix: string;
1204
- };
1205
- DynamicTags: {
1206
- add: string;
1207
- };
1208
- Log: {
1209
- loading: string;
1210
- };
1211
- Input: {
1212
- placeholder: string;
1213
- };
1214
- InputNumber: {
1215
- placeholder: string;
1216
- };
1217
- DynamicInput: {
1218
- create: string;
1219
- };
1220
- ThemeEditor: {
1221
- title: string;
1222
- clearAllVars: string;
1223
- clearSearch: string;
1224
- filterCompName: string;
1225
- filterVarName: string;
1226
- import: string;
1227
- export: string;
1228
- restore: string;
1229
- };
1230
- Image: {
1231
- tipPrevious: string;
1232
- tipNext: string;
1233
- tipCounterclockwise: string;
1234
- tipClockwise: string;
1235
- tipZoomOut: string;
1236
- tipZoomIn: string;
1237
- tipDownload: string;
1238
- tipClose: string;
1239
- tipOriginalSize: string;
1240
- };
1241
- Heatmap: {
1242
- less: string;
1243
- more: string;
1244
- monthFormat: string;
1245
- weekdayFormat: string;
1246
- };
1247
- } | null | undefined;
1248
- readonly clsPrefix?: string | undefined;
1249
- readonly dateLocale?: NDateLocale | null | undefined;
1250
- readonly rtl?: RtlProp | undefined;
1251
- readonly hljs?: Hljs | undefined;
1252
- readonly katex?: any;
1253
- readonly componentOptions?: GlobalComponentConfig | undefined;
1254
- readonly icons?: GlobalIconConfig | undefined;
1255
- readonly breakpoints?: Breakpoints;
1256
- readonly preflightStyleDisabled?: boolean | undefined;
1257
- readonly styleMountTarget?: ParentNode | null | undefined;
1258
- readonly onSubmit?: ((formData: {
1259
- [x: string]: unknown;
1260
- }, id: string | undefined, version: number | undefined) => any) | undefined;
1261
- readonly "onUpdate:modelValue"?: ((value: {
1262
- [x: string]: unknown;
1263
- }) => any) | undefined;
1264
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
1265
- $attrs: Attrs;
1266
- $refs: {
1267
- [x: string]: unknown;
1268
- } & {
1269
- formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<{
1270
- type?: string;
1271
- name?: string;
1272
- actions?: boolean;
1273
- formClass?: string;
1274
- disabled?: boolean;
1275
- modelValue?: {
1276
- [x: string]: unknown;
1277
- };
1278
- 'onUpdate:modelValue'?: (value: {
1279
- [x: string]: unknown;
1280
- }) => void;
1281
- onSubmit?: (formData: {
1282
- [x: string]: unknown;
1283
- }) => void;
1284
- }>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
1285
- P: {};
1286
- B: {};
1287
- D: {};
1288
- C: {};
1289
- M: {};
1290
- Defaults: {};
1291
- }, Readonly<{
1292
- type?: string;
1293
- name?: string;
1294
- actions?: boolean;
1295
- formClass?: string;
1296
- disabled?: boolean;
1297
- modelValue?: {
1298
- [x: string]: unknown;
1299
- };
1300
- 'onUpdate:modelValue'?: (value: {
1301
- [x: string]: unknown;
1302
- }) => void;
1303
- onSubmit?: (formData: {
1304
- [x: string]: unknown;
1305
- }) => void;
1306
- }>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
1307
- };
1308
- $slots: Readonly<{
1309
- [name: string]: Slot<any> | undefined;
1310
- }>;
1311
- $root: ComponentPublicInstance | null;
1312
- $parent: ComponentPublicInstance | null;
1313
- $host: Element | null;
1314
- $emit: ((event: "submit", formData: {
1315
- [x: string]: unknown;
1316
- }, id: string | undefined, version: number | undefined) => void) & ((event: "update:modelValue", value: {
1317
- [x: string]: unknown;
1318
- }) => void);
1319
- $el: any;
1320
- $options: ComponentOptionsBase<Readonly<{
1321
- definition?: FormDefinition;
1322
- schema?: FormKitSchemaFormKit[];
1323
- dataStructure?: "flat" | "nested";
1324
- modelValue?: {
1325
- [x: string]: unknown;
1326
- };
1327
- actions?: boolean;
1328
- submitLabel?: string;
1329
- resetLabel?: string;
1330
- submitAttrs?: Record<string, unknown>;
1331
- resetAttrs?: Record<string, unknown>;
1332
- actionsJustify?: "start" | "center" | "end" | "space-between";
1333
- formClass?: string;
1334
- formName?: string;
1335
- labelPosition?: "top" | "left";
1336
- labelWidth?: number;
1337
- schemaLibrary?: Record<string, Component>;
1338
- interactiveContainers?: boolean;
1339
- config?: FormBuilderConfig;
1340
- theme?: BuilderTheme;
1341
- http?: AxiosInstance;
1342
- disabled?: boolean;
1343
- } & Omit<Partial<Partial<ExtractPropTypes< {
1344
- readonly abstract: BooleanConstructor;
1345
- readonly bordered: {
1346
- readonly type: PropType<boolean | undefined>;
1347
- readonly default: undefined;
1348
- };
1349
- readonly clsPrefix: StringConstructor;
1350
- readonly locale: PropType<NLocale | null>;
1351
- readonly dateLocale: PropType<NDateLocale | null>;
1352
- readonly namespace: StringConstructor;
1353
- readonly rtl: PropType<RtlProp>;
1354
- readonly tag: {
1355
- readonly type: StringConstructor;
1356
- readonly default: "div";
1357
- };
1358
- readonly hljs: PropType<Hljs>;
1359
- readonly katex: PropType<Katex>;
1360
- readonly theme: PropType<GlobalTheme | null>;
1361
- readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
1362
- readonly componentOptions: PropType<GlobalComponentConfig>;
1363
- readonly icons: PropType<GlobalIconConfig>;
1364
- readonly breakpoints: PropType<Breakpoints>;
1365
- readonly preflightStyleDisabled: BooleanConstructor;
1366
- readonly styleMountTarget: PropType<ParentNode | null>;
1367
- readonly inlineThemeDisabled: {
1368
- readonly type: BooleanConstructor;
1369
- readonly default: undefined;
1370
- };
1371
- readonly as: {
1372
- readonly type: PropType<string | undefined>;
1373
- readonly validator: () => boolean;
1374
- readonly default: undefined;
1375
- };
1376
- }>>>, "theme">> & Readonly<{
1377
- onSubmit?: ((formData: {
1378
- [x: string]: unknown;
1379
- }, id: string | undefined, version: number | undefined) => any) | undefined;
1380
- "onUpdate:modelValue"?: ((value: {
1381
- [x: string]: unknown;
1382
- }) => any) | undefined;
1383
- }>, {
1384
- submit: () => void | undefined;
1385
- reset: () => void | undefined;
1386
- validate: () => Promise<boolean>;
1387
- loading: Ref<boolean, boolean>;
1388
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
1389
- submit: (formData: {
1390
- [x: string]: unknown;
1391
- }, id: string | undefined, version: number | undefined) => any;
1392
- "update:modelValue": (value: {
1393
- [x: string]: unknown;
1394
- }) => any;
1395
- }, string, {
1396
- disabled: boolean;
1397
- actions: boolean;
1398
- formClass: string;
1399
- dataStructure: "flat" | "nested";
1400
- actionsJustify: "start" | "center" | "end" | "space-between";
1401
- interactiveContainers: boolean;
1402
- }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
1403
- beforeCreate?: (() => void) | (() => void)[];
1404
- created?: (() => void) | (() => void)[];
1405
- beforeMount?: (() => void) | (() => void)[];
1406
- mounted?: (() => void) | (() => void)[];
1407
- beforeUpdate?: (() => void) | (() => void)[];
1408
- updated?: (() => void) | (() => void)[];
1409
- activated?: (() => void) | (() => void)[];
1410
- deactivated?: (() => void) | (() => void)[];
1411
- beforeDestroy?: (() => void) | (() => void)[];
1412
- beforeUnmount?: (() => void) | (() => void)[];
1413
- destroyed?: (() => void) | (() => void)[];
1414
- unmounted?: (() => void) | (() => void)[];
1415
- renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
1416
- renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
1417
- errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
1418
- };
1419
- $forceUpdate: () => void;
1420
- $nextTick: typeof nextTick;
1421
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
1422
- } & Readonly<{
1423
- disabled: boolean;
1424
- actions: boolean;
1425
- formClass: string;
1426
- dataStructure: "flat" | "nested";
1427
- actionsJustify: "start" | "center" | "end" | "space-between";
1428
- interactiveContainers: boolean;
1429
- }> & Omit<Readonly<{
1430
- definition?: FormDefinition;
1431
- schema?: FormKitSchemaFormKit[];
1432
- dataStructure?: "flat" | "nested";
1433
- modelValue?: {
1434
- [x: string]: unknown;
1435
- };
1436
- actions?: boolean;
1437
- submitLabel?: string;
1438
- resetLabel?: string;
1439
- submitAttrs?: Record<string, unknown>;
1440
- resetAttrs?: Record<string, unknown>;
1441
- actionsJustify?: "start" | "center" | "end" | "space-between";
1442
- formClass?: string;
1443
- formName?: string;
1444
- labelPosition?: "top" | "left";
1445
- labelWidth?: number;
1446
- schemaLibrary?: Record<string, Component>;
1447
- interactiveContainers?: boolean;
1448
- config?: FormBuilderConfig;
1449
- theme?: BuilderTheme;
1450
- http?: AxiosInstance;
1451
- disabled?: boolean;
1452
- } & Omit<Partial<Partial<ExtractPropTypes< {
1453
- readonly abstract: BooleanConstructor;
1454
- readonly bordered: {
1455
- readonly type: PropType<boolean | undefined>;
1456
- readonly default: undefined;
1457
- };
1458
- readonly clsPrefix: StringConstructor;
1459
- readonly locale: PropType<NLocale | null>;
1460
- readonly dateLocale: PropType<NDateLocale | null>;
1461
- readonly namespace: StringConstructor;
1462
- readonly rtl: PropType<RtlProp>;
1463
- readonly tag: {
1464
- readonly type: StringConstructor;
1465
- readonly default: "div";
1466
- };
1467
- readonly hljs: PropType<Hljs>;
1468
- readonly katex: PropType<Katex>;
1469
- readonly theme: PropType<GlobalTheme | null>;
1470
- readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
1471
- readonly componentOptions: PropType<GlobalComponentConfig>;
1472
- readonly icons: PropType<GlobalIconConfig>;
1473
- readonly breakpoints: PropType<Breakpoints>;
1474
- readonly preflightStyleDisabled: BooleanConstructor;
1475
- readonly styleMountTarget: PropType<ParentNode | null>;
1476
- readonly inlineThemeDisabled: {
1477
- readonly type: BooleanConstructor;
1478
- readonly default: undefined;
1479
- };
1480
- readonly as: {
1481
- readonly type: PropType<string | undefined>;
1482
- readonly validator: () => boolean;
1483
- readonly default: undefined;
1484
- };
1485
- }>>>, "theme">> & Readonly<{
1486
- onSubmit?: ((formData: {
1487
- [x: string]: unknown;
1488
- }, id: string | undefined, version: number | undefined) => any) | undefined;
1489
- "onUpdate:modelValue"?: ((value: {
1490
- [x: string]: unknown;
1491
- }) => any) | undefined;
1492
- }>, "submit" | "reset" | "loading" | "validate" | ("disabled" | "actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
1493
- submit: () => void | undefined;
1494
- reset: () => void | undefined;
1495
- validate: () => Promise<boolean>;
1496
- loading: boolean;
1497
- } & {} & ComponentCustomProperties & {} & {
1498
- $slots: Readonly<{
1499
- actions?: (props: FormActionsScope) => unknown;
1500
- }> & {
1501
- actions?: (props: FormActionsScope) => unknown;
1502
- };
1503
- }) | null;
1504
- }, any>;
621
+ export declare const FormDefinitionPreview: typeof __VLS_export_4;
1505
622
 
1506
623
  declare interface FormDefinitionState {
1507
- formDefinition: Ref<FormDefinition>;
624
+ formDefinition: ShallowRef<FormDefinition>;
1508
625
  formSchema: ComputedRef<FormKitSchemaFormKit[]>;
626
+ /** 本实例的增量转换投影(按节点身份缓存)。commitSchemaReconcile 的基线投影
627
+ * 复用同一个 projector 才能命中缓存,因此随实例状态一并暴露,不要再改调
628
+ * 公开的 dslToSchema(那是无缓存的纯函数,每次都会重新转换整棵树)。 */
629
+ schemaProjector: ReturnType<typeof createSchemaProjector>;
1509
630
  commitSchemaChildren: (children: FormKitSchemaFormKit[], source?: Pick<FormDefinition, 'name' | 'settings'>) => FormDefinition;
1510
631
  }
1511
632
 
1512
- declare type FormEvent = FormKitEvent | ElEvent;
633
+ declare type FormEvent = (typeof FORM_EVENTS)[number];
1513
634
 
1514
- export declare function formkitConfig(elements?: RegisterElementInput[]): Partial<Omit<FormKitContext, "children" | "config" | "plugins" | "hook"> & {
1515
- config: Partial<FormKitConfig>;
1516
- props: Partial<FormKitProps>;
1517
- children: FormKitNode[] | Set<FormKitNode>;
635
+ export declare function formkitConfig(elements?: RegisterElementInput[]): Partial<Omit< FormKitContext, "children" | "config" | "plugins" | "hook"> & {
636
+ config: Partial< FormKitConfig>;
637
+ props: Partial< FormKitProps>;
638
+ children: FormKitNode[] | Set< FormKitNode>;
1518
639
  index?: number;
1519
640
  sync: boolean;
1520
641
  plugins: FormKitPlugin[];
@@ -1522,43 +643,39 @@ export declare function formkitConfig(elements?: RegisterElementInput[]): Partia
1522
643
  schemaAlias: string;
1523
644
  }>;
1524
645
 
1525
- declare type FormKitEvent = 'change' | 'input' | 'blur' | 'focus';
1526
-
1527
- declare type FormKitTypedProps = {
1528
- type?: string;
1529
- name?: string;
1530
- actions?: boolean;
1531
- formClass?: string;
1532
- disabled?: boolean;
1533
- modelValue?: ModelValue_3;
1534
- 'onUpdate:modelValue'?: (value: ModelValue_3) => void;
1535
- onSubmit?: (formData: ModelValue_3) => void;
1536
- };
1537
-
1538
646
  export declare type FormNode = FieldNode | ContainerNode | LayoutNode | StaticNode;
1539
647
 
648
+ export declare const FormRenderer: typeof __VLS_export_6;
649
+
1540
650
  export declare interface FormSettings {
1541
- /** 布局方向 */
1542
- layout: 'vertical' | 'horizontal' | 'inline';
651
+ labelAlign?: 'top' | 'left';
1543
652
  labelWidth?: number;
1544
- labelAlign?: 'left' | 'right' | 'top';
1545
- /** 根栅格列数(默认 12) */
1546
- columns?: number;
1547
- fullWidth?: boolean;
1548
653
  submit?: string;
654
+ /** 统一控件尺寸:字段自身未设置 size 时继承(见 use-schema-attrs.ts 的渲染层默认值) */
655
+ size?: 'small' | 'medium' | 'large';
656
+ /** 整表禁用:级联到每个字段(FormKit 表单级 disabled 天然级联) */
657
+ disabled?: boolean;
658
+ /** 整表只读:原生支持 readonly 的字段真只读,其余组件没有只读语义时退化为禁用 */
659
+ readonly?: boolean;
660
+ /** 提交成功后的提示文案(naive-ui message),为空则不提示 */
661
+ successMessage?: string;
662
+ /** 提交成功后跳转的地址:仅允许 http/https 绝对地址或以 / 开头的站内路径 */
663
+ successRedirect?: string;
664
+ /** 是否显示重置按钮(默认 true) */
665
+ showReset?: boolean;
666
+ submitText?: string;
667
+ resetText?: string;
1549
668
  }
1550
669
 
1551
670
  /** 取元素 $cmp 渲染名(统一为 type;兼容旧 libraryName) */
1552
671
  export declare function getElementCmpName(type: string): string;
1553
672
 
1554
- export declare interface IRendererEngine<T = any> {
1555
- use(plugin: RendererPlugin<T>): this;
1556
- registerField(type: string, fn: FieldRenderer<T>): void;
1557
- registerContainer(type: string, fn: ContainerRenderer<T>): void;
1558
- registerLayout(type: string, fn: LayoutRenderer<T>): void;
1559
- registerStatic(type: string, fn: StaticRenderer<T>): void;
1560
- render(node: FormNode, ctx?: Partial<RenderContext<T>>): T;
1561
- renderForm(form: FormDefinition): any;
673
+ declare interface HistoryEntry {
674
+ def: DefSnapshot;
675
+ /** 产生这一步状态的提交 reason;初始状态 / 外部 setFormDefinition 时为 undefined,
676
+ * 面板侧统一归为「修改」。 */
677
+ reason?: string;
678
+ at: number;
1562
679
  }
1563
680
 
1564
681
  export declare interface LayoutNode extends BaseNode {
@@ -1567,10 +684,11 @@ export declare interface LayoutNode extends BaseNode {
1567
684
  children: FormNode[];
1568
685
  }
1569
686
 
1570
- declare type LayoutRenderer<T> = (node: LayoutNode, ctx: RenderContext<T>, children?: T[]) => T;
1571
-
1572
687
  export declare type LayoutType = 'grid' | 'row' | 'column' | 'card' | 'tabs' | 'tabsPane' | 'steps' | 'stepsPane';
1573
688
 
689
+ /** 语言 → IANA 时区。en 故意不映射(英语无单一时区),回落浏览器本地时区 */
690
+ export declare const LOCALE_TIME_ZONES: Record<string, string>;
691
+
1574
692
  declare type ModelValue = Record<string, unknown>;
1575
693
 
1576
694
  declare type ModelValue_2 = Record<string, unknown>;
@@ -1579,22 +697,6 @@ declare type ModelValue_3 = Record<string, unknown>;
1579
697
 
1580
698
  export declare type NodeCategory = 'field' | 'container' | 'layout' | 'static';
1581
699
 
1582
- declare interface NodeLayout {
1583
- /** 栅格占位(基于 settings.columns,默认 12) */
1584
- colspan?: number;
1585
- rowspan?: number;
1586
- /** 显式宽度(px / 百分比),grid 模式下忽略 */
1587
- width?: number | string;
1588
- order?: number;
1589
- /** 响应式断点覆盖 */
1590
- responsive?: {
1591
- sm?: NodeLayout;
1592
- md?: NodeLayout;
1593
- lg?: NodeLayout;
1594
- xl?: NodeLayout;
1595
- };
1596
- }
1597
-
1598
700
  declare interface OptionItem {
1599
701
  label: string;
1600
702
  value: StaticValue;
@@ -1603,6 +705,10 @@ declare interface OptionItem {
1603
705
  [key: string]: unknown;
1604
706
  }
1605
707
 
708
+ /** 并行预加载一批元素类型;不是按需类型(始终静态加载)的直接忽略。
709
+ * loader 结果按类型缓存(loadOnce),重复调用同一类型不会重复发起网络请求。 */
710
+ export declare function preloadElementComponents(types: string[]): Promise<void>;
711
+
1606
712
  export declare function provideFormBuilderConfig(config: FormBuilderConfig): void;
1607
713
 
1608
714
  /** 为当前组件子树提供 FormBuilder 状态。 */
@@ -1628,23 +734,19 @@ export declare interface RegisterElementInput extends Omit<ElementCatalogEntry,
1628
734
 
1629
735
  export declare function registerElements(inputs: RegisterElementInput[] | undefined): void;
1630
736
 
1631
- export declare interface RenderContext<T = any> {
1632
- form: FormDefinition;
1633
- engine: IRendererEngine<T>;
1634
- render(node: FormNode): T;
1635
- }
1636
-
1637
- export declare interface RendererPlugin<T = any> {
1638
- name: string;
1639
- install(engine: IRendererEngine<T>): void;
1640
- }
1641
-
1642
737
  export declare type RenderKind = 'formkit' | 'cmp' | 'el';
1643
738
 
739
+ /** locale → 时区:精确匹配 → 按语言前缀匹配('zh' / 'zh-SG' → 首个以 'zh' 开头的 key)→ undefined */
740
+ export declare function resolveTimeZoneForLocale(locale?: string): string | undefined;
741
+
1644
742
  /** 历史漏斗返回值(commit/undo/redo + 外部应用)。 */
1645
743
  declare interface SchemaHistory {
1646
744
  canUndo: ComputedRef<boolean>;
1647
745
  canRedo: ComputedRef<boolean>;
746
+ /** E2:完整历史,从旧到新,含当前这一步——历史面板据此渲染列表。 */
747
+ historyEntries: ComputedRef<HistoryEntry[]>;
748
+ /** historyEntries 中「当前」这一步的下标(即 past 的长度)。 */
749
+ currentHistoryIndex: ComputedRef<number>;
1648
750
  commitFormDefinition: (nextDef: DefSnapshot, options?: {
1649
751
  reason?: string;
1650
752
  merge?: boolean;
@@ -1661,6 +763,9 @@ declare interface SchemaHistory {
1661
763
  }) => void;
1662
764
  undo: () => void;
1663
765
  redo: () => void;
766
+ /** E2:一次性跳到 historyEntries 里的某一步,等价于连续多次 undo/redo
767
+ * (future 正确保留)。index 越界或就是当前步时忽略。 */
768
+ jumpTo: (index: number) => void;
1664
769
  resetHistory: () => void;
1665
770
  /** 外部应用(如 v-model 预载 / 父级替换表单):直接落真源、不推历史。
1666
771
  * 默认重置内部 undo 栈(父级权威),可传 { resetHistory: false } 保留。 */
@@ -1671,7 +776,41 @@ declare interface SchemaHistory {
1671
776
 
1672
777
  declare type SchemaNode = FormKitSchemaFormKit & Record<string, unknown>;
1673
778
 
1674
- declare type SchemaNode_2 = FormKitSchemaFormKit & Record<string, unknown>;
779
+ declare type SchemaNode_2 = FormKitSchemaFormKit & {
780
+ /** $cmp 组件节点的组件名(与 $formkit / $el 三选一,见 dsl/convert/shared.ts 的 inferRenderTarget) */
781
+ $cmp?: string;
782
+ /** $el 原生标签节点的标签名 */
783
+ $el?: string;
784
+ /** DnD 身份键:贯穿插入 / 移动 / 提交,用来识别“同一节点” */
785
+ __key?: string;
786
+ /** 事件绑定:fromSchema/toSchema 收敛后的唯一真源(见 dsl/events.ts) */
787
+ __bind?: string;
788
+ name?: string;
789
+ label?: string;
790
+ id?: string;
791
+ /** 表达式类静态节点承载的原始表达式文本 */
792
+ expr?: string;
793
+ props?: SchemaNodeProps;
794
+ attrs?: Record<string, unknown> & {
795
+ class?: string;
796
+ };
797
+ /** 外框类:容器 / 字段宽度(col-span-N)、行高(row-span-N)等信息落在这里 */
798
+ outerClass?: string;
799
+ validation?: unknown;
800
+ options?: unknown;
801
+ };
802
+
803
+ /** $cmp / 容器节点的 props:身份键(keyProp,如 __listKey)、modelValue 等按容器规格
804
+ * 动态挂载,键名不固定,仍需兜底索引签名;这里把代码里常读写的几个键显式列出来。 */
805
+ declare interface SchemaNodeProps {
806
+ name?: string;
807
+ id?: string;
808
+ outerClass?: string;
809
+ disabled?: boolean;
810
+ modelValue?: unknown;
811
+ showActions?: boolean;
812
+ [key: string]: unknown;
813
+ }
1675
814
 
1676
815
  export declare function schemaToDsl(schema: FormKitSchemaFormKit[], options?: SchemaToDslOptions): FormDefinition;
1677
816
 
@@ -1684,6 +823,16 @@ declare interface SelectionState {
1684
823
  selectedIndex: Ref<number>;
1685
824
  selectedKey: Ref<string | null>;
1686
825
  selectedTarget: Ref<'field' | 'form'>;
826
+ /** D1:多选的 key 列表。单选时恒等于 [selectedKey](null 时为 []),由下面的
827
+ * watcher 跟随 selectedKey 自动同步;真正的多选(长度 > 1)只能经 setMultiSelection
828
+ * 写入(use-canvas-commands.ts 的 selectItem/selectAllRoot 用它)。旧代码路径
829
+ * (各容器的 onSelect、use-canvas-schema.ts 的 selectByKey 等)完全不需要知道
830
+ * 这个字段的存在——它们照常只改 selectedKey,多选状态会自动折叠回单选。 */
831
+ selectedKeys: Ref<string[]>;
832
+ /** D1:原子写入多选(keys + 最后点击的锚点 key,同步生效、不触发下面把 selectedKeys
833
+ * 折叠回 [anchorKey] 的自动同步)。多选逻辑一律经这里写,不要直接改
834
+ * selectedKeys.value——否则会被下面的 watcher 按"单选"语义立即覆盖。 */
835
+ setMultiSelection: (keys: string[], anchorKey: string | null) => void;
1687
836
  /** 数据表格选中列下标(null = 未选中列;配合 selectedKey 定位所属数据表格节点) */
1688
837
  selectedColumnIndex: Ref<number | null>;
1689
838
  /** 元素属性编辑目标覆盖:列元素等非树节点复用标准字段编辑器时指向的工作节点 */
@@ -1692,6 +841,9 @@ declare interface SelectionState {
1692
841
  elementEditCommit: Ref<((node: FormNode) => void) | null>;
1693
842
  }
1694
843
 
844
+ /** 设置表达式求值使用的语言(模块级状态,见文件头限制说明) */
845
+ export declare function setExprLocale(locale: string): void;
846
+
1695
847
  export declare function setGlobalFormBuilderConfig(config?: FormBuilderConfig): void;
1696
848
 
1697
849
  export declare interface StaticNode extends BaseNode {
@@ -1702,10 +854,12 @@ export declare interface StaticNode extends BaseNode {
1702
854
  src?: string;
1703
855
  }
1704
856
 
1705
- export declare type StaticRenderer<T> = (node: StaticNode, ctx: RenderContext<T>, children?: T[]) => T;
1706
-
1707
857
  declare type StaticValue = any;
1708
858
 
859
+ /** 去掉仅前端使用的字段(BaseNode.key / meta.rawSchema),得到可安全交给后端
860
+ * 持久化 / 反序列化的表单定义。深拷贝后剥离,不改动传入对象,也不改动其他任何字段。 */
861
+ export declare function toPortableDefinition(def: FormDefinition): FormDefinition;
862
+
1709
863
  /** 树型字典定义(分页搜索返回的一行) */
1710
864
  declare interface TreeDictionaryDefinition {
1711
865
  value: string;
@@ -1720,6 +874,7 @@ declare interface TreeDictionaryOption {
1720
874
  disabled?: boolean;
1721
875
  }
1722
876
 
877
+ /** @public 分页树型字典查询参数:FormBuilderConfig.fetchTreeDictionaryPage 的入参形状,理由同 DictionaryPageQuery */
1723
878
  declare interface TreeDictionaryPageQuery {
1724
879
  /** 按 code 模糊过滤 */
1725
880
  value?: string;
@@ -1729,6 +884,7 @@ declare interface TreeDictionaryPageQuery {
1729
884
  pageSize: number;
1730
885
  }
1731
886
 
887
+ /** @public 分页树型字典查询结果:FormBuilderConfig.fetchTreeDictionaryPage 的返回形状,理由同 DictionaryPageQuery */
1732
888
  declare interface TreeDictionaryPageResult {
1733
889
  pageNum: number;
1734
890
  pageSize: number;
@@ -1738,9 +894,18 @@ declare interface TreeDictionaryPageResult {
1738
894
 
1739
895
  export declare function useFormBuilderConfig(): FormBuilderConfig;
1740
896
 
1741
- /** 读取所在 FormBuilder 实例的状态;子树外(如独立使用的 BuilderPreview)回落到默认实例。 */
897
+ /** 读取所在 FormBuilder 实例的完整状态(含 undo/redo/选中/画布交互);子树外调用
898
+ * 直接报错(不再回落全局单例)。FormRenderer 子树不提供这份状态——它是只读渲染
899
+ * 场景,用不到设计器专属的写操作,改读窄得多的 useFormDefinition()(见
900
+ * src/composables/use-form-definition.ts)。多实例场景下,静默写进一个谁也看不见
901
+ * 的全局实例比报错更难排查——找不到上下文时宁可让调用方立刻看到问题,也不要悄悄
902
+ * 改错状态。独立使用的组件请改用 useOptionalFormBuilderState()。 */
1742
903
  export declare function useFormBuilderState(): FormBuilderState;
1743
904
 
905
+ /** 可选读取:可脱离 FormBuilder 独立使用的组件(如 BuilderPreview 传 schema prop)用它,
906
+ * 子树外返回 null,由调用方自行决定回落逻辑。 */
907
+ export declare function useOptionalFormBuilderState(): FormBuilderState | null;
908
+
1744
909
  declare interface ValidationRule {
1745
910
  rule: string;
1746
911
  args?: StaticValue[];