v-nuxt-ui 0.1.10 → 0.1.11

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 (70) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -0
  3. package/dist/runtime/components/date-picker/index.d.vue.ts +2 -1
  4. package/dist/runtime/components/date-picker/index.vue +1 -1
  5. package/dist/runtime/components/date-picker/index.vue.d.ts +2 -1
  6. package/dist/runtime/components/form/create-modal-template/WithApi.d.vue.ts +2 -2
  7. package/dist/runtime/components/form/create-modal-template/WithApi.vue.d.ts +2 -2
  8. package/dist/runtime/components/form/create-modal-template/index.d.vue.ts +2 -2
  9. package/dist/runtime/components/form/create-modal-template/index.vue.d.ts +2 -2
  10. package/dist/runtime/components/simple-table/index.d.vue.ts +1 -1
  11. package/dist/runtime/components/simple-table/index.vue.d.ts +1 -1
  12. package/dist/runtime/composables/api/index.d.ts +0 -1
  13. package/dist/runtime/composables/api/index.js +0 -1
  14. package/dist/runtime/composables/api/sys/useAuthApi.d.ts +4 -4
  15. package/dist/runtime/composables/api/sys/useCompanyApi.d.ts +2 -1
  16. package/dist/runtime/composables/api/sys/useDepartmentApi.d.ts +2 -2
  17. package/dist/runtime/composables/api/sys/useJobTitleApi.d.ts +2 -1
  18. package/dist/runtime/composables/api/sys/useLoginApi.d.ts +4 -4
  19. package/dist/runtime/composables/api/sys/useMenuApi.d.ts +2 -2
  20. package/dist/runtime/composables/api/sys/useRoleApi.d.ts +2 -2
  21. package/dist/runtime/composables/api/sys/useRowRecord.d.ts +4 -4
  22. package/dist/runtime/composables/api/sys/useUserApi.d.ts +3 -3
  23. package/dist/runtime/composables/api/useModel.d.ts +2 -1
  24. package/dist/runtime/composables/index.js +1 -1
  25. package/dist/runtime/composables/useAuth.d.ts +112 -5
  26. package/dist/runtime/composables/useAuth.js +1 -1
  27. package/dist/runtime/composables/useDate.d.ts +2 -1
  28. package/dist/runtime/composables/useForm.d.ts +2 -2
  29. package/dist/runtime/composables/useForm.js +1 -1
  30. package/dist/runtime/composables/usePermission.d.ts +3 -2
  31. package/dist/runtime/composables/useSidebarMenu.d.ts +37 -19
  32. package/dist/runtime/constants/columns.d.ts +3 -3
  33. package/dist/runtime/constants/time.d.ts +1 -0
  34. package/dist/runtime/plugins/05.api.d.ts +6 -0
  35. package/dist/runtime/plugins/05.api.js +157 -0
  36. package/dist/runtime/types/cmds/index.d.ts +3 -0
  37. package/dist/runtime/types/cmds/index.js +3 -0
  38. package/dist/runtime/types/cmds/login.d.ts +19 -23
  39. package/dist/runtime/types/cmds/login.js +0 -0
  40. package/dist/runtime/types/cmds/sys.d.ts +7 -10
  41. package/dist/runtime/types/cmds/sys.js +0 -0
  42. package/dist/runtime/types/cmds/user.d.ts +4 -8
  43. package/dist/runtime/types/cmds/user.js +0 -0
  44. package/dist/runtime/types/index.d.ts +2 -0
  45. package/dist/runtime/types/index.js +2 -0
  46. package/dist/runtime/types/models/base.d.ts +12 -15
  47. package/dist/runtime/types/models/base.js +0 -0
  48. package/dist/runtime/types/models/index.d.ts +2 -0
  49. package/dist/runtime/types/models/index.js +2 -0
  50. package/dist/runtime/types/models/sys.d.ts +84 -107
  51. package/dist/runtime/types/models/sys.js +0 -0
  52. package/dist/runtime/types/storage.d.ts +13 -0
  53. package/package.json +1 -1
  54. package/dist/runtime/composables/api/flow/index.d.ts +0 -3
  55. package/dist/runtime/composables/api/flow/index.js +0 -3
  56. package/dist/runtime/composables/api/flow/useFlowApi.d.ts +0 -1
  57. package/dist/runtime/composables/api/flow/useFlowApi.js +0 -3
  58. package/dist/runtime/composables/api/flow/useFlowNodeApi.d.ts +0 -1
  59. package/dist/runtime/composables/api/flow/useFlowNodeApi.js +0 -3
  60. package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.d.ts +0 -1
  61. package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.js +0 -3
  62. package/dist/runtime/composables/flow/index.d.ts +0 -3
  63. package/dist/runtime/composables/flow/index.js +0 -3
  64. package/dist/runtime/composables/flow/useFlow.d.ts +0 -46
  65. package/dist/runtime/composables/flow/useFlow.js +0 -162
  66. package/dist/runtime/composables/flow/useFlowResize.d.ts +0 -56
  67. package/dist/runtime/composables/flow/useFlowResize.js +0 -148
  68. package/dist/runtime/types/constants/time.d.ts +0 -5
  69. package/dist/runtime/types/localStorage.d.ts +0 -15
  70. package/dist/runtime/types/models/flow.d.ts +0 -31
package/dist/module.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.1.10",
10
+ "version": "0.1.11",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -31,6 +31,7 @@ const module$1 = defineNuxtModule({
31
31
  addPlugin(resolve("./runtime/plugins/02.dayjs"));
32
32
  addPlugin(resolve("./runtime/plugins/03.theme"));
33
33
  addPlugin(resolve("./runtime/plugins/04.head"));
34
+ addPlugin(resolve("./runtime/plugins/05.api"));
34
35
  nuxt.options.vite ??= {};
35
36
  nuxt.options.vite.optimizeDeps ??= {};
36
37
  nuxt.options.vite.optimizeDeps.include ??= [];
@@ -1,12 +1,13 @@
1
1
  import type { ButtonProps } from '@nuxt/ui';
2
2
  import type { DateRange, DateValue } from 'reka-ui';
3
+ import type { TimeUnit } from '#v/constants';
3
4
  import type { DateShortcut } from '#v/types';
4
5
  type __VLS_Props = {
5
6
  size?: ButtonProps['size'];
6
7
  loading?: ButtonProps['loading'];
7
8
  range?: boolean;
8
9
  placeholder?: string;
9
- timeUnit?: Const.Time.TimeUnit;
10
+ timeUnit?: TimeUnit;
10
11
  leadingIcon?: ButtonProps['leadingIcon'];
11
12
  shortcuts?: DateShortcut[];
12
13
  peerButtons?: ButtonProps[];
@@ -12,7 +12,7 @@ const props = defineProps({
12
12
  loading: { type: Boolean, required: false },
13
13
  range: { type: Boolean, required: false },
14
14
  placeholder: { type: String, required: false },
15
- timeUnit: { type: null, required: false },
15
+ timeUnit: { type: String, required: false },
16
16
  leadingIcon: { type: null, required: false },
17
17
  shortcuts: { type: Array, required: false },
18
18
  peerButtons: { type: Array, required: false }
@@ -1,12 +1,13 @@
1
1
  import type { ButtonProps } from '@nuxt/ui';
2
2
  import type { DateRange, DateValue } from 'reka-ui';
3
+ import type { TimeUnit } from '#v/constants';
3
4
  import type { DateShortcut } from '#v/types';
4
5
  type __VLS_Props = {
5
6
  size?: ButtonProps['size'];
6
7
  loading?: ButtonProps['loading'];
7
8
  range?: boolean;
8
9
  placeholder?: string;
9
- timeUnit?: Const.Time.TimeUnit;
10
+ timeUnit?: TimeUnit;
10
11
  leadingIcon?: ButtonProps['leadingIcon'];
11
12
  shortcuts?: DateShortcut[];
12
13
  peerButtons?: ButtonProps[];
@@ -1,5 +1,5 @@
1
- import type { CreateModalFormTemplatePropsWithApi } from '#v/types';
2
- declare const __VLS_export: <T extends Model.BaseModel>(__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<{
1
+ import type { BaseModel, CreateModalFormTemplatePropsWithApi } from '#v/types';
2
+ declare const __VLS_export: <T extends BaseModel>(__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
3
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CreateModalFormTemplatePropsWithApi<T>> & (typeof globalThis extends {
4
4
  __VLS_PROPS_FALLBACK: infer P;
5
5
  } ? P : {});
@@ -1,5 +1,5 @@
1
- import type { CreateModalFormTemplatePropsWithApi } from '#v/types';
2
- declare const __VLS_export: <T extends Model.BaseModel>(__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<{
1
+ import type { BaseModel, CreateModalFormTemplatePropsWithApi } from '#v/types';
2
+ declare const __VLS_export: <T extends BaseModel>(__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
3
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CreateModalFormTemplatePropsWithApi<T>> & (typeof globalThis extends {
4
4
  __VLS_PROPS_FALLBACK: infer P;
5
5
  } ? P : {});
@@ -1,5 +1,5 @@
1
- import type { CreateModalFormTemplateProps } from '#v/types';
2
- declare const __VLS_export: <T extends Model.BaseModel>(__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<{
1
+ import type { BaseModel, CreateModalFormTemplateProps } from '#v/types';
2
+ declare const __VLS_export: <T extends BaseModel>(__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
3
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CreateModalFormTemplateProps<T>> & (typeof globalThis extends {
4
4
  __VLS_PROPS_FALLBACK: infer P;
5
5
  } ? P : {});
@@ -1,5 +1,5 @@
1
- import type { CreateModalFormTemplateProps } from '#v/types';
2
- declare const __VLS_export: <T extends Model.BaseModel>(__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<{
1
+ import type { BaseModel, CreateModalFormTemplateProps } from '#v/types';
2
+ declare const __VLS_export: <T extends BaseModel>(__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
3
  props: import("vue").PublicProps & __VLS_PrettifyLocal<CreateModalFormTemplateProps<T>> & (typeof globalThis extends {
4
4
  __VLS_PROPS_FALLBACK: infer P;
5
5
  } ? P : {});
@@ -1,6 +1,6 @@
1
1
  import type { VTableProps } from '#v/types';
2
2
  declare const __VLS_export: <T>(__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<Pick<VTableProps<T>, "bizColumns" | "singleColumn" | "hideLastRowBorder" | "singleRow"> & {
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<Pick<VTableProps<T>, "bizColumns" | "singleRow" | "singleColumn" | "hideLastRowBorder"> & {
4
4
  data: T[];
5
5
  }> & (typeof globalThis extends {
6
6
  __VLS_PROPS_FALLBACK: infer P;
@@ -1,6 +1,6 @@
1
1
  import type { VTableProps } from '#v/types';
2
2
  declare const __VLS_export: <T>(__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<Pick<VTableProps<T>, "bizColumns" | "singleColumn" | "hideLastRowBorder" | "singleRow"> & {
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<Pick<VTableProps<T>, "bizColumns" | "singleRow" | "singleColumn" | "hideLastRowBorder"> & {
4
4
  data: T[];
5
5
  }> & (typeof globalThis extends {
6
6
  __VLS_PROPS_FALLBACK: infer P;
@@ -1,4 +1,3 @@
1
- export * from './flow/index.js';
2
1
  export * from './sys/index.js';
3
2
  export * from './useApi.js';
4
3
  export * from './useModel.js';
@@ -1,4 +1,3 @@
1
- export * from "./flow/index.js";
2
1
  export * from "./sys/index.js";
3
2
  export * from "./useApi.js";
4
3
  export * from "./useModel.js";
@@ -1,11 +1,11 @@
1
1
  import type { Ref } from 'vue';
2
- import type { RequestResult } from '#v/types';
2
+ import type { LoginResult, RefreshTokensPayload, RequestResult, User } from '#v/types';
3
3
  type AuthApi = {
4
- refreshToken: (cmd: Cmd.RefreshTokensPayload) => Promise<{
5
- data: Ref<RequestResult<Cmd.LoginResult>>;
4
+ refreshToken: (cmd: RefreshTokensPayload) => Promise<{
5
+ data: Ref<RequestResult<LoginResult>>;
6
6
  }>;
7
7
  getUserByAccessToken: () => Promise<{
8
- data: Ref<RequestResult<Model.User>>;
8
+ data: Ref<RequestResult<User>>;
9
9
  }>;
10
10
  };
11
11
  export declare const useAuthApi: () => AuthApi;
@@ -1 +1,2 @@
1
- export declare const useCompanyApi: () => import("../../../types/index.js").ApiGroup<Model.Company>;
1
+ import type { Company } from '#v/types';
2
+ export declare const useCompanyApi: () => import("#v/types").ApiGroup<Company>;
@@ -1,2 +1,2 @@
1
- import type { ApiGroup } from '#v/types';
2
- export declare const useDepartmentApi: () => ApiGroup<Model.Department>;
1
+ import type { ApiGroup, Department } from '#v/types';
2
+ export declare const useDepartmentApi: () => ApiGroup<Department>;
@@ -1 +1,2 @@
1
- export declare const useJobTitleApi: () => import("../../../types/index.js").ApiGroup<Model.JobTitle>;
1
+ import type { JobTitle } from '#v/types';
2
+ export declare const useJobTitleApi: () => import("#v/types").ApiGroup<JobTitle>;
@@ -1,10 +1,10 @@
1
1
  import type { Ref } from 'vue';
2
- import type { RequestResult } from '#v/types';
2
+ import type { ChangeUserPwdCmd, LoginResult, RequestResult, UsernamePasswordLoginPayload } from '#v/types';
3
3
  type LoginApi = {
4
- loginByUsernameAndPassword: (cmd: Cmd.UsernamePasswordLoginPayload) => Promise<{
5
- data: Ref<RequestResult<Cmd.LoginResult>>;
4
+ loginByUsernameAndPassword: (cmd: UsernamePasswordLoginPayload) => Promise<{
5
+ data: Ref<RequestResult<LoginResult>>;
6
6
  }>;
7
- changeUserPassword: (cmd: Cmd.ChangeUserPwdCmd) => Promise<{
7
+ changeUserPassword: (cmd: ChangeUserPwdCmd) => Promise<{
8
8
  data: Ref<RequestResult<unknown>>;
9
9
  }>;
10
10
  };
@@ -1,2 +1,2 @@
1
- import type { ApiGroup } from '#v/types';
2
- export declare const useMenuApi: () => ApiGroup<Model.Menu>;
1
+ import type { ApiGroup, Menu } from '#v/types';
2
+ export declare const useMenuApi: () => ApiGroup<Menu>;
@@ -1,2 +1,2 @@
1
- import type { ApiGroup } from '#v/types';
2
- export declare const useRoleApi: () => ApiGroup<Model.Role>;
1
+ import type { ApiGroup, Role } from '#v/types';
2
+ export declare const useRoleApi: () => ApiGroup<Role>;
@@ -1,9 +1,9 @@
1
- import type { ApiGroup, PageResult, RequestResult } from '#v/types';
1
+ import type { ApiGroup, PageResult, RequestResult, RowRecord, RowRecordPayload } from '#v/types';
2
2
  import type { UseFetchOptions } from 'nuxt/app';
3
3
  import type { Ref } from 'vue';
4
- type RowRecordApiGroup = ApiGroup<Model.RowRecord> & {
5
- getByTableNameAndRowId: (payload: Cmd.RowRecordPayload, customOptions?: UseFetchOptions<PageResult<Model.RowRecord>>) => Promise<{
6
- data: Ref<RequestResult<PageResult<Model.RowRecord>>>;
4
+ type RowRecordApiGroup = ApiGroup<RowRecord> & {
5
+ getByTableNameAndRowId: (payload: RowRecordPayload, customOptions?: UseFetchOptions<PageResult<RowRecord>>) => Promise<{
6
+ data: Ref<RequestResult<PageResult<RowRecord>>>;
7
7
  }>;
8
8
  };
9
9
  export declare const useRowRecordApi: () => RowRecordApiGroup;
@@ -1,8 +1,8 @@
1
1
  import type { UseFetchOptions } from 'nuxt/app';
2
- import type { ApiGroup, RequestResult } from '#v/types';
2
+ import type { ApiGroup, ChangePwdPayload, RequestResult, User } from '#v/types';
3
3
  import type { Ref } from 'vue';
4
- type UserApiGroup = ApiGroup<Model.User> & {
5
- changePwd: (payload: Cmd.User.ChangePwdPayload, customOptions?: UseFetchOptions<unknown>) => Promise<{
4
+ type UserApiGroup = ApiGroup<User> & {
5
+ changePwd: (payload: ChangePwdPayload, customOptions?: UseFetchOptions<unknown>) => Promise<{
6
6
  data: Ref<RequestResult<unknown>>;
7
7
  }>;
8
8
  resetPwd: (userId: number, customOptions?: UseFetchOptions<unknown>) => Promise<{
@@ -1,3 +1,4 @@
1
+ import type { BaseModel } from '#v/types';
1
2
  export declare const useBizModel: () => {
2
- extractIds: <T extends Model.BaseModel>(models: T[] | undefined) => T[] | undefined;
3
+ extractIds: <T extends BaseModel>(models: T[] | undefined) => T[] | undefined;
3
4
  };
@@ -1,5 +1,5 @@
1
1
  export * from "./api/index.js";
2
- export * from "./flow/index.js";
2
+ export * from "./flow";
3
3
  export * from "./table/index.js";
4
4
  export * from "./useApp.js";
5
5
  export * from "./useBoolean.js";
@@ -1,14 +1,121 @@
1
+ import type { Menu, Role, User, UsernamePasswordLoginPayload } from '#v/types';
1
2
  import type { UseFetchOptions } from 'nuxt/app';
2
3
  import type { RouteLocationNormalizedLoadedGeneric } from 'vue-router';
3
4
  export declare const useAuth: () => {
4
5
  loginLoading: import("vue").Ref<boolean, boolean>;
5
6
  isLoggedIn: import("vue").ComputedRef<boolean>;
6
- isUserInfoFetched: import("vue").ComputedRef<any>;
7
- loginUser: import("vue").Ref<any, any>;
8
- loginUserRoles: import("vue").Ref<any, any>;
9
- loginUserMenus: import("vue").Ref<any, any>;
7
+ isUserInfoFetched: import("vue").ComputedRef<boolean | undefined>;
8
+ loginUser: import("vue").Ref<User | undefined, User | undefined>;
9
+ loginUserRoles: import("vue").Ref<{
10
+ isAdmin?: boolean | undefined;
11
+ name?: string | undefined;
12
+ permission?: string | undefined;
13
+ disabled?: boolean | undefined;
14
+ remark?: string | undefined;
15
+ menus?: {
16
+ isAdmin?: boolean | undefined;
17
+ type?: string | undefined;
18
+ parentId?: number | undefined;
19
+ parent?: /*elided*/ any | undefined;
20
+ name?: string | undefined;
21
+ i18nKey?: string | undefined;
22
+ staticRouteKeys?: string[] | undefined;
23
+ permission?: string | undefined;
24
+ order?: string | undefined;
25
+ disabled?: boolean | undefined;
26
+ id: number;
27
+ createdAt?: string | undefined;
28
+ updatedAt?: string | undefined;
29
+ version?: number | undefined;
30
+ createdBy?: number | undefined;
31
+ creator?: any;
32
+ updatedBy?: number | undefined;
33
+ updater?: any;
34
+ }[] | undefined;
35
+ id: number;
36
+ createdAt?: string | undefined;
37
+ updatedAt?: string | undefined;
38
+ version?: number | undefined;
39
+ createdBy?: number | undefined;
40
+ creator?: any;
41
+ updatedBy?: number | undefined;
42
+ updater?: any;
43
+ }[], Role[] | {
44
+ isAdmin?: boolean | undefined;
45
+ name?: string | undefined;
46
+ permission?: string | undefined;
47
+ disabled?: boolean | undefined;
48
+ remark?: string | undefined;
49
+ menus?: {
50
+ isAdmin?: boolean | undefined;
51
+ type?: string | undefined;
52
+ parentId?: number | undefined;
53
+ parent?: /*elided*/ any | undefined;
54
+ name?: string | undefined;
55
+ i18nKey?: string | undefined;
56
+ staticRouteKeys?: string[] | undefined;
57
+ permission?: string | undefined;
58
+ order?: string | undefined;
59
+ disabled?: boolean | undefined;
60
+ id: number;
61
+ createdAt?: string | undefined;
62
+ updatedAt?: string | undefined;
63
+ version?: number | undefined;
64
+ createdBy?: number | undefined;
65
+ creator?: any;
66
+ updatedBy?: number | undefined;
67
+ updater?: any;
68
+ }[] | undefined;
69
+ id: number;
70
+ createdAt?: string | undefined;
71
+ updatedAt?: string | undefined;
72
+ version?: number | undefined;
73
+ createdBy?: number | undefined;
74
+ creator?: any;
75
+ updatedBy?: number | undefined;
76
+ updater?: any;
77
+ }[]>;
78
+ loginUserMenus: import("vue").Ref<{
79
+ isAdmin?: boolean | undefined;
80
+ type?: string | undefined;
81
+ parentId?: number | undefined;
82
+ parent?: /*elided*/ any | undefined;
83
+ name?: string | undefined;
84
+ i18nKey?: string | undefined;
85
+ staticRouteKeys?: string[] | undefined;
86
+ permission?: string | undefined;
87
+ order?: string | undefined;
88
+ disabled?: boolean | undefined;
89
+ id: number;
90
+ createdAt?: string | undefined;
91
+ updatedAt?: string | undefined;
92
+ version?: number | undefined;
93
+ createdBy?: number | undefined;
94
+ creator?: any;
95
+ updatedBy?: number | undefined;
96
+ updater?: any;
97
+ }[], Menu[] | {
98
+ isAdmin?: boolean | undefined;
99
+ type?: string | undefined;
100
+ parentId?: number | undefined;
101
+ parent?: /*elided*/ any | undefined;
102
+ name?: string | undefined;
103
+ i18nKey?: string | undefined;
104
+ staticRouteKeys?: string[] | undefined;
105
+ permission?: string | undefined;
106
+ order?: string | undefined;
107
+ disabled?: boolean | undefined;
108
+ id: number;
109
+ createdAt?: string | undefined;
110
+ updatedAt?: string | undefined;
111
+ version?: number | undefined;
112
+ createdBy?: number | undefined;
113
+ creator?: any;
114
+ updatedBy?: number | undefined;
115
+ updater?: any;
116
+ }[]>;
10
117
  logout: (route: RouteLocationNormalizedLoadedGeneric) => Promise<void>;
11
- loginByUsernameAndPassword: (route: RouteLocationNormalizedLoadedGeneric, payload: Cmd.UsernamePasswordLoginPayload, redirect?: boolean) => Promise<void>;
118
+ loginByUsernameAndPassword: (route: RouteLocationNormalizedLoadedGeneric, payload: UsernamePasswordLoginPayload, redirect?: boolean) => Promise<void>;
12
119
  initUserInfo: () => Promise<boolean>;
13
120
  refreshToken: <T>(route: RouteLocationNormalizedLoadedGeneric, options: UseFetchOptions<T>) => Promise<UseFetchOptions<T> | null>;
14
121
  };
@@ -2,7 +2,7 @@ import { StorageKey } from "#v/types";
2
2
  import { isEmptyString } from "#v/utils";
3
3
  import { useLocalStorage, createSharedComposable } from "@vueuse/core";
4
4
  import { useAuthApi, useLoading, useLoginApi, useRouterPush } from "./index.js";
5
- import { useToast } from "@nuxt/ui/runtime/composables/useToast.js";
5
+ import { useToast } from "@nuxt/ui/composables";
6
6
  import { computed, ref } from "vue";
7
7
  const _useAuth = () => {
8
8
  const { loading: loginLoading, startLoading: startLoginLoading, endLoading: endLoginLoading } = useLoading();
@@ -1,12 +1,13 @@
1
1
  import { type DateValue } from '@internationalized/date';
2
2
  import dayjs from 'dayjs';
3
+ import type { TimeUnit } from '#v/constants';
3
4
  import type { DateRange } from 'reka-ui';
4
5
  import type { DateShortcut } from '#v/types';
5
6
  export declare const useDate: () => {
6
7
  dayjsToDateValue: (date: dayjs.Dayjs | null | undefined) => DateValue | undefined;
7
8
  isoUtcStringToDateValue: (isoString: string | null | undefined) => DateValue | undefined;
8
9
  dateValueToDayjs: (dateValue: DateValue | null | undefined) => dayjs.Dayjs | undefined;
9
- formatTimeUnit: (dateValue: DateValue | null | undefined, unit: Const.Time.TimeUnit) => string;
10
+ formatTimeUnit: (dateValue: DateValue | null | undefined, unit: TimeUnit) => string;
10
11
  getRecentDateRange: (days: number) => DateRange;
11
12
  getlastWeekDateRange: () => DateRange;
12
13
  lastWeekDateShortcut: DateShortcut;
@@ -1,9 +1,9 @@
1
1
  import { type Ref } from 'vue';
2
- import type { ApiGroup } from '#v/types';
2
+ import type { ApiGroup, BaseModel } from '#v/types';
3
3
  export declare const useFormValues: <T>(raw: Ref<T>, defaultValues?: Partial<T>) => {
4
4
  oldValues: Ref<T>;
5
5
  newValues: Ref<T>;
6
6
  };
7
- export declare const useFormSubmission: <T extends Model.BaseModel>(oldValues: Ref<T>, newValues: Ref<T>, close: (ok: boolean) => void, save: (model: T) => void, apiGroup: () => ApiGroup<T>, arrayTypeFieldKeys?: (keyof T)[], rowKey?: keyof T, versionKey?: keyof T) => {
7
+ export declare const useFormSubmission: <T extends BaseModel>(oldValues: Ref<T>, newValues: Ref<T>, close: (ok: boolean) => void, save: (model: T) => void, apiGroup: () => ApiGroup<T>, arrayTypeFieldKeys?: (keyof T)[], rowKey?: keyof T, versionKey?: keyof T) => {
8
8
  onSubmit: () => Promise<void>;
9
9
  };
@@ -1,7 +1,7 @@
1
1
  import { ref, watch } from "vue";
2
2
  import { defu } from "defu";
3
3
  import { getObjWithModifiedFields } from "#v/utils";
4
- import { useToast } from "@nuxt/ui/runtime/composables/useToast.js";
4
+ import { useToast } from "@nuxt/ui/composables";
5
5
  export const useFormValues = (raw, defaultValues) => {
6
6
  const oldValues = ref({});
7
7
  const newValues = ref({});
@@ -1,10 +1,11 @@
1
+ import type { Role, Menu } from '#v/types';
1
2
  export declare const _usePermission: () => {
2
- setUserDynamicPermissions: (userRoles?: Model.Role[], userMenus?: Model.Menu[]) => void;
3
+ setUserDynamicPermissions: (userRoles?: Role[], userMenus?: Menu[]) => void;
3
4
  hasPermissions: (perms: string[] | string) => boolean;
4
5
  hasAnyPermission: (perms: string[]) => boolean;
5
6
  };
6
7
  export declare const usePermission: () => {
7
- setUserDynamicPermissions: (userRoles?: Model.Role[], userMenus?: Model.Menu[]) => void;
8
+ setUserDynamicPermissions: (userRoles?: Role[], userMenus?: Menu[]) => void;
8
9
  hasPermissions: (perms: string[] | string) => boolean;
9
10
  hasAnyPermission: (perms: string[]) => boolean;
10
11
  };
@@ -1,37 +1,55 @@
1
- import type { BreadcrumbItem, NavigationMenuItem } from '@nuxt/ui';
2
1
  import type { ComputedRef, Ref } from 'vue';
2
+ import type { Menu, Role } from '#v/types';
3
+ type ShallowNavigationMenuItem = {
4
+ to?: string;
5
+ triggerTo?: string;
6
+ children?: ShallowNavigationMenuItem[];
7
+ label?: string;
8
+ icon?: string;
9
+ disabled?: boolean;
10
+ open?: boolean;
11
+ defaultOpen?: boolean;
12
+ staticRouteKeys?: string[];
13
+ };
14
+ type ShallowBreadcrumbItem = {
15
+ label?: string;
16
+ icon?: string;
17
+ to?: string;
18
+ children?: ShallowBreadcrumbItem[];
19
+ };
3
20
  export declare function setGlobalSidebarMenus(opts: {
4
- constantMenus?: NavigationMenuItem[];
5
- bizMenus?: NavigationMenuItem[];
21
+ constantMenus?: ShallowNavigationMenuItem[];
22
+ bizMenus?: ShallowNavigationMenuItem[];
6
23
  menuMode?: 'static' | 'dynamic';
7
24
  }): void;
8
25
  export declare const _useSidebarMenus: () => {
9
- constantMenus: Ref<NavigationMenuItem[]>;
26
+ constantMenus: Ref<ShallowNavigationMenuItem[]>;
10
27
  constantMenuPathSet: ComputedRef<Set<string>>;
11
- bizMenus: Ref<NavigationMenuItem[]>;
12
- flattenBizMenus: ComputedRef<NavigationMenuItem[]>;
28
+ bizMenus: Ref<ShallowNavigationMenuItem[]>;
29
+ flattenBizMenus: ComputedRef<ShallowNavigationMenuItem[]>;
13
30
  bizMenuPathSet: ComputedRef<Set<string>>;
14
- menusFromUser: Ref<Model.Menu[]>;
15
- sidebarMenus: Ref<NavigationMenuItem[]>;
31
+ menusFromUser: Ref<Menu[]>;
32
+ sidebarMenus: Ref<ShallowNavigationMenuItem[]>;
16
33
  sidebarMenuPathSet: Ref<Set<string>>;
17
34
  expandSidebarMenu: (path: string) => void;
18
- setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
35
+ setUserDynamicMenus: (newRolesFromUser: Role[], newMenusFromUser: Menu[]) => void;
19
36
  disabledMenuPathSet: ComputedRef<Set<string>>;
20
- breadcrumbs: Ref<BreadcrumbItem[]>;
21
- getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
37
+ breadcrumbs: Ref<ShallowBreadcrumbItem[]>;
38
+ getBreadcrumbs: (current: string, menus?: ShallowNavigationMenuItem[]) => ShallowBreadcrumbItem[];
22
39
  };
23
40
  export declare const useSidebarMenus: () => {
24
- constantMenus: Ref<NavigationMenuItem[]>;
41
+ constantMenus: Ref<ShallowNavigationMenuItem[]>;
25
42
  constantMenuPathSet: ComputedRef<Set<string>>;
26
- bizMenus: Ref<NavigationMenuItem[]>;
27
- flattenBizMenus: ComputedRef<NavigationMenuItem[]>;
43
+ bizMenus: Ref<ShallowNavigationMenuItem[]>;
44
+ flattenBizMenus: ComputedRef<ShallowNavigationMenuItem[]>;
28
45
  bizMenuPathSet: ComputedRef<Set<string>>;
29
- menusFromUser: Ref<Model.Menu[]>;
30
- sidebarMenus: Ref<NavigationMenuItem[]>;
46
+ menusFromUser: Ref<Menu[]>;
47
+ sidebarMenus: Ref<ShallowNavigationMenuItem[]>;
31
48
  sidebarMenuPathSet: Ref<Set<string>>;
32
49
  expandSidebarMenu: (path: string) => void;
33
- setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
50
+ setUserDynamicMenus: (newRolesFromUser: Role[], newMenusFromUser: Menu[]) => void;
34
51
  disabledMenuPathSet: ComputedRef<Set<string>>;
35
- breadcrumbs: Ref<BreadcrumbItem[]>;
36
- getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
52
+ breadcrumbs: Ref<ShallowBreadcrumbItem[]>;
53
+ getBreadcrumbs: (current: string, menus?: ShallowNavigationMenuItem[]) => ShallowBreadcrumbItem[];
37
54
  };
55
+ export {};
@@ -1,3 +1,3 @@
1
- import type { OrderQueryOpr, VColumn } from '#v/types';
2
- export declare const getCreateAtColumn: <T extends Model.BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>;
3
- export declare const getOprColumns: <T extends Model.BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>[];
1
+ import type { BaseModel, OrderQueryOpr, VColumn } from '#v/types';
2
+ export declare const getCreateAtColumn: <T extends BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>;
3
+ export declare const getOprColumns: <T extends BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>[];
@@ -5,3 +5,4 @@ export declare const weekEnLabels: string[];
5
5
  export declare const weekCnLabels: string[];
6
6
  export declare const dateFormat = "YYYY-MM-DD";
7
7
  export declare const dateTimeFormat = "YYYY-MM-DD HH:mm:ss";
8
+ export type TimeUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
@@ -0,0 +1,6 @@
1
+ declare const _default: import("nuxt/app").Plugin<{
2
+ api: import("nitropack/types").$Fetch<unknown, import("nitropack/types").NitroFetchRequest>;
3
+ }> & import("nuxt/app").ObjectPlugin<{
4
+ api: import("nitropack/types").$Fetch<unknown, import("nitropack/types").NitroFetchRequest>;
5
+ }>;
6
+ export default _default;