@robot-admin/layout 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +344 -635
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +593 -4
- package/dist/index.js +2164 -444
- package/dist/index.js.map +1 -1
- package/package.json +76 -77
- package/src/styles/layouts.scss +662 -0
- package/src/styles/settings.scss +385 -385
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,283 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
|
+
import { Component } from 'vue';
|
|
2
3
|
import { ComponentOptionsMixin } from 'vue';
|
|
3
4
|
import { ComponentProvideOptions } from 'vue';
|
|
4
5
|
import { ComputedRef } from 'vue';
|
|
5
6
|
import { DefineComponent } from 'vue';
|
|
7
|
+
import { InjectionKey } from 'vue';
|
|
8
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
6
9
|
import { PublicProps } from 'vue';
|
|
7
10
|
import { Ref } from 'vue';
|
|
8
11
|
import { StoreDefinition } from 'pinia';
|
|
9
12
|
import { ThemeMode } from '@robot-admin/theme';
|
|
13
|
+
import { VNode } from 'vue';
|
|
14
|
+
|
|
15
|
+
declare const __VLS_component: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
16
|
+
|
|
17
|
+
declare const __VLS_component_2: DefineComponent<__VLS_Props_8, {
|
|
18
|
+
collapsed: ComputedRef<boolean>;
|
|
19
|
+
toggleCollapse: () => void;
|
|
20
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
21
|
+
"update:collapsed": (value: boolean) => any;
|
|
22
|
+
}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{
|
|
23
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
|
|
28
|
+
declare const __VLS_component_3: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
29
|
+
|
|
30
|
+
declare const __VLS_component_4: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
31
|
+
|
|
32
|
+
declare const __VLS_component_5: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
33
|
+
|
|
34
|
+
declare const __VLS_component_6: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
35
|
+
|
|
36
|
+
declare const __VLS_component_7: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
10
37
|
|
|
11
38
|
declare type __VLS_Props = {
|
|
12
|
-
|
|
39
|
+
/** 是否显示品牌名称 */
|
|
40
|
+
showName?: boolean;
|
|
41
|
+
/** 是否显示分隔线 */
|
|
42
|
+
showDivider?: boolean;
|
|
43
|
+
/** Logo 尺寸 */
|
|
44
|
+
size?: number;
|
|
45
|
+
/** 是否折叠状态 */
|
|
46
|
+
collapsed?: boolean;
|
|
47
|
+
/** 布局方向 */
|
|
48
|
+
variant?: "vertical" | "horizontal";
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare type __VLS_Props_2 = {
|
|
52
|
+
/** 菜单数据 */
|
|
53
|
+
menus: MenuOptions[];
|
|
54
|
+
/** 当前激活的菜单路径 */
|
|
55
|
+
active?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare type __VLS_Props_3 = {
|
|
59
|
+
/** 是否显示 */
|
|
60
|
+
show: boolean;
|
|
61
|
+
/** 当前悬浮的一级菜单项(包含 children) */
|
|
62
|
+
menuItem: MenuOptions | null;
|
|
63
|
+
/** 判断菜单项是否激活 */
|
|
64
|
+
isActive?: (path: string | undefined) => boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
declare type __VLS_Props_4 = {
|
|
68
|
+
/** 二级菜单列表 */
|
|
69
|
+
menus: MenuOptions[];
|
|
70
|
+
/** 当前一级菜单项(显示标题和图标) */
|
|
71
|
+
activeItem?: MenuOptions;
|
|
72
|
+
/** 判断菜单项是否激活 */
|
|
73
|
+
isActive?: (path: string | undefined) => boolean;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
declare type __VLS_Props_5 = {
|
|
77
|
+
/** 菜单数据 */
|
|
78
|
+
menus: MenuOptions[];
|
|
79
|
+
/** 是否显示 */
|
|
80
|
+
show: boolean;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
declare type __VLS_Props_6 = {
|
|
84
|
+
show?: boolean;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
declare type __VLS_Props_7 = {
|
|
88
|
+
/** 菜单数据 */
|
|
89
|
+
data: MenuOptions[];
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare type __VLS_Props_8 = {
|
|
93
|
+
/** 控制侧边栏折叠状态 (支持 v-model:collapsed) */
|
|
94
|
+
collapsed?: boolean;
|
|
13
95
|
};
|
|
14
96
|
|
|
15
97
|
declare type __VLS_PublicProps = {
|
|
16
98
|
"show"?: boolean;
|
|
17
|
-
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare function __VLS_template(): {
|
|
102
|
+
attrs: Partial<{}>;
|
|
103
|
+
slots: {
|
|
104
|
+
logo?(_: {}): any;
|
|
105
|
+
logo?(_: {}): any;
|
|
106
|
+
logo?(_: {}): any;
|
|
107
|
+
logo?(_: {}): any;
|
|
108
|
+
logo?(_: {}): any;
|
|
109
|
+
logo?(_: {}): any;
|
|
110
|
+
menu?(_: {
|
|
111
|
+
collapsed: boolean;
|
|
112
|
+
}): any;
|
|
113
|
+
header?(_: {}): any;
|
|
114
|
+
header?(_: {}): any;
|
|
115
|
+
footer?(_: {}): any;
|
|
116
|
+
footer?(_: {}): any;
|
|
117
|
+
footer?(_: {}): any;
|
|
118
|
+
footer?(_: {}): any;
|
|
119
|
+
footer?(_: {}): any;
|
|
120
|
+
footer?(_: {}): any;
|
|
121
|
+
'top-menu'?(_: {}): any;
|
|
122
|
+
'top-menu'?(_: {}): any;
|
|
123
|
+
'top-menu'?(_: {}): any;
|
|
124
|
+
'header-extra'?(_: {}): any;
|
|
125
|
+
'header-extra'?(_: {}): any;
|
|
126
|
+
'header-extra'?(_: {}): any;
|
|
127
|
+
'header-extra'?(_: {}): any;
|
|
128
|
+
'tags-view'?(_: {}): any;
|
|
129
|
+
'tags-view'?(_: {}): any;
|
|
130
|
+
'tags-view'?(_: {}): any;
|
|
131
|
+
'tags-view'?(_: {}): any;
|
|
132
|
+
brand?(_: {}): any;
|
|
133
|
+
'menu-trigger'?(_: {}): any;
|
|
134
|
+
'drawer-menu'?(_: {}): any;
|
|
135
|
+
};
|
|
136
|
+
refs: {};
|
|
137
|
+
rootEl: HTMLDivElement;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
declare function __VLS_template_2(): {
|
|
141
|
+
attrs: Partial<{}>;
|
|
142
|
+
slots: {
|
|
143
|
+
logo?(_: {}): any;
|
|
144
|
+
menu?(_: {
|
|
145
|
+
collapsed: boolean;
|
|
146
|
+
}): any;
|
|
147
|
+
header?(_: {}): any;
|
|
148
|
+
footer?(_: {}): any;
|
|
149
|
+
};
|
|
150
|
+
refs: {};
|
|
151
|
+
rootEl: any;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
declare function __VLS_template_3(): {
|
|
155
|
+
attrs: Partial<{}>;
|
|
156
|
+
slots: {
|
|
157
|
+
logo?(_: {}): any;
|
|
158
|
+
menu?(_: {}): any;
|
|
159
|
+
'header-extra'?(_: {}): any;
|
|
160
|
+
'tags-view'?(_: {}): any;
|
|
161
|
+
footer?(_: {}): any;
|
|
162
|
+
};
|
|
163
|
+
refs: {};
|
|
164
|
+
rootEl: HTMLDivElement;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
declare function __VLS_template_4(): {
|
|
168
|
+
attrs: Partial<{}>;
|
|
169
|
+
slots: {
|
|
170
|
+
logo?(_: {}): any;
|
|
171
|
+
header?(_: {}): any;
|
|
172
|
+
footer?(_: {}): any;
|
|
173
|
+
};
|
|
174
|
+
refs: {};
|
|
175
|
+
rootEl: HTMLDivElement;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
declare function __VLS_template_5(): {
|
|
179
|
+
attrs: Partial<{}>;
|
|
180
|
+
slots: {
|
|
181
|
+
logo?(_: {}): any;
|
|
182
|
+
brand?(_: {}): any;
|
|
183
|
+
'top-menu'?(_: {}): any;
|
|
184
|
+
'header-extra'?(_: {}): any;
|
|
185
|
+
'tags-view'?(_: {}): any;
|
|
186
|
+
footer?(_: {}): any;
|
|
187
|
+
};
|
|
188
|
+
refs: {};
|
|
189
|
+
rootEl: HTMLDivElement;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare function __VLS_template_6(): {
|
|
193
|
+
attrs: Partial<{}>;
|
|
194
|
+
slots: {
|
|
195
|
+
logo?(_: {}): any;
|
|
196
|
+
'top-menu'?(_: {}): any;
|
|
197
|
+
'header-extra'?(_: {}): any;
|
|
198
|
+
'tags-view'?(_: {}): any;
|
|
199
|
+
footer?(_: {}): any;
|
|
200
|
+
};
|
|
201
|
+
refs: {};
|
|
202
|
+
rootEl: HTMLDivElement;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
declare function __VLS_template_7(): {
|
|
206
|
+
attrs: Partial<{}>;
|
|
207
|
+
slots: {
|
|
208
|
+
'menu-trigger'?(_: {}): any;
|
|
209
|
+
logo?(_: {}): any;
|
|
210
|
+
'header-extra'?(_: {}): any;
|
|
211
|
+
'tags-view'?(_: {}): any;
|
|
212
|
+
'drawer-menu'?(_: {}): any;
|
|
213
|
+
footer?(_: {}): any;
|
|
214
|
+
};
|
|
215
|
+
refs: {};
|
|
216
|
+
rootEl: HTMLDivElement;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
220
|
+
|
|
221
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
222
|
+
|
|
223
|
+
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
224
|
+
|
|
225
|
+
declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
|
|
226
|
+
|
|
227
|
+
declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
|
|
228
|
+
|
|
229
|
+
declare type __VLS_TemplateResult_6 = ReturnType<typeof __VLS_template_6>;
|
|
230
|
+
|
|
231
|
+
declare type __VLS_TemplateResult_7 = ReturnType<typeof __VLS_template_7>;
|
|
232
|
+
|
|
233
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
234
|
+
new (): {
|
|
235
|
+
$slots: S;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
240
|
+
new (): {
|
|
241
|
+
$slots: S;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
246
|
+
new (): {
|
|
247
|
+
$slots: S;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare type __VLS_WithTemplateSlots_4<T, S> = T & {
|
|
252
|
+
new (): {
|
|
253
|
+
$slots: S;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
declare type __VLS_WithTemplateSlots_5<T, S> = T & {
|
|
258
|
+
new (): {
|
|
259
|
+
$slots: S;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
declare type __VLS_WithTemplateSlots_6<T, S> = T & {
|
|
264
|
+
new (): {
|
|
265
|
+
$slots: S;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
declare type __VLS_WithTemplateSlots_7<T, S> = T & {
|
|
270
|
+
new (): {
|
|
271
|
+
$slots: S;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* 调整颜色亮度
|
|
277
|
+
* @param color - 十六进制颜色值
|
|
278
|
+
* @param amount - 调整量,正数变亮,负数变暗
|
|
279
|
+
*/
|
|
280
|
+
export declare function adjustColor(color: string, amount: number): string;
|
|
18
281
|
|
|
19
282
|
export declare const BORDER_RADIUS_MAP: {
|
|
20
283
|
readonly small: "4px";
|
|
@@ -27,6 +290,16 @@ export declare const BORDER_RADIUS_MAP: {
|
|
|
27
290
|
*/
|
|
28
291
|
export declare type BorderRadiusSize = "small" | "medium" | "large";
|
|
29
292
|
|
|
293
|
+
export declare const BrandLogo: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
294
|
+
collapsed: boolean;
|
|
295
|
+
size: number;
|
|
296
|
+
showName: boolean;
|
|
297
|
+
showDivider: boolean;
|
|
298
|
+
variant: "vertical" | "horizontal";
|
|
299
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
300
|
+
|
|
301
|
+
export declare const C_LayoutContainer: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
302
|
+
|
|
30
303
|
/** Color swatches for color picker */
|
|
31
304
|
export declare const COLOR_SWATCHES: string[];
|
|
32
305
|
|
|
@@ -123,10 +396,155 @@ updateThemeMode: (mode: ThemeMode) => Promise<void>;
|
|
|
123
396
|
toggleCollapse: () => void;
|
|
124
397
|
}, "syncCSSVariables" | "applyPreset" | "resetSettings" | "updateThemeMode" | "toggleCollapse">>;
|
|
125
398
|
|
|
399
|
+
declare const _default: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
400
|
+
export { _default as C_SideLayout }
|
|
401
|
+
export { _default as SideLayout }
|
|
402
|
+
|
|
403
|
+
declare const _default_2: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
404
|
+
export { _default_2 as C_TopLayout }
|
|
405
|
+
export { _default_2 as TopLayout }
|
|
406
|
+
|
|
407
|
+
declare const _default_3: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
408
|
+
export { _default_3 as C_MixLayout }
|
|
409
|
+
export { _default_3 as MixLayout }
|
|
410
|
+
|
|
411
|
+
declare const _default_4: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
412
|
+
export { _default_4 as C_MixTopLayout }
|
|
413
|
+
export { _default_4 as MixTopLayout }
|
|
414
|
+
|
|
415
|
+
declare const _default_5: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
|
|
416
|
+
export { _default_5 as C_ReverseHorizontalMixLayout }
|
|
417
|
+
export { _default_5 as ReverseHorizontalMixLayout }
|
|
418
|
+
|
|
419
|
+
declare const _default_6: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
|
|
420
|
+
export { _default_6 as C_CardLayout }
|
|
421
|
+
export { _default_6 as CardLayout }
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* 默认品牌配置
|
|
425
|
+
*/
|
|
426
|
+
export declare const DEFAULT_BRAND_CONFIG: Required<LayoutBrandConfig>;
|
|
427
|
+
|
|
126
428
|
export declare const DEFAULT_SETTINGS: SettingsState;
|
|
127
429
|
|
|
430
|
+
/**
|
|
431
|
+
* 抽屉菜单控制器 Injection Key
|
|
432
|
+
*/
|
|
433
|
+
export declare const DRAWER_HANDLER_KEY: InjectionKey<DrawerHandlers>;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* 抽屉菜单统一控制器
|
|
437
|
+
* 解决 MenuTrigger 与 DrawerMenu 各自拥有独立定时器导致的
|
|
438
|
+
* "鼠标从 trigger 移到 drawer 过程中 drawer 被关闭"问题
|
|
439
|
+
*/
|
|
440
|
+
export declare interface DrawerHandlers {
|
|
441
|
+
/** 显示抽屉并取消所有待执行的隐藏操作 */
|
|
442
|
+
show: () => void;
|
|
443
|
+
/** 启动延迟隐藏(300ms) */
|
|
444
|
+
startHide: () => void;
|
|
445
|
+
/** 立即隐藏抽屉(如导航跳转后) */
|
|
446
|
+
hide: () => void;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export declare const DrawerMenu: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
450
|
+
|
|
451
|
+
export declare const FloatingMenu: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
452
|
+
click: (item: MenuOptions) => any;
|
|
453
|
+
}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
|
|
454
|
+
onClick?: ((item: MenuOptions) => any) | undefined;
|
|
455
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
456
|
+
|
|
457
|
+
export declare const IconMenu: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
458
|
+
click: (item: MenuOptions) => any;
|
|
459
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
460
|
+
onClick?: ((item: MenuOptions) => any) | undefined;
|
|
461
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* 布局上下文 Injection Key
|
|
465
|
+
*/
|
|
466
|
+
export declare const LAYOUT_CONTEXT_KEY: InjectionKey<LayoutContext>;
|
|
467
|
+
|
|
128
468
|
export declare const LAYOUT_MODES: LayoutInfo[];
|
|
129
469
|
|
|
470
|
+
/**
|
|
471
|
+
* 品牌配置
|
|
472
|
+
*/
|
|
473
|
+
export declare interface LayoutBrandConfig {
|
|
474
|
+
/** 品牌名称,如 'Robot Admin' */
|
|
475
|
+
name?: string;
|
|
476
|
+
/** 品牌副标题,如 '机器人管理系统' */
|
|
477
|
+
subtitle?: string;
|
|
478
|
+
/** Logo 地址(图片或视频) */
|
|
479
|
+
logoSrc?: string;
|
|
480
|
+
/** Logo 类型 */
|
|
481
|
+
logoType?: "video" | "image";
|
|
482
|
+
/** Logo 尺寸 */
|
|
483
|
+
logoSize?: number;
|
|
484
|
+
/** 首页路径,默认 '/home' */
|
|
485
|
+
homePath?: string;
|
|
486
|
+
/** 页脚版权文本 */
|
|
487
|
+
copyright?: string;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @robot-admin/layout
|
|
492
|
+
*
|
|
493
|
+
* 统一的 KeepAlive 缓存管理
|
|
494
|
+
* 从主项目提取的通用 composable,零业务依赖
|
|
495
|
+
*/
|
|
496
|
+
/** KeepAlive 缓存选项 */
|
|
497
|
+
export declare interface LayoutCacheOptions {
|
|
498
|
+
/** 最大缓存数量,默认 20 */
|
|
499
|
+
maxCacheCount?: number;
|
|
500
|
+
/** 是否在开发模式下输出日志,默认 true */
|
|
501
|
+
enableDevLog?: boolean;
|
|
502
|
+
/** 是否暴露调试方法到 window,默认 true */
|
|
503
|
+
exposeToWindow?: boolean;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 布局上下文数据接口
|
|
508
|
+
* 骨架组件通过 inject 获取这些数据
|
|
509
|
+
*/
|
|
510
|
+
export declare interface LayoutContext {
|
|
511
|
+
/** 菜单列表数据 */
|
|
512
|
+
menus: ComputedRef<MenuOptions[]>;
|
|
513
|
+
/** 是否为暗色模式 */
|
|
514
|
+
isDark: ComputedRef<boolean>;
|
|
515
|
+
/** 当前布局模式 */
|
|
516
|
+
layoutMode: ComputedRef<LayoutMode>;
|
|
517
|
+
/** 侧边栏宽度 (px) */
|
|
518
|
+
sidebarWidth: ComputedRef<number>;
|
|
519
|
+
/** 侧边栏折叠后宽度 (px) */
|
|
520
|
+
sidebarCollapsedWidth: ComputedRef<number>;
|
|
521
|
+
/** 是否显示页脚 */
|
|
522
|
+
showFooter: ComputedRef<boolean>;
|
|
523
|
+
/** 是否显示标签页 */
|
|
524
|
+
showTagsView: ComputedRef<boolean>;
|
|
525
|
+
/** 标签页高度 (px) */
|
|
526
|
+
tagsViewHeight: ComputedRef<number>;
|
|
527
|
+
/** 头部高度 (px) */
|
|
528
|
+
headerHeight: ComputedRef<number>;
|
|
529
|
+
/** 过渡动画名称 */
|
|
530
|
+
transitionName: ComputedRef<string>;
|
|
531
|
+
/** 是否显示面包屑 */
|
|
532
|
+
showBreadcrumb: ComputedRef<boolean>;
|
|
533
|
+
/** 是否显示面包屑图标 */
|
|
534
|
+
showBreadcrumbIcon: ComputedRef<boolean>;
|
|
535
|
+
/** 是否固定头部 */
|
|
536
|
+
fixedHeader: ComputedRef<boolean>;
|
|
537
|
+
/** 品牌信息 */
|
|
538
|
+
brand: LayoutBrandConfig;
|
|
539
|
+
/**
|
|
540
|
+
* 自定义图标组件(如 @iconify/vue 的 Icon 组件)
|
|
541
|
+
* 用于布局内部组件渲染菜单图标
|
|
542
|
+
* 组件需接受 name (string) 和 size (number) 两个 props
|
|
543
|
+
* 如果不提供,将使用 CSS class 渲染图标
|
|
544
|
+
*/
|
|
545
|
+
iconComponent?: Component;
|
|
546
|
+
}
|
|
547
|
+
|
|
130
548
|
/**
|
|
131
549
|
* 布局模式信息
|
|
132
550
|
*/
|
|
@@ -142,6 +560,80 @@ export declare interface LayoutInfo {
|
|
|
142
560
|
*/
|
|
143
561
|
export declare type LayoutMode = "side" | "top" | "mix" | "mix-top" | "reverse-horizontal-mix" | "card-layout";
|
|
144
562
|
|
|
563
|
+
/**
|
|
564
|
+
* 菜单项类型
|
|
565
|
+
* - `group` 分组
|
|
566
|
+
* - `divider` 分割线
|
|
567
|
+
* - `item` 普通菜单项
|
|
568
|
+
*/
|
|
569
|
+
export declare type MenuItemType = "group" | "divider" | "item";
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* 菜单选项的详细类型定义
|
|
573
|
+
*/
|
|
574
|
+
export declare interface MenuOptions {
|
|
575
|
+
/** 菜单项类型(分组/分割线) */
|
|
576
|
+
type?: "group" | "divider";
|
|
577
|
+
/** 唯一标识 */
|
|
578
|
+
key?: string;
|
|
579
|
+
/** 菜单跳转路径 */
|
|
580
|
+
path?: string;
|
|
581
|
+
/** 菜单名称(可对应路由名) */
|
|
582
|
+
name?: string;
|
|
583
|
+
/** 菜单项对应的组件名称 */
|
|
584
|
+
component?: string;
|
|
585
|
+
/** 重定向路径 */
|
|
586
|
+
redirect?: string;
|
|
587
|
+
/** 菜单显示的文本 */
|
|
588
|
+
label?: string;
|
|
589
|
+
/** 图标 */
|
|
590
|
+
icon?: string | (() => VNode) | VNode;
|
|
591
|
+
/** 是否禁用此菜单项 */
|
|
592
|
+
disabled?: boolean;
|
|
593
|
+
/** 元数据 */
|
|
594
|
+
meta?: {
|
|
595
|
+
/** 页面标题 */
|
|
596
|
+
title?: string;
|
|
597
|
+
/** 菜单项的图标 */
|
|
598
|
+
icon?: string;
|
|
599
|
+
/** 是否在菜单中隐藏 */
|
|
600
|
+
hidden?: boolean;
|
|
601
|
+
/** 是否固定在标签栏 */
|
|
602
|
+
affix?: boolean;
|
|
603
|
+
/** 是否缓存该页面 */
|
|
604
|
+
keepAlive?: boolean;
|
|
605
|
+
/** 是否全屏显示 */
|
|
606
|
+
full?: boolean;
|
|
607
|
+
/** 外部链接 URL */
|
|
608
|
+
link?: string;
|
|
609
|
+
/** 扩展属性 */
|
|
610
|
+
[key: string]: any;
|
|
611
|
+
};
|
|
612
|
+
/** 子菜单 */
|
|
613
|
+
children?: MenuOptions[];
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* 标签栏项类型定义
|
|
618
|
+
*/
|
|
619
|
+
export declare interface MenuTag {
|
|
620
|
+
/** 标签项对应的路由路径 */
|
|
621
|
+
path: string;
|
|
622
|
+
/** 标签显示的标题(已翻译) */
|
|
623
|
+
title: string;
|
|
624
|
+
/** 原始标题(中文,用于重新翻译) */
|
|
625
|
+
originalTitle?: string;
|
|
626
|
+
/** 显示的图标 */
|
|
627
|
+
icon?: string;
|
|
628
|
+
/** 标签相关元数据 */
|
|
629
|
+
meta?: {
|
|
630
|
+
/** 是否固定在标签栏 */
|
|
631
|
+
affix?: boolean;
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export declare const MenuTrigger: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
636
|
+
|
|
145
637
|
export declare const PRESET_COLORS: PresetColor[];
|
|
146
638
|
|
|
147
639
|
/**
|
|
@@ -152,6 +644,11 @@ export declare interface PresetColor {
|
|
|
152
644
|
value: string;
|
|
153
645
|
}
|
|
154
646
|
|
|
647
|
+
export declare const ResponsiveMenu: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
648
|
+
containerRef: HTMLDivElement;
|
|
649
|
+
visibleRef: HTMLDivElement;
|
|
650
|
+
}, HTMLDivElement>;
|
|
651
|
+
|
|
155
652
|
export declare const SettingsDrawer: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
156
653
|
"update:show": (value: boolean) => any;
|
|
157
654
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
@@ -208,8 +705,6 @@ export declare interface SettingsState {
|
|
|
208
705
|
export declare interface SettingsStoreOptions {
|
|
209
706
|
/** 默认配置 */
|
|
210
707
|
defaults?: Partial<SettingsState>;
|
|
211
|
-
/** localStorage 键名 */
|
|
212
|
-
storageKey?: string;
|
|
213
708
|
/** 主题模式变化回调(用于同步到 theme store) */
|
|
214
709
|
onThemeModeChange?: (mode: ThemeMode) => void | Promise<void>;
|
|
215
710
|
}
|
|
@@ -317,6 +812,12 @@ updateThemeMode: (mode: ThemeMode) => Promise<void>;
|
|
|
317
812
|
toggleCollapse: () => void;
|
|
318
813
|
}, "syncCSSVariables" | "applyPreset" | "resetSettings" | "updateThemeMode" | "toggleCollapse">>;
|
|
319
814
|
|
|
815
|
+
export declare const SideMenu: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
816
|
+
click: (item: MenuOptions) => any;
|
|
817
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
818
|
+
onClick?: ((item: MenuOptions) => any) | undefined;
|
|
819
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
820
|
+
|
|
320
821
|
/**
|
|
321
822
|
* 标签页风格
|
|
322
823
|
*/
|
|
@@ -352,6 +853,94 @@ export declare const TRANSITION_MAP: {
|
|
|
352
853
|
*/
|
|
353
854
|
export declare type TransitionType = "fade" | "slide" | "zoom" | "none";
|
|
354
855
|
|
|
856
|
+
/**
|
|
857
|
+
* 统一的 KeepAlive 缓存管理 composable
|
|
858
|
+
*
|
|
859
|
+
* @param options - 缓存配置选项
|
|
860
|
+
* @returns 缓存视图列表和管理方法
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```vue
|
|
864
|
+
* <script setup>
|
|
865
|
+
* import { useLayoutCache } from '@robot-admin/layout'
|
|
866
|
+
*
|
|
867
|
+
* const { cachedViews, maxCacheCount } = useLayoutCache({ maxCacheCount: 30 })
|
|
868
|
+
* </script>
|
|
869
|
+
*
|
|
870
|
+
* <template>
|
|
871
|
+
* <KeepAlive :include="cachedViews" :max="maxCacheCount">
|
|
872
|
+
* <RouterView />
|
|
873
|
+
* </KeepAlive>
|
|
874
|
+
* </template>
|
|
875
|
+
* ```
|
|
876
|
+
*/
|
|
877
|
+
export declare function useLayoutCache(options?: LayoutCacheOptions): {
|
|
878
|
+
cachedViews: Ref<string[], string[]>;
|
|
879
|
+
maxCacheCount: Ref<number, number>;
|
|
880
|
+
addCache: (name: string) => void;
|
|
881
|
+
removeCache: (name: string) => void;
|
|
882
|
+
clearAllCache: () => void;
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* 在骨架组件中获取布局上下文
|
|
887
|
+
*
|
|
888
|
+
* @throws 如果没有 provide LayoutContext 会抛出错误
|
|
889
|
+
*
|
|
890
|
+
* @example
|
|
891
|
+
* ```vue
|
|
892
|
+
* <script setup>
|
|
893
|
+
* // 在包的骨架组件内部使用
|
|
894
|
+
* const ctx = useLayoutContext()
|
|
895
|
+
* const menus = ctx.menus
|
|
896
|
+
* const isDark = ctx.isDark
|
|
897
|
+
* </script>
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
export declare function useLayoutContext(): LayoutContext;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* 菜单拆分 Composable
|
|
904
|
+
*
|
|
905
|
+
* 提供一级/二级菜单拆分状态管理、路由自动匹配、菜单点击处理。
|
|
906
|
+
* 供 MixLayout / MixTopLayout / ReverseHorizontalMixLayout 共用。
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* ```ts
|
|
910
|
+
* const menuSplit = useMenuSplit({
|
|
911
|
+
* menus: ctx.menus,
|
|
912
|
+
* floatingSecondMenu: computed(() => layoutMode.value === 'mix'),
|
|
913
|
+
* })
|
|
914
|
+
* ```
|
|
915
|
+
*/
|
|
916
|
+
export declare function useMenuSplit(options: UseMenuSplitOptions): UseMenuSplitReturn;
|
|
917
|
+
|
|
918
|
+
export declare interface UseMenuSplitOptions {
|
|
919
|
+
/** 菜单数据(响应式) */
|
|
920
|
+
menus: ComputedRef<MenuOptions[]>;
|
|
921
|
+
/** 是否使用悬浮式二级菜单(MixLayout 的 toggle 模式) */
|
|
922
|
+
floatingSecondMenu?: MaybeRefOrGetter<boolean>;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export declare interface UseMenuSplitReturn {
|
|
926
|
+
/** 当前激活的一级菜单路径 */
|
|
927
|
+
activeFirstMenu: Ref<string>;
|
|
928
|
+
/** 当前激活的一级菜单完整数据 */
|
|
929
|
+
activeFirstMenuItem: ComputedRef<MenuOptions | undefined>;
|
|
930
|
+
/** 当前一级菜单对应的二级菜单列表 */
|
|
931
|
+
currentSecondMenus: ComputedRef<MenuOptions[]>;
|
|
932
|
+
/** 悬浮的菜单项(MixLayout 使用) */
|
|
933
|
+
hoveredMenuItem: Ref<MenuOptions | null>;
|
|
934
|
+
/** 是否显示悬浮二级菜单(MixLayout 使用) */
|
|
935
|
+
showSecondMenu: Ref<boolean>;
|
|
936
|
+
/** 处理一级菜单点击 */
|
|
937
|
+
handleFirstMenuClick: (item: MenuOptions) => void;
|
|
938
|
+
/** 处理二级菜单点击 */
|
|
939
|
+
handleSecondMenuClick: (item: MenuOptions) => void;
|
|
940
|
+
/** 检查路由是否匹配菜单项 */
|
|
941
|
+
isMenuItemActive: (menuPath: string | undefined) => boolean;
|
|
942
|
+
}
|
|
943
|
+
|
|
355
944
|
/**
|
|
356
945
|
* 默认的设置 Store(使用默认配置)
|
|
357
946
|
*/
|