@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
@@ -0,0 +1,2625 @@
1
+ import { S as e, a as t, c as n, d as r, f as i, l as a, p as o, t as s, u as c, x as l } from "./schema-adapter-_sLPmdLy.js";
2
+ import { c as u } from "./expr-parse-u7_CxMWg.js";
3
+ import { n as d, r as f } from "./form-layout-Dm4QeYrL.js";
4
+ import { a as p, n as m, r as h, t as ee } from "./bind-runtime-CRyrBYCi.js";
5
+ import { n as g, t as _ } from "./use-bind-events-C-H7jhW_.js";
6
+ import { r as te, t as ne } from "./use-config-DTr8dhzM.js";
7
+ import { t as v } from "./use-dynamic-options-DbGSz-3_.js";
8
+ import { t as y } from "./InlineEditableText-BO-dT5rp.js";
9
+ import { n as b, t as re } from "./context-4zkSHwVA.js";
10
+ import { n as ie, t as x } from "./evaluator-DqNftI0d.js";
11
+ import { a as ae, n as oe, u as S } from "./grid-C8xMKll5.js";
12
+ import { t as se } from "./keys-D4DlFgJT.js";
13
+ import { t as ce } from "./_plugin-vue_export-helper-BxNYtmDu.js";
14
+ import { n as le, r as C, t as ue } from "./use-schema-render-data-DagOPKiy.js";
15
+ import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as de, createTextVNode as fe, createVNode as A, defineAsyncComponent as pe, defineComponent as j, guardReactiveProps as me, h as he, inject as M, markRaw as N, mergeProps as P, nextTick as ge, normalizeClass as F, normalizeProps as _e, normalizeStyle as ve, onScopeDispose as I, openBlock as L, provide as ye, ref as R, renderList as z, renderSlot as be, resolveDynamicComponent as xe, toDisplayString as B, toRaw as Se, unref as V, vShow as Ce, watch as H, withCtx as U, withDirectives as we, withModifiers as Te } from "vue";
16
+ import { NA as Ee, NBadge as De, NBlockquote as Oe, NButton as ke, NButtonGroup as Ae, NCard as je, NCheckbox as Me, NCheckboxGroup as Ne, NConfigProvider as Pe, NDivider as Fe, NEmpty as W, NH1 as Ie, NH2 as G, NH3 as K, NH4 as Le, NH5 as Re, NH6 as ze, NInput as Be, NInputGroup as Ve, NInputNumber as He, NLi as Ue, NMessageProvider as We, NNotificationProvider as Ge, NOl as Ke, NP as qe, NRadio as Je, NRadioGroup as Ye, NSelect as Xe, NStep as Ze, NSteps as Qe, NSwitch as $e, NTabPane as et, NTabs as tt, NText as nt, NTooltip as rt, NUl as it, alertDark as at, autoCompleteDark as ot, avatarDark as st, backTopDark as ct, badgeDark as lt, buttonDark as ut, cardDark as dt, cascaderDark as ft, checkboxDark as pt, collapseDark as mt, createTheme as ht, dataTableDark as gt, dateEnUS as _t, datePickerDark as vt, dateZhCN as yt, dividerDark as bt, dropdownDark as xt, dynamicTagsDark as St, emptyDark as Ct, enUS as wt, inputDark as Tt, inputNumberDark as Et, layoutDark as Dt, mentionDark as Ot, messageDark as kt, modalDark as At, notificationDark as jt, paginationDark as Mt, popconfirmDark as Nt, popoverDark as Pt, popselectDark as Ft, progressDark as It, radioDark as Lt, rateDark as Rt, scrollbarDark as zt, selectDark as Bt, sliderDark as Vt, spaceDark as Ht, spinDark as Ut, stepsDark as Wt, switchDark as Gt, tabsDark as Kt, tagDark as qt, timePickerDark as Jt, tooltipDark as Yt, transferDark as Xt, treeDark as Zt, treeSelectDark as Qt, typographyDark as $t, uploadDark as en, useMessage as tn, zhCN as nn } from "naive-ui";
17
+ import { FormKit as rn, FormKitSchema as q, changeLocale as an, createInput as on } from "@formkit/vue";
18
+ import { useColorMode as sn, usePreferredDark as cn, useResizeObserver as ln } from "@vueuse/core";
19
+ import { colorPickerDark as un } from "naive-ui/es/color-picker/styles";
20
+ import { imageDark as dn } from "naive-ui/es/image/styles";
21
+ import { qrcodeDark as fn } from "naive-ui/es/qr-code/styles";
22
+ import { createMessage as pn } from "@formkit/core";
23
+ //#region src/components/ui/fields/NaiveTextInput.vue?vue&type=script&setup=true&lang.ts
24
+ var mn = {
25
+ key: 1,
26
+ class: "text-xs text-muted-foreground"
27
+ }, hn = {
28
+ key: 1,
29
+ class: "text-xs text-muted-foreground"
30
+ }, gn = /* @__PURE__ */ j({
31
+ __name: "NaiveTextInput",
32
+ props: { context: {} },
33
+ setup(e) {
34
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context, { omit: ["prefix", "suffix"] }), { runEvent: a } = _(e.context, r), o = T(() => e.context.type === "password" ? "password" : "text"), s = T(() => String(t.prefix ?? "").trim()), c = T(() => String(t.suffix ?? "").trim()), l = (e) => e.startsWith("i-"), u = T(() => !!(t.pair ?? !1)), d = T(() => t.separator ?? "-"), f = T(() => {
35
+ let t = e.context._value;
36
+ if (!u.value) return t ?? "";
37
+ if (Array.isArray(t)) {
38
+ let e = t[0] ?? "", n = t[1] ?? "";
39
+ return [String(e), String(n)];
40
+ }
41
+ if (typeof t == "string") {
42
+ let e = t.split(d.value);
43
+ return [e[0] ?? "", e[1] ?? ""];
44
+ }
45
+ return ["", ""];
46
+ });
47
+ async function p(t) {
48
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
49
+ }
50
+ let m = async (e) => {
51
+ await a("onFocus", e);
52
+ }, h = async (t) => {
53
+ await a("onBlur", t), e.context.handlers.blur(t);
54
+ };
55
+ return (t, r) => (L(), E(V(Be), P(V(n), {
56
+ value: f.value,
57
+ type: o.value,
58
+ "input-props": { id: e.context.id },
59
+ pair: u.value,
60
+ separator: d.value,
61
+ disabled: V(i),
62
+ "onUpdate:value": p,
63
+ onFocus: m,
64
+ onBlur: h
65
+ }), de({ _: 2 }, [s.value ? {
66
+ name: "prefix",
67
+ fn: U(() => [l(s.value) ? (L(), O("span", {
68
+ key: 0,
69
+ class: F([s.value, "h-4 w-4"])
70
+ }, null, 2)) : (L(), O("span", mn, B(s.value), 1))]),
71
+ key: "0"
72
+ } : void 0, c.value ? {
73
+ name: "suffix",
74
+ fn: U(() => [l(c.value) ? (L(), O("span", {
75
+ key: 0,
76
+ class: F([c.value, "h-4 w-4"])
77
+ }, null, 2)) : (L(), O("span", hn, B(c.value), 1))]),
78
+ key: "1"
79
+ } : void 0]), 1040, [
80
+ "value",
81
+ "type",
82
+ "input-props",
83
+ "pair",
84
+ "separator",
85
+ "disabled"
86
+ ]));
87
+ }
88
+ }), _n = {
89
+ key: 1,
90
+ class: "text-xs text-muted-foreground"
91
+ }, vn = {
92
+ key: 1,
93
+ class: "text-xs text-muted-foreground"
94
+ }, yn = /* @__PURE__ */ j({
95
+ __name: "NaiveTextarea",
96
+ props: { context: {} },
97
+ setup(e) {
98
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context, { omit: ["prefix", "suffix"] }), { runEvent: a } = _(e.context, r), o = T(() => String(t.prefix ?? "").trim()), s = T(() => String(t.suffix ?? "").trim()), c = (e) => e.startsWith("i-"), l = T(() => e.context._value ?? "");
99
+ async function u(t) {
100
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
101
+ }
102
+ let d = async (e) => {
103
+ await a("onFocus", e);
104
+ }, f = async (t) => {
105
+ await a("onBlur", t), e.context.handlers.blur(t);
106
+ };
107
+ return (t, r) => (L(), E(V(Be), P(V(n), {
108
+ value: l.value,
109
+ type: "textarea",
110
+ "input-props": { id: e.context.id },
111
+ disabled: V(i),
112
+ "onUpdate:value": u,
113
+ onFocus: d,
114
+ onBlur: f
115
+ }), de({ _: 2 }, [o.value ? {
116
+ name: "prefix",
117
+ fn: U(() => [c(o.value) ? (L(), O("span", {
118
+ key: 0,
119
+ class: F([o.value, "h-4 w-4"])
120
+ }, null, 2)) : (L(), O("span", _n, B(o.value), 1))]),
121
+ key: "0"
122
+ } : void 0, s.value ? {
123
+ name: "suffix",
124
+ fn: U(() => [c(s.value) ? (L(), O("span", {
125
+ key: 0,
126
+ class: F([s.value, "h-4 w-4"])
127
+ }, null, 2)) : (L(), O("span", vn, B(s.value), 1))]),
128
+ key: "1"
129
+ } : void 0]), 1040, [
130
+ "value",
131
+ "input-props",
132
+ "disabled"
133
+ ]));
134
+ }
135
+ }), bn = /* @__PURE__ */ j({
136
+ __name: "NaiveNumberInput",
137
+ props: { context: {} },
138
+ setup(e) {
139
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context), { runEvent: a } = _(e.context, r), o = T(() => {
140
+ let e = t.step;
141
+ if (e === void 0) return;
142
+ if (typeof e == "number") return e;
143
+ let n = Number(e);
144
+ return Number.isFinite(n) ? n : void 0;
145
+ }), s = T(() => {
146
+ let t = e.context._value;
147
+ if (t == null || t === "") return null;
148
+ let n = typeof t == "number" ? t : Number(t);
149
+ return Number.isFinite(n) ? n : null;
150
+ });
151
+ async function c(t) {
152
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
153
+ }
154
+ let l = async (e) => {
155
+ await a("onFocus", e);
156
+ }, u = async (t) => {
157
+ await a("onBlur", t), e.context.handlers.blur(t);
158
+ };
159
+ return (t, r) => (L(), E(V(He), P(V(n), {
160
+ value: s.value,
161
+ step: o.value,
162
+ "input-props": { id: e.context.id },
163
+ disabled: V(i),
164
+ "onUpdate:value": c,
165
+ onFocus: l,
166
+ onBlur: u
167
+ }), null, 16, [
168
+ "value",
169
+ "step",
170
+ "input-props",
171
+ "disabled"
172
+ ]));
173
+ }
174
+ }), xn = /* @__PURE__ */ j({
175
+ __name: "NaiveSelect",
176
+ props: { context: {} },
177
+ setup(e) {
178
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context), { runEvent: a } = _(e.context, r), o = T(() => t.multiple ?? !1), s = T(() => n.value.options), { isDynamic: c, dynamicOptions: l } = v(s), u = T(() => {
179
+ if (c.value) return l.value;
180
+ let e = s.value;
181
+ return Array.isArray(e) ? e.reduce((e, t) => {
182
+ if (typeof t == "string" || typeof t == "number") return e.push({
183
+ label: String(t),
184
+ value: t
185
+ }), e;
186
+ if (t && typeof t == "object") {
187
+ let n = t.value, r = t.label;
188
+ (typeof n == "string" || typeof n == "number") && e.push({
189
+ label: String(r ?? n),
190
+ value: n
191
+ });
192
+ }
193
+ return e;
194
+ }, []) : [];
195
+ }), d = T(() => {
196
+ let t = e.context._value;
197
+ return o.value ? Array.isArray(t) ? t.filter((e) => typeof e == "string" || typeof e == "number") : typeof t == "string" || typeof t == "number" ? [t] : [] : typeof t == "string" || typeof t == "number" ? t : Array.isArray(t) ? t.find((e) => typeof e == "string" || typeof e == "number") ?? null : null;
198
+ });
199
+ async function f(t) {
200
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
201
+ }
202
+ let p = async (e) => {
203
+ await a("onFocus", e);
204
+ }, m = async (t) => {
205
+ await a("onBlur", t), e.context.handlers.blur(t);
206
+ };
207
+ return (t, r) => (L(), E(V(Xe), P(V(n), {
208
+ value: d.value,
209
+ options: u.value,
210
+ "input-props": { id: e.context.id },
211
+ disabled: V(i),
212
+ "onUpdate:value": f,
213
+ onFocus: p,
214
+ onBlur: m
215
+ }), null, 16, [
216
+ "value",
217
+ "options",
218
+ "input-props",
219
+ "disabled"
220
+ ]));
221
+ }
222
+ }), Sn = /* @__PURE__ */ j({
223
+ __name: "NaiveCheckboxGroup",
224
+ props: { context: {} },
225
+ setup(e) {
226
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context, { omit: ["horizontal"] }), { runEvent: a } = _(e.context, r), o = T(() => {
227
+ let e = t.size;
228
+ return e === "tiny" ? "small" : e === "small" || e === "medium" || e === "large" ? e : "medium";
229
+ }), s = T(() => t.horizontal ?? !1), c = T(() => n.value.options), { isDynamic: l, dynamicOptions: u } = v(c), d = T(() => {
230
+ if (l.value) return u.value;
231
+ let e = c.value;
232
+ return Array.isArray(e) ? e.map((e) => {
233
+ if (typeof e == "string" || typeof e == "number") return {
234
+ label: String(e),
235
+ value: e
236
+ };
237
+ if (e && typeof e == "object") {
238
+ let t = e.value, n = e.label;
239
+ if (t !== void 0) return {
240
+ label: String(n ?? t),
241
+ value: t
242
+ };
243
+ }
244
+ return null;
245
+ }).filter((e) => e !== null) : [];
246
+ }), f = T(() => {
247
+ let t = e.context._value;
248
+ return Array.isArray(t) ? t : t == null || t === "" ? [] : [t];
249
+ });
250
+ async function p(t) {
251
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
252
+ }
253
+ return (e, t) => (L(), E(V(Ne), P(V(n), {
254
+ value: f.value,
255
+ size: o.value,
256
+ disabled: V(i),
257
+ "onUpdate:value": p
258
+ }), {
259
+ default: U(() => [k("div", { class: F(s.value ? "flex flex-row flex-wrap gap-4 w-full py-1" : "flex flex-col gap-2 w-full py-1") }, [(L(!0), O(w, null, z(d.value, (e) => (L(), E(V(Me), {
260
+ key: String(e.value),
261
+ value: e.value,
262
+ label: e.label
263
+ }, null, 8, ["value", "label"]))), 128))], 2)]),
264
+ _: 1
265
+ }, 16, [
266
+ "value",
267
+ "size",
268
+ "disabled"
269
+ ]));
270
+ }
271
+ }), Cn = /* @__PURE__ */ j({
272
+ __name: "NaiveRadioGroup",
273
+ props: { context: {} },
274
+ setup(e) {
275
+ let { config: t, props: n, bind: r, disabled: i } = g(e.context, { omit: ["horizontal"] }), { runEvent: a } = _(e.context, r), o = T(() => t.horizontal ?? !1), s = T(() => n.value.options), { isDynamic: c, dynamicOptions: l } = v(s), u = T(() => {
276
+ if (c.value) return l.value;
277
+ let e = s.value;
278
+ return Array.isArray(e) ? e.map((e) => {
279
+ if (typeof e == "string" || typeof e == "number") return {
280
+ label: String(e),
281
+ value: e
282
+ };
283
+ if (e && typeof e == "object") {
284
+ let t = e.value, n = e.label;
285
+ if (t !== void 0) return {
286
+ label: String(n ?? t),
287
+ value: t
288
+ };
289
+ }
290
+ return null;
291
+ }).filter((e) => e !== null) : [];
292
+ }), d = T(() => e.context._value);
293
+ async function f(t) {
294
+ e.context.node.input(t), await a("onInput", t), await a("onChange", t);
295
+ }
296
+ return (e, t) => (L(), E(V(Ye), P(V(n), {
297
+ value: d.value,
298
+ disabled: V(i),
299
+ "onUpdate:value": f
300
+ }), {
301
+ default: U(() => [k("div", { class: F(o.value ? "flex flex-row flex-wrap gap-4 w-full py-1" : "flex flex-col gap-2 w-full py-1") }, [(L(!0), O(w, null, z(u.value, (e) => (L(), E(V(Je), {
302
+ key: String(e.value),
303
+ value: e.value
304
+ }, {
305
+ default: U(() => [fe(B(e.label), 1)]),
306
+ _: 2
307
+ }, 1032, ["value"]))), 128))], 2)]),
308
+ _: 1
309
+ }, 16, ["value", "disabled"]));
310
+ }
311
+ }), wn = /* @__PURE__ */ j({
312
+ __name: "NaiveSwitch",
313
+ props: { context: {} },
314
+ setup(e) {
315
+ let { props: t, bind: n, disabled: r } = g(e.context), { runEvent: i } = _(e.context, n), a = T(() => !!(e.context._value ?? !1));
316
+ async function o(t) {
317
+ e.context.node.input(t), await i("onInput", t), await i("onChange", t);
318
+ }
319
+ return (e, n) => (L(), E(V($e), P(V(t), {
320
+ value: a.value,
321
+ disabled: V(r),
322
+ "onUpdate:value": o
323
+ }), null, 16, ["value", "disabled"]));
324
+ }
325
+ }), Tn = /* @__PURE__ */ j({
326
+ __name: "CustomButton",
327
+ props: { context: {} },
328
+ setup(e) {
329
+ let { config: t, props: n, bind: r } = g(e.context, { omit: [
330
+ "buttonText",
331
+ "buttonType",
332
+ "text",
333
+ "fullWidth",
334
+ "align"
335
+ ] }), { runEvent: i } = _(e.context, r), a = T(() => !!(e.context?.disabled ?? !1)), o = T(() => t.buttonText ?? t.text ?? e.context?.label ?? ""), s = T(() => t.buttonType ?? "primary"), c = T(() => {
336
+ let t = e.context.node.props.type;
337
+ return t === "submit" ? "submit" : t === "reset" ? "reset" : "button";
338
+ }), l = T(() => t.align || "left"), u = T(() => !!t.fullWidth);
339
+ async function d(t) {
340
+ if (e.context.node.props.type === "reset") {
341
+ t.preventDefault(), e.context?.node?.root?.reset?.();
342
+ return;
343
+ }
344
+ await i("onClick", t), e.context?.handlers?.click?.(t);
345
+ }
346
+ async function f(t) {
347
+ await i("onFocus", t), e.context?.handlers?.focus?.(t);
348
+ }
349
+ async function p(t) {
350
+ await i("onBlur", t), e.context?.handlers?.blur?.(t);
351
+ }
352
+ return (t, r) => (L(), O("div", { class: F([
353
+ "flex",
354
+ u.value ? "w-full" : "",
355
+ l.value === "center" ? "justify-center" : l.value === "right" ? "justify-end" : "justify-start"
356
+ ]) }, [A(V(ke), P(V(n), {
357
+ class: [u.value ? "w-full" : ""],
358
+ type: s.value,
359
+ "attr-type": c.value,
360
+ disabled: a.value,
361
+ onClick: d,
362
+ onFocus: f,
363
+ onBlur: p
364
+ }), {
365
+ default: U(() => [A(y, {
366
+ context: e.context,
367
+ "prop-key": "buttonText",
368
+ value: o.value
369
+ }, null, 8, ["context", "value"])]),
370
+ _: 1
371
+ }, 16, [
372
+ "class",
373
+ "type",
374
+ "attr-type",
375
+ "disabled"
376
+ ])], 2));
377
+ }
378
+ }), En = { class: "whitespace-pre-line" }, Dn = /* @__PURE__ */ j({
379
+ __name: "NaiveTypographyText",
380
+ props: { context: {} },
381
+ setup(e) {
382
+ let { config: t, props: n } = g(e.context, { omit: [
383
+ "text",
384
+ "theme",
385
+ "depth"
386
+ ] }), r = T(() => {
387
+ let n = t.text;
388
+ return typeof n == "string" ? n : String(e.context._value ?? "");
389
+ }), i = T(() => t.theme), a = T(() => {
390
+ let e = t.depth;
391
+ if (typeof e == "number" && Number.isFinite(e)) return e;
392
+ if (typeof e == "string") {
393
+ let t = Number(e);
394
+ return Number.isFinite(t) ? t : void 0;
395
+ }
396
+ });
397
+ return (t, o) => (L(), E(V(nt), P(V(n), {
398
+ type: i.value,
399
+ depth: a.value
400
+ }), {
401
+ default: U(() => [k("span", En, [A(y, {
402
+ context: e.context,
403
+ "prop-key": "text",
404
+ value: r.value
405
+ }, null, 8, ["context", "value"])])]),
406
+ _: 1
407
+ }, 16, ["type", "depth"]));
408
+ }
409
+ }), On = { class: "whitespace-pre-line" }, kn = /* @__PURE__ */ j({
410
+ __name: "NaiveTypographyP",
411
+ props: { context: {} },
412
+ setup(e) {
413
+ let { config: t, props: n } = g(e.context, { omit: [
414
+ "text",
415
+ "theme",
416
+ "depth",
417
+ "align"
418
+ ] }), r = T(() => {
419
+ let n = t.text;
420
+ return typeof n == "string" ? n : String(e.context._value ?? "");
421
+ }), i = T(() => t.theme), a = T(() => {
422
+ let e = t.align;
423
+ return e === "start" || e === "center" || e === "end" ? e : void 0;
424
+ }), o = T(() => {
425
+ let e = t.depth;
426
+ if (typeof e == "number" && Number.isFinite(e)) return e;
427
+ if (typeof e == "string") {
428
+ let t = Number(e);
429
+ return Number.isFinite(t) ? t : void 0;
430
+ }
431
+ });
432
+ return (t, s) => (L(), E(V(qe), P(V(n), { style: a.value ? { textAlign: a.value } : void 0 }), {
433
+ default: U(() => [A(V(nt), {
434
+ type: i.value,
435
+ depth: o.value
436
+ }, {
437
+ default: U(() => [k("span", On, [A(y, {
438
+ context: e.context,
439
+ "prop-key": "text",
440
+ value: r.value
441
+ }, null, 8, ["context", "value"])])]),
442
+ _: 1
443
+ }, 8, ["type", "depth"])]),
444
+ _: 1
445
+ }, 16, ["style"]));
446
+ }
447
+ }), An = { class: "whitespace-pre-line" }, jn = /* @__PURE__ */ j({
448
+ __name: "NaiveTypographyA",
449
+ props: { context: {} },
450
+ setup(e) {
451
+ let { config: t, props: n } = g(e.context, { omit: ["text", "href"] }), r = T(() => {
452
+ let n = t.text;
453
+ return typeof n == "string" ? n : String(e.context._value ?? "");
454
+ }), i = T(() => t.href ?? "#");
455
+ return (t, a) => (L(), E(V(Ee), P(V(n), { href: i.value }), {
456
+ default: U(() => [k("span", An, [A(y, {
457
+ context: e.context,
458
+ "prop-key": "text",
459
+ value: r.value
460
+ }, null, 8, ["context", "value"])])]),
461
+ _: 1
462
+ }, 16, ["href"]));
463
+ }
464
+ }), Mn = { class: "whitespace-pre-line" }, Nn = /* @__PURE__ */ j({
465
+ __name: "NaiveTypographyBlockquote",
466
+ props: { context: {} },
467
+ setup(e) {
468
+ let { config: t } = g(e.context), n = T(() => {
469
+ let n = t.text;
470
+ return typeof n == "string" ? n : String(e.context._value ?? "");
471
+ });
472
+ return (t, r) => (L(), E(V(Oe), null, {
473
+ default: U(() => [k("span", Mn, [A(y, {
474
+ context: e.context,
475
+ "prop-key": "text",
476
+ value: n.value
477
+ }, null, 8, ["context", "value"])])]),
478
+ _: 1
479
+ }));
480
+ }
481
+ }), Pn = { class: "whitespace-pre-line" }, Fn = /* @__PURE__ */ j({
482
+ __name: "NaiveTypographyHeader",
483
+ props: { context: {} },
484
+ setup(e) {
485
+ let { config: t } = g(e.context), n = T(() => {
486
+ let n = t.text;
487
+ return typeof n == "string" ? n : String(e.context._value ?? "");
488
+ }), r = T(() => {
489
+ let t = e.context.type;
490
+ return t === "naiveH1" ? Ie : t === "naiveH2" ? G : t === "naiveH3" ? K : t === "naiveH4" ? Le : t === "naiveH5" ? Re : ze;
491
+ });
492
+ return (t, i) => (L(), E(xe(r.value), null, {
493
+ default: U(() => [k("span", Pn, [A(y, {
494
+ context: e.context,
495
+ "prop-key": "text",
496
+ value: n.value
497
+ }, null, 8, ["context", "value"])])]),
498
+ _: 1
499
+ }));
500
+ }
501
+ }), In = /* @__PURE__ */ j({
502
+ __name: "NaiveTypographyUl",
503
+ props: { context: {} },
504
+ setup(e) {
505
+ let { config: t } = g(e.context), n = T(() => {
506
+ let e = t.options;
507
+ return Array.isArray(e) ? e.map((e) => String(e)) : [];
508
+ });
509
+ return (t, r) => (L(), E(V(it), null, {
510
+ default: U(() => [(L(!0), O(w, null, z(n.value, (t, n) => (L(), E(V(Ue), { key: n }, {
511
+ default: U(() => [A(y, {
512
+ context: e.context,
513
+ "prop-key": "options",
514
+ "prop-index": n,
515
+ value: t
516
+ }, null, 8, [
517
+ "context",
518
+ "prop-index",
519
+ "value"
520
+ ])]),
521
+ _: 2
522
+ }, 1024))), 128))]),
523
+ _: 1
524
+ }));
525
+ }
526
+ }), Ln = /* @__PURE__ */ j({
527
+ __name: "NaiveTypographyOl",
528
+ props: { context: {} },
529
+ setup(e) {
530
+ let { config: t } = g(e.context), n = T(() => {
531
+ let e = t.options;
532
+ return Array.isArray(e) ? e.map((e) => String(e)) : [];
533
+ });
534
+ return (t, r) => (L(), E(V(Ke), null, {
535
+ default: U(() => [(L(!0), O(w, null, z(n.value, (t, n) => (L(), E(V(Ue), { key: n }, {
536
+ default: U(() => [A(y, {
537
+ context: e.context,
538
+ "prop-key": "options",
539
+ "prop-index": n,
540
+ value: t
541
+ }, null, 8, [
542
+ "context",
543
+ "prop-index",
544
+ "value"
545
+ ])]),
546
+ _: 2
547
+ }, 1024))), 128))]),
548
+ _: 1
549
+ }));
550
+ }
551
+ }), Rn = { class: "whitespace-pre-line" }, zn = /* @__PURE__ */ j({
552
+ __name: "NaiveTypographyLi",
553
+ props: { context: {} },
554
+ setup(e) {
555
+ let t = e, n = T(() => String(t.context._value ?? ""));
556
+ return (e, r) => (L(), E(V(Ue), null, {
557
+ default: U(() => [k("span", Rn, [A(y, {
558
+ context: t.context,
559
+ "prop-key": "value",
560
+ value: n.value
561
+ }, null, 8, ["context", "value"])])]),
562
+ _: 1
563
+ }));
564
+ }
565
+ }), Bn = /* @__PURE__ */ j({
566
+ __name: "NaiveDivider",
567
+ props: { context: {} },
568
+ setup(e) {
569
+ let { config: t, props: n } = g(e.context, { omit: ["title"] }), r = T(() => {
570
+ let n = t.title;
571
+ return typeof n == "string" ? n : String(e.context._value ?? "");
572
+ });
573
+ return (t, i) => (L(), E(V(Fe), _e(me(V(n))), {
574
+ default: U(() => [A(y, {
575
+ context: e.context,
576
+ "prop-key": "title",
577
+ value: r.value
578
+ }, null, 8, ["context", "value"])]),
579
+ _: 1
580
+ }, 16));
581
+ }
582
+ }), Vn = () => import("./date-family-BYkr1OaE.js"), Hn = () => import("./selection-family-T_wZGrXc.js"), Un = () => import("./media-family-B4Wijm18.js"), Wn = () => import("./misc-family-CQJhCKco.js"), Gn = {
583
+ date: () => Vn().then((e) => ({ default: e.NaiveDatePicker })),
584
+ naiveDateTime: () => Vn().then((e) => ({ default: e.NaiveDatePicker })),
585
+ time: () => Vn().then((e) => ({ default: e.NaiveTimePicker })),
586
+ naiveCascader: () => Hn().then((e) => ({ default: e.NaiveCascader })),
587
+ naiveTreeSelect: () => Hn().then((e) => ({ default: e.NaiveTreeSelect })),
588
+ naiveTransfer: () => Hn().then((e) => ({ default: e.NaiveTransfer })),
589
+ naiveMention: () => Hn().then((e) => ({ default: e.NaiveMention })),
590
+ naiveAutoComplete: () => Hn().then((e) => ({ default: e.NaiveAutoComplete })),
591
+ file: () => Un().then((e) => ({ default: e.NaiveUpload })),
592
+ color: () => Un().then((e) => ({ default: e.NaiveColorPicker })),
593
+ naiveAvatar: () => Un().then((e) => ({ default: e.NaiveAvatar })),
594
+ naiveImage: () => Un().then((e) => ({ default: e.NaiveImage })),
595
+ naiveRate: () => Wn().then((e) => ({ default: e.NaiveRate })),
596
+ range: () => Wn().then((e) => ({ default: e.NaiveSlider })),
597
+ naiveQrCode: () => Wn().then((e) => ({ default: e.NaiveQrCode })),
598
+ naiveProgress: () => Wn().then((e) => ({ default: e.NaiveProgress })),
599
+ naiveAlert: () => Wn().then((e) => ({ default: e.NaiveAlert })),
600
+ naiveBackTop: () => Wn().then((e) => ({ default: e.NaiveBackTop })),
601
+ richText: () => import("./RichText-DqcMtoil.js"),
602
+ signature: () => import("./SignaturePad-qhmoMg1E.js")
603
+ }, Kn = { dataTable: () => import("./DataTableContainerPreview-phlGcigM.js") };
604
+ function qn(e) {
605
+ return Gn[e] ?? Kn[e];
606
+ }
607
+ function Jn(e) {
608
+ return !!qn(e);
609
+ }
610
+ function Yn() {
611
+ return [...Object.keys(Gn), ...Object.keys(Kn)];
612
+ }
613
+ var Xn = /* @__PURE__ */ new Map(), Zn = /* @__PURE__ */ new Set();
614
+ function Qn(e) {
615
+ let t = qn(e);
616
+ if (!t) return;
617
+ let n = Xn.get(e);
618
+ return n || (n = t().then((t) => (Zn.add(e), t.default)), Xn.set(e, n)), n;
619
+ }
620
+ function $n(e) {
621
+ return Zn.has(e);
622
+ }
623
+ function er(e) {
624
+ return Promise.all(e.map((e) => Qn(e) ?? Promise.resolve(void 0))).then(() => void 0);
625
+ }
626
+ var tr = N(j({
627
+ name: "LazyLoadErrorPlaceholder",
628
+ setup() {
629
+ let { t: e } = b();
630
+ return () => he("div", { class: "text-xs text-muted-foreground py-1" }, e("elements.common.loadError"));
631
+ }
632
+ })), nr = /* @__PURE__ */ new Map();
633
+ function J(e) {
634
+ if (!qn(e)) return;
635
+ let t = nr.get(e);
636
+ if (t) return t;
637
+ let n = N(pe({
638
+ loader: () => Qn(e),
639
+ errorComponent: tr,
640
+ onError(e, t, n) {
641
+ n();
642
+ }
643
+ }));
644
+ return nr.set(e, n), n;
645
+ }
646
+ function rr(e, t) {
647
+ t.add(e.type);
648
+ let n = e.children;
649
+ if (Array.isArray(n)) for (let e of n) rr(e, t);
650
+ }
651
+ function ir(e) {
652
+ let t = /* @__PURE__ */ new Set();
653
+ return rr(e.root, t), [...t];
654
+ }
655
+ function ar(e) {
656
+ let n = /* @__PURE__ */ new Set();
657
+ for (let r of e ?? []) r && typeof r == "object" && rr(t(r), n);
658
+ return [...n];
659
+ }
660
+ //#endregion
661
+ //#region src/elements/formkit.ts
662
+ n();
663
+ var or = {
664
+ text: {
665
+ component: gn,
666
+ libraryName: "NaiveTextInput"
667
+ },
668
+ textarea: {
669
+ component: yn,
670
+ libraryName: "NaiveTextarea"
671
+ },
672
+ email: {
673
+ component: gn,
674
+ libraryName: "NaiveEmailInput"
675
+ },
676
+ number: {
677
+ component: bn,
678
+ libraryName: "NaiveNumberInput"
679
+ },
680
+ url: {
681
+ component: gn,
682
+ libraryName: "NaiveUrlInput"
683
+ },
684
+ checkbox: {
685
+ component: Sn,
686
+ libraryName: "NaiveCheckboxGroup"
687
+ },
688
+ color: {
689
+ component: J("color"),
690
+ libraryName: "NaiveColorPicker"
691
+ },
692
+ date: {
693
+ component: J("date"),
694
+ libraryName: "NaiveDatePicker"
695
+ },
696
+ time: {
697
+ component: J("time"),
698
+ libraryName: "NaiveTimePicker"
699
+ },
700
+ naiveDateTime: {
701
+ component: J("naiveDateTime"),
702
+ libraryName: "NaiveDateTimePicker"
703
+ },
704
+ file: {
705
+ component: J("file"),
706
+ libraryName: "NaiveUpload"
707
+ },
708
+ password: {
709
+ component: gn,
710
+ libraryName: "NaivePasswordInput"
711
+ },
712
+ radio: {
713
+ component: Cn,
714
+ libraryName: "NaiveRadioGroup"
715
+ },
716
+ range: {
717
+ component: J("range"),
718
+ libraryName: "NaiveSlider"
719
+ },
720
+ select: {
721
+ component: xn,
722
+ libraryName: "NaiveSelect"
723
+ },
724
+ naiveCascader: {
725
+ component: J("naiveCascader"),
726
+ libraryName: "NaiveCascader"
727
+ },
728
+ naiveTreeSelect: {
729
+ component: J("naiveTreeSelect"),
730
+ libraryName: "NaiveTreeSelect"
731
+ },
732
+ naiveTransfer: {
733
+ component: J("naiveTransfer"),
734
+ libraryName: "NaiveTransfer"
735
+ },
736
+ naiveMention: {
737
+ component: J("naiveMention"),
738
+ libraryName: "NaiveMention"
739
+ },
740
+ naiveAutoComplete: {
741
+ component: J("naiveAutoComplete"),
742
+ libraryName: "NaiveAutoComplete"
743
+ },
744
+ naiveRate: {
745
+ component: J("naiveRate"),
746
+ libraryName: "NaiveRate"
747
+ },
748
+ richText: {
749
+ component: J("richText"),
750
+ libraryName: "RichText"
751
+ },
752
+ signature: {
753
+ component: J("signature"),
754
+ libraryName: "SignaturePad"
755
+ },
756
+ naiveSwitch: {
757
+ component: wn,
758
+ libraryName: "NaiveSwitch"
759
+ },
760
+ naiveAvatar: {
761
+ component: J("naiveAvatar"),
762
+ libraryName: "NaiveAvatar"
763
+ },
764
+ naiveImage: {
765
+ component: J("naiveImage"),
766
+ libraryName: "NaiveImage"
767
+ },
768
+ tel: {
769
+ component: gn,
770
+ libraryName: "NaiveTelInput"
771
+ },
772
+ submit: {
773
+ component: Tn,
774
+ libraryName: "CustomButton"
775
+ },
776
+ reset: {
777
+ component: Tn,
778
+ libraryName: "CustomButton"
779
+ },
780
+ naiveButton: {
781
+ component: Tn,
782
+ libraryName: "CustomButton"
783
+ },
784
+ naiveText: {
785
+ component: Dn,
786
+ libraryName: "NaiveTypographyText"
787
+ },
788
+ naiveP: {
789
+ component: kn,
790
+ libraryName: "NaiveTypographyP"
791
+ },
792
+ naiveA: {
793
+ component: jn,
794
+ libraryName: "NaiveTypographyA"
795
+ },
796
+ naiveBlockquote: {
797
+ component: Nn,
798
+ libraryName: "NaiveTypographyBlockquote"
799
+ },
800
+ naiveH1: {
801
+ component: Fn,
802
+ libraryName: "NaiveTypographyHeader"
803
+ },
804
+ naiveH2: {
805
+ component: Fn,
806
+ libraryName: "NaiveTypographyHeader"
807
+ },
808
+ naiveH3: {
809
+ component: Fn,
810
+ libraryName: "NaiveTypographyHeader"
811
+ },
812
+ naiveH4: {
813
+ component: Fn,
814
+ libraryName: "NaiveTypographyHeader"
815
+ },
816
+ naiveH5: {
817
+ component: Fn,
818
+ libraryName: "NaiveTypographyHeader"
819
+ },
820
+ naiveH6: {
821
+ component: Fn,
822
+ libraryName: "NaiveTypographyHeader"
823
+ },
824
+ naiveUl: {
825
+ component: In,
826
+ libraryName: "NaiveTypographyUl"
827
+ },
828
+ naiveOl: {
829
+ component: Ln,
830
+ libraryName: "NaiveTypographyOl"
831
+ },
832
+ naiveLi: {
833
+ component: zn,
834
+ libraryName: "NaiveTypographyLi"
835
+ },
836
+ naiveDivider: {
837
+ component: Bn,
838
+ libraryName: "NaiveDivider"
839
+ },
840
+ naiveAlert: {
841
+ component: J("naiveAlert"),
842
+ libraryName: "NaiveAlert"
843
+ },
844
+ naiveBackTop: {
845
+ component: J("naiveBackTop"),
846
+ libraryName: "NaiveBackTop"
847
+ },
848
+ naiveQrCode: {
849
+ component: J("naiveQrCode"),
850
+ libraryName: "NaiveQrCode"
851
+ },
852
+ naiveProgress: {
853
+ component: J("naiveProgress"),
854
+ libraryName: "NaiveProgress"
855
+ }
856
+ };
857
+ o(Object.fromEntries(Object.entries(or).map(([e, t]) => [t.libraryName ?? e, e])));
858
+ var sr = /* @__PURE__ */ new Map();
859
+ function cr(e, t) {
860
+ sr.set(e, t), o({ [t.libraryName ?? e]: e });
861
+ }
862
+ function lr(e) {
863
+ return or[e] ?? sr.get(e);
864
+ }
865
+ function ur() {
866
+ let e = { ...or };
867
+ for (let [t, n] of sr) e[t] = n;
868
+ return Object.entries(e);
869
+ }
870
+ function dr() {
871
+ let e = {};
872
+ for (let [t, n] of ur()) {
873
+ let r = n.libraryName ?? t;
874
+ e[t] = on({
875
+ $el: "div",
876
+ attrs: { class: "w-full" },
877
+ children: [{
878
+ $cmp: r,
879
+ props: { context: "$node.context" }
880
+ }]
881
+ }, {
882
+ family: "naive",
883
+ library: { [r]: n.component },
884
+ features: [],
885
+ props: []
886
+ });
887
+ }
888
+ return e;
889
+ }
890
+ function fr(e) {
891
+ return N(j({
892
+ inheritAttrs: !1,
893
+ setup(t, { attrs: n }) {
894
+ return () => he(rn, {
895
+ ...n,
896
+ type: e
897
+ });
898
+ }
899
+ }));
900
+ }
901
+ function pr(e) {
902
+ let t = c(e);
903
+ return t?.target ? t.target : lr(e)?.libraryName ?? e;
904
+ }
905
+ function mr() {
906
+ let e = {};
907
+ for (let t of r()) lr(t.type) && (e[pr(t.type)] = fr(t.type));
908
+ return e;
909
+ }
910
+ //#endregion
911
+ //#region src/components/ui/containers/list/ListContainerPreview.vue?vue&type=script&setup=true&lang.ts
912
+ var hr = {
913
+ key: 0,
914
+ class: "mb-2px"
915
+ }, gr = {
916
+ key: 0,
917
+ class: "text-12px font-bold"
918
+ }, _r = { class: "p-2" }, vr = {
919
+ key: 0,
920
+ class: "grid grid-cols-12 gap-x-4 gap-y-2"
921
+ }, yr = {
922
+ key: 1,
923
+ class: "flex w-full items-center justify-center"
924
+ }, br = /* @__PURE__ */ j({
925
+ __name: "ListContainerPreview",
926
+ props: {
927
+ listKey: {},
928
+ children: {},
929
+ modelValue: {},
930
+ label: {},
931
+ name: {},
932
+ bordered: { type: Boolean },
933
+ itemIndex: {}
934
+ },
935
+ setup(e) {
936
+ let t = e, n = M("previewListInteractive", !0), { t: r } = b(), i = Q(), a = C(), o = T(() => typeof t.label == "string" && t.label.trim() ? t.label.trim() : ""), s = T(() => t.bordered ?? !0), u = T(() => typeof t.name == "string" && t.name.trim() ? t.name.trim() : t.listKey || "list"), d = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []), f = (e) => {
937
+ let t = e;
938
+ for (; t && typeof t.$el == "string" && l(t).length === 1;) t = l(t)[0];
939
+ return t;
940
+ }, p = (e, t) => e.map((e) => {
941
+ let n = e;
942
+ if (!n || typeof n != "object") return e;
943
+ let r = n.props && typeof n.props == "object" ? { ...n.props } : {};
944
+ return {
945
+ ...e,
946
+ props: {
947
+ ...r,
948
+ itemIndex: t
949
+ }
950
+ };
951
+ }), m = T(() => {
952
+ let e = d.value;
953
+ if (e.length === 1) {
954
+ let t = f(e[0]);
955
+ if (t && typeof t == "object" && (t.$formkit === "group" || t.$cmp === "group")) {
956
+ let e = l(t);
957
+ if (e.length) return e;
958
+ }
959
+ }
960
+ return e;
961
+ }), h = T(() => {
962
+ let e = d.value;
963
+ if (e.length !== 1) return e.length ? {
964
+ type: "group",
965
+ attrs: {},
966
+ children: e
967
+ } : null;
968
+ let t = f(e[0]), n = t?.$formkit ?? t?.$cmp, r = (typeof e[0]?.$el == "string" && typeof e[0]?.attrs?.class == "string" ? e[0].attrs.class : "").match(/\bcol-span-\d+\b/)?.[0] ?? "", i = c(n)?.category === "field";
969
+ if (typeof t?.$formkit == "string" && n !== "group" && n !== "list" || i) {
970
+ let e;
971
+ if (typeof t?.$formkit == "string") {
972
+ let { $formkit: n, name: r, id: i, __key: a, ...o } = t;
973
+ e = o;
974
+ } else e = { ...t?.props && typeof t.props == "object" ? t.props : {} }, delete e.name, delete e.id, delete e.__key;
975
+ return {
976
+ type: n,
977
+ attrs: e
978
+ };
979
+ }
980
+ if (n === "group") {
981
+ let e = l(t), n = "";
982
+ e.length === 1 && e[0] && typeof e[0].$el == "string" && Array.isArray(e[0].children) && (n = typeof e[0].attrs?.class == "string" ? e[0].attrs.class : "", e = l(e[0]));
983
+ let i = n.match(/\bcol-span-\d+\b/)?.[0] || r || "col-span-12";
984
+ return e = e.map((e) => e && typeof e.$cmp == "string" && c(e.$cmp)?.category !== "field" ? {
985
+ $el: "div",
986
+ attrs: { class: i },
987
+ children: [e]
988
+ } : e), {
989
+ type: "group",
990
+ attrs: {},
991
+ children: e
992
+ };
993
+ }
994
+ return n === "list" && t && typeof t == "object" ? {
995
+ type: "list",
996
+ attrs: {},
997
+ nestedList: [t]
998
+ } : {
999
+ type: "group",
1000
+ attrs: {},
1001
+ children: e
1002
+ };
1003
+ }), ee = (e, t) => {
1004
+ let n = h.value?.type, r = n === "group" ? {} : n === "list" ? [] : "";
1005
+ e.input([...Array.isArray(t) ? t : [], r]);
1006
+ }, g = (e, t, n) => {
1007
+ e.input((Array.isArray(t) ? t : []).filter((e, t) => t !== n));
1008
+ };
1009
+ return (t, c) => (L(), O("div", { class: F(["w-full rounded-xl pt-2", s.value ? "border border-border/50" : ""]) }, [o.value ? (L(), O("div", hr, [o.value ? (L(), O("div", gr, B(o.value), 1)) : D("", !0)])) : D("", !0), k("div", _r, [A(V(rn), {
1010
+ type: "list",
1011
+ name: e.itemIndex === void 0 ? u.value : void 0,
1012
+ index: e.itemIndex,
1013
+ dynamic: !0,
1014
+ value: []
1015
+ }, {
1016
+ default: U(({ items: e, node: t, value: o }) => [
1017
+ (L(!0), O(w, null, z(e, (s, l) => (L(), O("div", {
1018
+ key: l,
1019
+ class: "relative mb-2 rounded-lg border border-border/40 p-4"
1020
+ }, [h.value?.nestedList ? (L(), E(V(q), {
1021
+ key: 0,
1022
+ schema: p(h.value.nestedList, l),
1023
+ library: V(i),
1024
+ data: V(a)
1025
+ }, null, 8, [
1026
+ "schema",
1027
+ "library",
1028
+ "data"
1029
+ ])) : h.value ? (L(), E(V(rn), P({
1030
+ key: 1,
1031
+ index: l,
1032
+ type: h.value.type
1033
+ }, { ref_for: !0 }, h.value.attrs), {
1034
+ default: U(() => [h.value.children ? (L(), O("div", vr, [A(V(q), {
1035
+ schema: h.value.children,
1036
+ library: V(i),
1037
+ data: V(a)
1038
+ }, null, 8, [
1039
+ "schema",
1040
+ "library",
1041
+ "data"
1042
+ ])])) : D("", !0)]),
1043
+ _: 1
1044
+ }, 16, ["index", "type"])) : D("", !0), V(n) && e.length > 1 && l > 0 ? (L(), E(V(rt), {
1045
+ key: 2,
1046
+ placement: "top"
1047
+ }, {
1048
+ trigger: U(() => [A(V(ke), {
1049
+ text: "",
1050
+ type: "error",
1051
+ size: "small",
1052
+ class: "!absolute -top-2 -right-2 z-10",
1053
+ onClick: Te((e) => g(t, o, l), ["stop"])
1054
+ }, {
1055
+ icon: U(() => [...c[0] ||= [k("span", { class: "i-lucide-trash-2 h-4 w-4" }, null, -1)]]),
1056
+ _: 1
1057
+ }, 8, ["onClick"])]),
1058
+ default: U(() => [fe(" " + B(V(r)("builder.listRemove")), 1)]),
1059
+ _: 2
1060
+ }, 1024)) : D("", !0)]))), 128)),
1061
+ V(n) && m.value.length > 0 ? (L(), E(V(ke), {
1062
+ key: 0,
1063
+ secondary: "",
1064
+ type: "primary",
1065
+ size: "small",
1066
+ class: "w-full",
1067
+ onClick: (e) => ee(t, o)
1068
+ }, {
1069
+ icon: U(() => [...c[1] ||= [k("span", { class: "i-lucide-plus h-4 w-4" }, null, -1)]]),
1070
+ default: U(() => [fe(" " + B(V(r)("builder.listAdd")), 1)]),
1071
+ _: 1
1072
+ }, 8, ["onClick"])) : D("", !0),
1073
+ m.value.length <= 0 ? (L(), O("div", yr, [A(V(W), { description: V(r)("builder.listDropHere") }, null, 8, ["description"])])) : D("", !0)
1074
+ ]),
1075
+ _: 1
1076
+ }, 8, ["name", "index"])])], 2));
1077
+ }
1078
+ }), xr = { class: "flex flex-col gap-0.5" }, Sr = {
1079
+ key: 0,
1080
+ class: "text-sm font-medium"
1081
+ }, Cr = {
1082
+ key: 1,
1083
+ class: "text-xs text-muted-foreground"
1084
+ }, wr = { class: "w-full grid grid-cols-12 gap-x-4 gap-y-2" }, Tr = {
1085
+ key: 1,
1086
+ class: "col-span-12 flex min-h-[120px] items-center justify-center"
1087
+ }, Er = /* @__PURE__ */ j({
1088
+ __name: "CardContainerPreview",
1089
+ props: {
1090
+ children: {},
1091
+ modelValue: {},
1092
+ label: {},
1093
+ help: {},
1094
+ bordered: { type: Boolean },
1095
+ embedded: { type: Boolean },
1096
+ hoverable: { type: Boolean },
1097
+ size: {}
1098
+ },
1099
+ setup(e) {
1100
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => typeof t.label == "string" && t.label.trim() ? t.label.trim() : ""), o = T(() => typeof t.help == "string" && t.help.trim() ? t.help.trim() : ""), s = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []), c = T(() => t.bordered ?? !0), l = T(() => t.embedded ?? !1), u = T(() => t.hoverable ?? !1), d = T(() => t.size ?? "medium"), f = T(() => !!(a.value || o.value));
1101
+ return (e, t) => (L(), E(V(je), {
1102
+ class: "w-full",
1103
+ bordered: c.value,
1104
+ embedded: l.value,
1105
+ hoverable: u.value,
1106
+ size: d.value,
1107
+ "content-style": "padding: 8px;"
1108
+ }, de({
1109
+ default: U(() => [k("div", wr, [s.value.length ? (L(), E(V(q), {
1110
+ key: 0,
1111
+ schema: s.value,
1112
+ library: V(r),
1113
+ data: V(i)
1114
+ }, null, 8, [
1115
+ "schema",
1116
+ "library",
1117
+ "data"
1118
+ ])) : (L(), O("div", Tr, [A(V(W), { description: V(n)("builder.listDropHere") }, null, 8, ["description"])]))])]),
1119
+ _: 2
1120
+ }, [f.value ? {
1121
+ name: "header",
1122
+ fn: U(() => [k("div", xr, [a.value ? (L(), O("div", Sr, B(a.value), 1)) : D("", !0), o.value ? (L(), O("div", Cr, B(o.value), 1)) : D("", !0)])]),
1123
+ key: "0"
1124
+ } : void 0]), 1032, [
1125
+ "bordered",
1126
+ "embedded",
1127
+ "hoverable",
1128
+ "size"
1129
+ ]));
1130
+ }
1131
+ }), Dr = { class: "w-full" }, Or = {
1132
+ key: 0,
1133
+ class: "mb-2px"
1134
+ }, kr = {
1135
+ key: 0,
1136
+ class: "text-12px font-bold"
1137
+ }, Ar = {
1138
+ key: 1,
1139
+ class: "flex w-full items-center justify-center"
1140
+ }, jr = {
1141
+ key: 1,
1142
+ class: "text-xs text-muted-foreground"
1143
+ }, Mr = /* @__PURE__ */ ce(/* @__PURE__ */ j({
1144
+ __name: "InputGroupContainerPreview",
1145
+ props: {
1146
+ children: {},
1147
+ modelValue: {},
1148
+ label: {},
1149
+ help: {}
1150
+ },
1151
+ setup(e) {
1152
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => typeof t.label == "string" && t.label.trim() ? t.label.trim() : ""), o = T(() => typeof t.help == "string" && t.help.trim() ? t.help.trim() : ""), s = T(() => !!(a.value || o.value)), c = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []);
1153
+ return (e, t) => (L(), O("div", Dr, [
1154
+ s.value ? (L(), O("div", Or, [a.value ? (L(), O("div", kr, B(a.value), 1)) : D("", !0)])) : D("", !0),
1155
+ A(V(Ve), { class: "w-full" }, {
1156
+ default: U(() => [c.value.length ? (L(), E(V(q), {
1157
+ key: 0,
1158
+ schema: c.value,
1159
+ library: V(r),
1160
+ data: V(i)
1161
+ }, null, 8, [
1162
+ "schema",
1163
+ "library",
1164
+ "data"
1165
+ ])) : (L(), O("div", Ar, [A(V(W), { description: V(n)("builder.listDropHere") }, null, 8, ["description"])]))]),
1166
+ _: 1
1167
+ }),
1168
+ o.value ? (L(), O("div", jr, B(o.value), 1)) : D("", !0)
1169
+ ]));
1170
+ }
1171
+ }), [["__scopeId", "data-v-dd9a2838"]]), Nr = { class: "w-full" }, Pr = {
1172
+ key: 1,
1173
+ class: "flex w-full items-center justify-center"
1174
+ }, Fr = /* @__PURE__ */ ce(/* @__PURE__ */ j({
1175
+ __name: "ButtonGroupContainerPreview",
1176
+ props: {
1177
+ children: {},
1178
+ modelValue: {},
1179
+ size: {},
1180
+ vertical: { type: Boolean }
1181
+ },
1182
+ setup(e) {
1183
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []);
1184
+ return (e, o) => (L(), O("div", Nr, [A(V(Ae), {
1185
+ size: t.size,
1186
+ vertical: t.vertical,
1187
+ class: "w-full"
1188
+ }, {
1189
+ default: U(() => [a.value.length ? (L(), E(V(q), {
1190
+ key: 0,
1191
+ schema: a.value,
1192
+ library: V(r),
1193
+ data: V(i)
1194
+ }, null, 8, [
1195
+ "schema",
1196
+ "library",
1197
+ "data"
1198
+ ])) : (L(), O("div", Pr, [A(V(W), { description: V(n)("builder.listDropHere") }, null, 8, ["description"])]))]),
1199
+ _: 1
1200
+ }, 8, ["size", "vertical"])]));
1201
+ }
1202
+ }), [["__scopeId", "data-v-7984905e"]]);
1203
+ //#endregion
1204
+ //#region src/composables/use-badge-sup-position.ts
1205
+ function Ir(e, t) {
1206
+ let n = e, r = 0;
1207
+ for (; n && n !== t;) r += n.offsetLeft, n = n.offsetParent;
1208
+ return n === t ? r : null;
1209
+ }
1210
+ function Lr(e, t) {
1211
+ let n = e, r = 0;
1212
+ for (; n && n !== t;) r += n.offsetTop, n = n.offsetParent;
1213
+ return n === t ? r : null;
1214
+ }
1215
+ function Rr(e) {
1216
+ let t = R(void 0), n = R(void 0), r = R(null), i = () => {
1217
+ let i = e.badgeRef.value;
1218
+ if (!i || !e.enabled.value) {
1219
+ t.value = void 0, n.value = void 0;
1220
+ return;
1221
+ }
1222
+ let a = i.querySelector(e.childSelector);
1223
+ if (!a) {
1224
+ r.value = null, t.value = void 0, n.value = void 0;
1225
+ return;
1226
+ }
1227
+ r.value !== a && (r.value = a);
1228
+ let o, s = Ir(a, i);
1229
+ if (s !== null) o = s + a.offsetWidth;
1230
+ else {
1231
+ let e = i.getBoundingClientRect();
1232
+ o = a.getBoundingClientRect().right - e.left;
1233
+ }
1234
+ let c = Lr(a, i), l = c === null ? a.getBoundingClientRect().top - i.getBoundingClientRect().top : c;
1235
+ t.value = Number.isFinite(o) && o > 0 ? `${o}px` : void 0, n.value = Number.isFinite(l) && l > 0 ? `${l}px` : void 0;
1236
+ }, a = () => ge(i);
1237
+ ln(e.badgeRef, i), ln(r, i);
1238
+ let o = 0, s = () => cancelAnimationFrame(o), c = () => {
1239
+ s();
1240
+ let e = 0, n = 0, r, a = () => {
1241
+ n >= 5 || e++ > 120 || (i(), t.value === r ? n++ : (n = 0, r = t.value), o = requestAnimationFrame(a));
1242
+ };
1243
+ o = requestAnimationFrame(a);
1244
+ };
1245
+ return H([e.badgeRef, e.enabled], ([e, r]) => {
1246
+ e && r ? c() : r || (t.value = void 0, n.value = void 0);
1247
+ }, { immediate: !0 }), H(() => [e.enabled.value, e.refreshTrigger?.value], a, { deep: !0 }), I(s), {
1248
+ supLeft: t,
1249
+ supTop: n,
1250
+ refresh: a
1251
+ };
1252
+ }
1253
+ //#endregion
1254
+ //#region src/composables/use-badge-value.ts
1255
+ function zr(e) {
1256
+ let t = M(ue, null);
1257
+ return { badgeValue: T(() => {
1258
+ let n = e.value;
1259
+ if (typeof n == "string" && n.includes("$")) {
1260
+ try {
1261
+ let e = t?.value ?? {}, r = x(n).evaluate(e);
1262
+ if (r != null && r !== "" && !(typeof r == "number" && Number.isNaN(r))) return r;
1263
+ } catch {}
1264
+ return n;
1265
+ }
1266
+ return n ?? "";
1267
+ }) };
1268
+ }
1269
+ //#endregion
1270
+ //#region src/components/ui/containers/badge/BadgeContainerPreview.vue?vue&type=script&setup=true&lang.ts
1271
+ var Br = { class: "w-full" }, Vr = {
1272
+ key: 0,
1273
+ class: "flex flex-col gap-0.5 mb-1"
1274
+ }, Hr = {
1275
+ key: 0,
1276
+ class: "text-sm font-medium"
1277
+ }, Ur = {
1278
+ key: 1,
1279
+ class: "text-xs text-muted-foreground"
1280
+ }, Wr = { class: "w-full grid grid-cols-12 gap-x-4 gap-y-2" }, Gr = {
1281
+ key: 1,
1282
+ class: "flex w-full min-h-[120px] items-center justify-center rounded-xl border border-dashed border-border/50"
1283
+ }, Kr = /* @__PURE__ */ ce(/* @__PURE__ */ j({
1284
+ __name: "BadgeContainerPreview",
1285
+ props: {
1286
+ children: {},
1287
+ modelValue: {},
1288
+ label: {},
1289
+ help: {},
1290
+ value: {},
1291
+ max: {},
1292
+ dot: { type: Boolean },
1293
+ show: { type: Boolean },
1294
+ showZero: { type: Boolean },
1295
+ processing: { type: Boolean },
1296
+ type: {},
1297
+ color: {},
1298
+ offset: {}
1299
+ },
1300
+ setup(e) {
1301
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => typeof t.label == "string" && t.label.trim() ? t.label.trim() : ""), o = T(() => typeof t.help == "string" && t.help.trim() ? t.help.trim() : ""), s = T(() => !!(a.value || o.value)), c = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []), l = T(() => c.value.length > 0), u = R(null), { supLeft: d, supTop: f } = Rr({
1302
+ badgeRef: u,
1303
+ childSelector: ".formkit-outer",
1304
+ enabled: l,
1305
+ refreshTrigger: c
1306
+ }), p = T(() => d.value || f.value ? {
1307
+ "--badge-sup-left": d.value,
1308
+ "--badge-sup-top": f.value
1309
+ } : void 0), { badgeValue: m } = zr(T(() => typeof t.value == "string" && t.value.trim() ? t.value.trim() : t.value)), h = T(() => (t.show ?? !0) && l.value), ee = T(() => t.dot ?? !1), g = T(() => t.showZero ?? !1), _ = T(() => t.processing ?? !1), te = T(() => typeof t.max == "number" && Number.isFinite(t.max) ? t.max : void 0), ne = T(() => t.type ?? "error"), v = T(() => typeof t.color == "string" && t.color.trim() ? t.color.trim() : void 0), y = T(() => Array.isArray(t.offset) && t.offset.length ? t.offset : void 0);
1310
+ return (e, t) => (L(), O("div", Br, [s.value ? (L(), O("div", Vr, [a.value ? (L(), O("div", Hr, B(a.value), 1)) : D("", !0), o.value ? (L(), O("div", Ur, B(o.value), 1)) : D("", !0)])) : D("", !0), k("div", {
1311
+ ref_key: "badgeWrapRef",
1312
+ ref: u,
1313
+ class: "w-full"
1314
+ }, [l.value ? (L(), E(V(De), {
1315
+ key: 0,
1316
+ value: V(m),
1317
+ max: te.value,
1318
+ dot: ee.value,
1319
+ show: h.value,
1320
+ "show-zero": g.value,
1321
+ processing: _.value,
1322
+ type: ne.value,
1323
+ color: v.value,
1324
+ offset: y.value,
1325
+ style: ve(p.value)
1326
+ }, {
1327
+ default: U(() => [k("div", Wr, [A(V(q), {
1328
+ schema: c.value,
1329
+ library: V(r),
1330
+ data: V(i)
1331
+ }, null, 8, [
1332
+ "schema",
1333
+ "library",
1334
+ "data"
1335
+ ])])]),
1336
+ _: 1
1337
+ }, 8, [
1338
+ "value",
1339
+ "max",
1340
+ "dot",
1341
+ "show",
1342
+ "show-zero",
1343
+ "processing",
1344
+ "type",
1345
+ "color",
1346
+ "offset",
1347
+ "style"
1348
+ ])) : (L(), O("div", Gr, [A(V(W), { description: V(n)("builder.listDropHere") }, null, 8, ["description"])]))], 512)]));
1349
+ }
1350
+ }), [["__scopeId", "data-v-787fe4ed"]]), qr = { class: "w-full" }, Jr = {
1351
+ key: 0,
1352
+ class: "flex flex-col gap-0.5 mb-2"
1353
+ }, Yr = {
1354
+ key: 0,
1355
+ class: "text-sm font-medium"
1356
+ }, Xr = {
1357
+ key: 1,
1358
+ class: "text-xs text-muted-foreground"
1359
+ }, Zr = /* @__PURE__ */ j({
1360
+ __name: "TabsContainerPreview",
1361
+ props: {
1362
+ children: {},
1363
+ modelValue: {},
1364
+ label: {},
1365
+ help: {},
1366
+ type: {},
1367
+ placement: {},
1368
+ size: {},
1369
+ animated: { type: Boolean },
1370
+ closable: { type: Boolean }
1371
+ },
1372
+ setup(e) {
1373
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []), o = (e, t) => {
1374
+ let n = e?.label ?? e?.props?.label;
1375
+ if (typeof n == "string" && n.trim()) return n.trim();
1376
+ let r = e?.name;
1377
+ return typeof r == "string" && r.trim() ? r.trim() : `Tab ${t + 1}`;
1378
+ }, s = T(() => !!(t.closable ?? !1)), c = (e, t) => {
1379
+ let n = l(e)[0]?.name;
1380
+ return typeof n == "string" && n ? n : `__pane_${t}`;
1381
+ };
1382
+ return (e, u) => (L(), O("div", qr, [t.label || t.help ? (L(), O("div", Jr, [t.label ? (L(), O("div", Yr, B(t.label), 1)) : D("", !0), t.help ? (L(), O("div", Xr, B(t.help), 1)) : D("", !0)])) : D("", !0), a.value.length === 0 ? (L(), E(V(W), {
1383
+ key: 1,
1384
+ description: V(n)("builder.listDropHere")
1385
+ }, null, 8, ["description"])) : (L(), E(V(tt), {
1386
+ key: 2,
1387
+ type: t.type || "line",
1388
+ placement: t.placement || "top",
1389
+ size: t.size || "small",
1390
+ animated: t.animated ?? !0
1391
+ }, {
1392
+ default: U(() => [(L(!0), O(w, null, z(a.value, (e, t) => (L(), E(V(et), {
1393
+ key: e?.__key || t,
1394
+ name: e?.__key || t,
1395
+ tab: o(e, t),
1396
+ closable: s.value,
1397
+ "display-directive": "show:lazy"
1398
+ }, {
1399
+ default: U(() => [(L(), O("div", { key: c(e, t) }, [V(l)(e).length > 0 ? (L(), E(V(q), {
1400
+ key: 0,
1401
+ schema: V(l)(e),
1402
+ library: V(r),
1403
+ data: V(i)
1404
+ }, null, 8, [
1405
+ "schema",
1406
+ "library",
1407
+ "data"
1408
+ ])) : (L(), E(V(W), {
1409
+ key: 1,
1410
+ description: V(n)("builder.listDropHere")
1411
+ }, null, 8, ["description"]))]))]),
1412
+ _: 2
1413
+ }, 1032, [
1414
+ "name",
1415
+ "tab",
1416
+ "closable"
1417
+ ]))), 128))]),
1418
+ _: 1
1419
+ }, 8, [
1420
+ "type",
1421
+ "placement",
1422
+ "size",
1423
+ "animated"
1424
+ ]))]));
1425
+ }
1426
+ }), Qr = { class: "w-full" }, $r = {
1427
+ key: 0,
1428
+ class: "flex flex-col gap-0.5 mb-2"
1429
+ }, ei = {
1430
+ key: 0,
1431
+ class: "text-sm font-medium"
1432
+ }, ti = {
1433
+ key: 1,
1434
+ class: "text-xs text-muted-foreground"
1435
+ }, ni = { class: "mt-4" }, ri = /* @__PURE__ */ j({
1436
+ __name: "StepsContainerPreview",
1437
+ props: {
1438
+ children: {},
1439
+ modelValue: {},
1440
+ label: {},
1441
+ help: {},
1442
+ size: {},
1443
+ status: {},
1444
+ vertical: { type: Boolean }
1445
+ },
1446
+ setup(e) {
1447
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []), o = R(0);
1448
+ H(() => a.value.length, (e) => {
1449
+ e <= 0 ? o.value = 0 : o.value > e - 1 && (o.value = e - 1);
1450
+ }, { immediate: !0 });
1451
+ let s = (e, t) => {
1452
+ let n = e?.label ?? e?.props?.label;
1453
+ if (typeof n == "string" && n.trim()) return n.trim();
1454
+ let r = e?.name;
1455
+ return typeof r == "string" && r.trim() ? r.trim() : `Step ${t + 1}`;
1456
+ }, c = (e) => l(e), u = (e) => c(e).some((e) => l(e).length > 0), d = (e, t) => {
1457
+ let n = c(e)[0]?.name;
1458
+ return typeof n == "string" && n ? n : `__pane_${t}`;
1459
+ };
1460
+ return (e, l) => (L(), O("div", Qr, [t.label || t.help ? (L(), O("div", $r, [t.label ? (L(), O("div", ei, B(t.label), 1)) : D("", !0), t.help ? (L(), O("div", ti, B(t.help), 1)) : D("", !0)])) : D("", !0), a.value.length === 0 ? (L(), E(V(W), {
1461
+ key: 1,
1462
+ description: V(n)("builder.listDropHere")
1463
+ }, null, 8, ["description"])) : (L(), O(w, { key: 2 }, [A(V(Qe), {
1464
+ current: o.value + 1,
1465
+ status: t.status || "process",
1466
+ size: t.size || "small",
1467
+ vertical: t.vertical,
1468
+ "onUpdate:current": l[0] ||= (e) => o.value = e - 1
1469
+ }, {
1470
+ default: U(() => [(L(!0), O(w, null, z(a.value, (e, t) => (L(), E(V(Ze), {
1471
+ key: e?.__key || t,
1472
+ title: s(e, t),
1473
+ description: e?.description
1474
+ }, null, 8, ["title", "description"]))), 128))]),
1475
+ _: 1
1476
+ }, 8, [
1477
+ "current",
1478
+ "status",
1479
+ "size",
1480
+ "vertical"
1481
+ ]), k("div", ni, [(L(!0), O(w, null, z(a.value, (e, t) => (L(), O("div", {
1482
+ key: e?.__key || t,
1483
+ style: ve({ display: t === o.value ? "" : "none" })
1484
+ }, [(L(), O("div", { key: d(e, t) }, [u(e) ? (L(), E(V(q), {
1485
+ key: 0,
1486
+ schema: c(e),
1487
+ library: V(r),
1488
+ data: V(i)
1489
+ }, null, 8, [
1490
+ "schema",
1491
+ "library",
1492
+ "data"
1493
+ ])) : (L(), E(V(W), {
1494
+ key: 1,
1495
+ description: V(n)("builder.listDropHere")
1496
+ }, null, 8, ["description"]))]))], 4))), 128))])], 64))]));
1497
+ }
1498
+ }), ii = ["disabled", "aria-expanded"], ai = { class: "min-w-0 flex-1 truncate text-sm font-medium" }, oi = { class: "p-2" }, si = { class: "grid w-full grid-cols-12 gap-x-4 gap-y-2" }, ci = /* @__PURE__ */ j({
1499
+ __name: "CollapseContainerPreview",
1500
+ props: {
1501
+ children: {},
1502
+ modelValue: {},
1503
+ label: {},
1504
+ disabled: { type: Boolean },
1505
+ defaultExpanded: { type: Boolean },
1506
+ disableCollapse: { type: Boolean },
1507
+ bordered: { type: Boolean }
1508
+ },
1509
+ setup(e) {
1510
+ let t = e, { t: n } = b(), r = Q(), i = C(), a = T(() => typeof t.label == "string" && t.label.trim() ? t.label.trim() : n("elements.collapse.name")), o = T(() => t.bordered ?? !0), s = T(() => t.defaultExpanded ?? !0), c = T(() => !!t.disableCollapse), l = R(s.value || c.value);
1511
+ H(c, (e) => {
1512
+ e && (l.value = !0);
1513
+ });
1514
+ function u() {
1515
+ c.value || (l.value = !l.value);
1516
+ }
1517
+ let d = T(() => Array.isArray(t.modelValue) ? t.modelValue : Array.isArray(t.children) ? t.children : []);
1518
+ return (t, n) => (L(), O("div", { class: F(["w-full rounded-md", o.value ? "border border-solid border-input" : ""]) }, [k("button", {
1519
+ type: "button",
1520
+ class: F(["w-full border-0 bg-transparent p-0 text-left text-inherit [font-family:inherit]", c.value ? "cursor-default" : "cursor-pointer"]),
1521
+ disabled: c.value || e.disabled,
1522
+ "aria-expanded": l.value,
1523
+ onClick: u
1524
+ }, [k("div", { class: F(["flex w-full items-center gap-1.5 px-2.5 py-2", o.value && l.value ? "border-b border-b-solid border-input" : ""]) }, [k("span", { class: F(["i-lucide-chevron-down h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform", l.value ? "" : "-rotate-90"]) }, null, 2), k("span", ai, B(a.value), 1)], 2)], 10, ii), we(k("div", oi, [k("div", si, [d.value.length ? (L(), E(V(q), {
1525
+ key: 0,
1526
+ schema: d.value,
1527
+ library: V(r),
1528
+ data: V(i)
1529
+ }, null, 8, [
1530
+ "schema",
1531
+ "library",
1532
+ "data"
1533
+ ])) : D("", !0)])], 512), [[Ce, l.value]])], 2));
1534
+ }
1535
+ });
1536
+ //#endregion
1537
+ //#region src/elements/canvas.ts
1538
+ n();
1539
+ function Y(t) {
1540
+ let n = e(t);
1541
+ if (!n) throw Error(`[formkit-form-builder] 缺少容器规格: ${t}`);
1542
+ return n;
1543
+ }
1544
+ function X(e, t) {
1545
+ if (!e || typeof e != "object") return !1;
1546
+ let n = e;
1547
+ return n.$cmp === t || n.$formkit === t;
1548
+ }
1549
+ function Z(e, t, n) {
1550
+ let r = { ...e };
1551
+ r.$cmp = t, n.primitive === "group" && delete r.$formkit, r.children = Array.isArray(r.children) ? r.children : [];
1552
+ let i = typeof r.props == "object" && r.props ? { ...r.props } : {};
1553
+ return i[n.keyProp] = typeof i[n.keyProp] == "string" && i[n.keyProp] ? i[n.keyProp] : r.__key ?? "", i.modelValue = r.children, n.primitive === "group" && typeof r.name == "string" && r.name && (i.name = r.name), (n.dataShape === "arrayOfObjects" || n.dataShape === "array") && i.showActions === void 0 && (i.showActions = !1), r.props = i, r;
1554
+ }
1555
+ var li = {
1556
+ 1: "!w-[8.33%]",
1557
+ 2: "!w-[16.67%]",
1558
+ 3: "!w-[25%]",
1559
+ 4: "!w-[33.33%]",
1560
+ 5: "!w-[41.67%]",
1561
+ 6: "!w-[50%]",
1562
+ 7: "!w-[58.33%]",
1563
+ 8: "!w-[66.67%]",
1564
+ 9: "!w-[75%]",
1565
+ 10: "!w-[83.33%]",
1566
+ 11: "!w-[91.67%]",
1567
+ 12: "!w-[100%]"
1568
+ }, ui = (e) => (typeof e == "string" ? e : "").replace(/\bcol-span-\d+\b/g, "").replace(/\b!?w-\[[^\]]+\]/g, "").replace(/\bpt-2\b/g, "").replace(/\s+/g, " ").trim();
1569
+ function di(e) {
1570
+ return ae(e);
1571
+ }
1572
+ function fi(e) {
1573
+ let t = `${li[di(e)] ?? "w-[100%]"} ${ui(e.outerClass)}`.trim(), n = {
1574
+ ...e,
1575
+ outerClass: t || void 0
1576
+ };
1577
+ if (e.props && typeof e.props == "object") {
1578
+ let r = { ...e.props }, i = ui(r.outerClass);
1579
+ r.outerClass = t || i, n.props = r;
1580
+ }
1581
+ return n;
1582
+ }
1583
+ function pi(e, t) {
1584
+ return e.map(fi);
1585
+ }
1586
+ function mi(e, t) {
1587
+ let n = t.props?.disabled;
1588
+ return e.map((e) => {
1589
+ let t = S(e);
1590
+ return n ? oe(t) : t;
1591
+ });
1592
+ }
1593
+ var hi = [
1594
+ {
1595
+ id: "list",
1596
+ match: (e) => X(e, "list"),
1597
+ preview: {
1598
+ libraryKey: "list",
1599
+ component: br
1600
+ },
1601
+ normalize: (e) => Z(e, "list", Y("list")),
1602
+ formatPreview: (e, t) => $(e, t, "list", Y("list"))
1603
+ },
1604
+ {
1605
+ id: "card",
1606
+ match: (e) => X(e, "card"),
1607
+ preview: {
1608
+ libraryKey: "card",
1609
+ component: Er
1610
+ },
1611
+ normalize: (e) => Z(e, "card", Y("card")),
1612
+ formatPreview: (e, t) => $(e, t, "card", Y("card"))
1613
+ },
1614
+ {
1615
+ id: "inputGroup",
1616
+ match: (e) => X(e, "inputGroup"),
1617
+ preview: {
1618
+ libraryKey: "inputGroup",
1619
+ component: Mr
1620
+ },
1621
+ normalize: (e) => Z(e, "inputGroup", Y("inputGroup")),
1622
+ formatPreview: (e, t) => $(e, t, "inputGroup", Y("inputGroup"), { transformChildren: pi })
1623
+ },
1624
+ {
1625
+ id: "buttonGroup",
1626
+ match: (e) => X(e, "buttonGroup"),
1627
+ preview: {
1628
+ libraryKey: "buttonGroup",
1629
+ component: Fr
1630
+ },
1631
+ normalize: (e) => Z(e, "buttonGroup", Y("buttonGroup")),
1632
+ formatPreview: (e, t) => $(e, t, "buttonGroup", Y("buttonGroup"), { transformChildren: mi })
1633
+ },
1634
+ {
1635
+ id: "badge",
1636
+ match: (e) => X(e, "badge"),
1637
+ preview: {
1638
+ libraryKey: "badge",
1639
+ component: Kr
1640
+ },
1641
+ normalize: (e) => Z(e, "badge", Y("badge")),
1642
+ formatPreview: (e, t) => $(e, t, "badge", Y("badge"))
1643
+ },
1644
+ {
1645
+ id: "tabs",
1646
+ match: (e) => X(e, "tabs"),
1647
+ preview: {
1648
+ libraryKey: "tabs",
1649
+ component: Zr
1650
+ },
1651
+ normalize: (e) => Z(e, "tabs", Y("tabs")),
1652
+ formatPreview: (e, t) => $(e, t, "tabs", Y("tabs"))
1653
+ },
1654
+ {
1655
+ id: "steps",
1656
+ match: (e) => X(e, "steps"),
1657
+ preview: {
1658
+ libraryKey: "steps",
1659
+ component: ri
1660
+ },
1661
+ normalize: (e) => Z(e, "steps", Y("steps")),
1662
+ formatPreview: (e, t) => $(e, t, "steps", Y("steps"))
1663
+ },
1664
+ {
1665
+ id: "group",
1666
+ match: (e) => X(e, "group"),
1667
+ normalize: (e) => Z(e, "group", Y("group")),
1668
+ formatPreview: (e, t) => $(e, t, "group", Y("group"))
1669
+ },
1670
+ {
1671
+ id: "dataTable",
1672
+ match: (e) => X(e, "dataTable"),
1673
+ preview: {
1674
+ libraryKey: "dataTable",
1675
+ component: J("dataTable")
1676
+ },
1677
+ normalize: (e) => Z(e, "dataTable", Y("dataTable")),
1678
+ formatPreview: (e, t) => $(e, t, "dataTable", Y("dataTable"))
1679
+ },
1680
+ {
1681
+ id: "collapse",
1682
+ match: (e) => X(e, "collapse"),
1683
+ preview: {
1684
+ libraryKey: "collapse",
1685
+ component: ci
1686
+ },
1687
+ normalize: (e) => Z(e, "collapse", Y("collapse")),
1688
+ formatPreview: (e, t) => $(e, t, "collapse", Y("collapse"))
1689
+ }
1690
+ ];
1691
+ function gi(e) {
1692
+ for (let t of hi) {
1693
+ let n = e[t.id];
1694
+ n && (t.canvas = {
1695
+ libraryKey: t.id,
1696
+ component: n
1697
+ });
1698
+ }
1699
+ }
1700
+ function _i(e) {
1701
+ for (let t of hi) if (t.match(e)) return t;
1702
+ return null;
1703
+ }
1704
+ function vi(e) {
1705
+ hi.push(e);
1706
+ }
1707
+ function yi(e) {
1708
+ let t = _i(e);
1709
+ return t?.normalize ? t.normalize(e) : e;
1710
+ }
1711
+ function bi() {
1712
+ let e = { ...mr() };
1713
+ for (let t of hi) t.canvas && (e[t.canvas.libraryKey] = N(t.canvas.component));
1714
+ return e;
1715
+ }
1716
+ function Q() {
1717
+ let e = { ...mr() };
1718
+ for (let t of hi) t.preview && (e[t.preview.libraryKey] = N(t.preview.component));
1719
+ return e;
1720
+ }
1721
+ function xi(e, t) {
1722
+ let n = _i(e);
1723
+ return n?.formatPreview ? n.formatPreview(e, t) : null;
1724
+ }
1725
+ function $(e, t, n, r, i) {
1726
+ let a = e.__key, o = Z(e, n, r), s = l(o).map((e, n) => t.format(e, n)), c = i?.transformChildren ? i.transformChildren(s, o) : s, u = o.if, d = o.props?.name ?? o.name, f = o.props?.[r.keyProp] ?? a ?? "";
1727
+ if (r.dataShape === "none") {
1728
+ let e = {
1729
+ $el: "div",
1730
+ attrs: { class: o.outerClass || "col-span-12" },
1731
+ children: [{
1732
+ $cmp: n,
1733
+ props: {
1734
+ ...o.props,
1735
+ [r.keyProp]: f,
1736
+ modelValue: c
1737
+ }
1738
+ }]
1739
+ };
1740
+ return (typeof u == "string" && u.trim() || typeof u == "boolean") && (e.if = u), e;
1741
+ }
1742
+ if (r.dataShape === "arrayOfObjects" || r.dataShape === "array") {
1743
+ let e = { ...o.props };
1744
+ delete e.modelValue;
1745
+ let t = {
1746
+ $cmp: n,
1747
+ props: {
1748
+ ...e,
1749
+ [r.keyProp]: f,
1750
+ name: d,
1751
+ modelValue: c
1752
+ }
1753
+ }, i = {
1754
+ $el: "div",
1755
+ attrs: { class: o.outerClass || "col-span-12" },
1756
+ children: [t]
1757
+ };
1758
+ return (typeof u == "string" && u.trim() || typeof u == "boolean") && (i.if = u), i;
1759
+ }
1760
+ if (r.dataShape === "objectOfObjects") {
1761
+ let e = l(o).map((e, n) => {
1762
+ let r = l(e).map((e, n) => t.format(e, n)), i = e.label, a = e.name, o = {
1763
+ $formkit: "group",
1764
+ children: r.length ? [{
1765
+ $el: "div",
1766
+ attrs: { class: "grid grid-cols-12 gap-x-4 gap-y-2" },
1767
+ children: r
1768
+ }] : [],
1769
+ outerClass: "!border-0 !p-0 !m-0 ![&>.formkit-wrapper]:border-0 ![&>.formkit-wrapper]:p-0 ![&>.formkit-wrapper]:m-0 ![&>.formkit-wrapper>fieldset]:border-0 ![&>.formkit-wrapper>fieldset]:p-0 ![&>.formkit-wrapper>fieldset]:m-0"
1770
+ }, s = a ?? i;
1771
+ return s && (o.name = s), {
1772
+ ...e,
1773
+ label: i,
1774
+ children: [o],
1775
+ __key: e.__key ?? `${n}`
1776
+ };
1777
+ }), i = {
1778
+ $el: "div",
1779
+ attrs: { class: o.outerClass || "col-span-12" },
1780
+ children: [{
1781
+ $cmp: n,
1782
+ props: {
1783
+ ...o.props,
1784
+ [r.keyProp]: f,
1785
+ modelValue: e
1786
+ }
1787
+ }]
1788
+ };
1789
+ return (typeof u == "string" && u.trim() || typeof u == "boolean") && (i.if = u), i;
1790
+ }
1791
+ if (r.primitive === "group") {
1792
+ let e = o.outerClass, t = {
1793
+ $formkit: "group",
1794
+ children: c.length ? [{
1795
+ $el: "div",
1796
+ attrs: { class: "grid grid-cols-12 gap-x-4 gap-y-2" },
1797
+ children: c
1798
+ }] : []
1799
+ };
1800
+ d && (t.name = d);
1801
+ let n = {
1802
+ $el: "div",
1803
+ attrs: { class: e || "col-span-12" },
1804
+ children: [t]
1805
+ };
1806
+ return (typeof u == "string" && u.trim() || typeof u == "boolean") && (n.if = u), n;
1807
+ }
1808
+ let p = { ...o.props };
1809
+ delete p.name;
1810
+ let m = {
1811
+ $formkit: "group",
1812
+ children: [{
1813
+ $cmp: n,
1814
+ props: {
1815
+ ...p,
1816
+ [r.keyProp]: f,
1817
+ modelValue: c
1818
+ }
1819
+ }],
1820
+ outerClass: "!border-0 !p-0 !m-0 ![&>.formkit-wrapper]:border-0 ![&>.formkit-wrapper]:p-0 ![&>.formkit-wrapper]:m-0 ![&>.formkit-wrapper>fieldset]:border-0 ![&>.formkit-wrapper>fieldset]:p-0 ![&>.formkit-wrapper>fieldset]:m-0"
1821
+ };
1822
+ d && (m.name = d);
1823
+ let h = {
1824
+ $el: "div",
1825
+ attrs: { class: o.outerClass || "col-span-12" },
1826
+ children: [m]
1827
+ };
1828
+ return (typeof u == "string" && u.trim() || typeof u == "boolean") && (h.if = u), h;
1829
+ }
1830
+ //#endregion
1831
+ //#region src/utils/canvas-schema.ts
1832
+ var Si = /* @__PURE__ */ new WeakMap();
1833
+ function Ci(e, t) {
1834
+ if (!e || typeof e != "object") return [t(e)];
1835
+ let n = Si.get(t);
1836
+ n || (n = /* @__PURE__ */ new WeakMap(), Si.set(t, n));
1837
+ let r = Se(e), i = n.get(r);
1838
+ if (i) return i;
1839
+ let a = [t(e)];
1840
+ return n.set(r, a), a;
1841
+ }
1842
+ var wi = (e) => e;
1843
+ function Ti(e) {
1844
+ return Ci(e, wi);
1845
+ }
1846
+ function Ei(e) {
1847
+ if (!e || typeof e != "object") return e;
1848
+ let t = { ...e };
1849
+ if ("if" in t && delete t.if, "__raw__ifExpression" in t && delete t.__raw__ifExpression, "__disabledIf" in t && delete t.__disabledIf, "__readonlyIf" in t && delete t.__readonlyIf, t.props && typeof t.props == "object" && ("__disabledIf" in t.props || "__readonlyIf" in t.props)) {
1850
+ let e = { ...t.props };
1851
+ delete e.__disabledIf, delete e.__readonlyIf, t.props = e;
1852
+ }
1853
+ if (t.attrs && typeof t.attrs == "object" && ("__disabledIf" in t.attrs || "__readonlyIf" in t.attrs)) {
1854
+ let e = { ...t.attrs };
1855
+ delete e.__disabledIf, delete e.__readonlyIf, t.attrs = e;
1856
+ }
1857
+ return "bind" in t && typeof t.bind != "string" && (t.__bind ||= t.bind, delete t.bind), typeof t.$cmp == "string" && typeof t.__key == "string" && (t.props = {
1858
+ ...t.props,
1859
+ __key: t.__key
1860
+ }), Array.isArray(t.children) && (t.children = l(t).map((e) => Ei(e))), t;
1861
+ }
1862
+ //#endregion
1863
+ //#region src/i18n/runtime-locale.ts
1864
+ var Di = {
1865
+ "zh-CN": nn,
1866
+ en: wt
1867
+ }, Oi = {
1868
+ "zh-CN": yt,
1869
+ en: _t
1870
+ };
1871
+ function ki(e) {
1872
+ return Di[e] ?? Di["zh-CN"];
1873
+ }
1874
+ function Ai(e) {
1875
+ return Oi[e] ?? Oi["zh-CN"];
1876
+ }
1877
+ var ji = Symbol("FormBuilderRuntimeLocale");
1878
+ function Mi(e) {
1879
+ let t = M(ji, null);
1880
+ if (t) return t;
1881
+ let { initialLocale: n, availableLocales: r = ["zh-CN", "en"], localeFallback: i = "zh-CN" } = e, a = R(n), o = R(i), s = T(() => r.map((e) => ({
1882
+ label: e === "zh-CN" ? "中文" : e === "en" ? "English" : e,
1883
+ value: e
1884
+ }))), c = T(() => ki(a.value)), l = T(() => Ai(a.value));
1885
+ H(a, (e) => u(e), { immediate: !0 });
1886
+ let d = {
1887
+ locale: a,
1888
+ setLocale: (e) => {
1889
+ r.includes(e) && (a.value = e);
1890
+ },
1891
+ availableLocales: s,
1892
+ localeFallback: o,
1893
+ naiveLocale: c,
1894
+ naiveDateLocale: l
1895
+ };
1896
+ return ye(ji, d), d;
1897
+ }
1898
+ function Ni() {
1899
+ let e = R("zh-CN");
1900
+ return M(ji, {
1901
+ locale: e,
1902
+ setLocale: (t) => {
1903
+ e.value = t, u(t);
1904
+ },
1905
+ availableLocales: T(() => [{
1906
+ label: "中文",
1907
+ value: "zh-CN"
1908
+ }, {
1909
+ label: "English",
1910
+ value: "en"
1911
+ }]),
1912
+ localeFallback: R("zh-CN"),
1913
+ naiveLocale: T(() => ki(e.value)),
1914
+ naiveDateLocale: T(() => Ai(e.value))
1915
+ });
1916
+ }
1917
+ //#endregion
1918
+ //#region src/plugin/register-element.ts
1919
+ function Pi(e) {
1920
+ return (t) => {
1921
+ let n = t;
1922
+ return !n || typeof n != "object" ? !1 : n.$cmp === e || n.$formkit === e;
1923
+ };
1924
+ }
1925
+ function Fi(e) {
1926
+ let { type: t, overwrite: n } = e;
1927
+ if (i(a(e), n), e.component && cr(t, {
1928
+ component: e.component,
1929
+ libraryName: e.schema.target ?? t
1930
+ }), e.category === "container" && (e.canvas || e.preview)) {
1931
+ let n = e.container ?? {
1932
+ dataShape: "none",
1933
+ keyProp: `${t}Key`,
1934
+ primitive: "cmp"
1935
+ };
1936
+ vi({
1937
+ id: t,
1938
+ match: Pi(t),
1939
+ canvas: e.canvas ? {
1940
+ libraryKey: t,
1941
+ component: e.canvas
1942
+ } : void 0,
1943
+ preview: e.preview ? {
1944
+ libraryKey: t,
1945
+ component: e.preview
1946
+ } : void 0,
1947
+ normalize: e.normalize ?? ((e) => Z(e, t, n)),
1948
+ formatPreview: e.formatPreview ?? ((e, r) => $(e, r, t, n))
1949
+ });
1950
+ }
1951
+ }
1952
+ function Ii(e) {
1953
+ if (e?.length) for (let t of e) Fi({
1954
+ ...t,
1955
+ overwrite: !0
1956
+ });
1957
+ }
1958
+ //#endregion
1959
+ //#region src/theme/dark-theme.ts
1960
+ var Li = ht([
1961
+ at,
1962
+ ot,
1963
+ st,
1964
+ ct,
1965
+ lt,
1966
+ ut,
1967
+ dt,
1968
+ ft,
1969
+ pt,
1970
+ mt,
1971
+ un,
1972
+ gt,
1973
+ vt,
1974
+ bt,
1975
+ xt,
1976
+ St,
1977
+ Ct,
1978
+ dn,
1979
+ Tt,
1980
+ Et,
1981
+ Dt,
1982
+ Ot,
1983
+ kt,
1984
+ At,
1985
+ jt,
1986
+ Mt,
1987
+ Nt,
1988
+ Pt,
1989
+ Ft,
1990
+ It,
1991
+ fn,
1992
+ Lt,
1993
+ Rt,
1994
+ zt,
1995
+ Bt,
1996
+ Vt,
1997
+ Ht,
1998
+ Ut,
1999
+ Wt,
2000
+ Gt,
2001
+ Kt,
2002
+ qt,
2003
+ Jt,
2004
+ Yt,
2005
+ Xt,
2006
+ Zt,
2007
+ Qt,
2008
+ $t,
2009
+ en
2010
+ ]), Ri = Symbol("FormBuilderTheme");
2011
+ function zi(e) {
2012
+ let t = sn(), n = cn(), r = T(() => t.value === "dark" || t.value === "auto" && n.value ? Li : null), i = (e) => {
2013
+ t.value = e;
2014
+ };
2015
+ return e && H(e, (e) => {
2016
+ (e === "light" || e === "dark") && i(e);
2017
+ }, { immediate: !0 }), {
2018
+ activeTheme: r,
2019
+ setTheme: i
2020
+ };
2021
+ }
2022
+ function Bi(e) {
2023
+ ye(Ri, e);
2024
+ }
2025
+ function Vi() {
2026
+ return M(Ri, null);
2027
+ }
2028
+ //#endregion
2029
+ //#region src/theme/BuilderThemeScope.vue
2030
+ var Hi = /* @__PURE__ */ j({
2031
+ __name: "BuilderThemeScope",
2032
+ props: {
2033
+ theme: {},
2034
+ locale: {},
2035
+ dateLocale: {},
2036
+ themeOverrides: {},
2037
+ breakpoints: {},
2038
+ clsPrefix: {},
2039
+ inlineThemeDisabled: { type: Boolean },
2040
+ preflightStyleDisabled: { type: Boolean }
2041
+ },
2042
+ setup(e) {
2043
+ let t = e, n = Vi(), r = n ?? zi(() => t.theme);
2044
+ n || Bi(r);
2045
+ let i = T(() => ({
2046
+ themeOverrides: t.themeOverrides,
2047
+ breakpoints: t.breakpoints,
2048
+ clsPrefix: t.clsPrefix,
2049
+ inlineThemeDisabled: t.inlineThemeDisabled,
2050
+ preflightStyleDisabled: t.preflightStyleDisabled
2051
+ }));
2052
+ return (e, a) => V(n) ? be(e.$slots, "default", { key: 1 }) : (L(), E(V(Pe), P({
2053
+ key: 0,
2054
+ abstract: "",
2055
+ theme: V(r).activeTheme.value,
2056
+ locale: t.locale,
2057
+ "date-locale": t.dateLocale
2058
+ }, i.value), {
2059
+ default: U(() => [A(V(Ge), null, {
2060
+ default: U(() => [A(V(We), null, {
2061
+ default: U(() => [be(e.$slots, "default")]),
2062
+ _: 3
2063
+ })]),
2064
+ _: 3
2065
+ })]),
2066
+ _: 3
2067
+ }, 16, [
2068
+ "theme",
2069
+ "locale",
2070
+ "date-locale"
2071
+ ]));
2072
+ }
2073
+ }), Ui = /* @__PURE__ */ j({
2074
+ __name: "FormKitSchemaWrapper",
2075
+ props: {
2076
+ schema: {},
2077
+ data: {},
2078
+ library: {}
2079
+ },
2080
+ setup(e) {
2081
+ let t = q;
2082
+ return (n, r) => (L(), E(V(t), {
2083
+ schema: e.schema,
2084
+ data: e.data,
2085
+ library: e.library
2086
+ }, null, 8, [
2087
+ "schema",
2088
+ "data",
2089
+ "library"
2090
+ ]));
2091
+ }
2092
+ });
2093
+ //#endregion
2094
+ //#region src/utils/format-schema.ts
2095
+ function Wi(e) {
2096
+ let t = /* @__PURE__ */ new WeakMap();
2097
+ return T(() => {
2098
+ if (!e) return [];
2099
+ let n = (e, n) => {
2100
+ let i = e && typeof e == "object" ? Se(e) : null;
2101
+ if (i) {
2102
+ let e = t.get(i)?.get(n);
2103
+ if (e) return e;
2104
+ }
2105
+ let a = r(e, n);
2106
+ if (i) {
2107
+ let e = t.get(i);
2108
+ e || (e = /* @__PURE__ */ new Map(), t.set(i, e)), e.set(n, a);
2109
+ }
2110
+ return a;
2111
+ }, r = (e, t) => {
2112
+ let r = e?.__key, i = xi(yi(e), {
2113
+ key: r,
2114
+ format: n
2115
+ });
2116
+ if (i) return i;
2117
+ let a = e, o = Array.isArray(a.children);
2118
+ if (typeof a.$cmp == "string") {
2119
+ let { bind: i, if: s, ...c } = a, u = a.props?.modelValue, d = o ? l(a).map((e, t) => n(e, t)) : Array.isArray(u) ? u.map((e, t) => n(e, t)) : void 0, f = {
2120
+ ...c,
2121
+ name: e.name || (r ? `field_${r}` : `field_${t}`),
2122
+ id: e.id || (r ? `preview_field_${r}` : `preview_field_${t}`)
2123
+ };
2124
+ return d && (f.children = d), typeof i == "string" && i.trim() && (f.bind = i), (typeof s == "string" && s.trim() || typeof s == "boolean") && (f.if = s), f;
2125
+ }
2126
+ if (typeof a.$el == "string" && o) {
2127
+ let { bind: e, if: t, outerClass: r, ...i } = a, o = l(a).map((e, t) => n(e, t)), s = a.name || a.props?.name, c = {
2128
+ $formkit: "group",
2129
+ children: [{
2130
+ ...i,
2131
+ children: o
2132
+ }],
2133
+ outerClass: `${r || "col-span-12"} !border-0 !p-0 !m-0 ![&>.formkit-wrapper]:border-0 ![&>.formkit-wrapper]:p-0 ![&>.formkit-wrapper]:m-0 ![&>.formkit-wrapper>fieldset]:border-0 ![&>.formkit-wrapper>fieldset]:p-0 ![&>.formkit-wrapper>fieldset]:m-0`
2134
+ };
2135
+ return s && (c.name = s), typeof e == "string" && e.trim() && (c.bind = e), (typeof t == "string" && t.trim() || typeof t == "boolean") && (c.if = t), c;
2136
+ }
2137
+ if (typeof a.$formkit == "string" && o) {
2138
+ let { bind: i, if: o, ...s } = a, c = {
2139
+ ...s,
2140
+ name: e.name || (r ? `field_${r}` : `field_${t}`),
2141
+ id: e.id || (r ? `preview_field_${r}` : `preview_field_${t}`),
2142
+ children: l(a).map((e, t) => n(e, t))
2143
+ };
2144
+ return typeof i == "string" && i.trim() && (c.bind = i), (typeof o == "string" && o.trim() || typeof o == "boolean") && (c.if = o), c;
2145
+ }
2146
+ let { $formkit: s, label: c, validation: u, validationMessages: d, help: f, value: p, expr: m, options: h, outerClass: ee, type: g, props: _, __bind: te, bind: ne, validationVisibility: v, __raw__sectionsSchema: y, if: b, __disabledIf: re, __readonlyIf: ie } = e, x = {
2147
+ $formkit: s,
2148
+ name: e.name || (r ? `field_${r}` : `field_${t}`),
2149
+ id: e.id || (r ? `preview_field_${r}` : `preview_field_${t}`),
2150
+ label: c,
2151
+ validation: u,
2152
+ validationMessages: d,
2153
+ help: f,
2154
+ value: p,
2155
+ options: h,
2156
+ outerClass: ee,
2157
+ type: g,
2158
+ props: _,
2159
+ __bind: te,
2160
+ validationVisibility: v,
2161
+ __raw__sectionsSchema: y,
2162
+ expr: m,
2163
+ __disabledIf: re,
2164
+ __readonlyIf: ie
2165
+ };
2166
+ return typeof ne == "string" && ne.trim() && (x.bind = ne), (typeof b == "string" && b.trim() || typeof b == "boolean") && (x.if = b), x;
2167
+ };
2168
+ return e.value.map((e, t) => n(e, t));
2169
+ });
2170
+ }
2171
+ //#endregion
2172
+ //#region src/utils/structural-share.ts
2173
+ function Gi(e) {
2174
+ if (typeof e != "object" || !e || Array.isArray(e)) return !1;
2175
+ let t = Object.getPrototypeOf(e);
2176
+ return t === Object.prototype || t === null;
2177
+ }
2178
+ function Ki(e) {
2179
+ if (Array.isArray(e)) return e.map((e) => Ki(e));
2180
+ if (Gi(e)) {
2181
+ let t = {};
2182
+ for (let n of Object.keys(e)) t[n] = Ki(e[n]);
2183
+ return t;
2184
+ }
2185
+ return e;
2186
+ }
2187
+ function qi(e, t) {
2188
+ if (Object.is(e, t)) return t;
2189
+ if (Array.isArray(t)) {
2190
+ if (!Array.isArray(e)) return t;
2191
+ let n = e.length !== t.length, r = t.map((t, r) => {
2192
+ let i = r < e.length ? e[r] : void 0, a = qi(i, t);
2193
+ return Object.is(a, i) || (n = !0), a;
2194
+ });
2195
+ return n ? r : e;
2196
+ }
2197
+ if (Gi(t)) {
2198
+ if (!Gi(e)) return t;
2199
+ let n = Object.keys(t), r = Object.keys(e).length !== n.length, i = {};
2200
+ for (let a of n) {
2201
+ let n = e[a], o = qi(n, t[a]);
2202
+ i[a] = o, Object.is(o, n) || (r = !0);
2203
+ }
2204
+ return r ? i : e;
2205
+ }
2206
+ return t;
2207
+ }
2208
+ //#endregion
2209
+ //#region src/expression/runtime.ts
2210
+ function Ji(e) {
2211
+ let t = new Set(e.map((e) => e.name)), n = /* @__PURE__ */ new Map();
2212
+ for (let r of e) n.set(r.name, r.compiled.deps.filter((e) => t.has(e)));
2213
+ let r = /* @__PURE__ */ new Set(), i = [], a = /* @__PURE__ */ new Map(), o = [], s = (e) => {
2214
+ a.set(e, 1), o.push(e);
2215
+ for (let t of n.get(e) ?? []) {
2216
+ let e = a.get(t) ?? 0;
2217
+ if (e === 0) s(t);
2218
+ else if (e === 1) {
2219
+ let e = o.indexOf(t), n = [...o.slice(e), t];
2220
+ i.push(n);
2221
+ for (let t of o.slice(e)) r.add(t);
2222
+ }
2223
+ }
2224
+ o.pop(), a.set(e, 2);
2225
+ };
2226
+ for (let e of t) (a.get(e) ?? 0) === 0 && s(e);
2227
+ return {
2228
+ cyclicNames: r,
2229
+ cycles: i
2230
+ };
2231
+ }
2232
+ function Yi(e, t, n) {
2233
+ let r = [], i = (e) => {
2234
+ let t = n();
2235
+ if (t) return t.find?.(e) ?? t.at?.(e);
2236
+ }, a = () => {
2237
+ for (let e of r) e();
2238
+ r = [];
2239
+ let n = t.value;
2240
+ if (!Array.isArray(n) || !n.length) return;
2241
+ let a = Xi(n);
2242
+ if (!a.length) return;
2243
+ let { cyclicNames: o, cycles: s } = Ji(a);
2244
+ s.length && console.warn("[expr-runtime] 检测到表达式依赖环,已跳过建立监听(字段仍可手动输入):\n" + s.map((e) => ` ${e.join(" → ")}`).join("\n"));
2245
+ let c = (t) => {
2246
+ try {
2247
+ let n = t.compiled.evaluate(e.value), r = i(t.name);
2248
+ r && r.input(n);
2249
+ } catch {}
2250
+ };
2251
+ for (let t of a) {
2252
+ if (o.has(t.name)) continue;
2253
+ let { compiled: n } = t, i = H(n.deps.length ? n.deps.map((t) => () => ie(e.value, t)) : () => t.name, () => c(t), { immediate: !0 });
2254
+ r.push(i);
2255
+ }
2256
+ };
2257
+ ge(a), H(() => t.value, () => ge(a), { deep: !0 }), H(n, () => ge(a)), I(() => {
2258
+ for (let e of r) e();
2259
+ r = [];
2260
+ });
2261
+ }
2262
+ function Xi(e, t = []) {
2263
+ for (let n of e) {
2264
+ if (!n || typeof n != "object") continue;
2265
+ let e = n, r = e.props ?? {}, i = typeof e.name == "string" ? e.name : r.name, a = typeof e.expr == "string" ? e.expr : r.expr;
2266
+ if (typeof i == "string" && i && typeof a == "string" && a) try {
2267
+ let e = x(a);
2268
+ t.push({
2269
+ name: i,
2270
+ compiled: e
2271
+ });
2272
+ } catch {
2273
+ console.warn(`[expr-runtime] 表达式编译失败: ${i} = ${a}`);
2274
+ }
2275
+ Array.isArray(e.children) && Xi(e.children, t), Array.isArray(r.modelValue) && Xi(r.modelValue, t);
2276
+ }
2277
+ return t;
2278
+ }
2279
+ //#endregion
2280
+ //#region src/renderer/FormRenderer.vue?vue&type=script&setup=true&lang.ts
2281
+ var Zi = {
2282
+ key: 0,
2283
+ class: "flex flex-row items-center justify-center gap-1 px-1 pb-3"
2284
+ }, Qi = { class: "flex items-center gap-2 text-sm font-semibold text-foreground" }, $i = { class: "truncate text-[14px]" }, ea = {
2285
+ key: 0,
2286
+ class: "text-[11px] text-muted-foreground ml-2 mt-1"
2287
+ }, ta = /* @__PURE__ */ j({
2288
+ __name: "FormRenderer",
2289
+ props: {
2290
+ definition: {},
2291
+ schema: {},
2292
+ dataStructure: { default: "flat" },
2293
+ modelValue: {},
2294
+ actions: {
2295
+ type: Boolean,
2296
+ default: !1
2297
+ },
2298
+ submitLabel: {},
2299
+ resetLabel: {},
2300
+ submitAttrs: {},
2301
+ resetAttrs: {},
2302
+ actionsJustify: { default: "start" },
2303
+ formClass: { default: "w-full !grid !grid-cols-12 gap-x-4 gap-y-2" },
2304
+ formName: {},
2305
+ labelPosition: {},
2306
+ labelWidth: {},
2307
+ schemaLibrary: {},
2308
+ interactiveContainers: {
2309
+ type: Boolean,
2310
+ default: !0
2311
+ },
2312
+ config: {},
2313
+ theme: {},
2314
+ http: {},
2315
+ disabled: {
2316
+ type: Boolean,
2317
+ default: !1
2318
+ },
2319
+ abstract: { type: Boolean },
2320
+ bordered: { type: Boolean },
2321
+ clsPrefix: {},
2322
+ locale: {},
2323
+ dateLocale: {},
2324
+ namespace: {},
2325
+ rtl: {},
2326
+ tag: {},
2327
+ hljs: {},
2328
+ katex: {},
2329
+ themeOverrides: {},
2330
+ componentOptions: {},
2331
+ icons: {},
2332
+ breakpoints: {},
2333
+ preflightStyleDisabled: { type: Boolean },
2334
+ styleMountTarget: {},
2335
+ inlineThemeDisabled: { type: Boolean },
2336
+ as: {}
2337
+ },
2338
+ emits: ["update:modelValue", "submit"],
2339
+ setup(e, { expose: t, emit: n }) {
2340
+ let r = (e) => {
2341
+ let t = e?.availableLocales ?? ["zh-CN", "en"], n = e?.localeFallback ?? "zh-CN";
2342
+ return t.includes(e?.locale ?? "") ? e.locale : n;
2343
+ }, i = rn, a = e, o = R(a.definition ? a.definition : {
2344
+ version: 2,
2345
+ id: "default-form",
2346
+ name: "form",
2347
+ root: {
2348
+ id: "root",
2349
+ category: "container",
2350
+ type: "group",
2351
+ renderAs: "formkit",
2352
+ dataType: "object",
2353
+ children: []
2354
+ },
2355
+ settings: {
2356
+ labelWidth: 80,
2357
+ labelAlign: "top"
2358
+ }
2359
+ });
2360
+ H(() => a.definition, (e) => {
2361
+ e && (o.value = se(e));
2362
+ }, { immediate: !0 }), p(o);
2363
+ let c = n, l = te();
2364
+ a.config && (Ii(a.config.elements), ne(a.config));
2365
+ let u = a.config ?? l, g = !!a.config, _ = g ? Mi({
2366
+ initialLocale: r(u),
2367
+ availableLocales: u?.availableLocales ?? ["zh-CN", "en"],
2368
+ localeFallback: u?.localeFallback ?? "zh-CN"
2369
+ }) : Ni(), v = T(() => a.locale ?? _.naiveLocale.value), y = T(() => a.dateLocale ?? _.naiveDateLocale.value);
2370
+ H(() => _.locale.value, (e) => {
2371
+ an(e === "en" ? "en" : "zh");
2372
+ }, { immediate: !0 }), g && re({
2373
+ locale: T(() => _.locale.value),
2374
+ localeFallback: T(() => _.localeFallback.value),
2375
+ messages: T(() => u?.messages)
2376
+ });
2377
+ let { t: ie } = b(), x = j({ setup(e, { expose: t }) {
2378
+ return t({ message: tn() }), () => null;
2379
+ } }), ae = R(null), oe = (e) => {
2380
+ try {
2381
+ return structuredClone(e);
2382
+ } catch {
2383
+ return JSON.parse(JSON.stringify(e));
2384
+ }
2385
+ }, S = R({}), ce = s(), C, de = T(() => {
2386
+ let e = Ki(a.definition), t = e && se(e), n = qi(C, t);
2387
+ return C = n, n;
2388
+ }), pe, me = T(() => {
2389
+ let e = Ki(a.schema), t = qi(pe, e);
2390
+ return pe = t, t;
2391
+ }), he = !1, M = T(() => {
2392
+ if (a.definition) {
2393
+ a.schema && Array.isArray(a.schema) && !he && (he = !0, console.warn("[FormRenderer] both \"definition\" and \"schema\" provided — using \"definition\""));
2394
+ let e = a.dataStructure === "nested" ? ce.toOutputSchema : ce.toSchema;
2395
+ try {
2396
+ let t = e(de.value);
2397
+ return Array.isArray(t) ? t : [];
2398
+ } catch (e) {
2399
+ return console.error("[FormRenderer] dslToSchema failed", e), [];
2400
+ }
2401
+ }
2402
+ return Array.isArray(me.value) ? me.value : [];
2403
+ });
2404
+ H(() => a.modelValue, (e) => {
2405
+ e && e !== S.value && (S.value = oe(e));
2406
+ }, {
2407
+ immediate: !0,
2408
+ deep: !0
2409
+ }), H(S, (e) => {
2410
+ c("update:modelValue", e);
2411
+ }, { deep: !0 });
2412
+ let N = le(S), ge = (e) => {
2413
+ if (!e || typeof e != "object") return;
2414
+ let t = {};
2415
+ for (let n of Object.keys(e)) n !== "slots" && (t[n] = e[n]);
2416
+ S.value = t;
2417
+ }, _e = T(() => a.schemaLibrary ? a.schemaLibrary : Q()), I = T(() => {
2418
+ let e = M.value.length === 1 ? M.value[0] : null;
2419
+ return !e || typeof e != "object" || e.$formkit !== "form" || !Array.isArray(e.children) ? null : e;
2420
+ }), xe = T(() => I.value ? I.value.children : M.value), Se = T(() => {
2421
+ let e = I.value?.name;
2422
+ if (typeof e == "string" && e.trim()) return e;
2423
+ let t = a.formName;
2424
+ if (typeof t == "string" && t.trim()) return t;
2425
+ }), Ce = T(() => {
2426
+ let e = I.value?.props?.labelPosition;
2427
+ return e === "left" || e === "top" ? e : a.labelPosition === "left" ? "left" : "top";
2428
+ }), we = T(() => {
2429
+ let e = Number(I.value?.props?.labelWidth);
2430
+ if (Number.isFinite(e)) return e;
2431
+ let t = Number(a.labelWidth);
2432
+ return Number.isFinite(t) ? t : 80;
2433
+ }), Te = T(() => [a.formClass, d(Ce.value)].join(" ")), Ee = Wi(xe), De = T(() => {
2434
+ let e = /* @__PURE__ */ new Set();
2435
+ return Ee.value.map((t, n) => {
2436
+ let r = xe.value[n], i = r?.id ?? r?.props?.id, a = typeof i == "string" && i || typeof r?.__key == "string" && r.__key || typeof t?.name == "string" && t.name || `__idx_${n}`;
2437
+ return e.has(a) && (a = `${a}__${n}`), e.add(a), {
2438
+ key: a,
2439
+ schemaArr: Ti(t)
2440
+ };
2441
+ });
2442
+ }), Oe = T(() => ar(M.value).filter(Jn)), Ae = R(!1);
2443
+ H(Oe, (e) => {
2444
+ let t = e.filter((e) => !$n(e));
2445
+ if (t.length === 0) {
2446
+ Ae.value = !0;
2447
+ return;
2448
+ }
2449
+ Ae.value = !1, er(t).then(() => {
2450
+ Ae.value = !0;
2451
+ });
2452
+ }, { immediate: !0 });
2453
+ let je = T(() => De.value.map((e, t) => ({
2454
+ key: e.key,
2455
+ outerClass: xe.value[t]?.outerClass || "col-span-12"
2456
+ })));
2457
+ ye(ue, S), h(T(() => a.http ?? u?.http)), ye("previewListInteractive", a.interactiveContainers);
2458
+ let Me = R(null);
2459
+ H(() => Me.value?.node, (e, t, n) => {
2460
+ if (!e) return;
2461
+ let r = e.on("input", () => {
2462
+ let t = e.value;
2463
+ if (!t || typeof t != "object") return;
2464
+ let n = {}, r = !1;
2465
+ for (let e of Object.keys(t)) {
2466
+ if (e === "slots") continue;
2467
+ let i = t[e];
2468
+ n[e] = i, S.value[e] !== i && (r = !0);
2469
+ }
2470
+ for (let e of Object.keys(S.value)) if (!(e in n) && e !== "slots") {
2471
+ r = !0;
2472
+ break;
2473
+ }
2474
+ r && (S.value = n);
2475
+ });
2476
+ n(() => e.off(r));
2477
+ }, { immediate: !0 });
2478
+ let Ne = T(() => Me.value?.node ?? null);
2479
+ Yi(S, Ee, () => Ne.value);
2480
+ let Pe = () => Ne.value?.submit?.(), Fe = () => Ne.value?.reset?.(), W = async () => {
2481
+ let e = Ne.value;
2482
+ if (!e) return !0;
2483
+ let t = (e) => {
2484
+ e.store.set(pn({
2485
+ key: "submitted",
2486
+ value: !0,
2487
+ visible: !1
2488
+ }));
2489
+ };
2490
+ return e.walk(t), t(e), await e.settled, e.ledger.value("validating") && await e.ledger.settled("validating"), !e.ledger.value("blocking");
2491
+ }, Ie = R(!1), G = T(() => a.definition?.settings), K = T(() => a.disabled || !!G.value?.disabled), Le = T(() => !!G.value?.readonly), Re = T(() => !K.value && !Le.value), ze = T(() => G.value?.showReset !== !1);
2492
+ function Be(e) {
2493
+ if (!e) return !1;
2494
+ if (e.startsWith("/")) return !0;
2495
+ try {
2496
+ let t = new URL(e);
2497
+ return t.protocol === "http:" || t.protocol === "https:";
2498
+ } catch {
2499
+ return !1;
2500
+ }
2501
+ }
2502
+ function Ve() {
2503
+ let e = G.value, t = e?.successMessage?.trim();
2504
+ t && ae.value?.message.success(t);
2505
+ let n = e?.successRedirect?.trim();
2506
+ n && Be(n) && (window.location.href = n);
2507
+ }
2508
+ let He = async (e) => {
2509
+ let t = { ...e };
2510
+ delete t.slots;
2511
+ let n = a.definition?.settings?.submit;
2512
+ if (typeof n == "string" && n.trim()) {
2513
+ await ee(n, void 0, { form: t }, {
2514
+ id: a.definition?.id,
2515
+ version: a.definition?.version,
2516
+ name: a.definition?.name
2517
+ }, void 0, a.http ?? u?.http ?? m), Ve();
2518
+ return;
2519
+ }
2520
+ c("submit", t, a.definition?.id, a.definition?.version), Ve();
2521
+ };
2522
+ t({
2523
+ submit: Pe,
2524
+ reset: Fe,
2525
+ validate: W,
2526
+ loading: Ie
2527
+ });
2528
+ let Ue = T(() => G.value?.submitText || a.submitLabel || ie("elements.submit.label")), We = T(() => G.value?.resetText || a.resetLabel || ie("elements.reset.label"));
2529
+ return (t, n) => (L(), E(Hi, {
2530
+ theme: a.theme,
2531
+ locale: v.value,
2532
+ "date-locale": y.value,
2533
+ "theme-overrides": e.themeOverrides,
2534
+ breakpoints: e.breakpoints,
2535
+ "cls-prefix": e.clsPrefix,
2536
+ "inline-theme-disabled": e.inlineThemeDisabled,
2537
+ "preflight-style-disabled": e.preflightStyleDisabled
2538
+ }, {
2539
+ default: U(() => [
2540
+ A(V(x), {
2541
+ ref_key: "messageHost",
2542
+ ref: ae
2543
+ }, null, 512),
2544
+ a.schema?.[0]?.name ? (L(), O("div", Zi, [k("div", Qi, [n[0] ||= k("span", { class: "i-lucide-file-text h-5 w-5 shrink-0 text-muted-foreground" }, null, -1), k("span", $i, B(a.schema?.[0]?.name), 1)]), a.schema?.[0]?.props?.version ? (L(), O("span", ea, " v" + B(a.schema?.[0]?.props?.version), 1)) : D("", !0)])) : D("", !0),
2545
+ A(V(i), {
2546
+ ref_key: "formKitRef",
2547
+ ref: Me,
2548
+ type: "form",
2549
+ name: Se.value,
2550
+ actions: !1,
2551
+ disabled: K.value,
2552
+ "model-value": S.value,
2553
+ "onUpdate:modelValue": ge,
2554
+ onSubmit: He,
2555
+ "form-class": Te.value,
2556
+ style: ve(V(f)(we.value))
2557
+ }, {
2558
+ default: U(() => [Ae.value ? (L(!0), O(w, { key: 0 }, z(De.value, (e) => (L(), E(Ui, {
2559
+ key: e.key,
2560
+ schema: e.schemaArr,
2561
+ data: V(N),
2562
+ library: _e.value
2563
+ }, null, 8, [
2564
+ "schema",
2565
+ "data",
2566
+ "library"
2567
+ ]))), 128)) : (L(!0), O(w, { key: 1 }, z(je.value, (e) => (L(), O("div", {
2568
+ key: e.key,
2569
+ class: F([e.outerClass, "h-9 rounded bg-primary/5 animate-pulse"])
2570
+ }, null, 2))), 128)), t.$slots.actions ? be(t.$slots, "actions", {
2571
+ key: 2,
2572
+ submit: Pe,
2573
+ reset: Fe,
2574
+ loading: Ie.value,
2575
+ disabled: K.value
2576
+ }) : e.actions && Re.value ? (L(), O("div", {
2577
+ key: 3,
2578
+ class: F([
2579
+ "col-span-12",
2580
+ "flex",
2581
+ "gap-3",
2582
+ e.actionsJustify === "center" ? "justify-center" : e.actionsJustify === "end" ? "justify-end" : e.actionsJustify === "space-between" ? "justify-between" : "justify-start"
2583
+ ])
2584
+ }, [A(V(ke), P({
2585
+ type: "primary",
2586
+ "attr-type": "submit"
2587
+ }, e.submitAttrs ?? {}, {
2588
+ loading: Ie.value,
2589
+ disabled: K.value
2590
+ }), {
2591
+ default: U(() => [fe(B(Ue.value), 1)]),
2592
+ _: 1
2593
+ }, 16, ["loading", "disabled"]), ze.value ? (L(), E(V(ke), P({ key: 0 }, e.resetAttrs ?? {}, {
2594
+ disabled: K.value,
2595
+ onClick: Fe
2596
+ }), {
2597
+ default: U(() => [fe(B(We.value), 1)]),
2598
+ _: 1
2599
+ }, 16, ["disabled"])) : D("", !0)], 2)) : D("", !0)]),
2600
+ _: 3
2601
+ }, 8, [
2602
+ "name",
2603
+ "disabled",
2604
+ "model-value",
2605
+ "form-class",
2606
+ "style"
2607
+ ])
2608
+ ]),
2609
+ _: 3
2610
+ }, 8, [
2611
+ "theme",
2612
+ "locale",
2613
+ "date-locale",
2614
+ "theme-overrides",
2615
+ "breakpoints",
2616
+ "cls-prefix",
2617
+ "inline-theme-disabled",
2618
+ "preflight-style-disabled"
2619
+ ]));
2620
+ }
2621
+ });
2622
+ //#endregion
2623
+ export { ir as _, Mi as a, Ei as c, gi as d, zr as f, pr as g, dr as h, Ii as i, bi as l, mr as m, Hi as n, Ni as o, Rr as p, Fi as r, Ci as s, ta as t, yi as u, Yn as v, er as y };
2624
+
2625
+ //# sourceMappingURL=FormRenderer-BwykpB3h.js.map