@movk/nuxt 1.4.2 → 1.5.1

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 (56) hide show
  1. package/README.en.md +2 -2
  2. package/README.md +2 -2
  3. package/dist/module.json +2 -2
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/AutoForm.d.vue.ts +1 -1
  6. package/dist/runtime/components/AutoForm.vue.d.ts +1 -1
  7. package/dist/runtime/components/ColorChooser.d.vue.ts +1 -1
  8. package/dist/runtime/components/ColorChooser.vue.d.ts +1 -1
  9. package/dist/runtime/components/DataTable.d.vue.ts +1 -1
  10. package/dist/runtime/components/DataTable.vue.d.ts +1 -1
  11. package/dist/runtime/components/DatePicker.d.vue.ts +1 -1
  12. package/dist/runtime/components/DatePicker.vue.d.ts +1 -1
  13. package/dist/runtime/components/PillGroup.d.vue.ts +1 -1
  14. package/dist/runtime/components/PillGroup.vue.d.ts +1 -1
  15. package/dist/runtime/components/Popconfirm.d.vue.ts +1 -1
  16. package/dist/runtime/components/Popconfirm.vue.d.ts +1 -1
  17. package/dist/runtime/components/SearchForm.d.vue.ts +1 -1
  18. package/dist/runtime/components/SearchForm.vue.d.ts +1 -1
  19. package/dist/runtime/components/Tree.d.vue.ts +1 -1
  20. package/dist/runtime/components/Tree.vue.d.ts +1 -1
  21. package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +1 -1
  22. package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +1 -1
  23. package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +1 -1
  24. package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +1 -1
  25. package/dist/runtime/components/input/WithClear.d.vue.ts +1 -1
  26. package/dist/runtime/components/input/WithClear.vue.d.ts +1 -1
  27. package/dist/runtime/components/input/WithCopy.d.vue.ts +1 -1
  28. package/dist/runtime/components/input/WithCopy.vue.d.ts +1 -1
  29. package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +1 -1
  30. package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +1 -1
  31. package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +1 -1
  32. package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +1 -1
  33. package/dist/runtime/composables/useTheme.js +3 -3
  34. package/dist/runtime/domains/api/auth.js +9 -3
  35. package/dist/runtime/domains/api/endpoint-config.d.ts +1 -1
  36. package/dist/runtime/domains/api/endpoint-config.js +5 -1
  37. package/dist/runtime/domains/auto-form/controls.d.ts +15 -95
  38. package/dist/runtime/domains/auto-form/controls.js +0 -2
  39. package/dist/runtime/domains/data-table/components/Pagination.d.vue.ts +1 -1
  40. package/dist/runtime/domains/data-table/components/Pagination.vue.d.ts +1 -1
  41. package/dist/runtime/domains/theme/theme-icons.d.ts +9 -0
  42. package/dist/runtime/domains/theme/theme-icons.js +7 -0
  43. package/dist/runtime/plugins/theme.js +2 -2
  44. package/dist/runtime/types/api/config.d.ts +12 -1
  45. package/dist/runtime/types/api/module.d.ts +1 -1
  46. package/dist/runtime/types/components/index.d.ts +0 -1
  47. package/dist/runtime/vue/plugins/theme.js +2 -2
  48. package/dist/shared/{nuxt.CXM2nhP4.mjs → nuxt.DJKBap-S.mjs} +0 -28
  49. package/dist/unplugin.mjs +1 -1
  50. package/dist/vite.mjs +1 -1
  51. package/package.json +22 -22
  52. package/dist/runtime/components/StarRating.d.vue.ts +0 -52
  53. package/dist/runtime/components/StarRating.vue +0 -238
  54. package/dist/runtime/components/StarRating.vue.d.ts +0 -52
  55. package/dist/runtime/types/components/star-rating.d.ts +0 -55
  56. package/dist/runtime/types/components/star-rating.js +0 -0
package/README.en.md CHANGED
@@ -22,7 +22,7 @@ Movk Nuxt is a UI engineering toolkit built on top of Nuxt UI, offering two ways
22
22
 
23
23
  - **AutoForm — Schema-driven forms** (✅ Nuxt | ✅ Vue + Vite) - Built on Zod v4 with a "define-is-render" model: a single Schema declares the data structure, validation rules, and UI configuration at once, automatically generating a complete form interface.
24
24
  - **DataTable — Data table** (✅ Nuxt | ✅ Vue + Vite) - Wraps TanStack Table, covering data columns, special columns (selection / index / expand / actions), tree-structured data, row interactions, appearance customization, pagination, and load-more.
25
- - **Standalone component library** (✅ Nuxt | ✅ Vue + Vite) - General-purpose UI components such as DatePicker, StarRating, PillGroup, SearchForm, Tree, WithCopy, and ThemePicker, usable on their own without AutoForm.
25
+ - **Standalone component library** (✅ Nuxt | ✅ Vue + Vite) - General-purpose UI components such as DatePicker, PillGroup, SearchForm, Tree, WithCopy, and ThemePicker, usable on their own without AutoForm.
26
26
  - **Theming and Composables** (✅ Nuxt | ✅ Vue + Vite) - Non-server composition functions such as useTheme (theme read/write and export), useMessageBox (imperative dialogs), and useDateFormatter (i18n dates).
27
27
  - **API integration system** (✅ Nuxt | ❌ Vue + Vite) - The useApiFetch / useLazyApiFetch / useClientApiFetch trio plus useUploadWithProgress / useDownloadWithProgress, providing multi-endpoint support, automatic authentication, business status-code checks, data unwrapping, Toast notifications, and progress monitoring; **depends on the Nuxt server runtime and is available in Nuxt mode only**.
28
28
  - **Type safety** - Full TypeScript type inference, from Schema to form data, with component prop callbacks and event handler types derivable via indexed access.
@@ -276,7 +276,7 @@ Movk Nuxt adopts a clear layered architecture:
276
276
 
277
277
  - **Core Systems** - AutoForm (Schema-driven forms), DataTable (data table)
278
278
  - **API System** - useApiFetch / useLazyApiFetch / useClientApiFetch, useUploadWithProgress, useDownloadWithProgress, providing a complete API request solution
279
- - **Standalone Components** - Standalone UI components such as DatePicker, StarRating, PillGroup, SearchForm, Tree, WithCopy, and ThemePicker
279
+ - **Standalone Components** - Standalone UI components such as DatePicker, PillGroup, SearchForm, Tree, WithCopy, and ThemePicker
280
280
  - **Composables** - General-purpose composition functions such as useDateFormatter, useTheme, useMessageBox, and useAutoForm
281
281
  - **Foundation** - Built on [Nuxt UI](https://ui.nuxt.com), [Zod v4](https://zod.dev), [VueUse](https://vueuse.org), and [TanStack Table](https://tanstack.com/table)
282
282
 
package/README.md CHANGED
@@ -22,7 +22,7 @@ Movk Nuxt 是构建在 Nuxt UI 之上的 UI 工程套件,提供两种使用方
22
22
 
23
23
  - **AutoForm — Schema 驱动表单**(✅ Nuxt | ✅ Vue + Vite)- 基于 Zod v4 的「定义即渲染」,一份 Schema 同时声明数据结构、验证规则和 UI 配置,自动生成完整表单界面。
24
24
  - **DataTable — 数据表格**(✅ Nuxt | ✅ Vue + Vite)- 基于 TanStack Table 封装,覆盖数据列、特殊列(选择/索引/展开/操作)、树形数据、行交互、外观定制、分页与加载更多。
25
- - **独立组件库**(✅ Nuxt | ✅ Vue + Vite)- DatePicker、StarRating、PillGroup、SearchForm、Tree、WithCopy、ThemePicker 等通用 UI 组件,无需依赖 AutoForm 即可独立使用。
25
+ - **独立组件库**(✅ Nuxt | ✅ Vue + Vite)- DatePicker、PillGroup、SearchForm、Tree、WithCopy、ThemePicker 等通用 UI 组件,无需依赖 AutoForm 即可独立使用。
26
26
  - **主题与 Composables**(✅ Nuxt | ✅ Vue + Vite)- useTheme(主题读写与导出)、useMessageBox(命令式弹窗)、useDateFormatter(国际化日期)等非服务端组合式函数。
27
27
  - **API 集成系统**(✅ Nuxt | ❌ Vue + Vite)- useApiFetch / useLazyApiFetch / useClientApiFetch 三件套 + useUploadWithProgress / useDownloadWithProgress,提供多端点、自动认证、业务状态码检查、数据解包、Toast 提示和进度监控;**依赖 Nuxt 服务端运行时,仅 Nuxt 模式可用**。
28
28
  - **类型安全** - 完整的 TypeScript 类型推断,从 Schema 到表单数据,组件 prop 回调与事件处理类型可索引访问派生。
@@ -276,7 +276,7 @@ Movk Nuxt 采用清晰的分层架构:
276
276
 
277
277
  - **Core Systems** - AutoForm(Schema 驱动表单)、DataTable(数据表格)
278
278
  - **API System** - useApiFetch / useLazyApiFetch / useClientApiFetch、useUploadWithProgress、useDownloadWithProgress,提供完整的 API 请求方案
279
- - **Standalone Components** - DatePicker、StarRating、PillGroup、SearchForm、Tree、WithCopy、ThemePicker 等独立 UI 组件
279
+ - **Standalone Components** - DatePicker、PillGroup、SearchForm、Tree、WithCopy、ThemePicker 等独立 UI 组件
280
280
  - **Composables** - useDateFormatter、useTheme、useMessageBox、useAutoForm 等通用组合式函数
281
281
  - **Foundation** - 基于 [Nuxt UI](https://ui.nuxt.com)、[Zod v4](https://zod.dev)、[VueUse](https://vueuse.org)、[TanStack Table](https://tanstack.com/table)
282
282
 
package/dist/module.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@movk/nuxt",
3
- "version": "1.4.2",
3
+ "version": "1.5.1",
4
4
  "configKey": "movk",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.4.2"
7
7
  },
8
8
  "builder": {
9
- "@nuxt/module-builder": "1.0.2",
9
+ "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { addPlugin, defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
2
  import defu, { defu as defu$1 } from 'defu';
3
- import { U as UI_COMPONENTS, a as addTemplates } from './shared/nuxt.CXM2nhP4.mjs';
3
+ import { U as UI_COMPONENTS, a as addTemplates } from './shared/nuxt.DJKBap-S.mjs';
4
4
  import { getPackageJsonMetadata } from '../dist/runtime/utils/meta.js';
5
5
  import { kebabCase } from 'scule';
6
6
  import { updateSiteConfig } from 'nuxt-site-config/kit';
@@ -9,7 +9,7 @@ export * from '../dist/runtime/types/index.js';
9
9
  import 'node:url';
10
10
 
11
11
  const name = "@movk/nuxt";
12
- const version = "1.4.2";
12
+ const version = "1.5.1";
13
13
 
14
14
  function getDefaultApiConfig(apiConfig) {
15
15
  const publicEndpoints = {};
@@ -20,7 +20,7 @@ declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N
20
20
  slots: AutoFormSlots<N extends false ? Partial<InferInput<S>> : never>;
21
21
  emit: (evt: "error", args_0: import("@nuxt/ui").FormErrorEvent) => void;
22
22
  }>) => import("vue").VNode & {
23
- __ctx?: Awaited<typeof __VLS_setup>;
23
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
24
24
  };
25
25
  declare const _default: typeof __VLS_export;
26
26
  export default _default;
@@ -20,7 +20,7 @@ declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N
20
20
  slots: AutoFormSlots<N extends false ? Partial<InferInput<S>> : never>;
21
21
  emit: (evt: "error", args_0: import("@nuxt/ui").FormErrorEvent) => void;
22
22
  }>) => import("vue").VNode & {
23
- __ctx?: Awaited<typeof __VLS_setup>;
23
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
24
24
  };
25
25
  declare const _default: typeof __VLS_export;
26
26
  export default _default;
@@ -25,7 +25,7 @@ declare const __VLS_export: <M extends "click" | "hover">(__VLS_props: NonNullab
25
25
  slots: ColorChooserSlots;
26
26
  emit: (((evt: "clear") => void) & ((evt: "change", value: string | undefined) => void) & ((evt: "copy", value: string) => void) & ((evt: "update:modelValue", value: string | undefined) => void) & ((evt: "update:open", open: boolean) => void) & ((evt: "format-change", format: ColorFormat) => void)) & ((event: "update:modelValue", value: string | undefined) => void);
27
27
  }>) => import("vue").VNode & {
28
- __ctx?: Awaited<typeof __VLS_setup>;
28
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
29
29
  };
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -25,7 +25,7 @@ declare const __VLS_export: <M extends "click" | "hover">(__VLS_props: NonNullab
25
25
  slots: ColorChooserSlots;
26
26
  emit: (((evt: "clear") => void) & ((evt: "change", value: string | undefined) => void) & ((evt: "copy", value: string) => void) & ((evt: "update:modelValue", value: string | undefined) => void) & ((evt: "update:open", open: boolean) => void) & ((evt: "format-change", format: ColorFormat) => void)) & ((event: "update:modelValue", value: string | undefined) => void);
27
27
  }>) => import("vue").VNode & {
28
- __ctx?: Awaited<typeof __VLS_setup>;
28
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
29
29
  };
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -46,7 +46,7 @@ declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Await
46
46
  slots: DataTableSlots<T>;
47
47
  emit: ((event: "update:pagination", value: PaginationState | undefined) => void) & ((event: "update:columnVisibility", value: VisibilityState | undefined) => void) & ((event: "update:columnPinning", value: ColumnPinningState | undefined) => void) & ((event: "update:columnSizing", value: ColumnSizingState | undefined) => void) & ((event: "update:rowSelection", value: RowSelectionState | undefined) => void) & ((event: "update:rowPinning", value: RowPinningState) => void) & ((event: "update:sorting", value: SortingState) => void) & ((event: "update:expanded", value: ExpandedState | undefined) => void) & ((event: "update:columnVisibilityKeys", value: string[] | undefined) => void) & ((event: "update:columnVisibilityExcludeKeys", value: string[] | undefined) => void) & ((event: "update:rowSelectionKeys", value: string[] | undefined) => void) & ((event: "update:expandedKeys", value: string[] | undefined) => void);
48
48
  }>) => import("vue").VNode & {
49
- __ctx?: Awaited<typeof __VLS_setup>;
49
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
50
50
  };
51
51
  declare const _default: typeof __VLS_export;
52
52
  export default _default;
@@ -46,7 +46,7 @@ declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Await
46
46
  slots: DataTableSlots<T>;
47
47
  emit: ((event: "update:pagination", value: PaginationState | undefined) => void) & ((event: "update:columnVisibility", value: VisibilityState | undefined) => void) & ((event: "update:columnPinning", value: ColumnPinningState | undefined) => void) & ((event: "update:columnSizing", value: ColumnSizingState | undefined) => void) & ((event: "update:rowSelection", value: RowSelectionState | undefined) => void) & ((event: "update:rowPinning", value: RowPinningState) => void) & ((event: "update:sorting", value: SortingState) => void) & ((event: "update:expanded", value: ExpandedState | undefined) => void) & ((event: "update:columnVisibilityKeys", value: string[] | undefined) => void) & ((event: "update:columnVisibilityExcludeKeys", value: string[] | undefined) => void) & ((event: "update:rowSelectionKeys", value: string[] | undefined) => void) & ((event: "update:expandedKeys", value: string[] | undefined) => void);
48
48
  }>) => import("vue").VNode & {
49
- __ctx?: Awaited<typeof __VLS_setup>;
49
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
50
50
  };
51
51
  declare const _default: typeof __VLS_export;
52
52
  export default _default;
@@ -25,7 +25,7 @@ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "cl
25
25
  slots: DatePickerSlots<P>;
26
26
  emit: (((evt: "update:modelValue", value: FormattedValue<R, M, V>) => void) & ((evt: "update:placeholder", 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)) & ((event: "update:modelValue", value: FormattedValue<R, M, V> | undefined) => void);
27
27
  }>) => import("vue").VNode & {
28
- __ctx?: Awaited<typeof __VLS_setup>;
28
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
29
29
  };
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -25,7 +25,7 @@ declare const __VLS_export: <R extends boolean, M extends boolean, P extends "cl
25
25
  slots: DatePickerSlots<P>;
26
26
  emit: (((evt: "update:modelValue", value: FormattedValue<R, M, V>) => void) & ((evt: "update:placeholder", 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)) & ((event: "update:modelValue", value: FormattedValue<R, M, V> | undefined) => void);
27
27
  }>) => import("vue").VNode & {
28
- __ctx?: Awaited<typeof __VLS_setup>;
28
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
29
29
  };
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends PillItem, VK extends GetItemKeys<T> | und
22
22
  slots: PillGroupSlots<T, VK, M>;
23
23
  emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", value: GetModelValue<T, VK, M, undefined>) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "select", payload: import("../types").PillSelectPayload<T>) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M, undefined>) => void)) & ((event: "update:modelValue", value: GetModelValue<T, VK, M> | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends PillItem, VK extends GetItemKeys<T> | und
22
22
  slots: PillGroupSlots<T, VK, M>;
23
23
  emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", value: GetModelValue<T, VK, M, undefined>) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "select", payload: import("../types").PillSelectPayload<T>) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M, undefined>) => void)) & ((event: "update:modelValue", value: GetModelValue<T, VK, M> | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -19,7 +19,7 @@ declare const __VLS_export: <M extends "click" | "hover">(__VLS_props: NonNullab
19
19
  slots: PopconfirmSlots<"click" | "hover">;
20
20
  emit: ((evt: "error", error: unknown) => void) & ((evt: "cancel") => void) & ((evt: "confirm") => void);
21
21
  }>) => import("vue").VNode & {
22
- __ctx?: Awaited<typeof __VLS_setup>;
22
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
23
23
  };
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -19,7 +19,7 @@ declare const __VLS_export: <M extends "click" | "hover">(__VLS_props: NonNullab
19
19
  slots: PopconfirmSlots<"click" | "hover">;
20
20
  emit: ((evt: "error", error: unknown) => void) & ((evt: "cancel") => void) & ((evt: "confirm") => void);
21
21
  }>) => import("vue").VNode & {
22
- __ctx?: Awaited<typeof __VLS_setup>;
22
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
23
23
  };
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -32,7 +32,7 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
32
32
  slots: SearchFormSlots<S>;
33
33
  emit: (((evt: "error", event: import("@nuxt/ui").FormErrorEvent) => void) & ((evt: "clear", state: Partial<InferInput<S>>) => void) & ((evt: "reset", state: Partial<InferInput<S>>) => void) & ((evt: "expand", expanded: boolean) => void) & ((evt: "update:expanded", expanded: boolean) => void)) & (((event: "update:modelValue", value: Partial<InferInput<S>>) => void) & ((event: "update:expanded", value: boolean | undefined) => void));
34
34
  }>) => import("vue").VNode & {
35
- __ctx?: Awaited<typeof __VLS_setup>;
35
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
36
36
  };
37
37
  declare const _default: typeof __VLS_export;
38
38
  export default _default;
@@ -32,7 +32,7 @@ declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awa
32
32
  slots: SearchFormSlots<S>;
33
33
  emit: (((evt: "error", event: import("@nuxt/ui").FormErrorEvent) => void) & ((evt: "clear", state: Partial<InferInput<S>>) => void) & ((evt: "reset", state: Partial<InferInput<S>>) => void) & ((evt: "expand", expanded: boolean) => void) & ((evt: "update:expanded", expanded: boolean) => void)) & (((event: "update:modelValue", value: Partial<InferInput<S>>) => void) & ((event: "update:expanded", value: boolean | undefined) => void));
34
34
  }>) => import("vue").VNode & {
35
- __ctx?: Awaited<typeof __VLS_setup>;
35
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
36
36
  };
37
37
  declare const _default: typeof __VLS_export;
38
38
  export default _default;
@@ -33,7 +33,7 @@ declare const __VLS_export: <T extends TreeItem[] = TreeItem[], M extends boolea
33
33
  selection: import("../types").TreeSelectionResult<T[number]>;
34
34
  }) => void) & ((evt: "update:modelValue", val: M extends true ? T[number][] : T[number]) => void) & ((evt: "update:expanded", val: string[]) => void) & ((evt: "update:search", value: string) => void)) & (((event: "update:modelValue", value: (M extends true ? T[number][] : T[number]) | undefined) => void) & ((event: "update:expanded", value: string[]) => void) & ((event: "update:search", value: string) => void) & ((event: "update:selectedKeys", value: string[] | undefined) => void));
35
35
  }>) => import("vue").VNode & {
36
- __ctx?: Awaited<typeof __VLS_setup>;
36
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
37
37
  };
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -33,7 +33,7 @@ declare const __VLS_export: <T extends TreeItem[] = TreeItem[], M extends boolea
33
33
  selection: import("../types").TreeSelectionResult<T[number]>;
34
34
  }) => void) & ((evt: "update:modelValue", val: M extends true ? T[number][] : T[number]) => void) & ((evt: "update:expanded", val: string[]) => void) & ((evt: "update:search", value: string) => void)) & (((event: "update:modelValue", value: (M extends true ? T[number][] : T[number]) | undefined) => void) & ((event: "update:expanded", value: string[]) => void) & ((event: "update:search", value: string) => void) & ((event: "update:selectedKeys", value: string[] | undefined) => void));
35
35
  }>) => import("vue").VNode & {
36
- __ctx?: Awaited<typeof __VLS_setup>;
36
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
37
37
  };
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "leading">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "leading">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "trailing">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "trailing">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "trailing">;
23
23
  emit: (((evt: "clear") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "trailing">;
23
23
  emit: (((evt: "clear") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "trailing">;
23
23
  emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "copy", value: string) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "trailing">;
23
23
  emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "copy", value: string) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "default" | "trailing">;
23
23
  emit: (((evt: "clear") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -22,7 +22,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
22
22
  slots: OmitByKey<InputSlots, "default" | "trailing">;
23
23
  emit: (((evt: "clear") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void);
24
24
  }>) => import("vue").VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "trailing">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -21,7 +21,7 @@ declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awai
21
21
  slots: OmitByKey<InputSlots, "trailing">;
22
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);
23
23
  }>) => import("vue").VNode & {
24
- __ctx?: Awaited<typeof __VLS_setup>;
24
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
25
25
  };
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { useAppConfig, useColorMode, useSiteConfig } from "#imports";
2
- import { themeIcons } from "../domains/theme/theme-icons.js";
2
+ import { resolveThemeIcons, themeIcons } from "../domains/theme/theme-icons.js";
3
3
  import { omit, kebabCase } from "@movk/core";
4
4
  import { useLocalStorage } from "@vueuse/core";
5
5
  import colors from "tailwindcss/colors";
@@ -67,7 +67,7 @@ export function useTheme() {
67
67
  },
68
68
  set(option) {
69
69
  _iconSet.value = option;
70
- ui.icons = themeIcons[option];
70
+ ui.icons = resolveThemeIcons(option, ui.icons);
71
71
  }
72
72
  });
73
73
  const modes = computed(() => [
@@ -172,7 +172,7 @@ export function useTheme() {
172
172
  _radius.value = movk?.radius ?? defaultConfig.radius;
173
173
  _font.value = movk?.font ?? defaultConfig.font;
174
174
  _iconSet.value = defaultIcon;
175
- ui.icons = themeIcons[defaultIcon];
175
+ ui.icons = resolveThemeIcons(defaultIcon, ui.icons);
176
176
  _blackAsPrimary.value = movk?.blackAsPrimary ?? defaultConfig.blackAsPrimary;
177
177
  }
178
178
  return {
@@ -1,5 +1,5 @@
1
1
  import { getPath } from "@movk/core";
2
- import { useNuxtApp, useUserSession } from "#imports";
2
+ import { useNuxtApp, useRuntimeConfig, useUserSession } from "#imports";
3
3
  function getUserSession() {
4
4
  try {
5
5
  const nuxtApp = useNuxtApp();
@@ -14,6 +14,13 @@ function getTokenFromSession(tokenPath) {
14
14
  const sessionData = userSession.session.value;
15
15
  return getPath(sessionData, tokenPath) || null;
16
16
  }
17
+ function getTokenFromPublicRuntimeConfig(tokenPath) {
18
+ try {
19
+ return getPath(useRuntimeConfig().public, tokenPath) || null;
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
17
24
  function buildAuthHeaderValue(token, config) {
18
25
  const tokenType = config.tokenType === "Custom" ? config.customTokenType || "" : config.tokenType || "Bearer";
19
26
  return tokenType ? `${tokenType} ${token}` : token;
@@ -21,8 +28,7 @@ function buildAuthHeaderValue(token, config) {
21
28
  export function getAuthHeaders(auth) {
22
29
  const headers = {};
23
30
  if (!auth.enabled) return headers;
24
- const tokenPath = auth.sessionTokenPath || "token";
25
- const token = getTokenFromSession(tokenPath);
31
+ const token = auth.tokenSource === "public-runtime-config" ? getTokenFromPublicRuntimeConfig(auth.tokenPath || "apiToken") : getTokenFromSession(auth.sessionTokenPath || "token");
26
32
  if (token) {
27
33
  const headerName = auth.headerName || "Authorization";
28
34
  headers[headerName] = buildAuthHeaderValue(token, auth);
@@ -5,7 +5,7 @@ import type { EndpointPrivateConfig, ResolvedEndpointConfig } from '../../types/
5
5
  *
6
6
  * @param publicConfig 模块公共配置
7
7
  * @param endpoint 端点名称;未指定时使用 defaultEndpoint
8
- * @param privateEndpoints 服务端私有端点配置(含 headers),仅在服务端可用
8
+ * @param privateEndpoints 服务端私有端点配置(含机密 headers),仅在服务端可用;与端点 publicHeaders 合并后生效
9
9
  * @description 端点不存在时降级到 defaultEndpoint,并打印警告
10
10
  */
11
11
  export declare function resolveEndpointConfig(publicConfig: MovkApiPublicConfig, endpoint?: string, privateEndpoints?: Record<string, EndpointPrivateConfig>): ResolvedEndpointConfig;
@@ -6,10 +6,14 @@ export function resolveEndpointConfig(publicConfig, endpoint, privateEndpoints)
6
6
  console.warn(`[@movk/nuxt] Endpoint "${endpointName}" not found, using default`);
7
7
  return resolveEndpointConfig(publicConfig, publicConfig.defaultEndpoint || "default", privateEndpoints);
8
8
  }
9
+ const mergedHeaders = defu(
10
+ privateEndpoints?.[endpointName]?.headers,
11
+ endpointConfig.publicHeaders
12
+ );
9
13
  return {
10
14
  ...endpointConfig,
11
15
  baseURL: endpointConfig.baseURL || "",
12
- headers: privateEndpoints?.[endpointName]?.headers,
16
+ headers: Object.keys(mergedHeaders).length > 0 ? mergedHeaders : void 0,
13
17
  auth: defu(endpointConfig.auth, publicConfig.auth),
14
18
  toast: defu(endpointConfig.toast, publicConfig.toast),
15
19
  response: defu(endpointConfig.response, publicConfig.response)