@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
@@ -1,19 +1,25 @@
1
- import type { InputProps, InputValue } from '@nuxt/ui';
2
- import type { WithPasswordToggleProps } from '../../types/components.js';
1
+ import type { InputSlots, InputValue, ComponentConfig } from '@nuxt/ui';
2
+ import type { OmitByKey } from '@movk/core';
3
+ import theme from '#build/movk-ui/with-password-toggle';
4
+ import inputTheme from '#build/ui/input';
5
+ import type { AppConfig } from 'nuxt/schema';
6
+ import type { WithPasswordToggleProps } from '../../types/components/input/with-password-toggle';
3
7
  declare const __VLS_export: <T extends InputValue>(__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<{
4
- props: import("vue").PublicProps & __VLS_PrettifyLocal<(WithPasswordToggleProps<import("@nuxt/ui/.").AcceptableValue> & {
5
- modelValue?: InputProps["modelValue"];
8
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(WithPasswordToggleProps<T> & {
9
+ ui?: ComponentConfig<typeof inputTheme & typeof theme, AppConfig, "withPasswordToggle">["slots"];
10
+ } & {
11
+ modelValue?: T;
6
12
  }) & {
7
13
  onBlur?: ((event: FocusEvent) => any) | undefined;
8
14
  onChange?: ((event: Event) => any) | undefined;
9
- "onUpdate:modelValue"?: ((value: import("@nuxt/ui/.").AcceptableValue | undefined) => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
10
16
  }> & (typeof globalThis extends {
11
17
  __VLS_PROPS_FALLBACK: infer P;
12
18
  } ? P : {});
13
19
  expose: (exposed: {}) => void;
14
20
  attrs: any;
15
- slots: import("@movk/core").OmitByKey<import("@nuxt/ui/.").InputSlots, "trailing">;
16
- emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: import("@nuxt/ui/.").AcceptableValue) => void)) & ((evt: "update:modelValue", value: import("@nuxt/ui/.").AcceptableValue | undefined) => void);
21
+ slots: OmitByKey<InputSlots, "trailing">;
22
+ emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
17
23
  }>) => import("vue").VNode & {
18
24
  __ctx?: Awaited<typeof __VLS_setup>;
19
25
  };
@@ -1,3 +1,10 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ import type { ComponentConfig } from '@nuxt/ui';
2
+ import type { AppConfig } from 'nuxt/schema';
3
+ import theme from '#build/movk-ui/theme-picker';
4
+ import popoverTheme from '#build/ui/popover';
5
+ interface ThemePickerProps {
6
+ ui?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, 'themePicker'>['slots'];
7
+ }
8
+ declare const __VLS_export: import("vue").DefineComponent<ThemePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemePickerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
9
  declare const _default: typeof __VLS_export;
3
10
  export default _default;
@@ -4,16 +4,29 @@ import { useClipboard } from "@vueuse/core";
4
4
  import { ref } from "vue";
5
5
  import { useTheme } from "../../composables/useTheme";
6
6
  import ThemePickerButton from "./ThemePickerButton.vue";
7
+ import theme from "#build/movk-ui/theme-picker";
8
+ import popoverTheme from "#build/ui/popover";
9
+ import { useExtendedTv } from "../../utils/extend-theme";
10
+ const props = defineProps({
11
+ ui: { type: Object, required: false }
12
+ });
7
13
  const appConfig = useAppConfig();
8
14
  const colorMode = useColorMode();
15
+ const { extendUi } = useExtendedTv(
16
+ popoverTheme,
17
+ theme,
18
+ () => appConfig.movk?.themePicker,
19
+ () => ({ ui: props.ui })
20
+ );
9
21
  const open = ref(false);
10
22
  const { copy: copyCSS, copied: copiedCSS } = useClipboard();
11
- const { copy: copyAppConfig, copied: copiedAppConfig } = useClipboard();
23
+ const { copy: copyConfig, copied: copiedConfig } = useClipboard();
12
24
  const {
13
25
  neutralColors,
14
26
  neutral,
15
27
  primaryColors,
16
28
  primary,
29
+ blackAsPrimary,
17
30
  setBlackAsPrimary,
18
31
  radiuses,
19
32
  radius,
@@ -24,18 +37,16 @@ const {
24
37
  modes,
25
38
  mode,
26
39
  hasCSSChanges,
27
- hasAppConfigChanges,
40
+ hasConfigChanges,
41
+ configLabel,
28
42
  exportCSS,
29
- exportAppConfig,
43
+ exportConfig,
30
44
  resetTheme
31
45
  } = useTheme();
32
46
  </script>
33
47
 
34
48
  <template>
35
- <UPopover
36
- v-model:open="open"
37
- :ui="{ content: 'w-72 px-6 py-4 flex flex-col gap-4 overflow-y-auto max-h-[calc(100vh-5rem)]' }"
38
- >
49
+ <UPopover v-model:open="open" :ui="extendUi">
39
50
  <template #default>
40
51
  <UButton
41
52
  icon="i-lucide-swatch-book"
@@ -57,17 +68,20 @@ const {
57
68
  size="xs"
58
69
  color="neutral"
59
70
  variant="link"
60
- target="_blank"
61
- icon="i-lucide-circle-help"
71
+ icon="i-lucide-help-circle"
62
72
  class="p-0 -my-0.5"
63
73
  :ui="{ leadingIcon: 'size-3' }"
64
74
  />
65
75
  </legend>
66
76
 
67
77
  <div class="grid grid-cols-3 gap-1 -mx-2">
68
- <ThemePickerButton label="Black" :selected="appConfig.theme.blackAsPrimary" @click="setBlackAsPrimary(true)">
78
+ <ThemePickerButton
79
+ label="Black"
80
+ :selected="blackAsPrimary"
81
+ @click="setBlackAsPrimary(true)"
82
+ >
69
83
  <template #leading>
70
- <span class="inline-block w-2 h-2 rounded-full bg-black dark:bg-white" />
84
+ <span class="inline-block size-2 rounded-full bg-black dark:bg-white" />
71
85
  </template>
72
86
  </ThemePickerButton>
73
87
 
@@ -76,7 +90,7 @@ const {
76
90
  :key="color"
77
91
  :label="color"
78
92
  :chip="color"
79
- :selected="!appConfig.theme.blackAsPrimary && primary === color"
93
+ :selected="!blackAsPrimary && primary === color"
80
94
  @click="primary = color"
81
95
  />
82
96
  </div>
@@ -91,8 +105,7 @@ const {
91
105
  size="xs"
92
106
  color="neutral"
93
107
  variant="link"
94
- target="_blank"
95
- icon="i-lucide-circle-help"
108
+ icon="i-lucide-help-circle"
96
109
  class="p-0 -my-0.5"
97
110
  :ui="{ leadingIcon: 'size-3' }"
98
111
  />
@@ -119,8 +132,7 @@ const {
119
132
  size="xs"
120
133
  color="neutral"
121
134
  variant="link"
122
- target="_blank"
123
- icon="i-lucide-circle-help"
135
+ icon="i-lucide-help-circle"
124
136
  class="p-0 -my-0.5"
125
137
  :ui="{ leadingIcon: 'size-3' }"
126
138
  />
@@ -147,8 +159,7 @@ const {
147
159
  size="xs"
148
160
  color="neutral"
149
161
  variant="link"
150
- target="_blank"
151
- icon="i-lucide-circle-help"
162
+ icon="i-lucide-help-circle"
152
163
  class="p-0 -my-0.5"
153
164
  :ui="{ leadingIcon: 'size-3' }"
154
165
  />
@@ -176,8 +187,7 @@ const {
176
187
  size="xs"
177
188
  color="neutral"
178
189
  variant="link"
179
- target="_blank"
180
- icon="i-lucide-circle-help"
190
+ icon="i-lucide-help-circle"
181
191
  class="p-0 -my-0.5"
182
192
  :ui="{ leadingIcon: 'size-3' }"
183
193
  />
@@ -205,8 +215,7 @@ const {
205
215
  size="xs"
206
216
  color="neutral"
207
217
  variant="link"
208
- target="_blank"
209
- icon="i-lucide-circle-help"
218
+ icon="i-lucide-help-circle"
210
219
  class="p-0 -my-0.5"
211
220
  :ui="{ leadingIcon: 'size-3' }"
212
221
  />
@@ -223,7 +232,7 @@ const {
223
232
  </div>
224
233
  </fieldset>
225
234
 
226
- <fieldset v-if="hasCSSChanges || hasAppConfigChanges">
235
+ <fieldset v-if="hasCSSChanges || hasConfigChanges">
227
236
  <legend class="text-[11px] leading-none font-semibold mb-2 select-none">
228
237
  Export
229
238
  </legend>
@@ -236,18 +245,18 @@ const {
236
245
  size="sm"
237
246
  label="main.css"
238
247
  class="flex-1 text-[11px]"
239
- :icon="copiedCSS ? appConfig.ui.icons.copyCheck : appConfig.ui.icons.copy"
248
+ :icon="copiedCSS ? 'i-lucide-copy-check' : 'i-lucide-copy'"
240
249
  @click="copyCSS(exportCSS())"
241
250
  />
242
251
  <UButton
243
- v-if="hasAppConfigChanges"
252
+ v-if="hasConfigChanges"
244
253
  color="neutral"
245
254
  variant="soft"
246
255
  size="sm"
247
- label="app.config.ts"
248
- :icon="copiedAppConfig ? appConfig.ui.icons.copyCheck : appConfig.ui.icons.copy"
256
+ :label="configLabel"
257
+ :icon="copiedConfig ? 'i-lucide-copy-check' : 'i-lucide-copy'"
249
258
  class="flex-1 text-[11px]"
250
- @click="copyAppConfig(exportAppConfig())"
259
+ @click="copyConfig(exportConfig())"
251
260
  />
252
261
  <UTooltip text="Reset theme">
253
262
  <UButton
@@ -1,3 +1,10 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ import type { ComponentConfig } from '@nuxt/ui';
2
+ import type { AppConfig } from 'nuxt/schema';
3
+ import theme from '#build/movk-ui/theme-picker';
4
+ import popoverTheme from '#build/ui/popover';
5
+ interface ThemePickerProps {
6
+ ui?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, 'themePicker'>['slots'];
7
+ }
8
+ declare const __VLS_export: import("vue").DefineComponent<ThemePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemePickerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
9
  declare const _default: typeof __VLS_export;
3
10
  export default _default;
@@ -1,16 +1,15 @@
1
- type __VLS_Props = {
1
+ interface ThemePickerButtonProps {
2
2
  label: string;
3
3
  icon?: string;
4
4
  chip?: string;
5
5
  selected?: boolean;
6
- };
7
- type __VLS_Slots = {
6
+ }
7
+ interface ThemePickerButtonSlots {
8
8
  leading: () => any;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ }
12
10
  declare const _default: typeof __VLS_export;
13
11
  export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemePickerButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemePickerButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ThemePickerButtonSlots>;
14
13
  type __VLS_WithSlots<T, S> = T & {
15
14
  new (): {
16
15
  $slots: S;
@@ -1,3 +1,7 @@
1
+ <script>
2
+
3
+ </script>
4
+
1
5
  <script setup>
2
6
  defineProps({
3
7
  label: { type: String, required: true },
@@ -1,16 +1,15 @@
1
- type __VLS_Props = {
1
+ interface ThemePickerButtonProps {
2
2
  label: string;
3
3
  icon?: string;
4
4
  chip?: string;
5
5
  selected?: boolean;
6
- };
7
- type __VLS_Slots = {
6
+ }
7
+ interface ThemePickerButtonSlots {
8
8
  leading: () => any;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ }
12
10
  declare const _default: typeof __VLS_export;
13
11
  export default _default;
12
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemePickerButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemePickerButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ThemePickerButtonSlots>;
14
13
  type __VLS_WithSlots<T, S> = T & {
15
14
  new (): {
16
15
  $slots: S;
@@ -1,8 +1,9 @@
1
- export * from './useApiFetch.js';
2
- export * from './useClientApiFetch.js';
3
- export * from './useApiAuth.js';
4
- export * from './useDownloadWithProgress.js';
5
- export * from './useUploadWithProgress.js';
6
- export * from './useAutoForm.js';
7
- export * from './useTheme.js';
8
- export * from './useDateFormatter.js';
1
+ export * from './useApiFetch';
2
+ export * from './useLazyApiFetch';
3
+ export * from './useClientApiFetch';
4
+ export * from './useDownloadWithProgress';
5
+ export * from './useUploadWithProgress';
6
+ export * from './useAutoForm';
7
+ export * from './useTheme';
8
+ export * from './useDateFormatter';
9
+ export * from './useMessageBox';
@@ -1,8 +1,9 @@
1
1
  export * from "./useApiFetch.js";
2
+ export * from "./useLazyApiFetch.js";
2
3
  export * from "./useClientApiFetch.js";
3
- export * from "./useApiAuth.js";
4
4
  export * from "./useDownloadWithProgress.js";
5
5
  export * from "./useUploadWithProgress.js";
6
6
  export * from "./useAutoForm.js";
7
7
  export * from "./useTheme.js";
8
8
  export * from "./useDateFormatter.js";
9
+ export * from "./useMessageBox.js";
@@ -1,16 +1,12 @@
1
- import type { UseApiFetchOptions, UseApiFetchReturn } from '../types/api.js';
1
+ import type { NitroFetchRequest } from 'nitropack/types';
2
+ import type { UseApiFetchOptions, UseApiFetchReturn } from '../types/api';
2
3
  /**
3
4
  * API Fetch 组合式函数
4
5
  *
5
- * 基于 Nuxt useFetch 封装,提供:
6
- * - 自动认证(从 session 获取 token)
7
- * - 业务状态码检查
8
- * - Toast 提示(通过内置 hooks 统一处理)
9
- * - 自动数据解包
10
- * - 支持用户自定义 hooks(与内置 hooks 合并执行)
6
+ * 基于 Nuxt useFetch 的薄封装,自动注入 $api 实例。
7
+ * 所有核心能力(认证、业务检查、数据解包、Toast)由 $api interceptors 统一处理。
11
8
  *
12
- * @typeParam ResT - API 响应 data 字段的原始类型
13
- * @typeParam DataT - transform 转换后的最终类型(默认等于 ResT)
9
+ * @typeParam T - 业务数据类型(默认已由 $api 自动解包;skipUnwrap 时为原始响应类型)
14
10
  *
15
11
  * @example
16
12
  * ```ts
@@ -23,20 +19,32 @@ import type { UseApiFetchOptions, UseApiFetchReturn } from '../types/api.js';
23
19
  * body: { name: 'test' }
24
20
  * })
25
21
  *
26
- * // 自定义 transform(双泛型,接收解包后的数据)
27
- * const { data } = await useApiFetch<{ content: User[] }, User[]>('/users', {
28
- * transform: ({ content }) => content ?? []
22
+ * // 自定义 transform(接收已解包的业务数据)
23
+ * const { data } = await useApiFetch<User[]>('/users', {
24
+ * transform: (users) => users.filter(u => u.active)
29
25
  * })
30
26
  *
31
27
  * // 使用其他端点
32
28
  * const { data } = await useApiFetch('/users', { endpoint: 'v2' })
33
29
  *
34
- * // 自定义 hooks(与内置 hooks 合并执行)
30
+ * // 自定义 Toast
31
+ * const { data } = await useApiFetch('/users', {
32
+ * toast: { successMessage: '加载成功' }
33
+ * })
34
+ *
35
+ * // 跳过业务状态码校验(仍按 dataKey 解包,适合 code 字段缺失的场景)
36
+ * const { data } = await useApiFetch('/legacy', { skipBusinessCheck: true })
37
+ *
38
+ * // 跳过解包,拿原始响应(与 skipBusinessCheck 正交)
39
+ * const { data } = await useApiFetch<ApiResponse>('/external', { skipUnwrap: true })
40
+ *
41
+ * // 用户自定义 hooks(通过 useFetch 原生选项透传)
35
42
  * const { data } = await useApiFetch('/users', {
36
43
  * onResponse({ response }) {
37
- * console.log('用户自定义处理:', response._data)
44
+ * // response._data 已是解包后的业务数据(除非传入 skipUnwrap: true)
45
+ * console.log('自定义处理:', response._data)
38
46
  * }
39
47
  * })
40
48
  * ```
41
49
  */
42
- export declare function useApiFetch<ResT = unknown, DataT = ResT>(url: string | (() => string), options?: UseApiFetchOptions<ResT, DataT>): UseApiFetchReturn<DataT>;
50
+ export declare function useApiFetch<T = unknown, DataT = T>(url: NitroFetchRequest | (() => NitroFetchRequest), options?: UseApiFetchOptions<T, DataT>): UseApiFetchReturn<DataT>;
@@ -1,41 +1,34 @@
1
- import { useNuxtApp, useFetch } from "#imports";
2
- import { createTransform, mergeFetchHooks } from "../utils/api-utils.js";
1
+ import { computed, toValue } from "vue";
2
+ import { useNuxtApp, useFetch } from "#app";
3
+ import { buildApiFetchKey } from "../domains/api/fetch-key.js";
3
4
  export function useApiFetch(url, options = {}) {
4
5
  const { $api } = useNuxtApp();
5
6
  const {
6
7
  endpoint,
7
8
  toast,
8
- skipBusinessCheck = false,
9
- transform: userTransform,
10
- onRequest: userOnRequest,
11
- onRequestError: userOnRequestError,
12
- onResponse: userOnResponse,
13
- onResponseError: userOnResponseError,
9
+ skipBusinessCheck,
10
+ skipUnwrap,
14
11
  ...fetchOptions
15
12
  } = options;
16
13
  const apiInstance = endpoint ? $api.use(endpoint) : $api;
17
- const endpointConfig = apiInstance.getConfig();
18
- const builtinHooks = endpointConfig.builtinHooks || {};
19
- const transformFn = createTransform({
20
- skipBusinessCheck,
21
- userTransform,
22
- successConfig: endpointConfig.response
23
- });
24
- const mergedHooks = mergeFetchHooks(builtinHooks, {
25
- onRequest: userOnRequest,
26
- onRequestError: userOnRequestError,
27
- onResponse: userOnResponse,
28
- onResponseError: userOnResponseError
14
+ const fetchKey = computed(() => {
15
+ const userKey = toValue(fetchOptions.key);
16
+ if (userKey) return userKey;
17
+ return buildApiFetchKey({
18
+ endpoint,
19
+ skipUnwrap,
20
+ skipBusinessCheck,
21
+ toast,
22
+ method: toValue(fetchOptions.method),
23
+ url: typeof url === "function" ? url() : url,
24
+ query: toValue(fetchOptions.query),
25
+ body: toValue(fetchOptions.body)
26
+ });
29
27
  });
30
- const context = { toast, skipBusinessCheck };
31
28
  return useFetch(url, {
32
29
  ...fetchOptions,
33
- $fetch: apiInstance.$fetch,
34
- transform: transformFn,
35
- onRequest: mergedHooks.onRequest,
36
- onRequestError: mergedHooks.onRequestError,
37
- onResponse: mergedHooks.onResponse,
38
- onResponseError: mergedHooks.onResponseError,
39
- context
30
+ key: fetchKey,
31
+ $fetch: apiInstance,
32
+ context: { toast, skipBusinessCheck, skipUnwrap }
40
33
  });
41
34
  }
@@ -1,101 +1,17 @@
1
- import type { IsComponent } from '@movk/core';
2
- import type { AutoFormControl, AutoFormControls, TypedZodFactory } from '../types/auto-form.js';
3
- import { z } from 'zod/v4';
4
- import WithClear from '../components/input/WithClear.vue.js';
5
- import WithPasswordToggle from '../components/input/WithPasswordToggle.vue.js';
6
- import WithCopy from '../components/input/WithCopy.vue.js';
7
- import WithCharacterLimit from '../components/input/WithCharacterLimit.vue.js';
8
- import DatePicker from '../components/DatePicker.vue.js';
9
- import ColorChooser from '../components/ColorChooser.vue.js';
10
- import StarRating from '../components/StarRating.vue.js';
11
- import SlideVerify from '../components/SlideVerify.vue.js';
12
- import { UInput, UInputNumber, UCheckbox, USwitch, UTextarea, USlider, UPinInput, UInputTags, UFileUpload, USelect, USelectMenu, UInputMenu, UCheckboxGroup, URadioGroup, UInputDate, UInputTime } from '#components';
13
- /**
14
- * 从 Zod schema 中提取自定义元数据
15
- */
16
- declare function getAutoFormMetadata(schema: z.ZodType): Record<string, any>;
17
- declare function defineControl<C extends IsComponent>(e: AutoFormControl<C>): AutoFormControl<C>;
18
- declare const DEFAULT_CONTROLS: {
19
- readonly string: AutoFormControl<typeof UInput>;
20
- readonly number: AutoFormControl<typeof UInputNumber>;
21
- readonly boolean: AutoFormControl<typeof UCheckbox>;
22
- readonly enum: AutoFormControl<typeof USelect>;
23
- readonly file: AutoFormControl<typeof UFileUpload>;
24
- readonly calendarDate: AutoFormControl<typeof DatePicker>;
25
- readonly switch: AutoFormControl<typeof USwitch>;
26
- readonly textarea: AutoFormControl<typeof UTextarea>;
27
- readonly slider: AutoFormControl<typeof USlider>;
28
- readonly pinInput: AutoFormControl<typeof UPinInput>;
29
- readonly inputTags: AutoFormControl<typeof UInputTags>;
30
- readonly selectMenu: AutoFormControl<typeof USelectMenu>;
31
- readonly inputMenu: AutoFormControl<typeof UInputMenu>;
32
- readonly checkboxGroup: AutoFormControl<typeof UCheckboxGroup>;
33
- readonly radioGroup: AutoFormControl<typeof URadioGroup>;
34
- readonly inputDate: AutoFormControl<typeof UInputDate>;
35
- readonly inputTime: AutoFormControl<typeof UInputTime>;
36
- readonly withClear: AutoFormControl<typeof WithClear>;
37
- readonly withPasswordToggle: AutoFormControl<typeof WithPasswordToggle>;
38
- readonly withCopy: AutoFormControl<typeof WithCopy>;
39
- readonly withCharacterLimit: AutoFormControl<typeof WithCharacterLimit>;
40
- readonly colorChooser: AutoFormControl<typeof ColorChooser>;
41
- readonly starRating: AutoFormControl<typeof StarRating>;
42
- readonly slideVerify: AutoFormControl<typeof SlideVerify>;
43
- };
44
- export declare function useAutoForm<TControls extends AutoFormControls = typeof DEFAULT_CONTROLS>(controls?: TControls): {
1
+ import type { AutoFormControls, TypedZodFactory } from '../types/auto-form';
2
+ import { getAutoFormMetadata } from '../domains/auto-form/metadata';
3
+ import { DEFAULT_CONTROLS, defineControl } from '../domains/auto-form/controls';
4
+ type UseAutoFormReturn<TControls extends AutoFormControls> = {
45
5
  defineControl: typeof defineControl;
46
- afz: TypedZodFactory<TControls, {
47
- readonly string: AutoFormControl<typeof UInput>;
48
- readonly number: AutoFormControl<typeof UInputNumber>;
49
- readonly boolean: AutoFormControl<typeof UCheckbox>;
50
- readonly enum: AutoFormControl<typeof USelect>;
51
- readonly file: AutoFormControl<typeof UFileUpload>;
52
- readonly calendarDate: AutoFormControl<typeof DatePicker>;
53
- readonly switch: AutoFormControl<typeof USwitch>;
54
- readonly textarea: AutoFormControl<typeof UTextarea>;
55
- readonly slider: AutoFormControl<typeof USlider>;
56
- readonly pinInput: AutoFormControl<typeof UPinInput>;
57
- readonly inputTags: AutoFormControl<typeof UInputTags>;
58
- readonly selectMenu: AutoFormControl<typeof USelectMenu>;
59
- readonly inputMenu: AutoFormControl<typeof UInputMenu>;
60
- readonly checkboxGroup: AutoFormControl<typeof UCheckboxGroup>;
61
- readonly radioGroup: AutoFormControl<typeof URadioGroup>;
62
- readonly inputDate: AutoFormControl<typeof UInputDate>;
63
- readonly inputTime: AutoFormControl<typeof UInputTime>;
64
- readonly withClear: AutoFormControl<typeof WithClear>;
65
- readonly withPasswordToggle: AutoFormControl<typeof WithPasswordToggle>;
66
- readonly withCopy: AutoFormControl<typeof WithCopy>;
67
- readonly withCharacterLimit: AutoFormControl<typeof WithCharacterLimit>;
68
- readonly colorChooser: AutoFormControl<typeof ColorChooser>;
69
- readonly starRating: AutoFormControl<typeof StarRating>;
70
- readonly slideVerify: AutoFormControl<typeof SlideVerify>;
71
- }>;
72
- DEFAULT_CONTROLS: {
73
- readonly string: AutoFormControl<typeof UInput>;
74
- readonly number: AutoFormControl<typeof UInputNumber>;
75
- readonly boolean: AutoFormControl<typeof UCheckbox>;
76
- readonly enum: AutoFormControl<typeof USelect>;
77
- readonly file: AutoFormControl<typeof UFileUpload>;
78
- readonly calendarDate: AutoFormControl<typeof DatePicker>;
79
- readonly switch: AutoFormControl<typeof USwitch>;
80
- readonly textarea: AutoFormControl<typeof UTextarea>;
81
- readonly slider: AutoFormControl<typeof USlider>;
82
- readonly pinInput: AutoFormControl<typeof UPinInput>;
83
- readonly inputTags: AutoFormControl<typeof UInputTags>;
84
- readonly selectMenu: AutoFormControl<typeof USelectMenu>;
85
- readonly inputMenu: AutoFormControl<typeof UInputMenu>;
86
- readonly checkboxGroup: AutoFormControl<typeof UCheckboxGroup>;
87
- readonly radioGroup: AutoFormControl<typeof URadioGroup>;
88
- readonly inputDate: AutoFormControl<typeof UInputDate>;
89
- readonly inputTime: AutoFormControl<typeof UInputTime>;
90
- readonly withClear: AutoFormControl<typeof WithClear>;
91
- readonly withPasswordToggle: AutoFormControl<typeof WithPasswordToggle>;
92
- readonly withCopy: AutoFormControl<typeof WithCopy>;
93
- readonly withCharacterLimit: AutoFormControl<typeof WithCharacterLimit>;
94
- readonly colorChooser: AutoFormControl<typeof ColorChooser>;
95
- readonly starRating: AutoFormControl<typeof StarRating>;
96
- readonly slideVerify: AutoFormControl<typeof SlideVerify>;
97
- };
98
- controls: TControls | undefined;
6
+ afz: TypedZodFactory<TControls>;
7
+ DEFAULT_CONTROLS: typeof DEFAULT_CONTROLS;
8
+ controls: TControls;
99
9
  getAutoFormMetadata: typeof getAutoFormMetadata;
100
10
  };
101
- export {};
11
+ /**
12
+ * 初始化 AutoForm,返回绑定了 controls 类型的 afz 工厂和工具方法。
13
+ * 可传入自定义 controls 以扩展或覆盖默认控件映射。
14
+ */
15
+ export declare function useAutoForm(): UseAutoFormReturn<typeof DEFAULT_CONTROLS>;
16
+ export declare function useAutoForm<const TControls extends AutoFormControls>(controls: TControls): UseAutoFormReturn<typeof DEFAULT_CONTROLS & TControls>;
17
+ export { defineControl, DEFAULT_CONTROLS, getAutoFormMetadata };