@quiteer/naive-extra 0.0.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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/dist/components/breadcrumb/index.d.ts +0 -0
  4. package/dist/components/breadcrumb/index.vue.d.ts +3 -0
  5. package/dist/components/breadcrumb/props.d.ts +0 -0
  6. package/dist/components/button/action/index.d.ts +3 -0
  7. package/dist/components/button/action/index.vue.d.ts +118 -0
  8. package/dist/components/button/action/props.d.ts +63 -0
  9. package/dist/components/button/action/utils.d.ts +8 -0
  10. package/dist/components/button/base/index.d.ts +3 -0
  11. package/dist/components/button/base/index.vue.d.ts +36 -0
  12. package/dist/components/button/base/props.d.ts +27 -0
  13. package/dist/components/button/index.d.ts +4 -0
  14. package/dist/components/button/types.d.ts +2 -0
  15. package/dist/components/form/helper.d.ts +11 -0
  16. package/dist/components/form/index.d.ts +3 -0
  17. package/dist/components/form/index.vue.d.ts +642 -0
  18. package/dist/components/form/props.d.ts +34 -0
  19. package/dist/components/icon/IconPicker.vue.d.ts +13 -0
  20. package/dist/components/icon/iconify.d.ts +25 -0
  21. package/dist/components/icon/index.d.ts +3 -0
  22. package/dist/components/icon/index.vue.d.ts +12 -0
  23. package/dist/components/layout/const.d.ts +22 -0
  24. package/dist/components/layout/context.d.ts +77 -0
  25. package/dist/components/layout/index.d.ts +5 -0
  26. package/dist/components/layout/index.vue.d.ts +80 -0
  27. package/dist/components/layout/layout-parts/AppBreadcrumb.vue.d.ts +3 -0
  28. package/dist/components/layout/layout-parts/AppFooter.vue.d.ts +18 -0
  29. package/dist/components/layout/layout-parts/AppHeader.vue.d.ts +18 -0
  30. package/dist/components/layout/layout-parts/AppLeftLogoInfo.vue.d.ts +3 -0
  31. package/dist/components/layout/layout-parts/AppMain.vue.d.ts +18 -0
  32. package/dist/components/layout/layout-parts/AppSidebar.vue.d.ts +4067 -0
  33. package/dist/components/layout/layout-parts/LayoutTransition.vue.d.ts +58 -0
  34. package/dist/components/layout/mode.d.ts +0 -0
  35. package/dist/components/layout/props.d.ts +35 -0
  36. package/dist/components/layout/types.d.ts +59 -0
  37. package/dist/components/layout/utils.d.ts +97 -0
  38. package/dist/components/provider/index.d.ts +3 -0
  39. package/dist/components/provider/index.vue.d.ts +19 -0
  40. package/dist/components/provider/props.d.ts +33 -0
  41. package/dist/components/search-bar/index.d.ts +3 -0
  42. package/dist/components/search-bar/index.vue.d.ts +1288 -0
  43. package/dist/components/search-bar/props.d.ts +15 -0
  44. package/dist/components/table/TableSetting.vue.d.ts +15 -0
  45. package/dist/components/table/index.d.ts +4 -0
  46. package/dist/components/table/index.vue.d.ts +17246 -0
  47. package/dist/components/table/props.d.ts +26 -0
  48. package/dist/components/table/useColumn.d.ts +15 -0
  49. package/dist/components/upload/enum.d.ts +18 -0
  50. package/dist/components/upload/index.d.ts +4 -0
  51. package/dist/components/upload/index.vue.d.ts +17 -0
  52. package/dist/components/upload/props.d.ts +7 -0
  53. package/dist/const/defaults.d.ts +7 -0
  54. package/dist/const/index.d.ts +2 -0
  55. package/dist/const/types.d.ts +134 -0
  56. package/dist/context/color.d.ts +13 -0
  57. package/dist/context/common.d.ts +117 -0
  58. package/dist/context/index.d.ts +41 -0
  59. package/dist/context/layout.d.ts +52 -0
  60. package/dist/context/loading-bar.d.ts +14 -0
  61. package/dist/context/locale.d.ts +143 -0
  62. package/dist/context/menu.d.ts +212 -0
  63. package/dist/context/message.d.ts +14 -0
  64. package/dist/context/notification.d.ts +14 -0
  65. package/dist/context/table.d.ts +917 -0
  66. package/dist/context/theme.d.ts +20 -0
  67. package/dist/hooks/index.d.ts +6 -0
  68. package/dist/hooks/useAdmin.d.ts +0 -0
  69. package/dist/hooks/useForm.d.ts +54 -0
  70. package/dist/hooks/useLayout.d.ts +116 -0
  71. package/dist/hooks/useProviderContext.d.ts +17 -0
  72. package/dist/hooks/useTable.d.ts +66 -0
  73. package/dist/hooks/useThemeOverrides.d.ts +8 -0
  74. package/dist/hooks/useUpload.d.ts +22 -0
  75. package/dist/index.css +36 -0
  76. package/dist/index.d.ts +29 -0
  77. package/dist/index.js +6771 -0
  78. package/dist/share/compact.d.ts +16 -0
  79. package/dist/share/index.d.ts +2 -0
  80. package/dist/share/menu.d.ts +0 -0
  81. package/dist/share/route.d.ts +0 -0
  82. package/dist/share/slot.d.ts +6 -0
  83. package/dist/utils/form.d.ts +0 -0
  84. package/dist/utils/index.d.ts +0 -0
  85. package/dist/utils/transformRoutes.d.ts +67 -0
  86. package/dist/utils/tree.d.ts +6 -0
  87. package/package.json +53 -0
  88. package/src/auto-imports.d.ts +73 -0
  89. package/src/components/breadcrumb/index.ts +0 -0
  90. package/src/components/breadcrumb/index.vue +0 -0
  91. package/src/components/breadcrumb/props.ts +0 -0
  92. package/src/components/button/action/index.ts +4 -0
  93. package/src/components/button/action/index.vue +313 -0
  94. package/src/components/button/action/props.ts +78 -0
  95. package/src/components/button/action/utils.ts +122 -0
  96. package/src/components/button/base/index.ts +4 -0
  97. package/src/components/button/base/index.vue +156 -0
  98. package/src/components/button/base/props.ts +29 -0
  99. package/src/components/button/index.ts +4 -0
  100. package/src/components/button/types.ts +2 -0
  101. package/src/components/form/helper.ts +73 -0
  102. package/src/components/form/index.ts +5 -0
  103. package/src/components/form/index.vue +243 -0
  104. package/src/components/form/props.ts +75 -0
  105. package/src/components/icon/IconPicker.vue +255 -0
  106. package/src/components/icon/iconify.ts +80 -0
  107. package/src/components/icon/index.ts +7 -0
  108. package/src/components/icon/index.vue +23 -0
  109. package/src/components/layout/const.ts +102 -0
  110. package/src/components/layout/context.ts +189 -0
  111. package/src/components/layout/index.ts +8 -0
  112. package/src/components/layout/index.vue +64 -0
  113. package/src/components/layout/layout-parts/AppBreadcrumb.vue +108 -0
  114. package/src/components/layout/layout-parts/AppFooter.vue +26 -0
  115. package/src/components/layout/layout-parts/AppHeader.vue +112 -0
  116. package/src/components/layout/layout-parts/AppLeftLogoInfo.vue +30 -0
  117. package/src/components/layout/layout-parts/AppMain.vue +34 -0
  118. package/src/components/layout/layout-parts/AppSidebar.vue +174 -0
  119. package/src/components/layout/layout-parts/LayoutTransition.vue +366 -0
  120. package/src/components/layout/mode.ts +0 -0
  121. package/src/components/layout/props.ts +36 -0
  122. package/src/components/layout/types.ts +79 -0
  123. package/src/components/layout/utils.ts +201 -0
  124. package/src/components/provider/index.ts +5 -0
  125. package/src/components/provider/index.vue +69 -0
  126. package/src/components/provider/props.ts +45 -0
  127. package/src/components/search-bar/index.ts +5 -0
  128. package/src/components/search-bar/index.vue +282 -0
  129. package/src/components/search-bar/props.ts +26 -0
  130. package/src/components/table/TableSetting.vue +253 -0
  131. package/src/components/table/index.ts +14 -0
  132. package/src/components/table/index.vue +179 -0
  133. package/src/components/table/props.ts +29 -0
  134. package/src/components/table/useColumn.ts +104 -0
  135. package/src/components/upload/enum.ts +21 -0
  136. package/src/components/upload/index.ts +9 -0
  137. package/src/components/upload/index.vue +267 -0
  138. package/src/components/upload/props.ts +8 -0
  139. package/src/components.d.ts +154 -0
  140. package/src/const/defaults.ts +94 -0
  141. package/src/const/index.ts +2 -0
  142. package/src/const/types.ts +139 -0
  143. package/src/context/color.ts +53 -0
  144. package/src/context/common.ts +27 -0
  145. package/src/context/index.ts +141 -0
  146. package/src/context/layout.ts +34 -0
  147. package/src/context/loading-bar.ts +26 -0
  148. package/src/context/locale.ts +22 -0
  149. package/src/context/menu.ts +26 -0
  150. package/src/context/message.ts +30 -0
  151. package/src/context/notification.ts +29 -0
  152. package/src/context/table.ts +32 -0
  153. package/src/context/theme.ts +35 -0
  154. package/src/hooks/index.ts +6 -0
  155. package/src/hooks/useAdmin.ts +0 -0
  156. package/src/hooks/useForm.ts +272 -0
  157. package/src/hooks/useLayout.ts +300 -0
  158. package/src/hooks/useProviderContext.ts +47 -0
  159. package/src/hooks/useTable.ts +241 -0
  160. package/src/hooks/useThemeOverrides.ts +18 -0
  161. package/src/hooks/useUpload.ts +82 -0
  162. package/src/index.ts +59 -0
  163. package/src/share/compact.ts +35 -0
  164. package/src/share/index.ts +2 -0
  165. package/src/share/menu.ts +0 -0
  166. package/src/share/route.ts +0 -0
  167. package/src/share/slot.ts +29 -0
  168. package/src/utils/form.ts +0 -0
  169. package/src/utils/index.ts +0 -0
  170. package/src/utils/transformRoutes.ts +163 -0
  171. package/src/utils/tree.ts +31 -0
@@ -0,0 +1,26 @@
1
+ import { DataTableColumn, DataTableProps } from 'naive-ui';
2
+ import { Recordable } from '../../const';
3
+ export type TableSize = 'medium' | 'small' | 'large' | undefined;
4
+ export interface Props extends /* @vue-ignore */ DataTableProps {
5
+ size?: TableSize;
6
+ striped?: boolean;
7
+ fetch: FetchFn;
8
+ hidebar?: boolean;
9
+ }
10
+ export type Column = DataTableColumn<Recordable>;
11
+ export type Columns = Column[];
12
+ export interface Settings {
13
+ size: TableSize;
14
+ striped: boolean;
15
+ columns: any[];
16
+ }
17
+ export interface FetchFn {
18
+ (pageInfo: {
19
+ pageNum: number;
20
+ pageSize: number;
21
+ }): Promise<{
22
+ list: any[];
23
+ total: number;
24
+ }>;
25
+ }
26
+ export type ExportType = 'all' | 'section';
@@ -0,0 +1,15 @@
1
+ import { WritableComputedRef } from 'vue';
2
+ export declare function useColumn(data: WritableComputedRef<any[]>): {
3
+ init: () => void;
4
+ columnsList: globalThis.Ref<any[], any[]>;
5
+ handleCheckAll: (flag: boolean) => void;
6
+ handleSelection: (flag: boolean) => void;
7
+ resetColumns: () => void;
8
+ handleChange: () => void;
9
+ fixedColumn: (item: any, type: "left" | "right") => void;
10
+ draggableEnd: () => void;
11
+ selection: globalThis.Ref<boolean, boolean>;
12
+ checkAll: globalThis.Ref<boolean, boolean>;
13
+ checkList: globalThis.Ref<any[], any[]>;
14
+ defaultCheckList: globalThis.Ref<any[], any[]>;
15
+ };
@@ -0,0 +1,18 @@
1
+ export declare enum AcceptType {
2
+ /**
3
+ * 图片格式:常见光栅和矢量图像
4
+ */
5
+ Image = ".jpg,.jpeg,.png,.gif,.bmp,.webp,.svg",
6
+ /**
7
+ * 视频格式:常见视频文件类型
8
+ */
9
+ Video = ".mp4,.webm,.ogg,.mov,.avi,.wmv,.flv,.mkv",
10
+ /**
11
+ * 音频格式:常见音频文件类型
12
+ */
13
+ Audio = ".mp3,.wav,.ogg,.aac,.flac,.m4a",
14
+ /**
15
+ * 文档和压缩文件:常用办公文档和压缩包
16
+ */
17
+ File = ".doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.pdf,.zip,.rar,.7z,.tar,.gz"
18
+ }
@@ -0,0 +1,4 @@
1
+ import { default as QuiUpload } from './index.vue';
2
+ export { QuiUpload };
3
+ export { AcceptType } from './enum';
4
+ export type { Props as UploadProps } from './props';
@@ -0,0 +1,17 @@
1
+ import { Props } from './props';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ interface FileListItem {
4
+ id: string;
5
+ name: string;
6
+ url: string;
7
+ }
8
+ type __VLS_Props = Props;
9
+ type __VLS_PublicProps = {
10
+ 'value'?: FileListItem[] | string | undefined;
11
+ } & __VLS_Props;
12
+ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
13
+ "update:value": (value: string | FileListItem[] | undefined) => any;
14
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
+ "onUpdate:value"?: ((value: string | FileListItem[] | undefined) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { UploadProps } from 'naive-ui';
2
+ export interface Props extends /* @vue-ignore */ UploadProps {
3
+ fileType: 'image-view' | 'video-view' | 'audio-view' | 'file' | 'dragger-file';
4
+ fileSize?: number;
5
+ /** 传入string返回值为url 不传默认数据为数组形式 */
6
+ dataType?: 'string';
7
+ }
@@ -0,0 +1,7 @@
1
+ import { NaiveExtraThemeConfig } from './types';
2
+ /**
3
+ * 默认主题配置托底
4
+ *
5
+ * 包含全局组件的默认样式与尺寸行为,确保在用户未提供配置时系统仍能正常运行。
6
+ */
7
+ export declare const DEFAULT_THEME_CONFIG: NaiveExtraThemeConfig;
@@ -0,0 +1,2 @@
1
+ export * from './defaults';
2
+ export * from './types';
@@ -0,0 +1,134 @@
1
+ import { GlobalThemeOverrides } from 'naive-ui';
2
+ /**
3
+ * 表格主题配置接口
4
+ */
5
+ export interface TableThemeConfig {
6
+ /** 是否开启斑马纹 */
7
+ striped?: boolean;
8
+ /** 行类名 */
9
+ rowClassName?: string | ((row: any) => string);
10
+ /** 分页回调 */
11
+ onUpdatePage?: (page: number) => void;
12
+ /** 每页条数回调 */
13
+ onUpdatePageSize?: (pageSize: number) => void;
14
+ /** 表格背景色 */
15
+ tableColor?: string;
16
+ /** 表头背景色 */
17
+ tableHeaderColor?: string;
18
+ /** 斑马纹颜色 */
19
+ tableColorStriped?: string;
20
+ /** 悬浮行背景色 */
21
+ tableColorHover?: string;
22
+ /** 单元格左右内边距 */
23
+ tdPaddingHorizontal?: string;
24
+ /** 单元格上下内边距 */
25
+ tdPaddingVertical?: string;
26
+ /** 表头单元格左右内边距 */
27
+ thPaddingHorizontal?: string;
28
+ /** 表头单元格上下内边距 */
29
+ thPaddingVertical?: string;
30
+ }
31
+ /**
32
+ * Naive UI 基础变量类型
33
+ */
34
+ export type CommonThemeVars = NonNullable<GlobalThemeOverrides['common']>;
35
+ /**
36
+ * 泛型对象类型
37
+ */
38
+ export type Recordable<T = any> = Record<string, T>;
39
+ /**
40
+ * 品牌色板类型
41
+ */
42
+ export interface BrandPalette {
43
+ primary: string;
44
+ info: string;
45
+ success: string;
46
+ warning: string;
47
+ error: string;
48
+ }
49
+ /**
50
+ * 主题配置接口定义
51
+ */
52
+ export interface NaiveExtraThemeConfig {
53
+ /** 主题模式 */
54
+ themeMode?: 'light' | 'dark' | 'system';
55
+ /** 语言模式 */
56
+ localeMode?: 'zh' | 'en';
57
+ /** 全局圆角 (px) */
58
+ borderRadius?: number;
59
+ /** 品牌色板 */
60
+ palette?: Partial<BrandPalette>;
61
+ /** 全局基础变量配置 (对应 Naive UI 的 common) */
62
+ common?: CommonThemeVars;
63
+ /** 表格相关配置 */
64
+ table?: TableThemeConfig;
65
+ /** 布局相关配置 */
66
+ layout?: {
67
+ headerHeight?: number;
68
+ footerHeight?: number;
69
+ siderWidth?: number;
70
+ siderCollapsedWidth?: number;
71
+ mixedMenuWidth?: number;
72
+ mixedMenuCollapsedWidth?: number;
73
+ color?: string;
74
+ colorEmbedded?: string;
75
+ headerColor?: string;
76
+ footerColor?: string;
77
+ siderColor?: string;
78
+ showFooter?: boolean;
79
+ showHeader?: boolean;
80
+ showTabs?: boolean;
81
+ fixedHeader?: boolean;
82
+ fixedFooter?: boolean;
83
+ };
84
+ /** 菜单相关配置 */
85
+ menu?: {
86
+ accordion?: boolean;
87
+ collapsedIconSize?: number;
88
+ iconSize?: number;
89
+ indent?: number;
90
+ inverted?: boolean;
91
+ itemHeight?: number;
92
+ collapsedWidth?: number;
93
+ };
94
+ /** 标签页相关配置 */
95
+ tabs?: {
96
+ type?: 'line' | 'card' | 'bar';
97
+ closable?: boolean;
98
+ animated?: boolean;
99
+ showIcon?: boolean;
100
+ };
101
+ /** 滚动条相关配置 */
102
+ scrollbar?: {
103
+ trigger?: 'none' | 'hover' | 'always';
104
+ xScrollable?: boolean;
105
+ };
106
+ /** 面包屑相关配置 */
107
+ breadcrumb?: {
108
+ showIcon?: boolean;
109
+ separator?: string;
110
+ };
111
+ /** 消息配置 */
112
+ message?: {
113
+ duration?: number;
114
+ max?: number;
115
+ placement?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right';
116
+ showIcon?: boolean;
117
+ closable?: boolean;
118
+ };
119
+ /** 通知配置 */
120
+ notification?: {
121
+ duration?: number;
122
+ max?: number;
123
+ placement?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
124
+ };
125
+ /** 加载条配置 */
126
+ loadingBar?: {
127
+ loadingBarStyle?: {
128
+ loading?: string;
129
+ error?: string;
130
+ };
131
+ };
132
+ /** 自定义 Naive UI 组件样式覆盖 (直接映射到 GlobalThemeOverrides) */
133
+ overrides?: GlobalThemeOverrides;
134
+ }
@@ -0,0 +1,13 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { NaiveExtraThemeConfig } from '../const';
3
+ /**
4
+ * 品牌色管理模块
5
+ *
6
+ * 负责生成品牌色阶并同步 CSS 变量到 :root
7
+ *
8
+ * @param mergedConfig - 合并后的响应式配置
9
+ * @returns 包含 common 变量中颜色部分的计算结果
10
+ */
11
+ export declare function useColorModule(mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>): {
12
+ colorVars: ComputedRef<any>;
13
+ };
@@ -0,0 +1,117 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { NaiveExtraThemeConfig } from '../const';
3
+ /**
4
+ * 基础变量管理模块
5
+ *
6
+ * 负责处理圆角、基础配置等 Naive UI common 变量
7
+ *
8
+ * @param mergedConfig - 合并后的响应式配置
9
+ * @returns 包含 common 变量中非颜色部分的计算结果
10
+ */
11
+ export declare function useCommonModule(mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>): {
12
+ commonVars: ComputedRef<{
13
+ borderRadius: string;
14
+ borderRadiusSmall: string;
15
+ baseColor?: string | undefined;
16
+ primaryColor?: string | undefined;
17
+ primaryColorHover?: string | undefined;
18
+ primaryColorPressed?: string | undefined;
19
+ primaryColorSuppl?: string | undefined;
20
+ infoColor?: string | undefined;
21
+ infoColorHover?: string | undefined;
22
+ infoColorPressed?: string | undefined;
23
+ infoColorSuppl?: string | undefined;
24
+ successColor?: string | undefined;
25
+ successColorHover?: string | undefined;
26
+ successColorPressed?: string | undefined;
27
+ successColorSuppl?: string | undefined;
28
+ warningColor?: string | undefined;
29
+ warningColorHover?: string | undefined;
30
+ warningColorPressed?: string | undefined;
31
+ warningColorSuppl?: string | undefined;
32
+ errorColor?: string | undefined;
33
+ errorColorHover?: string | undefined;
34
+ errorColorPressed?: string | undefined;
35
+ errorColorSuppl?: string | undefined;
36
+ textColorBase?: string | undefined;
37
+ textColor1?: string | undefined;
38
+ textColor2?: string | undefined;
39
+ textColor3?: string | undefined;
40
+ textColorDisabled?: string | undefined;
41
+ placeholderColor?: string | undefined;
42
+ placeholderColorDisabled?: string | undefined;
43
+ iconColor?: string | undefined;
44
+ iconColorHover?: string | undefined;
45
+ iconColorPressed?: string | undefined;
46
+ iconColorDisabled?: string | undefined;
47
+ opacity1?: string | undefined;
48
+ opacity2?: string | undefined;
49
+ opacity3?: string | undefined;
50
+ opacity4?: string | undefined;
51
+ opacity5?: string | undefined;
52
+ dividerColor?: string | undefined;
53
+ borderColor?: string | undefined;
54
+ closeIconColor?: string | undefined;
55
+ closeIconColorHover?: string | undefined;
56
+ closeIconColorPressed?: string | undefined;
57
+ closeColorHover?: string | undefined;
58
+ closeColorPressed?: string | undefined;
59
+ clearColor?: string | undefined;
60
+ clearColorHover?: string | undefined;
61
+ clearColorPressed?: string | undefined;
62
+ scrollbarColor?: string | undefined;
63
+ scrollbarColorHover?: string | undefined;
64
+ scrollbarWidth?: string | undefined;
65
+ scrollbarHeight?: string | undefined;
66
+ scrollbarBorderRadius?: string | undefined;
67
+ progressRailColor?: string | undefined;
68
+ railColor?: string | undefined;
69
+ popoverColor?: string | undefined;
70
+ tableColor?: string | undefined;
71
+ cardColor?: string | undefined;
72
+ modalColor?: string | undefined;
73
+ bodyColor?: string | undefined;
74
+ tagColor?: string | undefined;
75
+ avatarColor?: string | undefined;
76
+ invertedColor?: string | undefined;
77
+ inputColor?: string | undefined;
78
+ codeColor?: string | undefined;
79
+ tabColor?: string | undefined;
80
+ actionColor?: string | undefined;
81
+ tableHeaderColor?: string | undefined;
82
+ hoverColor?: string | undefined;
83
+ tableColorHover?: string | undefined;
84
+ tableColorStriped?: string | undefined;
85
+ pressedColor?: string | undefined;
86
+ opacityDisabled?: string | undefined;
87
+ inputColorDisabled?: string | undefined;
88
+ buttonColor2?: string | undefined;
89
+ buttonColor2Hover?: string | undefined;
90
+ buttonColor2Pressed?: string | undefined;
91
+ boxShadow1?: string | undefined;
92
+ boxShadow2?: string | undefined;
93
+ boxShadow3?: string | undefined;
94
+ fontFamily?: string | undefined;
95
+ fontFamilyMono?: string | undefined;
96
+ fontWeight?: string | undefined;
97
+ fontWeightStrong?: string | undefined;
98
+ cubicBezierEaseInOut?: string | undefined;
99
+ cubicBezierEaseOut?: string | undefined;
100
+ cubicBezierEaseIn?: string | undefined;
101
+ fontSize?: string | undefined;
102
+ fontSizeMini?: string | undefined;
103
+ fontSizeTiny?: string | undefined;
104
+ fontSizeSmall?: string | undefined;
105
+ fontSizeMedium?: string | undefined;
106
+ fontSizeLarge?: string | undefined;
107
+ fontSizeHuge?: string | undefined;
108
+ lineHeight?: string | undefined;
109
+ heightMini?: string | undefined;
110
+ heightTiny?: string | undefined;
111
+ heightSmall?: string | undefined;
112
+ heightMedium?: string | undefined;
113
+ heightLarge?: string | undefined;
114
+ heightHuge?: string | undefined;
115
+ name?: "common" | undefined;
116
+ }>;
117
+ };
@@ -0,0 +1,41 @@
1
+ import { ConfigProviderProps } from 'naive-ui';
2
+ import { ComputedRef, InjectionKey, Ref } from 'vue';
3
+ import { NaiveExtraThemeConfig } from '../const';
4
+ export * from '../const';
5
+ /**
6
+ * NaiveExtra 上下文接口
7
+ */
8
+ export interface NaiveExtraContext {
9
+ /** 响应式的主题配置 */
10
+ config: Ref<NaiveExtraThemeConfig>;
11
+ /** 合并了默认值的最终配置 */
12
+ mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>;
13
+ /** ConfigProvider 所需的所有 Props */
14
+ providerProps: ComputedRef<ConfigProviderProps>;
15
+ loadingBarProviderProps: ComputedRef<any>;
16
+ messageProviderProps: ComputedRef<any>;
17
+ notificationProviderProps: ComputedRef<any>;
18
+ /** 是否为暗黑模式 */
19
+ isDark: ComputedRef<boolean>;
20
+ /** 更新配置的方法 */
21
+ updateConfig: (newConfig: Partial<NaiveExtraThemeConfig>) => void;
22
+ /** 主题控制方法 */
23
+ setThemeMode: (mode: 'light' | 'dark' | 'system') => void;
24
+ toggleTheme: () => void;
25
+ /** 语言控制方法 */
26
+ setLocaleMode: (mode: 'zh' | 'en') => void;
27
+ toggleLocale: () => void;
28
+ /** 样式快捷操作 */
29
+ setPrimaryColor: (color: string) => void;
30
+ setBorderRadius: (radius: number) => void;
31
+ }
32
+ /**
33
+ * Context 注入标识
34
+ */
35
+ export declare const NAIVE_EXTRA_CONTEXT_KEY: InjectionKey<NaiveExtraContext>;
36
+ /**
37
+ * 创建并提供主题配置上下文
38
+ *
39
+ * 通过聚合多个子模块逻辑,实现一站式的主题与配置管理。
40
+ */
41
+ export declare function createProviderContext(initialConfig?: NaiveExtraThemeConfig): NaiveExtraContext;
@@ -0,0 +1,52 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { NaiveExtraThemeConfig } from '../const';
3
+ import { ExtractThemeOverrides } from 'naive-ui/es/_mixins/use-theme';
4
+ import { Theme } from 'naive-ui/es/_mixins';
5
+ /**
6
+ * 布局相关组件样式覆盖模块
7
+ *
8
+ * 涵盖 Layout, Tabs, Scrollbar 等
9
+ *
10
+ * @param mergedConfig - 合并后的响应式配置
11
+ * @returns 包含各组件主题覆盖对象的集合
12
+ */
13
+ export declare function useLayoutModule(mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>): {
14
+ layoutOverrides: ComputedRef< ExtractThemeOverrides< Theme<"Layout", {
15
+ textColor: string;
16
+ textColorInverted: string;
17
+ color: string;
18
+ colorEmbedded: string;
19
+ headerColor: string;
20
+ headerColorInverted: string;
21
+ footerColor: string;
22
+ footerColorInverted: string;
23
+ headerBorderColor: string;
24
+ headerBorderColorInverted: string;
25
+ footerBorderColor: string;
26
+ footerBorderColorInverted: string;
27
+ siderBorderColor: string;
28
+ siderBorderColorInverted: string;
29
+ siderColor: string;
30
+ siderColorInverted: string;
31
+ siderToggleButtonBorder: string;
32
+ siderToggleButtonColor: string;
33
+ siderToggleButtonIconColor: string;
34
+ siderToggleButtonIconColorInverted: string;
35
+ siderToggleBarColor: string;
36
+ siderToggleBarColorHover: string;
37
+ __invertScrollbar: string;
38
+ }, {
39
+ Scrollbar: Theme<"Scrollbar", {
40
+ height: string;
41
+ width: string;
42
+ borderRadius: string;
43
+ color: string;
44
+ colorHover: string;
45
+ railInsetHorizontalBottom: string;
46
+ railInsetHorizontalTop: string;
47
+ railInsetVerticalRight: string;
48
+ railInsetVerticalLeft: string;
49
+ railColor: string;
50
+ }, any>;
51
+ }> | undefined> | undefined>;
52
+ };
@@ -0,0 +1,14 @@
1
+ import { LoadingBarProviderProps } from 'naive-ui';
2
+ import { ComputedRef } from 'vue';
3
+ import { NaiveExtraThemeConfig } from '../const';
4
+ /**
5
+ * 加载条 (LoadingBar) 配置模块
6
+ *
7
+ * 负责管理 NLoadingBarProvider 的全局属性和样式
8
+ *
9
+ * @param mergedConfig - 合并后的完整主题配置
10
+ * @returns 包含 loadingBarProviderProps 的计算引用
11
+ */
12
+ export declare function useLoadingBarModule(mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>): {
13
+ loadingBarProviderProps: ComputedRef<LoadingBarProviderProps>;
14
+ };
@@ -0,0 +1,143 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { NaiveExtraThemeConfig } from '../const';
3
+ import { NDateLocale } from 'naive-ui';
4
+ /**
5
+ * 国际化管理模块
6
+ *
7
+ * 负责语言包及日期语言包的切换逻辑
8
+ *
9
+ * @param mergedConfig - 合并后的响应式配置
10
+ * @returns 包含语言包、日期语言包计算结果的对象
11
+ */
12
+ export declare function useLocaleModule(mergedConfig: ComputedRef<Required<NaiveExtraThemeConfig>>): {
13
+ locale: ComputedRef<{
14
+ name: string;
15
+ global: {
16
+ undo: string;
17
+ redo: string;
18
+ confirm: string;
19
+ clear: string;
20
+ };
21
+ Popconfirm: {
22
+ positiveText: string;
23
+ negativeText: string;
24
+ };
25
+ Cascader: {
26
+ placeholder: string;
27
+ loading: string;
28
+ loadingRequiredMessage: (label: string) => string;
29
+ };
30
+ Time: {
31
+ dateFormat: string;
32
+ dateTimeFormat: string;
33
+ };
34
+ DatePicker: {
35
+ yearFormat: string;
36
+ monthFormat: string;
37
+ dayFormat: string;
38
+ yearTypeFormat: string;
39
+ monthTypeFormat: string;
40
+ dateFormat: string;
41
+ dateTimeFormat: string;
42
+ quarterFormat: string;
43
+ weekFormat: string;
44
+ clear: string;
45
+ now: string;
46
+ confirm: string;
47
+ selectTime: string;
48
+ selectDate: string;
49
+ datePlaceholder: string;
50
+ datetimePlaceholder: string;
51
+ monthPlaceholder: string;
52
+ yearPlaceholder: string;
53
+ quarterPlaceholder: string;
54
+ weekPlaceholder: string;
55
+ startDatePlaceholder: string;
56
+ endDatePlaceholder: string;
57
+ startDatetimePlaceholder: string;
58
+ endDatetimePlaceholder: string;
59
+ startMonthPlaceholder: string;
60
+ endMonthPlaceholder: string;
61
+ monthBeforeYear: boolean;
62
+ firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
63
+ today: string;
64
+ };
65
+ DataTable: {
66
+ checkTableAll: string;
67
+ uncheckTableAll: string;
68
+ confirm: string;
69
+ clear: string;
70
+ };
71
+ LegacyTransfer: {
72
+ sourceTitle: string;
73
+ targetTitle: string;
74
+ };
75
+ Transfer: {
76
+ selectAll: string;
77
+ unselectAll: string;
78
+ clearAll: string;
79
+ total: (num: number) => string;
80
+ selected: (num: number) => string;
81
+ };
82
+ Empty: {
83
+ description: string;
84
+ };
85
+ Select: {
86
+ placeholder: string;
87
+ };
88
+ TimePicker: {
89
+ placeholder: string;
90
+ positiveText: string;
91
+ negativeText: string;
92
+ now: string;
93
+ clear: string;
94
+ };
95
+ Pagination: {
96
+ goto: string;
97
+ selectionSuffix: string;
98
+ };
99
+ DynamicTags: {
100
+ add: string;
101
+ };
102
+ Log: {
103
+ loading: string;
104
+ };
105
+ Input: {
106
+ placeholder: string;
107
+ };
108
+ InputNumber: {
109
+ placeholder: string;
110
+ };
111
+ DynamicInput: {
112
+ create: string;
113
+ };
114
+ ThemeEditor: {
115
+ title: string;
116
+ clearAllVars: string;
117
+ clearSearch: string;
118
+ filterCompName: string;
119
+ filterVarName: string;
120
+ import: string;
121
+ export: string;
122
+ restore: string;
123
+ };
124
+ Image: {
125
+ tipPrevious: string;
126
+ tipNext: string;
127
+ tipCounterclockwise: string;
128
+ tipClockwise: string;
129
+ tipZoomOut: string;
130
+ tipZoomIn: string;
131
+ tipDownload: string;
132
+ tipClose: string;
133
+ tipOriginalSize: string;
134
+ };
135
+ Heatmap: {
136
+ less: string;
137
+ more: string;
138
+ monthFormat: string;
139
+ weekdayFormat: string;
140
+ };
141
+ }>;
142
+ dateLocale: ComputedRef< NDateLocale>;
143
+ };