mamba-layout 0.19.0 → 0.20.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.
@@ -1,21 +1,9 @@
1
- import { Ref } from 'vue';
2
1
  import { RouteItem } from '../../utils/repoUtils';
3
2
  export interface RouteItemWithPath extends RouteItem {
4
3
  paths?: RouteItem[];
5
4
  }
6
- export interface LayoutContext {
7
- menus: Ref<RouteItem[]>;
8
- currentEndRoute: Ref<RouteItemWithPath | undefined>;
9
- currentEndParentRoute: Ref<RouteItem | undefined>;
10
- currentTabPath: Ref<string>;
11
- currentAppId: Ref<string>;
12
- defaultParentActive: Ref<string>;
13
- sideOpen: Ref<boolean>;
14
- isMobile: Ref<boolean>;
15
- getMenus: () => RouteItem[];
16
- }
17
5
  export declare function useLayoutState(): {
18
- menus: Ref<{
6
+ menus: import('vue').ComputedRef<{
19
7
  [x: string]: unknown;
20
8
  id?: string | undefined;
21
9
  path?: string | undefined;
@@ -48,7 +36,10 @@ export declare function useLayoutState(): {
48
36
  transition?: string | undefined;
49
37
  hideSidebar?: boolean | undefined;
50
38
  } | undefined;
51
- }[], RouteItem[] | {
39
+ }[]>;
40
+ sideOpen: import('vue').Ref<boolean, boolean>;
41
+ isMobile: import('vue').Ref<boolean, boolean>;
42
+ currentEndParentRoute: import('vue').ComputedRef<{
52
43
  [x: string]: unknown;
53
44
  id?: string | undefined;
54
45
  path?: string | undefined;
@@ -81,16 +72,45 @@ export declare function useLayoutState(): {
81
72
  transition?: string | undefined;
82
73
  hideSidebar?: boolean | undefined;
83
74
  } | undefined;
84
- }[]>;
85
- currentEndRoute: Ref<RouteItemWithPath | undefined, RouteItemWithPath | undefined>;
86
- currentTabPath: Ref<string, string>;
87
- currentAppId: Ref<string, string>;
88
- defaultParentActive: Ref<string, string>;
89
- sideOpen: Ref<boolean, boolean>;
90
- isMobile: Ref<boolean, boolean>;
91
- getMenus: () => RouteItem[];
92
- currentEndParentRoute: Ref<RouteItem | undefined, RouteItem | undefined>;
93
- leftScrollRef: Ref<({
75
+ }>;
76
+ defaultParentActive: import('vue').ComputedRef<string>;
77
+ currentTabPath: import('vue').ComputedRef<string>;
78
+ currentEndRoute: import('vue').ComputedRef<{
79
+ [x: string]: unknown;
80
+ id?: string | undefined;
81
+ path?: string | undefined;
82
+ name?: string | undefined;
83
+ icon?: string | undefined;
84
+ fullPath?: string | undefined;
85
+ title?: string | undefined;
86
+ children?: /*elided*/ any[] | undefined;
87
+ disabled?: boolean | undefined;
88
+ menuType?: string | undefined;
89
+ meta?: {
90
+ [x: string]: unknown;
91
+ appId?: string | undefined;
92
+ appName?: string | undefined;
93
+ icon?: string | undefined;
94
+ isAffix?: boolean | undefined;
95
+ isHide?: boolean | undefined;
96
+ isKeepAlive?: boolean | undefined;
97
+ isLink?: boolean | undefined;
98
+ permissionMenuId?: string | undefined;
99
+ title?: string | undefined;
100
+ visible?: string | undefined;
101
+ translations?: import('../../utils/repoUtils').Translations | {
102
+ name?: string | undefined;
103
+ description?: string | undefined;
104
+ tooltip?: string | undefined;
105
+ } | undefined;
106
+ parent?: string | undefined;
107
+ parentPath?: string | undefined;
108
+ transition?: string | undefined;
109
+ hideSidebar?: boolean | undefined;
110
+ } | undefined;
111
+ }>;
112
+ currentAppId: import('vue').ComputedRef<string>;
113
+ leftScrollRef: import('vue').Ref<({
94
114
  $: import('vue').ComponentInternalInstance;
95
115
  $data: {};
96
116
  $props: {
@@ -139,7 +159,7 @@ export declare function useLayoutState(): {
139
159
  }) => any) | undefined;
140
160
  "onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
141
161
  }>, {
142
- wrapRef: Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
162
+ wrapRef: import('vue').Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
143
163
  update: () => void;
144
164
  scrollTo: {
145
165
  (xCord: number, yCord?: number): void;
@@ -265,7 +285,7 @@ export declare function useLayoutState(): {
265
285
  }) => any) | undefined;
266
286
  "onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
267
287
  }>, {
268
- wrapRef: Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
288
+ wrapRef: import('vue').Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
269
289
  update: () => void;
270
290
  scrollTo: {
271
291
  (xCord: number, yCord?: number): void;
@@ -1,4 +1,3 @@
1
- import { Ref } from 'vue';
2
1
  import { RouteItem } from '../../utils/repoUtils';
3
2
  export type { RouteItem };
4
3
  export type LayoutMenuItem = RouteItem;
@@ -25,7 +24,377 @@ export interface LayoutApp {
25
24
  children?: LayoutApp[];
26
25
  [key: string]: unknown;
27
26
  }
28
- export declare function useSetting(): Ref<SettingConfig, SettingConfig>;
27
+ export declare function useSetting(): import('vue').Ref<{
28
+ [x: string]: unknown;
29
+ layout: "vertical" | "classic" | "transverse" | "columns" | "comprehensive" | "idc";
30
+ menus?: {
31
+ [x: string]: unknown;
32
+ id?: string | undefined;
33
+ path?: string | undefined;
34
+ name?: string | undefined;
35
+ icon?: string | undefined;
36
+ fullPath?: string | undefined;
37
+ title?: string | undefined;
38
+ children?: /*elided*/ any[] | undefined;
39
+ disabled?: boolean | undefined;
40
+ menuType?: string | undefined;
41
+ meta?: {
42
+ [x: string]: unknown;
43
+ appId?: string | undefined;
44
+ appName?: string | undefined;
45
+ icon?: string | undefined;
46
+ isAffix?: boolean | undefined;
47
+ isHide?: boolean | undefined;
48
+ isKeepAlive?: boolean | undefined;
49
+ isLink?: boolean | undefined;
50
+ permissionMenuId?: string | undefined;
51
+ title?: string | undefined;
52
+ visible?: string | undefined;
53
+ translations?: import('../../utils/repoUtils').Translations | {
54
+ name?: string | undefined;
55
+ description?: string | undefined;
56
+ tooltip?: string | undefined;
57
+ } | undefined;
58
+ parent?: string | undefined;
59
+ parentPath?: string | undefined;
60
+ transition?: string | undefined;
61
+ hideSidebar?: boolean | undefined;
62
+ } | undefined;
63
+ }[] | undefined;
64
+ accountMenu?: {
65
+ [x: string]: unknown;
66
+ id?: string | undefined;
67
+ path?: string | undefined;
68
+ name?: string | undefined;
69
+ icon?: string | undefined;
70
+ fullPath?: string | undefined;
71
+ title?: string | undefined;
72
+ children?: /*elided*/ any[] | undefined;
73
+ disabled?: boolean | undefined;
74
+ menuType?: string | undefined;
75
+ meta?: {
76
+ [x: string]: unknown;
77
+ appId?: string | undefined;
78
+ appName?: string | undefined;
79
+ icon?: string | undefined;
80
+ isAffix?: boolean | undefined;
81
+ isHide?: boolean | undefined;
82
+ isKeepAlive?: boolean | undefined;
83
+ isLink?: boolean | undefined;
84
+ permissionMenuId?: string | undefined;
85
+ title?: string | undefined;
86
+ visible?: string | undefined;
87
+ translations?: import('../../utils/repoUtils').Translations | {
88
+ name?: string | undefined;
89
+ description?: string | undefined;
90
+ tooltip?: string | undefined;
91
+ } | undefined;
92
+ parent?: string | undefined;
93
+ parentPath?: string | undefined;
94
+ transition?: string | undefined;
95
+ hideSidebar?: boolean | undefined;
96
+ } | undefined;
97
+ }[] | undefined;
98
+ user?: {
99
+ [x: string]: unknown;
100
+ id?: string | undefined;
101
+ userId?: string | undefined;
102
+ username?: string | undefined;
103
+ name?: string | undefined;
104
+ nickname?: string | undefined;
105
+ email?: string | undefined;
106
+ avatar?: string | undefined;
107
+ userType?: string | undefined;
108
+ roles?: string[] | undefined;
109
+ permissions?: string[] | undefined;
110
+ } | null | undefined;
111
+ appList?: {
112
+ [x: string]: unknown;
113
+ appId: string;
114
+ displayAppId?: string | undefined;
115
+ name: string;
116
+ desc?: string | undefined;
117
+ path?: string | undefined;
118
+ icon?: string | undefined;
119
+ children?: /*elided*/ any[] | undefined;
120
+ }[] | undefined;
121
+ onLogin?: (() => unknown) | undefined;
122
+ onLogout?: (() => unknown | Promise<unknown>) | undefined;
123
+ theme?: "dark" | "light" | undefined;
124
+ title: string;
125
+ logo: string;
126
+ themeColor?: {
127
+ [x: string]: string | undefined;
128
+ colorPrimary?: string | undefined;
129
+ headerBg?: string | undefined;
130
+ headerColor?: string | undefined;
131
+ asideBg?: string | undefined;
132
+ asideColor?: string | undefined;
133
+ } | undefined;
134
+ tabs?: boolean | string | undefined;
135
+ pageType?: "card" | "common" | undefined;
136
+ logoPath?: string | undefined;
137
+ hideDoc?: boolean | undefined;
138
+ docsPath?: string | undefined;
139
+ loginPath?: string | undefined;
140
+ userCenterPath?: string | undefined;
141
+ currentEndRoute: {
142
+ [x: string]: unknown;
143
+ id?: string | undefined;
144
+ path?: string | undefined;
145
+ name?: string | undefined;
146
+ icon?: string | undefined;
147
+ fullPath?: string | undefined;
148
+ title?: string | undefined;
149
+ children?: /*elided*/ any[] | undefined;
150
+ disabled?: boolean | undefined;
151
+ menuType?: string | undefined;
152
+ meta?: {
153
+ [x: string]: unknown;
154
+ appId?: string | undefined;
155
+ appName?: string | undefined;
156
+ icon?: string | undefined;
157
+ isAffix?: boolean | undefined;
158
+ isHide?: boolean | undefined;
159
+ isKeepAlive?: boolean | undefined;
160
+ isLink?: boolean | undefined;
161
+ permissionMenuId?: string | undefined;
162
+ title?: string | undefined;
163
+ visible?: string | undefined;
164
+ translations?: import('../../utils/repoUtils').Translations | {
165
+ name?: string | undefined;
166
+ description?: string | undefined;
167
+ tooltip?: string | undefined;
168
+ } | undefined;
169
+ parent?: string | undefined;
170
+ parentPath?: string | undefined;
171
+ transition?: string | undefined;
172
+ hideSidebar?: boolean | undefined;
173
+ } | undefined;
174
+ };
175
+ currentTabPath: string;
176
+ currentAppId: string;
177
+ defaultParentActive: string;
178
+ currentEndParentRoute: {
179
+ [x: string]: unknown;
180
+ id?: string | undefined;
181
+ path?: string | undefined;
182
+ name?: string | undefined;
183
+ icon?: string | undefined;
184
+ fullPath?: string | undefined;
185
+ title?: string | undefined;
186
+ children?: /*elided*/ any[] | undefined;
187
+ disabled?: boolean | undefined;
188
+ menuType?: string | undefined;
189
+ meta?: {
190
+ [x: string]: unknown;
191
+ appId?: string | undefined;
192
+ appName?: string | undefined;
193
+ icon?: string | undefined;
194
+ isAffix?: boolean | undefined;
195
+ isHide?: boolean | undefined;
196
+ isKeepAlive?: boolean | undefined;
197
+ isLink?: boolean | undefined;
198
+ permissionMenuId?: string | undefined;
199
+ title?: string | undefined;
200
+ visible?: string | undefined;
201
+ translations?: import('../../utils/repoUtils').Translations | {
202
+ name?: string | undefined;
203
+ description?: string | undefined;
204
+ tooltip?: string | undefined;
205
+ } | undefined;
206
+ parent?: string | undefined;
207
+ parentPath?: string | undefined;
208
+ transition?: string | undefined;
209
+ hideSidebar?: boolean | undefined;
210
+ } | undefined;
211
+ };
212
+ }, SettingConfig | {
213
+ [x: string]: unknown;
214
+ layout: "vertical" | "classic" | "transverse" | "columns" | "comprehensive" | "idc";
215
+ menus?: {
216
+ [x: string]: unknown;
217
+ id?: string | undefined;
218
+ path?: string | undefined;
219
+ name?: string | undefined;
220
+ icon?: string | undefined;
221
+ fullPath?: string | undefined;
222
+ title?: string | undefined;
223
+ children?: /*elided*/ any[] | undefined;
224
+ disabled?: boolean | undefined;
225
+ menuType?: string | undefined;
226
+ meta?: {
227
+ [x: string]: unknown;
228
+ appId?: string | undefined;
229
+ appName?: string | undefined;
230
+ icon?: string | undefined;
231
+ isAffix?: boolean | undefined;
232
+ isHide?: boolean | undefined;
233
+ isKeepAlive?: boolean | undefined;
234
+ isLink?: boolean | undefined;
235
+ permissionMenuId?: string | undefined;
236
+ title?: string | undefined;
237
+ visible?: string | undefined;
238
+ translations?: import('../../utils/repoUtils').Translations | {
239
+ name?: string | undefined;
240
+ description?: string | undefined;
241
+ tooltip?: string | undefined;
242
+ } | undefined;
243
+ parent?: string | undefined;
244
+ parentPath?: string | undefined;
245
+ transition?: string | undefined;
246
+ hideSidebar?: boolean | undefined;
247
+ } | undefined;
248
+ }[] | undefined;
249
+ accountMenu?: {
250
+ [x: string]: unknown;
251
+ id?: string | undefined;
252
+ path?: string | undefined;
253
+ name?: string | undefined;
254
+ icon?: string | undefined;
255
+ fullPath?: string | undefined;
256
+ title?: string | undefined;
257
+ children?: /*elided*/ any[] | undefined;
258
+ disabled?: boolean | undefined;
259
+ menuType?: string | undefined;
260
+ meta?: {
261
+ [x: string]: unknown;
262
+ appId?: string | undefined;
263
+ appName?: string | undefined;
264
+ icon?: string | undefined;
265
+ isAffix?: boolean | undefined;
266
+ isHide?: boolean | undefined;
267
+ isKeepAlive?: boolean | undefined;
268
+ isLink?: boolean | undefined;
269
+ permissionMenuId?: string | undefined;
270
+ title?: string | undefined;
271
+ visible?: string | undefined;
272
+ translations?: import('../../utils/repoUtils').Translations | {
273
+ name?: string | undefined;
274
+ description?: string | undefined;
275
+ tooltip?: string | undefined;
276
+ } | undefined;
277
+ parent?: string | undefined;
278
+ parentPath?: string | undefined;
279
+ transition?: string | undefined;
280
+ hideSidebar?: boolean | undefined;
281
+ } | undefined;
282
+ }[] | undefined;
283
+ user?: {
284
+ [x: string]: unknown;
285
+ id?: string | undefined;
286
+ userId?: string | undefined;
287
+ username?: string | undefined;
288
+ name?: string | undefined;
289
+ nickname?: string | undefined;
290
+ email?: string | undefined;
291
+ avatar?: string | undefined;
292
+ userType?: string | undefined;
293
+ roles?: string[] | undefined;
294
+ permissions?: string[] | undefined;
295
+ } | null | undefined;
296
+ appList?: {
297
+ [x: string]: unknown;
298
+ appId: string;
299
+ displayAppId?: string | undefined;
300
+ name: string;
301
+ desc?: string | undefined;
302
+ path?: string | undefined;
303
+ icon?: string | undefined;
304
+ children?: /*elided*/ any[] | undefined;
305
+ }[] | undefined;
306
+ onLogin?: (() => unknown) | undefined;
307
+ onLogout?: (() => unknown | Promise<unknown>) | undefined;
308
+ theme?: "dark" | "light" | undefined;
309
+ title: string;
310
+ logo: string;
311
+ themeColor?: {
312
+ [x: string]: string | undefined;
313
+ colorPrimary?: string | undefined;
314
+ headerBg?: string | undefined;
315
+ headerColor?: string | undefined;
316
+ asideBg?: string | undefined;
317
+ asideColor?: string | undefined;
318
+ } | undefined;
319
+ tabs?: boolean | string | undefined;
320
+ pageType?: "card" | "common" | undefined;
321
+ logoPath?: string | undefined;
322
+ hideDoc?: boolean | undefined;
323
+ docsPath?: string | undefined;
324
+ loginPath?: string | undefined;
325
+ userCenterPath?: string | undefined;
326
+ currentEndRoute: {
327
+ [x: string]: unknown;
328
+ id?: string | undefined;
329
+ path?: string | undefined;
330
+ name?: string | undefined;
331
+ icon?: string | undefined;
332
+ fullPath?: string | undefined;
333
+ title?: string | undefined;
334
+ children?: /*elided*/ any[] | undefined;
335
+ disabled?: boolean | undefined;
336
+ menuType?: string | undefined;
337
+ meta?: {
338
+ [x: string]: unknown;
339
+ appId?: string | undefined;
340
+ appName?: string | undefined;
341
+ icon?: string | undefined;
342
+ isAffix?: boolean | undefined;
343
+ isHide?: boolean | undefined;
344
+ isKeepAlive?: boolean | undefined;
345
+ isLink?: boolean | undefined;
346
+ permissionMenuId?: string | undefined;
347
+ title?: string | undefined;
348
+ visible?: string | undefined;
349
+ translations?: import('../../utils/repoUtils').Translations | {
350
+ name?: string | undefined;
351
+ description?: string | undefined;
352
+ tooltip?: string | undefined;
353
+ } | undefined;
354
+ parent?: string | undefined;
355
+ parentPath?: string | undefined;
356
+ transition?: string | undefined;
357
+ hideSidebar?: boolean | undefined;
358
+ } | undefined;
359
+ };
360
+ currentTabPath: string;
361
+ currentAppId: string;
362
+ defaultParentActive: string;
363
+ currentEndParentRoute: {
364
+ [x: string]: unknown;
365
+ id?: string | undefined;
366
+ path?: string | undefined;
367
+ name?: string | undefined;
368
+ icon?: string | undefined;
369
+ fullPath?: string | undefined;
370
+ title?: string | undefined;
371
+ children?: /*elided*/ any[] | undefined;
372
+ disabled?: boolean | undefined;
373
+ menuType?: string | undefined;
374
+ meta?: {
375
+ [x: string]: unknown;
376
+ appId?: string | undefined;
377
+ appName?: string | undefined;
378
+ icon?: string | undefined;
379
+ isAffix?: boolean | undefined;
380
+ isHide?: boolean | undefined;
381
+ isKeepAlive?: boolean | undefined;
382
+ isLink?: boolean | undefined;
383
+ permissionMenuId?: string | undefined;
384
+ title?: string | undefined;
385
+ visible?: string | undefined;
386
+ translations?: import('../../utils/repoUtils').Translations | {
387
+ name?: string | undefined;
388
+ description?: string | undefined;
389
+ tooltip?: string | undefined;
390
+ } | undefined;
391
+ parent?: string | undefined;
392
+ parentPath?: string | undefined;
393
+ transition?: string | undefined;
394
+ hideSidebar?: boolean | undefined;
395
+ } | undefined;
396
+ };
397
+ }>;
29
398
  export declare const provideSetting: (config: Partial<SettingConfig>) => Partial<SettingConfig> | undefined;
30
399
  export interface SettingConfig {
31
400
  layout: "vertical" | "classic" | "transverse" | "columns" | "comprehensive" | "idc";
@@ -47,6 +416,11 @@ export interface SettingConfig {
47
416
  loginPath?: string;
48
417
  userCenterPath?: string;
49
418
  [key: string]: unknown;
419
+ currentEndRoute: RouteItem;
420
+ currentTabPath: string;
421
+ currentAppId: string;
422
+ defaultParentActive: string;
423
+ currentEndParentRoute: RouteItem;
50
424
  }
51
425
  export interface TabItem {
52
426
  path: string;