@movk/nuxt 1.2.0 → 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 (293) hide show
  1. package/.nuxt/movk-ui.css +3 -0
  2. package/README.md +74 -79
  3. package/dist/module.d.mts +57 -1
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +120 -126
  6. package/dist/runtime/components/AutoForm.d.vue.ts +10 -30
  7. package/dist/runtime/components/AutoForm.vue +114 -125
  8. package/dist/runtime/components/AutoForm.vue.d.ts +10 -30
  9. package/dist/runtime/components/ColorChooser.d.vue.ts +21 -22
  10. package/dist/runtime/components/ColorChooser.vue +304 -27
  11. package/dist/runtime/components/ColorChooser.vue.d.ts +21 -22
  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 +20 -33
  16. package/dist/runtime/components/DatePicker.vue +173 -65
  17. package/dist/runtime/components/DatePicker.vue.d.ts +20 -33
  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 +21 -149
  28. package/dist/runtime/components/SearchForm.vue +211 -153
  29. package/dist/runtime/components/SearchForm.vue.d.ts +21 -149
  30. package/dist/runtime/components/SlideVerify.d.vue.ts +31 -70
  31. package/dist/runtime/components/SlideVerify.vue +117 -90
  32. package/dist/runtime/components/SlideVerify.vue.d.ts +31 -70
  33. package/dist/runtime/components/StarRating.d.vue.ts +38 -87
  34. package/dist/runtime/components/StarRating.vue +118 -74
  35. package/dist/runtime/components/StarRating.vue.d.ts +38 -87
  36. package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +11 -15
  37. package/dist/runtime/components/input/AsPhoneNumberInput.vue +22 -9
  38. package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +11 -15
  39. package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +11 -13
  40. package/dist/runtime/components/input/WithCharacterLimit.vue +23 -11
  41. package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +11 -13
  42. package/dist/runtime/components/input/WithClear.d.vue.ts +13 -11
  43. package/dist/runtime/components/input/WithClear.vue +27 -8
  44. package/dist/runtime/components/input/WithClear.vue.d.ts +13 -11
  45. package/dist/runtime/components/input/WithCopy.d.vue.ts +13 -13
  46. package/dist/runtime/components/input/WithCopy.vue +25 -8
  47. package/dist/runtime/components/input/WithCopy.vue.d.ts +13 -13
  48. package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +13 -16
  49. package/dist/runtime/components/input/WithFloatingLabel.vue +35 -27
  50. package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +13 -16
  51. package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +11 -7
  52. package/dist/runtime/components/input/WithPasswordToggle.vue +24 -7
  53. package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +11 -7
  54. package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +8 -1
  55. package/dist/runtime/components/theme-picker/ThemePicker.vue +27 -12
  56. package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +8 -1
  57. package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +9 -4
  58. package/dist/runtime/components/theme-picker/ThemePickerButton.vue +4 -0
  59. package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +9 -4
  60. package/dist/runtime/composables/index.d.ts +9 -8
  61. package/dist/runtime/composables/index.js +1 -0
  62. package/dist/runtime/composables/useApiFetch.d.ts +10 -5
  63. package/dist/runtime/composables/useApiFetch.js +20 -2
  64. package/dist/runtime/composables/useAutoForm.d.ts +4 -4
  65. package/dist/runtime/composables/useAutoForm.js +23 -9
  66. package/dist/runtime/composables/useClientApiFetch.d.ts +3 -2
  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 +142 -40
  71. package/dist/runtime/composables/useLazyApiFetch.d.ts +3 -2
  72. package/dist/runtime/composables/useMessageBox.d.ts +6 -0
  73. package/dist/runtime/composables/useMessageBox.js +16 -0
  74. package/dist/runtime/composables/useTheme.d.ts +26 -16
  75. package/dist/runtime/composables/useTheme.js +98 -71
  76. package/dist/runtime/composables/useUploadWithProgress.d.ts +23 -29
  77. package/dist/runtime/composables/useUploadWithProgress.js +78 -67
  78. package/dist/runtime/domains/api/auth.d.ts +2 -0
  79. package/dist/runtime/domains/api/auth.js +31 -0
  80. package/dist/runtime/domains/api/endpoint-config.d.ts +11 -0
  81. package/dist/runtime/domains/api/endpoint-config.js +17 -0
  82. package/dist/runtime/domains/api/errors.d.ts +2 -0
  83. package/dist/runtime/domains/api/errors.js +10 -0
  84. package/dist/runtime/domains/api/fetch-key.d.ts +20 -0
  85. package/dist/runtime/domains/api/fetch-key.js +23 -0
  86. package/dist/runtime/domains/api/interceptors/error.d.ts +13 -0
  87. package/dist/runtime/domains/api/interceptors/error.js +49 -0
  88. package/dist/runtime/domains/api/interceptors/request.d.ts +12 -0
  89. package/dist/runtime/domains/api/interceptors/request.js +46 -0
  90. package/dist/runtime/domains/api/interceptors/response.d.ts +17 -0
  91. package/dist/runtime/domains/api/interceptors/response.js +27 -0
  92. package/dist/runtime/domains/api/response.d.ts +4 -0
  93. package/dist/runtime/domains/api/response.js +14 -0
  94. package/dist/runtime/domains/api/toast.d.ts +15 -0
  95. package/dist/runtime/domains/api/toast.js +46 -0
  96. package/dist/runtime/domains/api/transfer.d.ts +69 -0
  97. package/dist/runtime/domains/api/transfer.js +81 -0
  98. package/dist/runtime/domains/auto-form/actions.d.ts +2 -0
  99. package/dist/runtime/domains/auto-form/actions.js +4 -0
  100. package/dist/runtime/domains/auto-form/components/Array.d.vue.ts +13 -0
  101. package/dist/runtime/{components/auto-form-renderer/AutoFormRendererArray.vue → domains/auto-form/components/Array.vue} +25 -29
  102. package/dist/runtime/domains/auto-form/components/Array.vue.d.ts +13 -0
  103. package/dist/runtime/domains/auto-form/components/Children.d.vue.ts +11 -0
  104. package/dist/runtime/{components/auto-form-renderer/AutoFormRendererChildren.vue → domains/auto-form/components/Children.vue} +18 -18
  105. package/dist/runtime/domains/auto-form/components/Children.vue.d.ts +11 -0
  106. package/dist/runtime/domains/auto-form/components/Field.d.vue.ts +11 -0
  107. package/dist/runtime/domains/auto-form/components/Field.vue +56 -0
  108. package/dist/runtime/domains/auto-form/components/Field.vue.d.ts +11 -0
  109. package/dist/runtime/domains/auto-form/components/Layout.d.vue.ts +11 -0
  110. package/dist/runtime/{components/auto-form-renderer/AutoFormRendererLayout.vue → domains/auto-form/components/Layout.vue} +24 -25
  111. package/dist/runtime/domains/auto-form/components/Layout.vue.d.ts +11 -0
  112. package/dist/runtime/domains/auto-form/components/Nested.d.vue.ts +11 -0
  113. package/dist/runtime/{components/auto-form-renderer/AutoFormRendererNested.vue → domains/auto-form/components/Nested.vue} +17 -21
  114. package/dist/runtime/domains/auto-form/components/Nested.vue.d.ts +11 -0
  115. package/dist/runtime/domains/auto-form/controls.d.ts +41 -0
  116. package/dist/runtime/{auto-form → domains/auto-form}/controls.js +27 -24
  117. package/dist/runtime/{auto-form/field-utils.d.ts → domains/auto-form/fields.d.ts} +3 -1
  118. package/dist/runtime/{auto-form/field-utils.js → domains/auto-form/fields.js} +18 -2
  119. package/dist/runtime/{auto-form → domains/auto-form}/metadata.js +1 -1
  120. package/dist/runtime/domains/auto-form/provider.d.ts +62 -0
  121. package/dist/runtime/{auto-form → domains/auto-form}/provider.js +6 -3
  122. package/dist/runtime/{auto-form/reactive-utils.d.ts → domains/auto-form/reactive.d.ts} +5 -5
  123. package/dist/runtime/{auto-form/reactive-utils.js → domains/auto-form/reactive.js} +1 -1
  124. package/dist/runtime/{auto-form/schema-introspector.d.ts → domains/auto-form/schema.d.ts} +2 -2
  125. package/dist/runtime/{auto-form/schema-introspector.js → domains/auto-form/schema.js} +1 -1
  126. package/dist/runtime/domains/data-table/columns/constants.d.ts +50 -0
  127. package/dist/runtime/domains/data-table/columns/constants.js +19 -0
  128. package/dist/runtime/domains/data-table/columns/resolve-columns.d.ts +4 -0
  129. package/dist/runtime/domains/data-table/columns/resolve-columns.js +59 -0
  130. package/dist/runtime/domains/data-table/columns/resolve-data-column.d.ts +9 -0
  131. package/dist/runtime/domains/data-table/columns/resolve-data-column.js +164 -0
  132. package/dist/runtime/domains/data-table/columns/resolve-group-column.d.ts +4 -0
  133. package/dist/runtime/domains/data-table/columns/resolve-group-column.js +19 -0
  134. package/dist/runtime/domains/data-table/columns/resolve-special-columns.d.ts +8 -0
  135. package/dist/runtime/domains/data-table/columns/resolve-special-columns.js +232 -0
  136. package/dist/runtime/domains/data-table/columns/style.d.ts +11 -0
  137. package/dist/runtime/domains/data-table/columns/style.js +67 -0
  138. package/dist/runtime/domains/data-table/columns/utils.d.ts +6 -0
  139. package/dist/runtime/domains/data-table/columns/utils.js +16 -0
  140. package/dist/runtime/domains/data-table/components/ActionConfirm.d.vue.ts +10 -0
  141. package/dist/runtime/domains/data-table/components/ActionConfirm.vue +39 -0
  142. package/dist/runtime/domains/data-table/components/ActionConfirm.vue.d.ts +10 -0
  143. package/dist/runtime/domains/data-table/components/ActionsCell.d.vue.ts +11 -0
  144. package/dist/runtime/domains/data-table/components/ActionsCell.vue +91 -0
  145. package/dist/runtime/domains/data-table/components/ActionsCell.vue.d.ts +11 -0
  146. package/dist/runtime/domains/data-table/components/CellTooltip.d.vue.ts +9 -0
  147. package/dist/runtime/domains/data-table/components/CellTooltip.vue +40 -0
  148. package/dist/runtime/domains/data-table/components/CellTooltip.vue.d.ts +9 -0
  149. package/dist/runtime/domains/data-table/components/Pagination.d.vue.ts +26 -0
  150. package/dist/runtime/domains/data-table/components/Pagination.vue +132 -0
  151. package/dist/runtime/domains/data-table/components/Pagination.vue.d.ts +26 -0
  152. package/dist/runtime/domains/data-table/indent.d.ts +8 -0
  153. package/dist/runtime/domains/data-table/indent.js +19 -0
  154. package/dist/runtime/domains/data-table/tree-selection.d.ts +9 -0
  155. package/dist/runtime/domains/data-table/tree-selection.js +76 -0
  156. package/dist/runtime/{utils/theme.d.ts → domains/theme/theme-icons.d.ts} +0 -1
  157. package/dist/runtime/index.css +1 -0
  158. package/dist/runtime/plugins/api.factory.js +17 -117
  159. package/dist/runtime/plugins/theme.js +49 -27
  160. package/dist/runtime/types/api/config.d.ts +127 -0
  161. package/dist/runtime/types/api/fetch.d.ts +50 -0
  162. package/dist/runtime/types/api/index.d.ts +5 -0
  163. package/dist/runtime/types/api/module.d.ts +94 -0
  164. package/dist/runtime/types/api/response.d.ts +62 -0
  165. package/dist/runtime/types/api/response.js +0 -0
  166. package/dist/runtime/types/api/transfer.d.ts +32 -0
  167. package/dist/runtime/types/api/transfer.js +0 -0
  168. package/dist/runtime/types/app.config.d.ts +6 -0
  169. package/dist/runtime/types/auto-form/base.d.ts +26 -0
  170. package/dist/runtime/types/auto-form/base.js +0 -0
  171. package/dist/runtime/types/auto-form/component.d.ts +28 -0
  172. package/dist/runtime/types/auto-form/component.js +0 -0
  173. package/dist/runtime/types/auto-form/controls.d.ts +45 -0
  174. package/dist/runtime/types/auto-form/controls.js +0 -0
  175. package/dist/runtime/types/auto-form/fields.d.ts +68 -0
  176. package/dist/runtime/types/auto-form/fields.js +0 -0
  177. package/dist/runtime/types/auto-form/index.d.ts +7 -0
  178. package/dist/runtime/types/auto-form/index.js +0 -0
  179. package/dist/runtime/types/auto-form/search-form.d.ts +84 -0
  180. package/dist/runtime/types/auto-form/search-form.js +0 -0
  181. package/dist/runtime/types/auto-form/slots.d.ts +85 -0
  182. package/dist/runtime/types/auto-form/slots.js +0 -0
  183. package/dist/runtime/types/auto-form/zod-factory.d.ts +127 -0
  184. package/dist/runtime/types/auto-form/zod-factory.js +0 -0
  185. package/dist/runtime/types/components/color-chooser.d.ts +109 -0
  186. package/dist/runtime/types/components/color-chooser.js +0 -0
  187. package/dist/runtime/types/components/date-picker.d.ts +41 -0
  188. package/dist/runtime/types/components/date-picker.js +0 -0
  189. package/dist/runtime/types/components/index.d.ts +8 -0
  190. package/dist/runtime/types/components/index.js +0 -0
  191. package/dist/runtime/types/components/input/as-phone-number-input.d.ts +17 -0
  192. package/dist/runtime/types/components/input/as-phone-number-input.js +0 -0
  193. package/dist/runtime/types/components/input/index.d.ts +6 -0
  194. package/dist/runtime/types/components/input/index.js +0 -0
  195. package/dist/runtime/types/components/input/with-character-limit.d.ts +11 -0
  196. package/dist/runtime/types/components/input/with-character-limit.js +0 -0
  197. package/dist/runtime/types/components/input/with-clear.d.ts +10 -0
  198. package/dist/runtime/types/components/input/with-clear.js +0 -0
  199. package/dist/runtime/types/components/input/with-copy.d.ts +11 -0
  200. package/dist/runtime/types/components/input/with-copy.js +0 -0
  201. package/dist/runtime/types/components/input/with-floating-label.d.ts +12 -0
  202. package/dist/runtime/types/components/input/with-floating-label.js +0 -0
  203. package/dist/runtime/types/components/input/with-password-toggle.d.ts +7 -0
  204. package/dist/runtime/types/components/input/with-password-toggle.js +0 -0
  205. package/dist/runtime/types/components/message-box.d.ts +69 -0
  206. package/dist/runtime/types/components/message-box.js +0 -0
  207. package/dist/runtime/types/components/pill-group.d.ts +103 -0
  208. package/dist/runtime/types/components/pill-group.js +0 -0
  209. package/dist/runtime/types/components/popconfirm.d.ts +74 -0
  210. package/dist/runtime/types/components/popconfirm.js +0 -0
  211. package/dist/runtime/types/components/slide-verify.d.ts +54 -0
  212. package/dist/runtime/types/components/slide-verify.js +0 -0
  213. package/dist/runtime/types/components/star-rating.d.ts +55 -0
  214. package/dist/runtime/types/components/star-rating.js +0 -0
  215. package/dist/runtime/types/data-table/columns.d.ts +236 -0
  216. package/dist/runtime/types/data-table/columns.js +6 -0
  217. package/dist/runtime/types/data-table/component.d.ts +190 -0
  218. package/dist/runtime/types/data-table/component.js +0 -0
  219. package/dist/runtime/types/data-table/contexts.d.ts +44 -0
  220. package/dist/runtime/types/data-table/contexts.js +0 -0
  221. package/dist/runtime/types/data-table/index.d.ts +6 -0
  222. package/dist/runtime/types/data-table/index.js +1 -0
  223. package/dist/runtime/types/data-table/pagination.d.ts +87 -0
  224. package/dist/runtime/types/data-table/pagination.js +0 -0
  225. package/dist/runtime/types/index.d.ts +6 -5
  226. package/dist/runtime/types/index.js +5 -5
  227. package/dist/runtime/types/shared.d.ts +5 -0
  228. package/dist/runtime/types/shared.js +0 -0
  229. package/dist/runtime/types/zod.d.ts +11 -10
  230. package/dist/runtime/utils/extend-theme.d.ts +19 -0
  231. package/dist/runtime/utils/extend-theme.js +44 -0
  232. package/dist/runtime/utils/form-control.d.ts +33 -0
  233. package/dist/runtime/utils/form-control.js +54 -0
  234. package/dist/runtime/utils/meta.d.ts +2 -5
  235. package/dist/runtime/utils/meta.js +1 -3
  236. package/dist/runtime/utils/theme-defaults.d.ts +27 -0
  237. package/dist/runtime/utils/theme-defaults.js +28 -0
  238. package/dist/runtime/utils/tv.d.ts +1 -0
  239. package/dist/runtime/utils/tv.js +4 -0
  240. package/dist/runtime/vue/composables/useSiteConfig.d.ts +13 -0
  241. package/dist/runtime/vue/composables/useSiteConfig.js +11 -0
  242. package/dist/runtime/vue/plugins/theme.d.ts +6 -0
  243. package/dist/runtime/vue/plugins/theme.js +14 -0
  244. package/dist/runtime/vue/stubs/base.d.ts +2 -0
  245. package/dist/runtime/vue/stubs/base.js +2 -0
  246. package/dist/runtime/vue/stubs/inertia.d.ts +2 -0
  247. package/dist/runtime/vue/stubs/inertia.js +2 -0
  248. package/dist/runtime/vue/stubs/movk-extra.d.ts +2 -0
  249. package/dist/runtime/vue/stubs/movk-extra.js +2 -0
  250. package/dist/runtime/vue/stubs/none.d.ts +2 -0
  251. package/dist/runtime/vue/stubs/none.js +2 -0
  252. package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
  253. package/dist/runtime/vue/stubs/vue-router.js +2 -0
  254. package/dist/shared/nuxt.DfBEyjld.mjs +667 -0
  255. package/dist/types.d.mts +2 -6
  256. package/dist/unplugin.d.mts +28 -0
  257. package/dist/unplugin.mjs +292 -0
  258. package/dist/vite.d.mts +12 -0
  259. package/dist/vite.mjs +20 -0
  260. package/package.json +75 -36
  261. package/vue-plugin.d.ts +5 -0
  262. package/dist/runtime/auto-form/controls.d.ts +0 -221
  263. package/dist/runtime/auto-form/provider.d.ts +0 -27
  264. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +0 -28
  265. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +0 -28
  266. package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.d.vue.ts +0 -26
  267. package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.vue.d.ts +0 -26
  268. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +0 -26
  269. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue +0 -55
  270. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +0 -26
  271. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +0 -26
  272. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +0 -26
  273. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +0 -26
  274. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +0 -26
  275. package/dist/runtime/constants/api-defaults.d.ts +0 -9
  276. package/dist/runtime/constants/api-defaults.js +0 -32
  277. package/dist/runtime/constants/grid-cols.d.ts +0 -7
  278. package/dist/runtime/constants/grid-cols.js +0 -44
  279. package/dist/runtime/style.css +0 -1
  280. package/dist/runtime/types/api.d.ts +0 -349
  281. package/dist/runtime/types/auto-form.d.ts +0 -259
  282. package/dist/runtime/types/module.d.ts +0 -96
  283. package/dist/runtime/types/theme.d.ts +0 -2
  284. package/dist/runtime/utils/api-utils.d.ts +0 -58
  285. package/dist/runtime/utils/api-utils.js +0 -98
  286. /package/dist/runtime/{constants/auto-form.d.ts → domains/auto-form/constants.d.ts} +0 -0
  287. /package/dist/runtime/{constants/auto-form.js → domains/auto-form/constants.js} +0 -0
  288. /package/dist/runtime/{auto-form → domains/auto-form}/metadata.d.ts +0 -0
  289. /package/dist/runtime/{utils/theme.js → domains/theme/theme-icons.js} +0 -0
  290. /package/dist/runtime/types/{api.js → api/config.js} +0 -0
  291. /package/dist/runtime/types/{auto-form.js → api/fetch.js} +0 -0
  292. /package/dist/runtime/types/{module.js → api/index.js} +0 -0
  293. /package/dist/runtime/types/{theme.js → api/module.js} +0 -0
@@ -1,44 +0,0 @@
1
- const BREAKPOINTS = ["sm", "md", "lg", "xl"];
2
- export const GRID_COL_SAFELIST = [
3
- "grid-cols-1",
4
- "grid-cols-2",
5
- "grid-cols-3",
6
- "grid-cols-4",
7
- "grid-cols-5",
8
- "grid-cols-6",
9
- "sm:grid-cols-1",
10
- "sm:grid-cols-2",
11
- "sm:grid-cols-3",
12
- "sm:grid-cols-4",
13
- "sm:grid-cols-5",
14
- "sm:grid-cols-6",
15
- "md:grid-cols-1",
16
- "md:grid-cols-2",
17
- "md:grid-cols-3",
18
- "md:grid-cols-4",
19
- "md:grid-cols-5",
20
- "md:grid-cols-6",
21
- "lg:grid-cols-1",
22
- "lg:grid-cols-2",
23
- "lg:grid-cols-3",
24
- "lg:grid-cols-4",
25
- "lg:grid-cols-5",
26
- "lg:grid-cols-6",
27
- "xl:grid-cols-1",
28
- "xl:grid-cols-2",
29
- "xl:grid-cols-3",
30
- "xl:grid-cols-4",
31
- "xl:grid-cols-5",
32
- "xl:grid-cols-6"
33
- ];
34
- export function resolveMaxCols(cols) {
35
- if (typeof cols === "number") return cols;
36
- return Math.max(...BREAKPOINTS.map((bp) => cols[bp] ?? 1));
37
- }
38
- export function resolveGridClasses(cols, gap) {
39
- if (typeof cols === "number") {
40
- return `grid ${gap} grid-cols-${cols}`;
41
- }
42
- const bpClasses = BREAKPOINTS.filter((bp) => cols[bp] != null).map((bp) => `${bp}:grid-cols-${cols[bp]}`);
43
- return ["grid", gap, "grid-cols-1", ...bpClasses].join(" ");
44
- }
@@ -1 +0,0 @@
1
- @import "tailwindcss" theme(static);@import "@nuxt/ui";@source "./components";@source "./constants";@theme static{--font-sans:"Alibaba PuHuiTi",sans-serif}
@@ -1,349 +0,0 @@
1
- import type { $Fetch, FetchError } from 'ofetch';
2
- import type { UseFetchOptions as NuxtUseFetchOptions, AsyncData } from 'nuxt/app';
3
- import type { ToastProps } from '@nuxt/ui';
4
- declare module 'ofetch' {
5
- interface FetchOptions {
6
- context?: ApiFetchContext;
7
- }
8
- }
9
- /**
10
- * API 请求扩展上下文
11
- * @description 通过 fetch options 的 context 字段传递的额外配置
12
- */
13
- export interface ApiFetchContext {
14
- /** Toast 提示配置,设置为 false 禁用提示 */
15
- toast?: RequestToastOptions | false;
16
- /** 是否跳过业务状态码检查 */
17
- skipBusinessCheck?: boolean;
18
- }
19
- /**
20
- * API 响应配置
21
- * @description 定义业务状态码判断规则和数据/消息字段的映射关系
22
- */
23
- export interface ApiResponseConfig {
24
- /**
25
- * 表示成功的业务状态码列表
26
- * @defaultValue [200, 0]
27
- */
28
- successCodes: (number | string)[];
29
- /**
30
- * 响应中业务状态码的字段名
31
- * @defaultValue 'code'
32
- */
33
- codeKey: string;
34
- /**
35
- * 响应中消息内容的字段名
36
- * @defaultValue 'message'
37
- */
38
- messageKey: string;
39
- /**
40
- * 响应中业务数据的字段名
41
- * @defaultValue 'data'
42
- */
43
- dataKey: string;
44
- }
45
- /**
46
- * 401 未授权处理配置
47
- * @description 定义当接收到 401 响应时的自动处理行为
48
- */
49
- export interface ApiUnauthorizedConfig {
50
- /**
51
- * 是否自动重定向到登录页
52
- * @defaultValue true
53
- */
54
- redirect?: boolean;
55
- /**
56
- * 登录页路径
57
- * @defaultValue '/login'
58
- */
59
- loginPath?: string;
60
- /**
61
- * 是否清除用户会话
62
- * @defaultValue true
63
- */
64
- clearSession?: boolean;
65
- }
66
- /**
67
- * API 认证配置
68
- * @description 定义认证令牌的来源、格式和请求头配置
69
- */
70
- export interface ApiAuthConfig {
71
- /**
72
- * 是否启用认证
73
- * @defaultValue false
74
- */
75
- enabled: boolean;
76
- /**
77
- * 令牌来源类型
78
- * @defaultValue 'session'
79
- */
80
- tokenSource: 'session';
81
- /**
82
- * 令牌在会话对象中的路径(支持点号分隔的嵌套路径)
83
- * @defaultValue 'token'
84
- * @example 'token' | 'user.accessToken' | 'auth.credentials.token'
85
- */
86
- sessionTokenPath: string;
87
- /**
88
- * 令牌类型前缀
89
- * @defaultValue 'Bearer'
90
- */
91
- tokenType: 'Bearer' | 'Basic' | 'Custom';
92
- /**
93
- * 自定义令牌类型前缀(当 tokenType 为 'Custom' 时使用)
94
- */
95
- customTokenType?: string;
96
- /**
97
- * 认证请求头名称
98
- * @defaultValue 'Authorization'
99
- */
100
- headerName: string;
101
- /**
102
- * 401 未授权处理配置
103
- */
104
- unauthorized?: ApiUnauthorizedConfig;
105
- }
106
- /**
107
- * Toast 提示配置
108
- * @description 定义成功和错误提示的全局样式和行为
109
- */
110
- export interface ApiToastConfig {
111
- /**
112
- * 是否启用 Toast 提示
113
- * @defaultValue true
114
- */
115
- enabled: boolean;
116
- /**
117
- * 成功提示配置
118
- */
119
- success?: {
120
- /**
121
- * 是否显示成功提示
122
- * @defaultValue true
123
- */
124
- show: boolean;
125
- /**
126
- * 提示颜色
127
- * @defaultValue 'success'
128
- */
129
- color: string;
130
- /**
131
- * 图标类名
132
- * @defaultValue 'i-lucide-circle-check'
133
- */
134
- icon?: string;
135
- /**
136
- * 显示时长(毫秒)
137
- * @defaultValue 3000
138
- */
139
- duration: number;
140
- };
141
- /**
142
- * 错误提示配置
143
- */
144
- error?: {
145
- /**
146
- * 是否显示错误提示
147
- * @defaultValue true
148
- */
149
- show: boolean;
150
- /**
151
- * 提示颜色
152
- * @defaultValue 'error'
153
- */
154
- color: string;
155
- /**
156
- * 图标类名
157
- * @defaultValue 'i-lucide-circle-x'
158
- */
159
- icon?: string;
160
- /**
161
- * 显示时长(毫秒)
162
- * @defaultValue 3000
163
- */
164
- duration: number;
165
- };
166
- }
167
- /**
168
- * API 端点公共配置
169
- * @description 定义单个 API 端点的配置(可在客户端访问的配置)
170
- */
171
- export interface ApiEndpointPublicConfig {
172
- /**
173
- * 端点的基础 URL
174
- */
175
- baseURL: string;
176
- /**
177
- * 端点别名(用于标识)
178
- */
179
- alias?: string;
180
- /**
181
- * 端点级别的认证配置(覆盖全局配置)
182
- */
183
- auth?: Partial<ApiAuthConfig>;
184
- /**
185
- * 端点级别的 Toast 配置(覆盖全局配置)
186
- */
187
- toast?: Partial<ApiToastConfig>;
188
- /**
189
- * 端点级别的响应配置(覆盖全局配置)
190
- */
191
- response?: Partial<ApiResponseConfig>;
192
- }
193
- /**
194
- * Movk API 模块公共配置
195
- * @description 定义模块的全局配置(可在客户端访问)
196
- */
197
- export interface MovkApiPublicConfig {
198
- /**
199
- * 默认使用的端点名称
200
- * @defaultValue 'default'
201
- */
202
- defaultEndpoint: string;
203
- /**
204
- * 是否启用调试模式(在控制台输出请求和响应日志)
205
- * @defaultValue false
206
- */
207
- debug: boolean;
208
- /**
209
- * 端点配置映射
210
- * @defaultValue { default: { baseURL: '/api' } }
211
- */
212
- endpoints: Record<string, ApiEndpointPublicConfig>;
213
- /**
214
- * 全局响应配置(已合并默认值,运行时必然存在)
215
- */
216
- response: ApiResponseConfig;
217
- /**
218
- * 全局认证配置(已合并默认值,运行时必然存在)
219
- */
220
- auth: ApiAuthConfig;
221
- /**
222
- * 全局 Toast 配置(已合并默认值,运行时必然存在)
223
- */
224
- toast: ApiToastConfig;
225
- }
226
- /**
227
- * 端点私有配置(仅服务端)
228
- * @description 从端点配置中拆分出的服务端专用字段,不会暴露给客户端
229
- */
230
- export interface EndpointPrivateConfig {
231
- /** 自定义请求头(仅服务端使用,不会暴露给客户端) */
232
- headers?: Record<string, string>;
233
- }
234
- /**
235
- * Movk API 模块完整配置
236
- * @description 定义模块的完整配置(公共+私有),用于模块初始化时的配置验证
237
- */
238
- export interface MovkApiFullConfig {
239
- /**
240
- * 是否启用 API 模块
241
- * @defaultValue true
242
- */
243
- enabled?: boolean;
244
- /**
245
- * 默认使用的端点名称
246
- * @defaultValue 'default'
247
- */
248
- defaultEndpoint?: string;
249
- /**
250
- * 是否启用调试模式
251
- * @defaultValue false
252
- */
253
- debug?: boolean;
254
- /**
255
- * 端点配置映射(包含公共和私有配置)
256
- * @defaultValue { default: { baseURL: '/api' } }
257
- */
258
- endpoints?: Record<string, ApiEndpointPublicConfig & EndpointPrivateConfig>;
259
- /**
260
- * 全局响应配置
261
- */
262
- response?: Partial<ApiResponseConfig>;
263
- /**
264
- * 全局认证配置
265
- */
266
- auth?: Partial<ApiAuthConfig>;
267
- /**
268
- * 全局 Toast 配置
269
- */
270
- toast?: Partial<ApiToastConfig>;
271
- }
272
- /**
273
- * API 响应数据结构
274
- * @description 字段名通过 ApiResponseConfig 的 codeKey/messageKey/dataKey 配置化读取
275
- */
276
- export interface ApiResponse {
277
- [key: string]: unknown;
278
- }
279
- /**
280
- * API 错误对象
281
- * @description 扩展标准 Error,包含业务响应和状态码信息
282
- */
283
- export interface ApiError extends Error {
284
- /** HTTP 或业务状态码 */
285
- statusCode: number;
286
- /** 原始 API 响应数据 */
287
- response?: ApiResponse;
288
- /** 是否为业务逻辑错误(非 HTTP 错误) */
289
- isBusinessError: boolean;
290
- }
291
- /**
292
- * 已解析的端点配置
293
- * @description 合并全局配置和端点配置后的最终配置,供内部使用
294
- */
295
- export interface ResolvedEndpointConfig extends ApiEndpointPublicConfig {
296
- /** 认证配置(已合并全局默认值) */
297
- auth: ApiAuthConfig;
298
- /** Toast 配置(已合并全局默认值) */
299
- toast: ApiToastConfig;
300
- /** 响应配置(已合并全局默认值) */
301
- response: ApiResponseConfig;
302
- /** 自定义请求头(仅服务端配置) */
303
- headers?: Record<string, string>;
304
- }
305
- /**
306
- * 请求级别的 Toast 提示选项
307
- * @description 用于单个请求的 Toast 配置,可覆盖全局配置
308
- */
309
- export interface RequestToastOptions {
310
- /** 成功提示配置,设置为 false 禁用成功提示 */
311
- success?: Partial<ToastProps> | false;
312
- /** 错误提示配置,设置为 false 禁用错误提示 */
313
- error?: Partial<ToastProps> | false;
314
- /** 自定义成功消息 */
315
- successMessage?: string;
316
- /** 自定义错误消息 */
317
- errorMessage?: string;
318
- }
319
- /**
320
- * API 实例类型
321
- * @description $fetch.create() 返回的实例,附加 use() 方法支持多端点切换
322
- */
323
- export type ApiInstance = $Fetch & {
324
- /** 切换到指定端点,返回该端点的 $fetch 实例 */
325
- use: (endpoint: string) => ApiInstance;
326
- };
327
- /**
328
- * useApiFetch 的扩展选项
329
- * @template T - 业务数据类型(已解包)
330
- */
331
- export interface ApiFetchExtras {
332
- /** 使用的端点名称(默认使用 defaultEndpoint) */
333
- endpoint?: string;
334
- /** Toast 提示配置,设置为 false 禁用提示 */
335
- toast?: RequestToastOptions | false;
336
- /** 是否跳过业务状态码检查 */
337
- skipBusinessCheck?: boolean;
338
- }
339
- /**
340
- * useApiFetch 选项类型
341
- * @template T - 业务数据类型(已解包)
342
- * @template DataT - transform 转换后的类型(默认等于 T)
343
- */
344
- export type UseApiFetchOptions<T = unknown, DataT = T> = Omit<NuxtUseFetchOptions<T, DataT>, '$fetch' | 'context'> & ApiFetchExtras;
345
- /**
346
- * useApiFetch 返回值类型
347
- * @template DataT - 最终数据类型
348
- */
349
- export type UseApiFetchReturn<DataT> = AsyncData<DataT | null, FetchError | ApiError | null>;
@@ -1,259 +0,0 @@
1
- import type { CollapsibleRootProps, DateRange } from 'reka-ui';
2
- import type { ClassNameValue } from './theme.js';
3
- import type { z } from 'zod';
4
- import type { ArrayFieldKeys, ComponentProps, ComponentSlots, GetFieldValue, IsAny, IsComponent, KnownKeys, NonObjectFieldKeys, ObjectFieldKeys, Prettify, ReactiveValue, UnionToIntersection, WidenLiteral } from '@movk/core';
5
- import type { FormError } from '@nuxt/ui';
6
- import type { AUTOFORM_META } from '../constants/auto-form.js';
7
- import type { CalendarDate, DateValue, Time } from '@internationalized/date';
8
- import type { ZodAutoFormFieldMeta } from './zod.js';
9
- type FieldValueType<S, P extends string> = P extends string ? (string extends P ? S[keyof S] : GetFieldValue<S, P>) : S[keyof S];
10
- type NonUndefinedFieldValue<S, P extends string> = Exclude<FieldValueType<S, P>, undefined>;
11
- type RelativePath<T> = T extends readonly any[] ? string : T extends Record<string, any> ? Extract<keyof T, string> : string;
12
- export interface AutoFormFieldContext<S = any, P extends string = string> {
13
- readonly state: S;
14
- readonly path: P;
15
- readonly value: FieldValueType<S, P>;
16
- /**
17
- * @example
18
- * setValue({ name: '张三', email: 'test@example.com' }) // 设置整个对象
19
- * setValue('name', '张三') // key 自动推断
20
- * setValue('[0].title', '新标题') // 数组索引路径
21
- */
22
- setValue: {
23
- (value: FieldValueType<S, P>): void;
24
- <K extends RelativePath<NonUndefinedFieldValue<S, P>>>(relativePath: K extends never ? string : K, value: any): void;
25
- (relativePath: string, value: any): void;
26
- };
27
- readonly errors: unknown[];
28
- readonly loading: boolean;
29
- readonly open?: boolean;
30
- readonly count?: number;
31
- }
32
- export interface AutoFormFieldSlots {
33
- label: (props: {
34
- label?: string;
35
- } & AutoFormFieldContext) => unknown;
36
- hint: (props: {
37
- hint?: string;
38
- } & AutoFormFieldContext) => unknown;
39
- description: (props: {
40
- description?: string;
41
- } & AutoFormFieldContext) => unknown;
42
- help: (props: {
43
- help?: string;
44
- } & AutoFormFieldContext) => unknown;
45
- error: (props: {
46
- error?: boolean | string;
47
- } & AutoFormFieldContext) => unknown;
48
- default: (props: {
49
- error?: boolean | string;
50
- } & AutoFormFieldContext) => unknown;
51
- }
52
- /** 插槽附加 props 查找表 */
53
- type SlotExtraPropsMap = {
54
- label: {
55
- label?: string;
56
- };
57
- hint: {
58
- hint?: string;
59
- };
60
- description: {
61
- description?: string;
62
- };
63
- help: {
64
- help?: string;
65
- };
66
- error: {
67
- error?: boolean | string;
68
- };
69
- default: {
70
- error?: boolean | string;
71
- };
72
- };
73
- /**
74
- * 动态表单插槽类型
75
- *
76
- * 插槽命名:
77
- * - 通用:`field-{slotType}`
78
- * - 字段:`field-{slotType}:{fieldKey}` — 精确推导字段类型
79
- * - 嵌套:`field-{content|before|after}:{objectKey|arrayKey}`
80
- */
81
- export type DynamicFormSlots<T> = Record<string, (props: AutoFormFieldContext<T>) => unknown> & {
82
- [K in keyof AutoFormFieldSlots as `field-${K}`]: (props: SlotExtraPropsMap[K] & AutoFormFieldContext<T>) => unknown;
83
- } & {
84
- [Key in `field-${keyof AutoFormFieldSlots}:${NonObjectFieldKeys<T> | ObjectFieldKeys<T>}`]: Key extends `field-${infer K extends keyof AutoFormFieldSlots}:${infer P extends string & (NonObjectFieldKeys<T> | ObjectFieldKeys<T>)}` ? (props: SlotExtraPropsMap[K] & AutoFormFieldContext<T, P>) => unknown : never;
85
- } & {
86
- [P in ObjectFieldKeys<T> | ArrayFieldKeys<T> as `field-${'content' | 'before' | 'after'}:${P}`]: (props: AutoFormFieldContext<T, P>) => unknown;
87
- };
88
- export interface AutoFormSlotProps<T extends object> {
89
- errors: FormError[];
90
- loading: boolean;
91
- fields: AutoFormField[];
92
- state: T;
93
- }
94
- export interface AutoFormControlsMeta<C extends IsComponent = IsComponent> {
95
- type?: string;
96
- component?: C;
97
- controlProps?: ReactiveValue<ComponentProps<C>, AutoFormFieldContext>;
98
- controlSlots?: ReactiveValue<Partial<ComponentSlots<C>>, AutoFormFieldContext> | Record<string, unknown>;
99
- error?: string;
100
- }
101
- /** 幻影类型哨兵:标记 P/S 未被覆写 */
102
- export type _Unset = {
103
- readonly __brand: 'AutoFormControlUnset';
104
- };
105
- export interface AutoFormControl<C extends IsComponent = IsComponent, _P = _Unset, _S = _Unset> {
106
- component: C;
107
- controlProps?: ComponentProps<C>;
108
- controlSlots?: Partial<ComponentSlots<C>>;
109
- }
110
- export type AutoFormControls = Record<string, AutoFormControl<any, any, any>>;
111
- export interface AutoFormLayoutConfig<C extends IsComponent = IsComponent> {
112
- component?: C;
113
- props?: ReactiveValue<ComponentProps<C>, AutoFormFieldContext>;
114
- class?: ReactiveValue<ClassNameValue, AutoFormFieldContext>;
115
- slots?: ReactiveValue<Partial<ComponentSlots<C>>, AutoFormFieldContext>;
116
- fields: Record<string, z.ZodType>;
117
- fieldSlot?: ReactiveValue<keyof ComponentSlots<C> & string, AutoFormFieldContext>;
118
- fieldSlots?: ReactiveValue<Partial<Record<string, keyof ComponentSlots<C> & string>>, AutoFormFieldContext>;
119
- }
120
- export type AutoFormMergeMeta = ZodAutoFormFieldMeta & AutoFormControlsMeta & {
121
- mapped?: AutoFormControl;
122
- layout?: AutoFormLayoutConfig;
123
- overwrite?: AutoFormControlsMeta;
124
- };
125
- export interface AutoFormField {
126
- path: string;
127
- schema: z.ZodType;
128
- meta: AutoFormMergeMeta;
129
- decorators: {
130
- isOptional?: boolean;
131
- isReadonly?: boolean;
132
- defaultValue?: unknown;
133
- description?: string;
134
- };
135
- children?: AutoFormField[];
136
- arrayElement?: AutoFormField;
137
- }
138
- export interface AutoFormNestedCollapsible extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open' | 'disabled' | 'unmountOnHide'> {
139
- enabled?: boolean;
140
- as?: unknown;
141
- class?: unknown;
142
- ui?: {
143
- root?: ClassNameValue;
144
- content?: ClassNameValue;
145
- };
146
- }
147
- interface LayoutFieldMarker<Fields extends Record<string, z.ZodType>> extends z.ZodType<AutoFormLayoutConfig<any>, any, any> {
148
- __brand: typeof AUTOFORM_META.LAYOUT_KEY;
149
- fields: Fields;
150
- }
151
- type LayoutRestShape<S extends Record<string, any>> = {
152
- [P in keyof S as S[P] extends LayoutFieldMarker<any> ? never : P]: S[P];
153
- };
154
- type LayoutExpandedShape<S extends Record<string, any>> = UnionToIntersection<{
155
- [P in keyof S]: S[P] extends LayoutFieldMarker<infer Fields> ? ExtractLayoutShape<Fields> : {};
156
- }[keyof S]>;
157
- type ExtractLayoutShape<S extends Record<string, any>> = LayoutRestShape<S> & LayoutExpandedShape<S>;
158
- type StrictComponentProps<C extends IsComponent> = {
159
- [K in keyof ComponentProps<C> as {} extends Record<K, unknown> ? never : K]: ComponentProps<C>[K];
160
- };
161
- type StrictComponentSlots<C extends IsComponent> = IsAny<ComponentSlots<C>> extends true ? {} : ComponentSlots<C>;
162
- type ControlKey<TControls extends AutoFormControls> = Extract<KnownKeys<TControls>, string>;
163
- type ControlEntryByKey<TControls extends AutoFormControls, K extends string> = K extends keyof TControls ? TControls[K] : never;
164
- type _WidenForFactory<T> = {
165
- [K in keyof T]+?: WidenLiteral<T[K]>;
166
- };
167
- type ResolveControlProps<C extends IsComponent, P> = [P] extends [_Unset] ? StrictComponentProps<C> : IsAny<P> extends true ? StrictComponentProps<C> : [unknown] extends [P] ? StrictComponentProps<C> : [keyof P] extends [never] ? StrictComponentProps<C> : Prettify<_WidenForFactory<P> & {}>;
168
- type ExtractControlProps<T> = T extends AutoFormControl<infer C, infer P, any> ? ResolveControlProps<C, P> : T extends {
169
- component: infer C extends IsComponent;
170
- } ? StrictComponentProps<C> : {};
171
- type ResolveControlSlots<C extends IsComponent, S> = [S] extends [_Unset] ? StrictComponentSlots<C> : IsAny<S> extends true ? StrictComponentSlots<C> : [unknown] extends [S] ? StrictComponentSlots<C> : [keyof S] extends [never] ? StrictComponentSlots<C> : S;
172
- type ExtractControlSlots<T> = T extends AutoFormControl<infer C, any, infer S> ? ResolveControlSlots<C, S> : T extends {
173
- component: infer C extends IsComponent;
174
- } ? StrictComponentSlots<C> : {};
175
- type FallbackToRecordIfEmpty<T> = [keyof T] extends [never] ? Record<string, unknown> : Prettify<T & {}>;
176
- type ControlPropsByKey<TControls extends AutoFormControls, K extends ControlKey<TControls>> = FallbackToRecordIfEmpty<ExtractControlProps<ControlEntryByKey<TControls, K>>>;
177
- type ControlSlotsByKey<TControls extends AutoFormControls, K extends ControlKey<TControls>> = Partial<ExtractControlSlots<ControlEntryByKey<TControls, K>>>;
178
- type MetaPropsFor<TControls extends AutoFormControls, K extends ControlKey<TControls>> = {
179
- controlProps?: ReactiveValue<ControlPropsByKey<TControls, K>, AutoFormFieldContext>;
180
- controlSlots?: ReactiveValue<ControlSlotsByKey<TControls, K>, AutoFormFieldContext> | Record<string, unknown>;
181
- error?: string;
182
- };
183
- type MetaByControlKey<TControls extends AutoFormControls, K extends ControlKey<TControls>> = {
184
- type: K;
185
- component?: never;
186
- } & MetaPropsFor<TControls, K>;
187
- type MetaByComponent<C extends IsComponent> = {
188
- component: C;
189
- type?: never;
190
- } & Omit<AutoFormControlsMeta<C>, 'component' | 'type'>;
191
- type MetaByDefaultIfExists<TControls extends AutoFormControls, TDefaultKey extends string> = TDefaultKey extends ControlKey<TControls> ? {
192
- component?: never;
193
- type?: never;
194
- } & MetaPropsFor<TControls, TDefaultKey> : never;
195
- export type AutoFormFactoryMethod<TControls extends AutoFormControls, TResult, TDefaultKey extends string, TExtraArgs extends unknown[] = []> = {
196
- <K extends ControlKey<TControls>>(...args: [...TExtraArgs, MetaByControlKey<TControls, K>]): TResult;
197
- (...args: [...TExtraArgs, MetaByDefaultIfExists<TControls, TDefaultKey>]): TResult;
198
- <C extends IsComponent>(...args: [...TExtraArgs, MetaByComponent<C>]): TResult;
199
- (...args: [...TExtraArgs, string?]): TResult;
200
- };
201
- /** 对象工厂重载 */
202
- type ObjectFactoryOverloads<TControls extends AutoFormControls, Mode extends z.core.$strip | z.core.$loose | z.core.$strict, TDefaultKey extends string, ShapeConstraint = {}> = {
203
- <S extends Record<string, z.ZodType>, K extends ControlKey<TControls>>(shape: S & ShapeConstraint, meta?: MetaByControlKey<TControls, K>): z.ZodObject<ExtractLayoutShape<S>, Mode>;
204
- <S extends Record<string, z.ZodType>>(shape: S & ShapeConstraint, meta: MetaByDefaultIfExists<TControls, TDefaultKey>): z.ZodObject<ExtractLayoutShape<S>, Mode>;
205
- <S extends Record<string, z.ZodType>, C extends IsComponent>(shape: S & ShapeConstraint, meta: MetaByComponent<C>): z.ZodObject<ExtractLayoutShape<S>, Mode>;
206
- };
207
- export interface TypedZodFactory<TControls extends AutoFormControls> {
208
- string: AutoFormFactoryMethod<TControls, z.ZodString, 'string'>;
209
- number: AutoFormFactoryMethod<TControls, z.ZodNumber, 'number'>;
210
- boolean: AutoFormFactoryMethod<TControls, z.ZodBoolean, 'boolean'>;
211
- file: AutoFormFactoryMethod<TControls, z.ZodType<File>, 'file'>;
212
- email: AutoFormFactoryMethod<TControls, z.ZodString, 'string'>;
213
- url: AutoFormFactoryMethod<TControls, z.ZodString, 'string'>;
214
- uuid: AutoFormFactoryMethod<TControls, z.ZodString, 'string'>;
215
- enum: {
216
- <K extends ControlKey<TControls>>(values: [], overwrite?: MetaByControlKey<TControls, K>): z.ZodString;
217
- (values: [], overwrite: MetaByDefaultIfExists<TControls, 'enum'>): z.ZodString;
218
- <C extends IsComponent>(values: [], overwrite: MetaByComponent<C>): z.ZodString;
219
- <const T extends readonly [string, ...string[]], K extends ControlKey<TControls>>(values: T, overwrite?: MetaByControlKey<TControls, K>): z.ZodEnum<z.core.util.ToEnum<T[number]>>;
220
- <const T extends readonly [string, ...string[]]>(values: T, overwrite: MetaByDefaultIfExists<TControls, 'enum'>): z.ZodEnum<z.core.util.ToEnum<T[number]>>;
221
- <const T extends readonly [string, ...string[]], C extends IsComponent>(values: T, overwrite: MetaByComponent<C>): z.ZodEnum<z.core.util.ToEnum<T[number]>>;
222
- <const T extends z.core.util.EnumLike, K extends ControlKey<TControls>>(values: T, overwrite?: MetaByControlKey<TControls, K>): z.ZodEnum<T>;
223
- <const T extends z.core.util.EnumLike>(values: T, overwrite: MetaByDefaultIfExists<TControls, 'enum'>): z.ZodEnum<T>;
224
- <const T extends z.core.util.EnumLike, C extends IsComponent>(values: T, overwrite: MetaByComponent<C>): z.ZodEnum<T>;
225
- };
226
- calendarDate: {
227
- <T extends DateValue | DateRange | DateValue[] = CalendarDate, K extends ControlKey<TControls> = never>(meta?: MetaByControlKey<TControls, K>): z.ZodType<T>;
228
- <T extends DateValue | DateRange | DateValue[] = CalendarDate>(meta: MetaByDefaultIfExists<TControls, 'calendarDate'>): z.ZodType<T>;
229
- <C extends IsComponent, T extends DateValue | DateRange | DateValue[] = CalendarDate>(meta: MetaByComponent<C>): z.ZodType<T>;
230
- };
231
- inputDate: AutoFormFactoryMethod<TControls, z.ZodType<CalendarDate>, 'inputDate'>;
232
- inputTime: AutoFormFactoryMethod<TControls, z.ZodType<Time>, 'inputTime'>;
233
- isoDatetime: AutoFormFactoryMethod<TControls, z.ZodType<string>, 'string'>;
234
- isoDate: AutoFormFactoryMethod<TControls, z.ZodType<string>, 'string'>;
235
- isoTime: AutoFormFactoryMethod<TControls, z.ZodType<string>, 'string'>;
236
- array: {
237
- <T extends z.ZodType, K extends ControlKey<TControls>>(schema: T, overwrite?: MetaByControlKey<TControls, K>): z.ZodArray<T>;
238
- <T extends z.ZodType>(schema: T, overwrite: MetaByDefaultIfExists<TControls, 'array'>): z.ZodArray<T>;
239
- <T extends z.ZodType, C extends IsComponent>(schema: T, overwrite: MetaByComponent<C>): z.ZodArray<T>;
240
- };
241
- tuple: {
242
- <T extends readonly [z.ZodType, ...z.ZodType[]], K extends ControlKey<TControls>>(schemas: T, overwrite?: MetaByControlKey<TControls, K>): z.ZodTuple<T>;
243
- <T extends readonly [z.ZodType, ...z.ZodType[]]>(schemas: T, overwrite: MetaByDefaultIfExists<TControls, 'tuple'>): z.ZodTuple<T>;
244
- <T extends readonly [z.ZodType, ...z.ZodType[]], C extends IsComponent>(schemas: T, overwrite: MetaByComponent<C>): z.ZodTuple<T>;
245
- };
246
- layout: <C extends IsComponent = IsComponent, Fields extends Record<string, z.ZodType> = Record<string, z.ZodType>>(config: Omit<AutoFormLayoutConfig<C>, 'fields'> & {
247
- fields: Fields;
248
- }) => LayoutFieldMarker<Fields>;
249
- object: {
250
- <T extends object>(): ObjectFactoryOverloads<TControls, z.core.$strip, 'object', Partial<Record<Extract<keyof T, string>, z.ZodType>>>;
251
- } & ObjectFactoryOverloads<TControls, z.core.$strip, 'object'>;
252
- looseObject: {
253
- <T extends object>(): ObjectFactoryOverloads<TControls, z.core.$loose, 'looseObject', Partial<Record<Extract<keyof T, string>, z.ZodType>>>;
254
- } & ObjectFactoryOverloads<TControls, z.core.$loose, 'looseObject'>;
255
- strictObject: {
256
- <T extends object>(): ObjectFactoryOverloads<TControls, z.core.$strict, 'strictObject', Partial<Record<Extract<keyof T, string>, z.ZodType>>>;
257
- } & ObjectFactoryOverloads<TControls, z.core.$strict, 'strictObject'>;
258
- }
259
- export {};