@movk/nuxt 0.1.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +84 -9
  2. package/dist/module.d.mts +11 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +29 -3
  5. package/dist/runtime/components/AutoForm.d.vue.ts +12 -6
  6. package/dist/runtime/components/AutoForm.vue +3 -1
  7. package/dist/runtime/components/AutoForm.vue.d.ts +12 -6
  8. package/dist/runtime/components/ColorChooser.d.vue.ts +11 -5
  9. package/dist/runtime/components/ColorChooser.vue.d.ts +11 -5
  10. package/dist/runtime/components/DatePicker.d.vue.ts +14 -5
  11. package/dist/runtime/components/DatePicker.vue.d.ts +14 -5
  12. package/dist/runtime/components/StarRating.d.vue.ts +7 -7
  13. package/dist/runtime/components/StarRating.vue.d.ts +7 -7
  14. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +6 -4
  15. package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +6 -4
  16. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +6 -4
  17. package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +6 -4
  18. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +6 -4
  19. package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +6 -4
  20. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +6 -4
  21. package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +6 -4
  22. package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +11 -5
  23. package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +11 -5
  24. package/dist/runtime/components/input/WithClear.d.vue.ts +12 -5
  25. package/dist/runtime/components/input/WithClear.vue.d.ts +12 -5
  26. package/dist/runtime/components/input/WithCopy.d.vue.ts +12 -5
  27. package/dist/runtime/components/input/WithCopy.vue.d.ts +12 -5
  28. package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +11 -5
  29. package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +11 -5
  30. package/dist/runtime/composables/useApiAuth.d.ts +47 -0
  31. package/dist/runtime/composables/useApiAuth.js +66 -0
  32. package/dist/runtime/composables/useApiFetch.d.ts +42 -0
  33. package/dist/runtime/composables/useApiFetch.js +43 -0
  34. package/dist/runtime/composables/useAutoForm.d.ts +874 -54
  35. package/dist/runtime/composables/useClientApiFetch.d.ts +24 -0
  36. package/dist/runtime/composables/useClientApiFetch.js +8 -0
  37. package/dist/runtime/composables/useDateFormatter.d.ts +21 -7
  38. package/dist/runtime/composables/useDateFormatter.js +92 -57
  39. package/dist/runtime/composables/useDownloadWithProgress.d.ts +48 -0
  40. package/dist/runtime/composables/useDownloadWithProgress.js +85 -0
  41. package/dist/runtime/composables/useUploadWithProgress.d.ts +52 -0
  42. package/dist/runtime/composables/useUploadWithProgress.js +117 -0
  43. package/dist/runtime/plugins/api.factory.d.ts +2 -0
  44. package/dist/runtime/plugins/api.factory.js +188 -0
  45. package/dist/runtime/schemas/api.d.ts +354 -0
  46. package/dist/runtime/schemas/api.js +212 -0
  47. package/dist/runtime/server/api/_movk/session.post.d.ts +10 -0
  48. package/dist/runtime/server/api/_movk/session.post.js +18 -0
  49. package/dist/runtime/types/api.d.ts +218 -0
  50. package/dist/runtime/types/api.js +8 -0
  51. package/dist/runtime/types/auth.d.ts +34 -0
  52. package/dist/runtime/types/auto-form-renderer.d.ts +14 -22
  53. package/dist/runtime/types/auto-form-renderer.js +0 -0
  54. package/dist/runtime/types/components.d.ts +29 -41
  55. package/dist/runtime/types/components.js +0 -0
  56. package/dist/runtime/types/index.d.ts +1 -0
  57. package/dist/runtime/types/index.js +3 -2
  58. package/dist/runtime/utils/api-utils.d.ts +64 -0
  59. package/dist/runtime/utils/api-utils.js +127 -0
  60. package/package.json +32 -25
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 驱动的自动表单生成、独立 UI 组件和通用工具函数。
3
+ > `@movk/nuxt` 是一个为 Nuxt 4 设计的模块化工程套件,提供 Schema 驱动的自动表单生成、API 集成系统、独立 UI 组件和通用工具函数。
4
4
 
5
5
  [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
6
6
  [![Nuxt](https://img.shields.io/badge/Nuxt-4-00DC82.svg)](https://nuxt.com/)
@@ -13,11 +13,12 @@
13
13
 
14
14
  ## ✨ 特性
15
15
 
16
- - **Schema 驱动** - 基于 Zod v4 的声明式表单定义,一份 Schema 同时定义数据结构、验证规则和 UI 配置。
17
- - **自动化系统** - AutoForm 通过 Schema 自动生成完整表单界面,支持 15+ 种控件类型。
18
- - **模块化设计** - 采用分层架构,按需使用 UI 组件、工具函数或全套自动化系统。
16
+ - **Schema 驱动** - 基于 Zod v4 的声明式表单定义,一份 Schema 同时定义数据结构、验证规则和 UI 配置。
17
+ - **自动化系统** - AutoForm 通过 Schema 自动生成完整表单界面,支持 15+ 种控件类型。
18
+ - **API 集成** - 内置 useApiFetch、useApiAuth、useUploadWithProgress、useDownloadWithProgress,提供多端点支持、自动认证、业务状态码检查、Toast 提示和进度监控。
19
+ - **模块化设计** - 采用分层架构,按需使用 UI 组件、工具函数或全套自动化系统。
19
20
  - **独立组件库** - 内置 DatePicker、StarRating、WithCopy 等 10+ 个通用 UI 组件。
20
- - **类型安全** - 完整的 TypeScript 类型推断,从 Schema 到表单数据。
21
+ - **类型安全** - 完整的 TypeScript 类型推断,从 Schema 到表单数据。
21
22
  - **可扩展** - 支持自定义控件、布局系统、条件渲染等高级特性。
22
23
 
23
24
  ## 🚀 快速开始
@@ -214,11 +215,82 @@ const customControl = defineControl({
214
215
  const meta = getAutoFormMetadata(schema)
215
216
  ```
216
217
 
218
+ #### useApiFetch
219
+
220
+ 基于 Nuxt useFetch 封装的 API 请求:
221
+
222
+ ```ts
223
+ // 基础用法
224
+ const { data, pending, error } = await useApiFetch<User[]>('/users')
225
+
226
+ // POST 请求
227
+ const { data } = await useApiFetch<User>('/users', {
228
+ method: 'POST',
229
+ body: { name: 'test' },
230
+ toast: { successMessage: '创建成功' }
231
+ })
232
+
233
+ // 使用其他端点
234
+ const { data } = await useApiFetch('/users', { endpoint: 'v2' })
235
+ ```
236
+
237
+ #### useApiAuth
238
+
239
+ 与 nuxt-auth-utils 集成的认证管理:
240
+
241
+ ```ts
242
+ const { login, clear, loggedIn, user } = useApiAuth()
243
+
244
+ // 登录
245
+ await login({
246
+ loginPath: '/auth/login',
247
+ credentials: { username: 'admin', password: '123456' },
248
+ userInfoPath: '/auth/me' // 可选,登录后获取用户信息
249
+ })
250
+
251
+ // 登出
252
+ await clear()
253
+
254
+ // 响应式状态
255
+ if (loggedIn.value) {
256
+ console.log('当前用户:', user.value)
257
+ }
258
+ ```
259
+
260
+ #### useUploadWithProgress
261
+
262
+ 带进度监控的文件上传:
263
+
264
+ ```ts
265
+ const { progress, uploading, upload, abort } = useUploadWithProgress()
266
+
267
+ // 上传文件
268
+ await upload('/api/upload', file, {
269
+ fieldName: 'avatar',
270
+ onSuccess: (response) => console.log('上传成功:', response)
271
+ })
272
+ ```
273
+
274
+ #### useDownloadWithProgress
275
+
276
+ 带进度监控的文件下载:
277
+
278
+ ```ts
279
+ const { progress, downloading, download, abort } = useDownloadWithProgress()
280
+
281
+ // 下载文件
282
+ await download('/api/export/report', {
283
+ filename: 'report.pdf',
284
+ onSuccess: (filename) => console.log('下载完成:', filename)
285
+ })
286
+ ```
287
+
217
288
  ## 🏗️ 架构分层
218
289
 
219
290
  Movk Nuxt 采用清晰的分层架构:
220
291
 
221
- - **Core Systems** - AutoForm(已发布)、AutoTable(规划中)
292
+ - **Core Systems** - AutoForm(已发布)
293
+ - **API System** - useApiFetch、useApiAuth,提供完整的 API 请求和认证方案
222
294
  - **Standalone Components** - DatePicker、StarRating、WithCopy 等独立 UI 组件
223
295
  - **Composables** - useDateFormatter、useAutoForm 等通用组合式函数
224
296
  - **Foundation** - 基于 [Nuxt UI](https://ui.nuxt.com)、[Zod v4](https://zod.dev)、[VueUse](https://vueuse.org)
@@ -234,9 +306,12 @@ Movk Nuxt 采用清晰的分层架构:
234
306
 
235
307
  ## 🗺️ 开发路线图
236
308
 
237
- - ✅ **AutoForm** - Schema 驱动的表单系统(已发布)
238
- - 🚧 **AutoTable** - 将复用相同的 Zod Schema,实现定义一次,既生成表单又生成表格
239
- - 🚧 **UseApi** - 将与 AutoForm 的提交逻辑无缝集成,处理加载状态和错误回显
309
+ - ✅ **AutoForm** - Schema 驱动的表单系统(已发布)
310
+ - **API System** - API 请求封装和认证管理(已发布)
311
+ - useApiFetch、useClientApiFetch - API 请求
312
+ - useApiAuth - 认证管理
313
+ - useUploadWithProgress、useDownloadWithProgress - 进度监控
314
+ - ✅ **独立组件库** - DatePicker、StarRating、WithCopy 等组件(已发布)
240
315
 
241
316
  ## 📄 许可证
242
317
 
package/dist/module.d.mts CHANGED
@@ -1,14 +1,25 @@
1
1
  import { z } from 'zod/v4';
2
+ import { ApiClient, MovkApiModuleOptions } from '../dist/runtime/types/index.js';
2
3
  export * from '../dist/runtime/types/index.js';
3
4
 
4
5
  declare const moduleOptionsSchema: any;
5
6
  type ModuleOptions = z.input<typeof moduleOptionsSchema>;
6
7
  declare const _default: any;
7
8
 
9
+ declare module 'nuxt/app' {
10
+ interface NuxtApp {
11
+ $api: ApiClient;
12
+ }
13
+ }
8
14
  declare module 'nuxt/schema' {
9
15
  interface NuxtOptions {
10
16
  ['movk']: ModuleOptions;
11
17
  }
18
+ interface RuntimeConfig {
19
+ }
20
+ interface PublicRuntimeConfig {
21
+ movkApi: MovkApiModuleOptions;
22
+ }
12
23
  }
13
24
 
14
25
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movk/nuxt",
3
- "version": "0.1.1",
3
+ "version": "1.0.0",
4
4
  "configKey": "movk",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.2.0"
package/dist/module.mjs CHANGED
@@ -1,16 +1,22 @@
1
- import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addTypeTemplate } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addPlugin, addServerHandler, addTypeTemplate } from '@nuxt/kit';
2
2
  import defu from 'defu';
3
3
  import { z } from 'zod/v4';
4
+ import { movkApiModuleOptionsSchema } from '../dist/runtime/schemas/api.js';
5
+ export * from '../dist/runtime/types/index.js';
4
6
 
5
7
  const name = "@movk/nuxt";
6
- const version = "0.1.1";
8
+ const version = "1.0.0";
7
9
 
8
10
  const moduleOptionsSchema = z.object({
9
11
  /**
10
12
  * 组件前缀
11
13
  * @default 'M'
12
14
  */
13
- prefix: z.string().default("M")
15
+ prefix: z.string().default("M"),
16
+ /**
17
+ * API 模块配置
18
+ */
19
+ api: movkApiModuleOptionsSchema.optional()
14
20
  });
15
21
  const module$1 = defineNuxtModule({
16
22
  meta: {
@@ -31,6 +37,9 @@ const module$1 = defineNuxtModule({
31
37
  },
32
38
  "@vueuse/nuxt": {
33
39
  version: ">=14.1.0"
40
+ },
41
+ "nuxt-auth-utils": {
42
+ version: ">=0.5.25"
34
43
  }
35
44
  },
36
45
  async setup(options, nuxt) {
@@ -38,6 +47,8 @@ const module$1 = defineNuxtModule({
38
47
  nuxt.options.movk = options;
39
48
  nuxt.options.alias["#movk"] = resolve("./runtime");
40
49
  nuxt.options.appConfig.movk = defu(nuxt.options.appConfig.movk || {}, options);
50
+ const apiConfig = movkApiModuleOptionsSchema.parse(options.api ?? {});
51
+ nuxt.options.runtimeConfig.public.movkApi = apiConfig;
41
52
  addComponentsDir({
42
53
  path: resolve("runtime/components"),
43
54
  prefix: options.prefix,
@@ -46,10 +57,25 @@ const module$1 = defineNuxtModule({
46
57
  });
47
58
  addImportsDir(resolve("runtime/composables"));
48
59
  addImportsDir(resolve("runtime/shared"));
60
+ if (apiConfig.enabled) {
61
+ addPlugin({
62
+ src: resolve("runtime/plugins/api.factory"),
63
+ mode: "all"
64
+ });
65
+ addServerHandler({
66
+ route: "/api/_movk/session",
67
+ method: "post",
68
+ handler: resolve("runtime/server/api/_movk/session.post")
69
+ });
70
+ }
49
71
  addTypeTemplate({
50
72
  filename: "runtime/types/auto-form-zod.d.ts",
51
73
  src: resolve("runtime/types/zod.d.ts")
52
74
  });
75
+ addTypeTemplate({
76
+ filename: "runtime/types/auth.d.ts",
77
+ src: resolve("runtime/types/auth.d.ts")
78
+ });
53
79
  }
54
80
  });
55
81
 
@@ -5,7 +5,7 @@ import type { AutoFormControls, AutoFormSlotProps, DynamicFormSlots } from '../t
5
5
  export interface AutoFormProps<S extends z.ZodObject, T extends boolean = true, N extends boolean = false> extends FormProps<S, T, N> {
6
6
  /**
7
7
  * 是否显示默认提交按钮
8
- * @default true
8
+ * @defaultValue true
9
9
  */
10
10
  submitButton?: boolean;
11
11
  /** 提交按钮属性 */
@@ -16,6 +16,7 @@ export interface AutoFormProps<S extends z.ZodObject, T extends boolean = true,
16
16
  globalMeta?: ZodAutoFormFieldMeta;
17
17
  /** 数组字段添加按钮属性 */
18
18
  addButtonProps?: ButtonProps;
19
+ loadingAuto?: boolean;
19
20
  }
20
21
  export interface AutoFormEmits<S extends z.ZodObject, T extends boolean = true> extends FormEmits<S, T> {
21
22
  }
@@ -24,12 +25,15 @@ export type AutoFormSlots<T extends object> = {
24
25
  footer: (props: AutoFormSlotProps<T>) => any;
25
26
  submit: (props: AutoFormSlotProps<T>) => any;
26
27
  } & DynamicFormSlots<T>;
27
- 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
28
- props: __VLS_PrettifyLocal<AutoFormProps<S, T, N> & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "error", event: import("@nuxt/ui/.").FormErrorEvent) => void) & ((evt: "submit", event: import("@nuxt/ui/.").FormSubmitEvent<import("@nuxt/ui/.").FormData<S, T>>) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
28
+ 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;
32
+ }> & (typeof globalThis extends {
29
33
  __VLS_PROPS_FALLBACK: infer P;
30
34
  } ? P : {});
31
35
  expose: (exposed: import("vue").ShallowUnwrapRef<{
32
- formRef: Readonly<import("vue").ShallowRef<any>>;
36
+ formRef: Readonly<import("vue").ShallowRef<any, any>>;
33
37
  reset: () => void;
34
38
  clear: () => void;
35
39
  }>) => void;
@@ -41,6 +45,8 @@ declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N
41
45
  };
42
46
  declare const _default: typeof __VLS_export;
43
47
  export default _default;
44
- type __VLS_PrettifyLocal<T> = {
48
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
49
+ [K in keyof T]: T[K];
50
+ } : {
45
51
  [K in keyof T as K]: T[K];
46
- } & {};
52
+ }) & {};
@@ -17,6 +17,7 @@ const {
17
17
  submitButtonProps,
18
18
  addButtonProps,
19
19
  state: _state,
20
+ loadingAuto = true,
20
21
  ...restProps
21
22
  } = defineProps({
22
23
  submitButton: { type: Boolean, required: false },
@@ -24,6 +25,7 @@ const {
24
25
  controls: { type: Object, required: false },
25
26
  globalMeta: { type: Object, required: false },
26
27
  addButtonProps: { type: Object, required: false },
28
+ loadingAuto: { type: Boolean, required: false },
27
29
  id: { type: [String, Number], required: false },
28
30
  schema: { type: null, required: false },
29
31
  state: { type: null, required: false },
@@ -34,7 +36,6 @@ const {
34
36
  validateOnInputDelay: { type: Number, required: false },
35
37
  transform: { type: null, required: false },
36
38
  nested: { type: Boolean, required: false },
37
- loadingAuto: { type: Boolean, required: false },
38
39
  class: { type: null, required: false },
39
40
  onSubmit: { type: Function, required: false }
40
41
  });
@@ -126,6 +127,7 @@ defineExpose({
126
127
  ref="formRef"
127
128
  :state="state"
128
129
  :schema="pureSchema"
130
+ :loading-auto="loadingAuto"
129
131
  v-bind="restProps"
130
132
  >
131
133
  <template #default="{ errors, loading }">
@@ -5,7 +5,7 @@ import type { AutoFormControls, AutoFormSlotProps, DynamicFormSlots } from '../t
5
5
  export interface AutoFormProps<S extends z.ZodObject, T extends boolean = true, N extends boolean = false> extends FormProps<S, T, N> {
6
6
  /**
7
7
  * 是否显示默认提交按钮
8
- * @default true
8
+ * @defaultValue true
9
9
  */
10
10
  submitButton?: boolean;
11
11
  /** 提交按钮属性 */
@@ -16,6 +16,7 @@ export interface AutoFormProps<S extends z.ZodObject, T extends boolean = true,
16
16
  globalMeta?: ZodAutoFormFieldMeta;
17
17
  /** 数组字段添加按钮属性 */
18
18
  addButtonProps?: ButtonProps;
19
+ loadingAuto?: boolean;
19
20
  }
20
21
  export interface AutoFormEmits<S extends z.ZodObject, T extends boolean = true> extends FormEmits<S, T> {
21
22
  }
@@ -24,12 +25,15 @@ export type AutoFormSlots<T extends object> = {
24
25
  footer: (props: AutoFormSlotProps<T>) => any;
25
26
  submit: (props: AutoFormSlotProps<T>) => any;
26
27
  } & DynamicFormSlots<T>;
27
- 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
28
- props: __VLS_PrettifyLocal<AutoFormProps<S, T, N> & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "error", event: import("@nuxt/ui/.").FormErrorEvent) => void) & ((evt: "submit", event: import("@nuxt/ui/.").FormSubmitEvent<import("@nuxt/ui/.").FormData<S, T>>) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
28
+ 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;
32
+ }> & (typeof globalThis extends {
29
33
  __VLS_PROPS_FALLBACK: infer P;
30
34
  } ? P : {});
31
35
  expose: (exposed: import("vue").ShallowUnwrapRef<{
32
- formRef: Readonly<import("vue").ShallowRef<any>>;
36
+ formRef: Readonly<import("vue").ShallowRef<any, any>>;
33
37
  reset: () => void;
34
38
  clear: () => void;
35
39
  }>) => void;
@@ -41,6 +45,8 @@ declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N
41
45
  };
42
46
  declare const _default: typeof __VLS_export;
43
47
  export default _default;
44
- type __VLS_PrettifyLocal<T> = {
48
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
49
+ [K in keyof T]: T[K];
50
+ } : {
45
51
  [K in keyof T as K]: T[K];
46
- } & {};
52
+ }) & {};
@@ -1,8 +1,12 @@
1
1
  import type { ColorChooserProps } from '../types/components.js';
2
- declare const __VLS_export: <P extends "click" | "hover" = "click">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<(ColorChooserProps<"click"> & {
2
+ declare const __VLS_export: <P extends "click" | "hover" = "click">(__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<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(ColorChooserProps<"click"> & {
4
4
  modelValue?: string;
5
- }) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "close:prevent") => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: string | undefined) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
5
+ }) & {
6
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
7
+ "onClose:prevent"?: (() => any) | undefined;
8
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
9
+ }> & (typeof globalThis extends {
6
10
  __VLS_PROPS_FALLBACK: infer P_1;
7
11
  } ? P_1 : {});
8
12
  expose: (exposed: {}) => void;
@@ -22,6 +26,8 @@ declare const __VLS_export: <P extends "click" | "hover" = "click">(__VLS_props:
22
26
  };
23
27
  declare const _default: typeof __VLS_export;
24
28
  export default _default;
25
- type __VLS_PrettifyLocal<T> = {
29
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
30
+ [K in keyof T]: T[K];
31
+ } : {
26
32
  [K in keyof T as K]: T[K];
27
- } & {};
33
+ }) & {};
@@ -1,8 +1,12 @@
1
1
  import type { ColorChooserProps } from '../types/components.js';
2
- declare const __VLS_export: <P extends "click" | "hover" = "click">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<(ColorChooserProps<"click"> & {
2
+ declare const __VLS_export: <P extends "click" | "hover" = "click">(__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<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(ColorChooserProps<"click"> & {
4
4
  modelValue?: string;
5
- }) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "close:prevent") => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: string | undefined) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
5
+ }) & {
6
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
7
+ "onClose:prevent"?: (() => any) | undefined;
8
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
9
+ }> & (typeof globalThis extends {
6
10
  __VLS_PROPS_FALLBACK: infer P_1;
7
11
  } ? P_1 : {});
8
12
  expose: (exposed: {}) => void;
@@ -22,6 +26,8 @@ declare const __VLS_export: <P extends "click" | "hover" = "click">(__VLS_props:
22
26
  };
23
27
  declare const _default: typeof __VLS_export;
24
28
  export default _default;
25
- type __VLS_PrettifyLocal<T> = {
29
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
30
+ [K in keyof T]: T[K];
31
+ } : {
26
32
  [K in keyof T as K]: T[K];
27
- } & {};
33
+ }) & {};
@@ -1,9 +1,16 @@
1
1
  import type { DateValue } from '@internationalized/date';
2
2
  import type { DatePickerProps, ValueType } from '../types/components.js';
3
- declare const __VLS_export: <R extends boolean, M extends boolean, P extends "click" | "hover" = "click">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<(DatePickerProps<R, M, P> & {
3
+ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "click" | "hover" = "click">(__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<(DatePickerProps<R, M, P> & {
5
5
  modelValue?: ValueType<R, M>;
6
- }) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "update:modelValue", date: R extends true ? import("reka-ui").DateRange | null : M extends true ? DateValue[] | undefined : DateValue | undefined) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void) & ((evt: "update:validModelValue", date: import("reka-ui").DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void) & ((evt: "close:prevent") => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: ValueType<R, M>) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
6
+ }) & {
7
+ "onUpdate:modelValue"?: ((value: ValueType<R, M>) => any) | undefined;
8
+ "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
9
+ "onUpdate:validModelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
10
+ "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
11
+ "onClose:prevent"?: (() => any) | undefined;
12
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
13
+ }> & (typeof globalThis extends {
7
14
  __VLS_PROPS_FALLBACK: infer P_1;
8
15
  } ? P_1 : {});
9
16
  expose: (exposed: {}) => void;
@@ -29,6 +36,8 @@ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "cl
29
36
  };
30
37
  declare const _default: typeof __VLS_export;
31
38
  export default _default;
32
- type __VLS_PrettifyLocal<T> = {
39
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
40
+ [K in keyof T]: T[K];
41
+ } : {
33
42
  [K in keyof T as K]: T[K];
34
- } & {};
43
+ }) & {};
@@ -1,9 +1,16 @@
1
1
  import type { DateValue } from '@internationalized/date';
2
2
  import type { DatePickerProps, ValueType } from '../types/components.js';
3
- declare const __VLS_export: <R extends boolean, M extends boolean, P extends "click" | "hover" = "click">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<(DatePickerProps<R, M, P> & {
3
+ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "click" | "hover" = "click">(__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<(DatePickerProps<R, M, P> & {
5
5
  modelValue?: ValueType<R, M>;
6
- }) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "update:modelValue", date: R extends true ? import("reka-ui").DateRange | null : M extends true ? DateValue[] | undefined : DateValue | undefined) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void) & ((evt: "update:validModelValue", date: import("reka-ui").DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void) & ((evt: "close:prevent") => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: ValueType<R, M>) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
6
+ }) & {
7
+ "onUpdate:modelValue"?: ((value: ValueType<R, M>) => any) | undefined;
8
+ "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
9
+ "onUpdate:validModelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
10
+ "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
11
+ "onClose:prevent"?: (() => any) | undefined;
12
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
13
+ }> & (typeof globalThis extends {
7
14
  __VLS_PROPS_FALLBACK: infer P_1;
8
15
  } ? P_1 : {});
9
16
  expose: (exposed: {}) => void;
@@ -29,6 +36,8 @@ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "cl
29
36
  };
30
37
  declare const _default: typeof __VLS_export;
31
38
  export default _default;
32
- type __VLS_PrettifyLocal<T> = {
39
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
40
+ [K in keyof T]: T[K];
41
+ } : {
33
42
  [K in keyof T as K]: T[K];
34
- } & {};
43
+ }) & {};
@@ -75,29 +75,29 @@ export interface StarRatingEmits {
75
75
  declare var __VLS_1: {
76
76
  value: number;
77
77
  max: number;
78
- }, __VLS_14: {
78
+ }, __VLS_13: {
79
79
  value: number;
80
80
  max: number;
81
- label: any;
82
- }, __VLS_22: {
81
+ label: string;
82
+ }, __VLS_20: {
83
83
  value: number;
84
84
  max: number;
85
85
  };
86
86
  type __VLS_Slots = {} & {
87
87
  prefix?: (props: typeof __VLS_1) => any;
88
88
  } & {
89
- badge?: (props: typeof __VLS_14) => any;
89
+ badge?: (props: typeof __VLS_13) => any;
90
90
  } & {
91
- suffix?: (props: typeof __VLS_22) => any;
91
+ suffix?: (props: typeof __VLS_20) => any;
92
92
  };
93
93
  declare const __VLS_base: import("vue").DefineComponent<StarRatingProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
94
94
  change: (value: number) => any;
95
- "update:modelValue": (value: number) => any;
96
95
  hover: (value: number | null) => any;
96
+ "update:modelValue": (value: number) => any;
97
97
  }, string, import("vue").PublicProps, Readonly<StarRatingProps> & Readonly<{
98
98
  onChange?: ((value: number) => any) | undefined;
99
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
100
99
  onHover?: ((value: number | null) => any) | undefined;
100
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
101
101
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
102
102
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
103
103
  declare const _default: typeof __VLS_export;
@@ -75,29 +75,29 @@ export interface StarRatingEmits {
75
75
  declare var __VLS_1: {
76
76
  value: number;
77
77
  max: number;
78
- }, __VLS_14: {
78
+ }, __VLS_13: {
79
79
  value: number;
80
80
  max: number;
81
- label: any;
82
- }, __VLS_22: {
81
+ label: string;
82
+ }, __VLS_20: {
83
83
  value: number;
84
84
  max: number;
85
85
  };
86
86
  type __VLS_Slots = {} & {
87
87
  prefix?: (props: typeof __VLS_1) => any;
88
88
  } & {
89
- badge?: (props: typeof __VLS_14) => any;
89
+ badge?: (props: typeof __VLS_13) => any;
90
90
  } & {
91
- suffix?: (props: typeof __VLS_22) => any;
91
+ suffix?: (props: typeof __VLS_20) => any;
92
92
  };
93
93
  declare const __VLS_base: import("vue").DefineComponent<StarRatingProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
94
94
  change: (value: number) => any;
95
- "update:modelValue": (value: number) => any;
96
95
  hover: (value: number | null) => any;
96
+ "update:modelValue": (value: number) => any;
97
97
  }, string, import("vue").PublicProps, Readonly<StarRatingProps> & Readonly<{
98
98
  onChange?: ((value: number) => any) | undefined;
99
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
100
99
  onHover?: ((value: number | null) => any) | undefined;
100
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
101
101
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
102
102
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
103
103
  declare const _default: typeof __VLS_export;
@@ -1,7 +1,7 @@
1
1
  import type { z } from 'zod/v4';
2
2
  import type { AutoFormRendererArrayProps } from '../../types/auto-form-renderer.js';
3
- declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<AutoFormRendererArrayProps<S>> & import("vue").PublicProps & (typeof globalThis extends {
3
+ declare const __VLS_export: <S extends z.ZodObject>(__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<AutoFormRendererArrayProps<S>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
6
6
  } ? P : {});
7
7
  expose: (exposed: {}) => void;
@@ -13,6 +13,8 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
13
13
  };
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
16
- type __VLS_PrettifyLocal<T> = {
16
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
17
+ [K in keyof T]: T[K];
18
+ } : {
17
19
  [K in keyof T as K]: T[K];
18
- } & {};
20
+ }) & {};
@@ -1,7 +1,7 @@
1
1
  import type { z } from 'zod/v4';
2
2
  import type { AutoFormRendererArrayProps } from '../../types/auto-form-renderer.js';
3
- declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<AutoFormRendererArrayProps<S>> & import("vue").PublicProps & (typeof globalThis extends {
3
+ declare const __VLS_export: <S extends z.ZodObject>(__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<AutoFormRendererArrayProps<S>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
6
6
  } ? P : {});
7
7
  expose: (exposed: {}) => void;
@@ -13,6 +13,8 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
13
13
  };
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
16
- type __VLS_PrettifyLocal<T> = {
16
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
17
+ [K in keyof T]: T[K];
18
+ } : {
17
19
  [K in keyof T as K]: T[K];
18
- } & {};
20
+ }) & {};
@@ -1,7 +1,7 @@
1
1
  import type { z } from 'zod/v4';
2
2
  import type { AutoFormFieldProps } from '../../types/auto-form-renderer.js';
3
- declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<AutoFormFieldProps<S>> & import("vue").PublicProps & (typeof globalThis extends {
3
+ declare const __VLS_export: <S extends z.ZodObject>(__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<AutoFormFieldProps<S>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
6
6
  } ? P : {});
7
7
  expose: (exposed: {}) => void;
@@ -13,6 +13,8 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
13
13
  };
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
16
- type __VLS_PrettifyLocal<T> = {
16
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
17
+ [K in keyof T]: T[K];
18
+ } : {
17
19
  [K in keyof T as K]: T[K];
18
- } & {};
20
+ }) & {};
@@ -1,7 +1,7 @@
1
1
  import type { z } from 'zod/v4';
2
2
  import type { AutoFormFieldProps } from '../../types/auto-form-renderer.js';
3
- declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<AutoFormFieldProps<S>> & import("vue").PublicProps & (typeof globalThis extends {
3
+ declare const __VLS_export: <S extends z.ZodObject>(__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<AutoFormFieldProps<S>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
6
6
  } ? P : {});
7
7
  expose: (exposed: {}) => void;
@@ -13,6 +13,8 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
13
13
  };
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
16
- type __VLS_PrettifyLocal<T> = {
16
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
17
+ [K in keyof T]: T[K];
18
+ } : {
17
19
  [K in keyof T as K]: T[K];
18
- } & {};
20
+ }) & {};