@movk/nuxt 1.1.2 → 1.3.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 (301) hide show
  1. package/.nuxt/movk-ui.css +3 -0
  2. package/README.md +75 -104
  3. package/dist/module.d.mts +59 -1
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +136 -56
  6. package/dist/runtime/components/AutoForm.d.vue.ts +10 -31
  7. package/dist/runtime/components/AutoForm.vue +114 -148
  8. package/dist/runtime/components/AutoForm.vue.d.ts +10 -31
  9. package/dist/runtime/components/ColorChooser.d.vue.ts +20 -17
  10. package/dist/runtime/components/ColorChooser.vue +305 -31
  11. package/dist/runtime/components/ColorChooser.vue.d.ts +20 -17
  12. package/dist/runtime/components/DataTable.d.vue.ts +57 -0
  13. package/dist/runtime/components/DataTable.vue +584 -0
  14. package/dist/runtime/components/DataTable.vue.d.ts +57 -0
  15. package/dist/runtime/components/DatePicker.d.vue.ts +15 -22
  16. package/dist/runtime/components/DatePicker.vue +173 -65
  17. package/dist/runtime/components/DatePicker.vue.d.ts +15 -22
  18. package/dist/runtime/components/MessageBox.d.vue.ts +36 -0
  19. package/dist/runtime/components/MessageBox.vue +113 -0
  20. package/dist/runtime/components/MessageBox.vue.d.ts +36 -0
  21. package/dist/runtime/components/PillGroup.d.vue.ts +33 -0
  22. package/dist/runtime/components/PillGroup.vue +291 -0
  23. package/dist/runtime/components/PillGroup.vue.d.ts +33 -0
  24. package/dist/runtime/components/Popconfirm.d.vue.ts +30 -0
  25. package/dist/runtime/components/Popconfirm.vue +143 -0
  26. package/dist/runtime/components/Popconfirm.vue.d.ts +30 -0
  27. package/dist/runtime/components/SearchForm.d.vue.ts +43 -0
  28. package/dist/runtime/components/SearchForm.vue +274 -0
  29. package/dist/runtime/components/SearchForm.vue.d.ts +43 -0
  30. package/dist/runtime/components/SlideVerify.d.vue.ts +13 -79
  31. package/dist/runtime/components/SlideVerify.vue +117 -90
  32. package/dist/runtime/components/SlideVerify.vue.d.ts +13 -79
  33. package/dist/runtime/components/StarRating.d.vue.ts +25 -82
  34. package/dist/runtime/components/StarRating.vue +128 -99
  35. package/dist/runtime/components/StarRating.vue.d.ts +25 -82
  36. package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +32 -0
  37. package/dist/runtime/components/input/AsPhoneNumberInput.vue +48 -0
  38. package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +32 -0
  39. package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +13 -7
  40. package/dist/runtime/components/input/WithCharacterLimit.vue +27 -15
  41. package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +13 -7
  42. package/dist/runtime/components/input/WithClear.d.vue.ts +11 -5
  43. package/dist/runtime/components/input/WithClear.vue +29 -10
  44. package/dist/runtime/components/input/WithClear.vue.d.ts +11 -5
  45. package/dist/runtime/components/input/WithCopy.d.vue.ts +13 -7
  46. package/dist/runtime/components/input/WithCopy.vue +28 -11
  47. package/dist/runtime/components/input/WithCopy.vue.d.ts +13 -7
  48. package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +33 -0
  49. package/dist/runtime/components/input/WithFloatingLabel.vue +75 -0
  50. package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +33 -0
  51. package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +13 -7
  52. package/dist/runtime/components/input/WithPasswordToggle.vue +27 -10
  53. package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +13 -7
  54. package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +8 -1
  55. package/dist/runtime/components/theme-picker/ThemePicker.vue +37 -28
  56. package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +8 -1
  57. package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +5 -6
  58. package/dist/runtime/components/theme-picker/ThemePickerButton.vue +4 -0
  59. package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +5 -6
  60. package/dist/runtime/composables/index.d.ts +9 -8
  61. package/dist/runtime/composables/index.js +2 -1
  62. package/dist/runtime/composables/useApiFetch.d.ts +23 -15
  63. package/dist/runtime/composables/useApiFetch.js +21 -28
  64. package/dist/runtime/composables/useAutoForm.d.ts +14 -98
  65. package/dist/runtime/composables/useAutoForm.js +55 -161
  66. package/dist/runtime/composables/useClientApiFetch.d.ts +7 -7
  67. package/dist/runtime/composables/useDateFormatter.d.ts +16 -3
  68. package/dist/runtime/composables/useDateFormatter.js +89 -30
  69. package/dist/runtime/composables/useDownloadWithProgress.d.ts +26 -27
  70. package/dist/runtime/composables/useDownloadWithProgress.js +143 -42
  71. package/dist/runtime/composables/useLazyApiFetch.d.ts +19 -0
  72. package/dist/runtime/composables/useLazyApiFetch.js +4 -0
  73. package/dist/runtime/composables/useMessageBox.d.ts +6 -0
  74. package/dist/runtime/composables/useMessageBox.js +16 -0
  75. package/dist/runtime/composables/useTheme.d.ts +21 -8
  76. package/dist/runtime/composables/useTheme.js +109 -86
  77. package/dist/runtime/composables/useUploadWithProgress.d.ts +22 -28
  78. package/dist/runtime/composables/useUploadWithProgress.js +79 -68
  79. package/dist/runtime/domains/api/auth.d.ts +2 -0
  80. package/dist/runtime/domains/api/auth.js +31 -0
  81. package/dist/runtime/domains/api/endpoint-config.d.ts +11 -0
  82. package/dist/runtime/domains/api/endpoint-config.js +17 -0
  83. package/dist/runtime/domains/api/errors.d.ts +2 -0
  84. package/dist/runtime/domains/api/errors.js +10 -0
  85. package/dist/runtime/domains/api/fetch-key.d.ts +20 -0
  86. package/dist/runtime/domains/api/fetch-key.js +23 -0
  87. package/dist/runtime/domains/api/interceptors/error.d.ts +13 -0
  88. package/dist/runtime/domains/api/interceptors/error.js +49 -0
  89. package/dist/runtime/domains/api/interceptors/request.d.ts +12 -0
  90. package/dist/runtime/domains/api/interceptors/request.js +46 -0
  91. package/dist/runtime/domains/api/interceptors/response.d.ts +17 -0
  92. package/dist/runtime/domains/api/interceptors/response.js +27 -0
  93. package/dist/runtime/domains/api/response.d.ts +4 -0
  94. package/dist/runtime/domains/api/response.js +14 -0
  95. package/dist/runtime/domains/api/toast.d.ts +15 -0
  96. package/dist/runtime/domains/api/toast.js +46 -0
  97. package/dist/runtime/domains/api/transfer.d.ts +69 -0
  98. package/dist/runtime/domains/api/transfer.js +81 -0
  99. package/dist/runtime/domains/auto-form/actions.d.ts +2 -0
  100. package/dist/runtime/domains/auto-form/actions.js +4 -0
  101. package/dist/runtime/domains/auto-form/components/Array.d.vue.ts +13 -0
  102. package/dist/runtime/{components/auto-form-renderer/AutoFormRendererArray.vue → domains/auto-form/components/Array.vue} +37 -48
  103. package/dist/runtime/domains/auto-form/components/Array.vue.d.ts +13 -0
  104. package/dist/runtime/domains/auto-form/components/Children.d.vue.ts +11 -0
  105. package/dist/runtime/domains/auto-form/components/Children.vue +50 -0
  106. package/dist/runtime/domains/auto-form/components/Children.vue.d.ts +11 -0
  107. package/dist/runtime/domains/auto-form/components/Field.d.vue.ts +11 -0
  108. package/dist/runtime/domains/auto-form/components/Field.vue +56 -0
  109. package/dist/runtime/domains/auto-form/components/Field.vue.d.ts +11 -0
  110. package/dist/runtime/domains/auto-form/components/Layout.d.vue.ts +11 -0
  111. package/dist/runtime/domains/auto-form/components/Layout.vue +89 -0
  112. package/dist/runtime/domains/auto-form/components/Layout.vue.d.ts +11 -0
  113. package/dist/runtime/domains/auto-form/components/Nested.d.vue.ts +11 -0
  114. package/dist/runtime/domains/auto-form/components/Nested.vue +47 -0
  115. package/dist/runtime/domains/auto-form/components/Nested.vue.d.ts +11 -0
  116. package/dist/runtime/{constants/auto-form.d.ts → domains/auto-form/constants.d.ts} +0 -2
  117. package/dist/runtime/{constants/auto-form.js → domains/auto-form/constants.js} +0 -25
  118. package/dist/runtime/domains/auto-form/controls.d.ts +41 -0
  119. package/dist/runtime/domains/auto-form/controls.js +73 -0
  120. package/dist/runtime/{utils/field-utils.d.ts → domains/auto-form/fields.d.ts} +7 -21
  121. package/dist/runtime/{utils/field-utils.js → domains/auto-form/fields.js} +19 -4
  122. package/dist/runtime/domains/auto-form/metadata.d.ts +22 -0
  123. package/dist/runtime/domains/auto-form/metadata.js +53 -0
  124. package/dist/runtime/domains/auto-form/provider.d.ts +62 -0
  125. package/dist/runtime/{internal/useAutoFormProvider.js → domains/auto-form/provider.js} +6 -3
  126. package/dist/runtime/domains/auto-form/reactive.d.ts +12 -0
  127. package/dist/runtime/{utils/reactive-utils.js → domains/auto-form/reactive.js} +1 -1
  128. package/dist/runtime/domains/auto-form/schema.d.ts +7 -0
  129. package/dist/runtime/{utils/schema-introspector.js → domains/auto-form/schema.js} +12 -10
  130. package/dist/runtime/domains/data-table/columns/constants.d.ts +50 -0
  131. package/dist/runtime/domains/data-table/columns/constants.js +19 -0
  132. package/dist/runtime/domains/data-table/columns/resolve-columns.d.ts +4 -0
  133. package/dist/runtime/domains/data-table/columns/resolve-columns.js +59 -0
  134. package/dist/runtime/domains/data-table/columns/resolve-data-column.d.ts +9 -0
  135. package/dist/runtime/domains/data-table/columns/resolve-data-column.js +164 -0
  136. package/dist/runtime/domains/data-table/columns/resolve-group-column.d.ts +4 -0
  137. package/dist/runtime/domains/data-table/columns/resolve-group-column.js +19 -0
  138. package/dist/runtime/domains/data-table/columns/resolve-special-columns.d.ts +8 -0
  139. package/dist/runtime/domains/data-table/columns/resolve-special-columns.js +232 -0
  140. package/dist/runtime/domains/data-table/columns/style.d.ts +11 -0
  141. package/dist/runtime/domains/data-table/columns/style.js +67 -0
  142. package/dist/runtime/domains/data-table/columns/utils.d.ts +6 -0
  143. package/dist/runtime/domains/data-table/columns/utils.js +16 -0
  144. package/dist/runtime/domains/data-table/components/ActionConfirm.d.vue.ts +10 -0
  145. package/dist/runtime/domains/data-table/components/ActionConfirm.vue +39 -0
  146. package/dist/runtime/domains/data-table/components/ActionConfirm.vue.d.ts +10 -0
  147. package/dist/runtime/domains/data-table/components/ActionsCell.d.vue.ts +11 -0
  148. package/dist/runtime/domains/data-table/components/ActionsCell.vue +91 -0
  149. package/dist/runtime/domains/data-table/components/ActionsCell.vue.d.ts +11 -0
  150. package/dist/runtime/domains/data-table/components/CellTooltip.d.vue.ts +9 -0
  151. package/dist/runtime/domains/data-table/components/CellTooltip.vue +40 -0
  152. package/dist/runtime/domains/data-table/components/CellTooltip.vue.d.ts +9 -0
  153. package/dist/runtime/domains/data-table/components/Pagination.d.vue.ts +26 -0
  154. package/dist/runtime/domains/data-table/components/Pagination.vue +132 -0
  155. package/dist/runtime/domains/data-table/components/Pagination.vue.d.ts +26 -0
  156. package/dist/runtime/domains/data-table/indent.d.ts +8 -0
  157. package/dist/runtime/domains/data-table/indent.js +19 -0
  158. package/dist/runtime/domains/data-table/tree-selection.d.ts +9 -0
  159. package/dist/runtime/domains/data-table/tree-selection.js +76 -0
  160. package/dist/runtime/{utils/theme.d.ts → domains/theme/theme-icons.d.ts} +0 -1
  161. package/dist/runtime/index.css +1 -0
  162. package/dist/runtime/plugins/api.factory.js +28 -171
  163. package/dist/runtime/plugins/theme.js +72 -70
  164. package/dist/runtime/types/api/config.d.ts +127 -0
  165. package/dist/runtime/types/api/fetch.d.ts +50 -0
  166. package/dist/runtime/types/api/index.d.ts +5 -0
  167. package/dist/runtime/types/api/module.d.ts +94 -0
  168. package/dist/runtime/types/api/response.d.ts +62 -0
  169. package/dist/runtime/types/api/transfer.d.ts +32 -0
  170. package/dist/runtime/types/api/transfer.js +0 -0
  171. package/dist/runtime/types/app.config.d.ts +6 -0
  172. package/dist/runtime/types/auto-form/base.d.ts +26 -0
  173. package/dist/runtime/types/auto-form/base.js +0 -0
  174. package/dist/runtime/types/auto-form/component.d.ts +28 -0
  175. package/dist/runtime/types/auto-form/component.js +0 -0
  176. package/dist/runtime/types/auto-form/controls.d.ts +45 -0
  177. package/dist/runtime/types/auto-form/controls.js +0 -0
  178. package/dist/runtime/types/auto-form/fields.d.ts +68 -0
  179. package/dist/runtime/types/auto-form/fields.js +0 -0
  180. package/dist/runtime/types/auto-form/index.d.ts +7 -0
  181. package/dist/runtime/types/auto-form/index.js +0 -0
  182. package/dist/runtime/types/auto-form/search-form.d.ts +84 -0
  183. package/dist/runtime/types/auto-form/search-form.js +0 -0
  184. package/dist/runtime/types/auto-form/slots.d.ts +85 -0
  185. package/dist/runtime/types/auto-form/slots.js +0 -0
  186. package/dist/runtime/types/auto-form/zod-factory.d.ts +127 -0
  187. package/dist/runtime/types/auto-form/zod-factory.js +0 -0
  188. package/dist/runtime/types/components/color-chooser.d.ts +109 -0
  189. package/dist/runtime/types/components/color-chooser.js +0 -0
  190. package/dist/runtime/types/components/date-picker.d.ts +41 -0
  191. package/dist/runtime/types/components/date-picker.js +0 -0
  192. package/dist/runtime/types/components/index.d.ts +8 -0
  193. package/dist/runtime/types/components/index.js +0 -0
  194. package/dist/runtime/types/components/input/as-phone-number-input.d.ts +17 -0
  195. package/dist/runtime/types/components/input/as-phone-number-input.js +0 -0
  196. package/dist/runtime/types/components/input/index.d.ts +6 -0
  197. package/dist/runtime/types/components/input/index.js +0 -0
  198. package/dist/runtime/types/components/input/with-character-limit.d.ts +11 -0
  199. package/dist/runtime/types/components/input/with-character-limit.js +0 -0
  200. package/dist/runtime/types/components/input/with-clear.d.ts +10 -0
  201. package/dist/runtime/types/components/input/with-clear.js +0 -0
  202. package/dist/runtime/types/components/input/with-copy.d.ts +11 -0
  203. package/dist/runtime/types/components/input/with-copy.js +0 -0
  204. package/dist/runtime/types/components/input/with-floating-label.d.ts +12 -0
  205. package/dist/runtime/types/components/input/with-floating-label.js +0 -0
  206. package/dist/runtime/types/components/input/with-password-toggle.d.ts +7 -0
  207. package/dist/runtime/types/components/input/with-password-toggle.js +0 -0
  208. package/dist/runtime/types/components/message-box.d.ts +69 -0
  209. package/dist/runtime/types/components/message-box.js +0 -0
  210. package/dist/runtime/types/components/pill-group.d.ts +103 -0
  211. package/dist/runtime/types/components/pill-group.js +0 -0
  212. package/dist/runtime/types/components/popconfirm.d.ts +74 -0
  213. package/dist/runtime/types/components/popconfirm.js +0 -0
  214. package/dist/runtime/types/components/slide-verify.d.ts +54 -0
  215. package/dist/runtime/types/components/slide-verify.js +0 -0
  216. package/dist/runtime/types/components/star-rating.d.ts +55 -0
  217. package/dist/runtime/types/components/star-rating.js +0 -0
  218. package/dist/runtime/types/data-table/columns.d.ts +236 -0
  219. package/dist/runtime/types/data-table/columns.js +6 -0
  220. package/dist/runtime/types/data-table/component.d.ts +190 -0
  221. package/dist/runtime/types/data-table/component.js +0 -0
  222. package/dist/runtime/types/data-table/contexts.d.ts +44 -0
  223. package/dist/runtime/types/data-table/contexts.js +0 -0
  224. package/dist/runtime/types/data-table/index.d.ts +6 -0
  225. package/dist/runtime/types/data-table/index.js +1 -0
  226. package/dist/runtime/types/data-table/pagination.d.ts +87 -0
  227. package/dist/runtime/types/data-table/pagination.js +0 -0
  228. package/dist/runtime/types/index.d.ts +6 -5
  229. package/dist/runtime/types/index.js +5 -5
  230. package/dist/runtime/types/shared.d.ts +5 -0
  231. package/dist/runtime/types/shared.js +0 -0
  232. package/dist/runtime/types/zod.d.ts +19 -17
  233. package/dist/runtime/utils/extend-theme.d.ts +19 -0
  234. package/dist/runtime/utils/extend-theme.js +44 -0
  235. package/dist/runtime/utils/form-control.d.ts +33 -0
  236. package/dist/runtime/utils/form-control.js +54 -0
  237. package/dist/runtime/utils/meta.d.ts +4 -0
  238. package/dist/runtime/utils/meta.js +14 -0
  239. package/dist/runtime/utils/theme-defaults.d.ts +27 -0
  240. package/dist/runtime/utils/theme-defaults.js +28 -0
  241. package/dist/runtime/utils/tv.d.ts +1 -0
  242. package/dist/runtime/utils/tv.js +4 -0
  243. package/dist/runtime/vue/composables/useSiteConfig.d.ts +13 -0
  244. package/dist/runtime/vue/composables/useSiteConfig.js +11 -0
  245. package/dist/runtime/vue/plugins/theme.d.ts +6 -0
  246. package/dist/runtime/vue/plugins/theme.js +14 -0
  247. package/dist/runtime/vue/stubs/base.d.ts +2 -0
  248. package/dist/runtime/vue/stubs/base.js +2 -0
  249. package/dist/runtime/vue/stubs/inertia.d.ts +2 -0
  250. package/dist/runtime/vue/stubs/inertia.js +2 -0
  251. package/dist/runtime/vue/stubs/movk-extra.d.ts +2 -0
  252. package/dist/runtime/vue/stubs/movk-extra.js +2 -0
  253. package/dist/runtime/vue/stubs/none.d.ts +2 -0
  254. package/dist/runtime/vue/stubs/none.js +2 -0
  255. package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
  256. package/dist/runtime/vue/stubs/vue-router.js +2 -0
  257. package/dist/shared/nuxt.DfBEyjld.mjs +667 -0
  258. package/dist/types.d.mts +2 -6
  259. package/dist/unplugin.d.mts +28 -0
  260. package/dist/unplugin.mjs +292 -0
  261. package/dist/vite.d.mts +12 -0
  262. package/dist/vite.mjs +20 -0
  263. package/package.json +82 -42
  264. package/vue-plugin.d.ts +5 -0
  265. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +0 -20
  266. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +0 -20
  267. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +0 -20
  268. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue +0 -55
  269. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +0 -20
  270. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +0 -20
  271. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue +0 -125
  272. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +0 -20
  273. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +0 -20
  274. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue +0 -105
  275. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +0 -20
  276. package/dist/runtime/composables/useApiAuth.d.ts +0 -47
  277. package/dist/runtime/composables/useApiAuth.js +0 -66
  278. package/dist/runtime/internal/useAutoFormProvider.d.ts +0 -50
  279. package/dist/runtime/schemas/api.d.ts +0 -590
  280. package/dist/runtime/schemas/api.js +0 -228
  281. package/dist/runtime/server/api/_movk/session.post.d.ts +0 -10
  282. package/dist/runtime/server/api/_movk/session.post.js +0 -18
  283. package/dist/runtime/style.css +0 -1
  284. package/dist/runtime/types/api.d.ts +0 -218
  285. package/dist/runtime/types/auth.d.ts +0 -34
  286. package/dist/runtime/types/auto-form-renderer.d.ts +0 -22
  287. package/dist/runtime/types/auto-form.d.ts +0 -548
  288. package/dist/runtime/types/components.d.ts +0 -43
  289. package/dist/runtime/types/module.d.ts +0 -39
  290. package/dist/runtime/utils/api-utils.d.ts +0 -79
  291. package/dist/runtime/utils/api-utils.js +0 -127
  292. package/dist/runtime/utils/auto-form.d.ts +0 -3
  293. package/dist/runtime/utils/auto-form.js +0 -18
  294. package/dist/runtime/utils/reactive-utils.d.ts +0 -30
  295. package/dist/runtime/utils/schema-introspector.d.ts +0 -13
  296. /package/dist/runtime/{utils/theme.js → domains/theme/theme-icons.js} +0 -0
  297. /package/dist/runtime/types/{api.js → api/config.js} +0 -0
  298. /package/dist/runtime/types/{auto-form-renderer.js → api/fetch.js} +0 -0
  299. /package/dist/runtime/types/{auto-form.js → api/index.js} +0 -0
  300. /package/dist/runtime/types/{module.js → api/module.js} +0 -0
  301. /package/dist/runtime/types/{components.js → api/response.js} +0 -0
@@ -0,0 +1,3 @@
1
+ @source "/Users/yixuanmiao/MOVK/movk-nuxt/**/*";
2
+ @source "./movk-ui";
3
+ @source inline("{,sm:,md:,lg:,xl:}grid-cols-{1,2,3,4,5,6,7,8,9,10,11,12}");
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Movk Nuxt](https://nuxt.mhaibaraai.cn/og-image.png)](https://nuxt.mhaibaraai.cn/)
2
2
 
3
- > `@movk/nuxt` 是一个为 Nuxt 4 设计的模块化工程套件,提供 Schema 驱动的自动表单生成、API 集成系统、独立 UI 组件和通用工具函数。
3
+ > 构建在 Nuxt UI 之上的 UI 工程套件 —— Schema 驱动的 AutoForm(Zod v4)、功能完备的 DataTable、独立组件与 Composables。在 Nuxt 4 中获得含认证与进度追踪的 API 集成在内的完整能力;其 UI、表单、表格与主题亦可经 Vite 插件直接用于纯 Vue + Vite 项目(API 集成域仅 Nuxt)。
4
4
 
5
5
  [![Install MCP in Cursor](https://nuxt.mhaibaraai.cn/mcp/badge.svg)](https://nuxt.mhaibaraai.cn/mcp/deeplink)
6
6
  [![Install MCP in VS Code](https://nuxt.mhaibaraai.cn/mcp/badge.svg?ide=vscode)](https://nuxt.mhaibaraai.cn/mcp/deeplink?ide=vscode)
@@ -16,13 +16,15 @@
16
16
 
17
17
  ## ✨ 特性
18
18
 
19
- - **Schema 驱动** - 基于 Zod v4 的声明式表单定义,一份 Schema 同时定义数据结构、验证规则和 UI 配置。
20
- - **自动化系统** - AutoForm 通过 Schema 自动生成完整表单界面,支持 15+ 种控件类型。
21
- - **API 集成** - 内置 useApiFetch、useApiAuth、useUploadWithProgress、useDownloadWithProgress,提供多端点支持、自动认证、业务状态码检查、Toast 提示和进度监控。
22
- - **模块化设计** - 采用分层架构,按需使用 UI 组件、工具函数或全套自动化系统。
23
- - **独立组件库** - 内置 DatePicker、StarRating、WithCopy 10+ 个通用 UI 组件。
24
- - **类型安全** - 完整的 TypeScript 类型推断,从 Schema 到表单数据。
25
- - **可扩展** - 支持自定义控件、布局系统、条件渲染等高级特性。
19
+ Movk Nuxt 是构建在 Nuxt UI 之上的 UI 工程套件,提供两种使用方式:在 **Nuxt 4** 中享受含 API 集成的完整能力,或经 **Vite 插件**在纯 **Vue + Vite** 项目中使用其 UI 层。各能力的可用框架如下:
20
+
21
+ - **AutoForm Schema 驱动表单**(✅ Nuxt | ✅ Vue + Vite)- 基于 Zod v4 的「定义即渲染」,一份 Schema 同时声明数据结构、验证规则和 UI 配置,自动生成完整表单界面。
22
+ - **DataTable 数据表格**(✅ Nuxt | ✅ Vue + Vite)- 基于 TanStack Table 封装,覆盖数据列、特殊列(选择/索引/展开/操作)、树形数据、行交互、外观定制、分页与加载更多。
23
+ - **独立组件库**(✅ Nuxt ✅ Vue + Vite)- DatePicker、StarRating、PillGroup、SearchForm、WithCopy、ThemePicker 等通用 UI 组件,无需依赖 AutoForm 即可独立使用。
24
+ - **主题与 Composables**(✅ Nuxt Vue + Vite)- useTheme(主题读写与导出)、useMessageBox(命令式弹窗)、useDateFormatter(国际化日期)等非服务端组合式函数。
25
+ - **API 集成系统**(✅ Nuxt | ❌ Vue + Vite)- useApiFetch / useLazyApiFetch / useClientApiFetch 三件套 + useUploadWithProgress / useDownloadWithProgress,提供多端点、自动认证、业务状态码检查、数据解包、Toast 提示和进度监控;**依赖 Nuxt 服务端运行时,仅 Nuxt 模式可用**。
26
+ - **类型安全** - 完整的 TypeScript 类型推断,从 Schema 到表单数据,组件 prop 回调与事件处理类型可索引访问派生。
27
+ - **AI 友好** - 内置 MCP Server 与 llms.txt,组件、composable、文档可被 AI 智能体检索。
26
28
 
27
29
  ## 🚀 快速开始
28
30
 
@@ -39,27 +41,57 @@ yarn add @movk/nuxt @nuxt/ui zod
39
41
  npm install @movk/nuxt @nuxt/ui zod
40
42
  ```
41
43
 
42
- ### 配置
44
+ ### Nuxt
43
45
 
44
46
  在 `nuxt.config.ts` 中注册模块:
45
47
 
46
48
  ```ts
47
49
  export default defineNuxtConfig({
48
- modules: ['@movk/nuxt']
50
+ modules: ['@movk/nuxt'],
51
+ movk: {
52
+ prefix: 'M' // 组件前缀,默认为 'M'
53
+ }
49
54
  })
50
55
  ```
51
56
 
52
- 可选配置项:
57
+ ### Vue / Vite
58
+
59
+ 在纯 Vue + Vite 项目中,经 Vite 插件 + Vue 插件使用 UI 层(组件、主题、AutoForm、DataTable、非服务端 Composables)。**API 集成域在此模式下不可用。**
60
+
61
+ ```bash
62
+ pnpm add @movk/nuxt @nuxt/ui zod tailwindcss vue-router
63
+ ```
53
64
 
54
65
  ```ts
55
- export default defineNuxtConfig({
56
- modules: ['@movk/nuxt'],
57
- movk: {
58
- prefix: 'M' // 组件前缀,默认为 'M'
59
- }
66
+ // vite.config.ts
67
+ import { defineConfig } from 'vite'
68
+ import vue from '@vitejs/plugin-vue'
69
+ import movk from '@movk/nuxt/vite'
70
+
71
+ export default defineConfig({
72
+ plugins: [vue(), movk()]
60
73
  })
61
74
  ```
62
75
 
76
+ ```ts
77
+ // src/main.ts
78
+ import './assets/css/main.css'
79
+ import { createApp } from 'vue'
80
+ import { createRouter, createWebHistory } from 'vue-router'
81
+ import movk from '@movk/nuxt/vue-plugin'
82
+ import App from './App.vue'
83
+
84
+ const router = createRouter({ routes: [], history: createWebHistory() })
85
+ createApp(App).use(router).use(movk).mount('#app')
86
+ ```
87
+
88
+ ```css
89
+ /* src/assets/css/main.css —— 已串联 Tailwind CSS + Nuxt UI + Movk 主题 */
90
+ @import "@movk/nuxt";
91
+ ```
92
+
93
+ 根组件用 `<UApp>` 包裹(Toast / Tooltip / useMessageBox 必需)。详见[在线文档 · Vue / Vite](https://nuxt.mhaibaraai.cn/docs/getting-started/vue)。
94
+
63
95
  ### 基础示例
64
96
 
65
97
  创建一个简单的用户注册表单:
@@ -67,7 +99,7 @@ export default defineNuxtConfig({
67
99
  ```vue
68
100
  <script setup lang="ts">
69
101
  import type { FormSubmitEvent } from '@nuxt/ui'
70
- import type { z } from 'zod/v4'
102
+ import type { z } from 'zod'
71
103
 
72
104
  const { afz } = useAutoForm()
73
105
 
@@ -97,6 +129,27 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
97
129
 
98
130
  ## 📦 核心功能
99
131
 
132
+ ### 独立组件
133
+
134
+ 可直接使用的高质量 UI 组件,涵盖输入增强、表单、反馈与高级交互四类。
135
+
136
+ ### DataTable - 功能完备的数据表格
137
+
138
+ 基于 TanStack Table 封装的 `MDataTable`,以声明式列配置驱动:
139
+
140
+ ```ts
141
+ import type { DataTableColumn } from '@movk/nuxt'
142
+
143
+ const columns: DataTableColumn<Person>[] = [
144
+ { type: 'selection' }, // 特殊列:行选择
145
+ { accessorKey: 'name', header: '姓名', sortable: true, pinable: true },
146
+ { accessorKey: 'salary', header: '薪资', sortable: true, truncate: true },
147
+ { type: 'actions', actions: row => [{ label: '编辑', onClick: () => edit(row) }] }
148
+ ]
149
+ ```
150
+
151
+ 支持数据列(排序/列固定/列宽拖拽/截断+Tooltip/可见性)、特殊列(选择/索引/展开/操作/分组)、树形数据与级联选择、行交互(点击/展开/右键菜单)、外观定制、客户端/服务端分页与加载更多。
152
+
100
153
  ### AutoForm - Schema 驱动的表单系统
101
154
 
102
155
  基于 Zod Schema 的"定义即渲染"表单解决方案:
@@ -127,56 +180,6 @@ const schema = afz.object({
127
180
  })
128
181
  ```
129
182
 
130
- **支持的控件类型**:
131
- - 基础输入: `UInput`、`UInputNumber`、`UCheckbox`、`USwitch`
132
- - 选择器: `USelect`、`USelectMenu`、`URadioGroup`、`UCheckboxGroup`
133
- - 高级输入: `UTextarea`、`USlider`、`UPinInput`、`UInputTags`
134
- - 自定义组件: `DatePicker`、`ColorChooser`、`StarRating`
135
- - 文件上传: `UFileUpload`
136
- - 增强输入: `WithCopy`、`WithClear`、`WithPasswordToggle`、`WithCharacterLimit`
137
-
138
- ### 独立组件
139
-
140
- 无需依赖 AutoForm,可直接使用的高质量 UI 组件:
141
-
142
- #### 日期选择器
143
-
144
- ```vue
145
- <template>
146
- <MDatePicker v-model="selectedDate" label-format="iso" />
147
- </template>
148
- ```
149
-
150
- #### 输入增强组件
151
-
152
- ```vue
153
- <template>
154
- <!-- 带复制功能 -->
155
- <MWithCopy v-model="apiKey" />
156
-
157
- <!-- 带清除按钮 -->
158
- <MWithClear v-model="searchText" />
159
-
160
- <!-- 密码显隐切换 -->
161
- <MWithPasswordToggle v-model="password" />
162
-
163
- <!-- 字符数限制 -->
164
- <MWithCharacterLimit v-model="bio" :max-length="200" />
165
- </template>
166
- ```
167
-
168
- #### 交互组件
169
-
170
- ```vue
171
- <template>
172
- <!-- 星级评分 -->
173
- <MStarRating v-model="rating" :max="5" />
174
-
175
- <!-- 颜色选择器 -->
176
- <MColorChooser v-model="color" />
177
- </template>
178
- ```
179
-
180
183
  ### Composables
181
184
 
182
185
  #### useDateFormatter
@@ -237,29 +240,6 @@ const { data } = await useApiFetch<User>('/users', {
237
240
  const { data } = await useApiFetch('/users', { endpoint: 'v2' })
238
241
  ```
239
242
 
240
- #### useApiAuth
241
-
242
- 与 nuxt-auth-utils 集成的认证管理:
243
-
244
- ```ts
245
- const { login, clear, loggedIn, user } = useApiAuth()
246
-
247
- // 登录
248
- await login({
249
- loginPath: '/auth/login',
250
- credentials: { username: 'admin', password: '123456' },
251
- userInfoPath: '/auth/me' // 可选,登录后获取用户信息
252
- })
253
-
254
- // 登出
255
- await clear()
256
-
257
- // 响应式状态
258
- if (loggedIn.value) {
259
- console.log('当前用户:', user.value)
260
- }
261
- ```
262
-
263
243
  #### useUploadWithProgress
264
244
 
265
245
  带进度监控的文件上传:
@@ -292,11 +272,11 @@ await download('/api/export/report', {
292
272
 
293
273
  Movk Nuxt 采用清晰的分层架构:
294
274
 
295
- - **Core Systems** - AutoForm(已发布)
296
- - **API System** - useApiFetch、useApiAuth,提供完整的 API 请求和认证方案
297
- - **Standalone Components** - DatePicker、StarRating、WithCopy 等独立 UI 组件
298
- - **Composables** - useDateFormatter、useAutoForm 等通用组合式函数
299
- - **Foundation** - 基于 [Nuxt UI](https://ui.nuxt.com)、[Zod v4](https://zod.dev)、[VueUse](https://vueuse.org)
275
+ - **Core Systems** - AutoForm(Schema 驱动表单)、DataTable(数据表格)
276
+ - **API System** - useApiFetch / useLazyApiFetch / useClientApiFetchuseUploadWithProgress、useDownloadWithProgress,提供完整的 API 请求方案
277
+ - **Standalone Components** - DatePicker、StarRating、PillGroup、SearchForm、WithCopy、ThemePicker 等独立 UI 组件
278
+ - **Composables** - useDateFormatter、useTheme、useMessageBox、useAutoForm 等通用组合式函数
279
+ - **Foundation** - 基于 [Nuxt UI](https://ui.nuxt.com)、[Zod v4](https://zod.dev)、[VueUse](https://vueuse.org)、[TanStack Table](https://tanstack.com/table)
300
280
 
301
281
  ## ⚡ 技术栈
302
282
 
@@ -307,15 +287,6 @@ Movk Nuxt 采用清晰的分层架构:
307
287
  - [VueUse](https://vueuse.org/) - Collection of Vue Composition Utilities
308
288
  - [Vitest](https://vitest.dev/) - Next Generation Testing Framework
309
289
 
310
- ## 🗺️ 开发路线图
311
-
312
- - ✅ **AutoForm** - Schema 驱动的表单系统(已发布)
313
- - ✅ **API System** - API 请求封装和认证管理(已发布)
314
- - useApiFetch、useClientApiFetch - API 请求
315
- - useApiAuth - 认证管理
316
- - useUploadWithProgress、useDownloadWithProgress - 进度监控
317
- - ✅ **独立组件库** - DatePicker、StarRating、WithCopy 等组件(已发布)
318
-
319
290
  ## 📄 许可证
320
291
 
321
292
  [MIT](./LICENSE) License © 2024-PRESENT [YiXuan](https://github.com/mhaibaraai)
package/dist/module.d.mts CHANGED
@@ -1,5 +1,63 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { MovkApiFullConfig } from '../dist/runtime/types/api/module.js';
3
+ import { ModuleOptions as ModuleOptions$1 } from '@nuxt/ui';
1
4
  export * from '../dist/runtime/types/index.js';
2
5
 
3
- declare const _default: any;
6
+ interface ThemeFontConfig {
7
+ /** 字体名称 */
8
+ name: string;
9
+ /**
10
+ * 字体 CSS 文件的完整 URL;未提供时运行时回退到 Google Fonts URL
11
+ * @example 'https://cdn.mhaibaraai.cn/fonts/alibaba-puhuiti.css'
12
+ */
13
+ href?: string;
14
+ }
15
+ type StrictUiTheme = {
16
+ [K in keyof NonNullable<ModuleOptions$1['theme']>]?: Exclude<NonNullable<ModuleOptions$1['theme']>[K], null>;
17
+ };
18
+ interface ModuleOptions {
19
+ /**
20
+ * 组件前缀
21
+ * @defaultValue 'M'
22
+ */
23
+ prefix?: string;
24
+ /** API 模块配置 */
25
+ api?: MovkApiFullConfig;
26
+ /** 主题模块配置 */
27
+ theme?: {
28
+ /**
29
+ * 是否启用主题模块(appConfig 默认值、theme plugin、ThemePicker 组件)
30
+ * @defaultValue true
31
+ */
32
+ enabled?: boolean;
33
+ /**
34
+ * Define the color aliases available for components
35
+ * @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
36
+ * @see https://ui.nuxt.com/docs/getting-started/installation/nuxt#themecolors
37
+ */
38
+ colors?: StrictUiTheme['colors'];
39
+ /**
40
+ * The default variants to use for components
41
+ * @defaultValue 'nuxt.options.ui.theme.defaultVariants'
42
+ * @see https://ui.nuxt.com/docs/getting-started/installation/nuxt#themedefaultvariants
43
+ */
44
+ defaultVariants?: StrictUiTheme['defaultVariants'];
45
+ /**
46
+ * Prefix for Tailwind CSS utility classes
47
+ * @defaultValue 'nuxt.options.ui.theme.prefix'
48
+ * @see https://ui.nuxt.com/docs/getting-started/installation/nuxt#themeprefix
49
+ * @example 'tw'
50
+ */
51
+ prefix?: StrictUiTheme['prefix'];
52
+ /** ThemePicker 字体可选项;提供时完整替换内置列表 */
53
+ fonts?: ThemeFontConfig[];
54
+ /** ThemePicker 圆角可选项 */
55
+ radiuses?: number[];
56
+ /** ThemePicker neutral 颜色可选项 */
57
+ neutralColors?: string[];
58
+ };
59
+ }
60
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
4
61
 
5
62
  export { _default as default };
63
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@movk/nuxt",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "configKey": "movk",
5
5
  "compatibility": {
6
- "nuxt": ">=4.2.0"
6
+ "nuxt": ">=4.4.2"
7
7
  },
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -1,97 +1,177 @@
1
- import { addPlugin, defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addServerHandler } from '@nuxt/kit';
2
- import { apiToastConfigSchema, apiAuthConfigSchema, apiResponseConfigSchema } from '../dist/runtime/schemas/api.js';
3
- import defu from 'defu';
1
+ import { addPlugin, defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
+ import defu, { defu as defu$1 } from 'defu';
3
+ import { a as addTemplates } from './shared/nuxt.DfBEyjld.mjs';
4
+ import { getPackageJsonMetadata } from '../dist/runtime/utils/meta.js';
5
+ import { kebabCase } from 'scule';
6
+ import { updateSiteConfig } from 'nuxt-site-config/kit';
7
+ import { getDefaultConfig } from '../dist/runtime/utils/theme-defaults.js';
4
8
  export * from '../dist/runtime/types/index.js';
9
+ import 'node:url';
5
10
 
6
11
  const name = "@movk/nuxt";
7
- const version = "1.1.2";
12
+ const version = "1.3.0";
8
13
 
9
- function setupTheme(nuxt, resolve) {
10
- nuxt.options.appConfig.theme = defu(nuxt.options.appConfig.theme || {}, {
11
- radius: 0.25,
12
- blackAsPrimary: false,
13
- font: "Public Sans",
14
- icons: "lucide"
15
- });
16
- nuxt.options.app.head.meta = nuxt.options.app.head.meta || [];
17
- nuxt.options.app.head.meta.push(
18
- { charset: "utf-8" },
19
- { name: "viewport", content: "width=device-width, initial-scale=1" }
20
- );
21
- addPlugin({
22
- src: resolve("runtime/plugins/theme"),
23
- mode: "all"
24
- });
25
- }
26
-
27
- const DEFAULT_ENDPOINT = { default: { baseURL: "/api" } };
28
- function splitEndpointConfigs(endpoints) {
14
+ function getDefaultApiConfig(apiConfig) {
29
15
  const publicEndpoints = {};
30
16
  const privateEndpoints = {};
31
- if (!endpoints) return { publicEndpoints, privateEndpoints };
32
- for (const [name2, { headers, ...publicConfig }] of Object.entries(endpoints)) {
33
- publicEndpoints[name2] = publicConfig;
34
- if (headers) {
35
- privateEndpoints[name2] = { headers };
17
+ if (apiConfig?.endpoints) {
18
+ for (const [key, { headers, ...rest }] of Object.entries(apiConfig.endpoints)) {
19
+ publicEndpoints[key] = rest;
20
+ if (headers) privateEndpoints[key] = { headers };
36
21
  }
37
22
  }
38
- return { publicEndpoints, privateEndpoints };
39
- }
40
- function buildApiRuntimeConfig(apiConfig) {
41
- const { publicEndpoints, privateEndpoints } = splitEndpointConfigs(apiConfig.endpoints);
42
- const hasEndpoints = Object.keys(publicEndpoints).length > 0;
23
+ const endpoints = { default: { baseURL: "/api" }, ...publicEndpoints };
43
24
  const publicConfig = {
44
- defaultEndpoint: apiConfig.defaultEndpoint ?? "default",
45
- debug: apiConfig.debug ?? false,
46
- endpoints: hasEndpoints ? publicEndpoints : DEFAULT_ENDPOINT,
47
- response: apiResponseConfigSchema.parse(apiConfig.response ?? {}),
48
- auth: apiAuthConfigSchema.parse(apiConfig.auth ?? {}),
49
- toast: apiToastConfigSchema.parse(apiConfig.toast ?? {})
25
+ defaultEndpoint: apiConfig?.defaultEndpoint ?? "default",
26
+ debug: apiConfig?.debug ?? false,
27
+ endpoints,
28
+ response: defu(
29
+ apiConfig?.response,
30
+ {
31
+ successCodes: [200, 0, "200", "0"],
32
+ codeKey: "code",
33
+ messageKey: "message",
34
+ dataKey: "data"
35
+ }
36
+ ),
37
+ auth: defu(
38
+ apiConfig?.auth,
39
+ {
40
+ enabled: false,
41
+ tokenSource: "session",
42
+ sessionTokenPath: "token",
43
+ tokenType: "Bearer",
44
+ headerName: "Authorization",
45
+ unauthorized: {
46
+ redirect: true,
47
+ clearSession: true,
48
+ loginPath: "/login"
49
+ }
50
+ }
51
+ ),
52
+ toast: defu(
53
+ apiConfig?.toast,
54
+ {
55
+ enabled: true,
56
+ success: {
57
+ show: true,
58
+ color: "success",
59
+ icon: "i-lucide-circle-check"
60
+ },
61
+ error: {
62
+ show: true,
63
+ color: "error",
64
+ icon: "i-lucide-circle-x"
65
+ }
66
+ }
67
+ )
50
68
  };
51
69
  const privateConfig = {
52
70
  endpoints: Object.keys(privateEndpoints).length > 0 ? privateEndpoints : void 0
53
71
  };
54
72
  return { publicConfig, privateConfig };
55
73
  }
74
+ const defaultOptions = {
75
+ prefix: "M",
76
+ theme: {
77
+ enabled: true
78
+ }
79
+ };
80
+
81
+ function addTheme(nuxt, resolve, theme) {
82
+ if (theme?.enabled === false) return;
83
+ nuxt.options.app.head.meta = nuxt.options.app.head.meta || [];
84
+ nuxt.options.app.head.meta.push(
85
+ { charset: "utf-8" },
86
+ { name: "viewport", content: "width=device-width, initial-scale=1" }
87
+ );
88
+ nuxt.options.app.head.htmlAttrs = defu(nuxt.options.app.head.htmlAttrs || {}, {
89
+ dir: "ltr"
90
+ });
91
+ nuxt.options.appConfig.movk = defu(
92
+ nuxt.options.appConfig.movk || {},
93
+ getDefaultConfig(theme)
94
+ );
95
+ nuxt.options.appConfig.ui = defu(
96
+ {
97
+ colors: {
98
+ primary: "blue",
99
+ secondary: "blue",
100
+ success: "green",
101
+ info: "blue",
102
+ warning: "yellow",
103
+ error: "red",
104
+ neutral: "slate"
105
+ }
106
+ },
107
+ nuxt.options.appConfig.ui || {}
108
+ );
109
+ addPlugin({
110
+ src: resolve("runtime/plugins/theme"),
111
+ mode: "all"
112
+ });
113
+ }
114
+
56
115
  const module$1 = defineNuxtModule({
57
116
  meta: {
58
117
  name,
59
118
  version,
60
119
  configKey: "movk",
61
- compatibility: { nuxt: ">=4.2.0" }
120
+ compatibility: { nuxt: ">=4.4.2" }
62
121
  },
63
- defaults: { prefix: "M" },
122
+ defaults: defaultOptions,
64
123
  moduleDependencies: {
65
124
  "@nuxt/image": { version: ">=2.0.0" },
66
- "@nuxt/ui": { version: ">=4.3.0" },
67
- "@vueuse/nuxt": { version: ">=14.1.0" },
68
- "nuxt-og-image": { version: ">=5.1.13" },
69
- "nuxt-auth-utils": { version: ">=0.5.26" }
125
+ "@nuxt/ui": { version: ">=4.6.0", defaults: { fonts: false } },
126
+ "@vueuse/nuxt": { version: ">=14.2.1" },
127
+ "nuxt-auth-utils": { version: ">=0.5.29" },
128
+ "nuxt-site-config": { version: ">=4.0.8" }
70
129
  },
71
- setup(options, nuxt) {
130
+ async setup(options, nuxt) {
72
131
  const { resolve } = createResolver(import.meta.url);
73
- setupTheme(nuxt, resolve);
132
+ nuxt.options.movk = options;
74
133
  nuxt.options.alias["#movk"] = resolve("./runtime");
75
- nuxt.options.css.push(resolve("runtime/style.css"));
134
+ nuxt.options.css = nuxt.options.css || [];
135
+ nuxt.options.css.push(resolve("runtime/index.css"));
136
+ const componentIgnore = [];
137
+ if (options.theme?.enabled === false) {
138
+ componentIgnore.push("theme-picker/**");
139
+ }
76
140
  addComponentsDir({
77
141
  path: resolve("runtime/components"),
78
142
  prefix: options.prefix,
79
143
  pathPrefix: false,
80
- ignore: ["auto-form-renderer/**", "theme-picker/ThemePickerButton.vue"]
144
+ ignore: componentIgnore
81
145
  });
82
146
  addImportsDir(resolve("runtime/composables"));
83
147
  const apiConfig = options.api ?? {};
84
148
  if (apiConfig.enabled !== false) {
85
- const { publicConfig, privateConfig } = buildApiRuntimeConfig(apiConfig);
149
+ const { publicConfig, privateConfig } = getDefaultApiConfig(apiConfig);
86
150
  nuxt.options.runtimeConfig.movkApi = privateConfig;
87
151
  nuxt.options.runtimeConfig.public.movkApi = publicConfig;
88
152
  addPlugin({ src: resolve("runtime/plugins/api.factory"), mode: "all" });
89
- addServerHandler({
90
- route: "/api/_movk/session",
91
- method: "post",
92
- handler: resolve("runtime/server/api/_movk/session.post")
93
- });
94
153
  }
154
+ const meta = await getPackageJsonMetadata(nuxt.options.rootDir);
155
+ nuxt.hook("modules:done", async () => {
156
+ const site = defu$1(nuxt.options.site, {
157
+ name: kebabCase(meta.name || "") || "movk",
158
+ description: meta.description,
159
+ debug: false
160
+ });
161
+ updateSiteConfig(site);
162
+ const uiTheme = nuxt.options.ui?.theme;
163
+ const themeDefaults = {
164
+ prefix: uiTheme?.prefix ?? void 0,
165
+ colors: uiTheme?.colors ?? void 0,
166
+ defaultVariants: uiTheme?.defaultVariants ?? void 0
167
+ };
168
+ options.theme = defu$1(options.theme || {}, themeDefaults);
169
+ addTheme(nuxt, resolve, options.theme);
170
+ await addTemplates(options, nuxt);
171
+ });
172
+ nuxt.hook("prepare:types", ({ references }) => {
173
+ references.push({ path: resolve("./runtime/types/app.config.d.ts") });
174
+ });
95
175
  }
96
176
  });
97
177
 
@@ -1,34 +1,13 @@
1
- import type { ButtonProps, FormEmits, FormProps, InferInput } from '@nuxt/ui';
2
- import type { z } from 'zod/v4';
3
- import type { ZodAutoFormFieldMeta } from '../types/zod.js';
4
- import type { AutoFormControls, AutoFormSlotProps, DynamicFormSlots } from '../types/auto-form.js';
5
- export interface AutoFormProps<S extends z.ZodObject, T extends boolean = true, N extends boolean = false> extends FormProps<S, T, N> {
6
- /**
7
- * 是否显示默认提交按钮
8
- * @defaultValue true
9
- */
10
- submitButton?: boolean;
11
- /** 提交按钮属性 */
12
- submitButtonProps?: ButtonProps;
13
- /** 自定义控件映射 */
14
- controls?: AutoFormControls;
15
- /** 全局字段元数据配置 */
16
- globalMeta?: ZodAutoFormFieldMeta;
17
- /** 数组字段添加按钮属性 */
18
- addButtonProps?: ButtonProps;
19
- loadingAuto?: boolean;
20
- }
21
- export interface AutoFormEmits<S extends z.ZodObject, T extends boolean = true> extends FormEmits<S, T> {
22
- }
23
- export type AutoFormSlots<T extends object> = {
24
- header: (props: AutoFormSlotProps<T>) => any;
25
- footer: (props: AutoFormSlotProps<T>) => any;
26
- submit: (props: AutoFormSlotProps<T>) => any;
27
- } & DynamicFormSlots<T>;
1
+ import type { ComponentConfig, InferInput } from '@nuxt/ui';
2
+ import type { z } from 'zod';
3
+ import type { AutoFormProps, AutoFormSlots } from '../types/auto-form/component';
4
+ import theme from '#build/movk-ui/auto-form';
5
+ import type { AppConfig } from 'nuxt/schema';
28
6
  declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
29
- props: import("vue").PublicProps & __VLS_PrettifyLocal<AutoFormProps<S, T, N> & {
30
- onError?: ((event: import("@nuxt/ui/.").FormErrorEvent) => any) | undefined;
31
- onSubmit?: ((event: import("@nuxt/ui/.").FormSubmitEvent<import("@nuxt/ui/.").FormData<S, T>>) => any) | undefined;
7
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(AutoFormProps<S, T, N> & {
8
+ ui?: ComponentConfig<typeof theme, AppConfig, "autoForm">["slots"];
9
+ }) & {
10
+ onError?: ((args_0: import("@nuxt/ui").FormErrorEvent) => any) | undefined;
32
11
  }> & (typeof globalThis extends {
33
12
  __VLS_PROPS_FALLBACK: infer P;
34
13
  } ? P : {});
@@ -39,7 +18,7 @@ declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N
39
18
  }>) => void;
40
19
  attrs: any;
41
20
  slots: AutoFormSlots<N extends false ? Partial<InferInput<S>> : never>;
42
- emit: ((evt: "error", event: import("@nuxt/ui/.").FormErrorEvent) => void) & ((evt: "submit", event: import("@nuxt/ui/.").FormSubmitEvent<import("@nuxt/ui/.").FormData<S, T>>) => void);
21
+ emit: (evt: "error", args_0: import("@nuxt/ui").FormErrorEvent) => void;
43
22
  }>) => import("vue").VNode & {
44
23
  __ctx?: Awaited<typeof __VLS_setup>;
45
24
  };