@campus-admin/core 2.0.5 → 2.0.7
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 +18 -0
- package/dist/context.d.ts +1 -12
- package/dist/i18n.d.ts +64 -0
- package/dist/index.js +661 -475
- package/dist/router.d.ts +3 -1
- package/dist/stores/layout.d.ts +45 -3
- package/dist/style.css +1 -1
- package/dist/types.d.ts +10 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -39,6 +39,24 @@ Since 2.0.5 a menu page can ask the desktop sidebar to collapse while it is open
|
|
|
39
39
|
|
|
40
40
|
For manual control use `useLayoutStore()`: `applySideCollapse('panel' | 'all' | 'none')`, `toggleSidePanel()` (same as the collapse button), and the read-only state `sidePanelCollapsed` and `sideHiddenActive`. The user's own collapse choice is still stored under the existing `side-collapsed` key.
|
|
41
41
|
|
|
42
|
+
## Page opening mode (2.0.6)
|
|
43
|
+
|
|
44
|
+
Set `MenuPage.openMode` (also forwarded to route meta):
|
|
45
|
+
|
|
46
|
+
| Value | Behavior |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `normal` / omitted | Normal layout (omitted keeps legacy `sideCollapse`) |
|
|
49
|
+
| `collapsePanel` | Collapse the second sidebar on desktop |
|
|
50
|
+
| `collapseAll` | Collapse both sidebars on desktop |
|
|
51
|
+
| `content` | Hide the header and sidebars within the window, on every screen size |
|
|
52
|
+
| `screen` | Browser fullscreen on every screen size; fall back to `content` if denied |
|
|
53
|
+
|
|
54
|
+
An explicit `openMode`, including `normal`, takes precedence over `sideCollapse`. The previous content layout returns on leaving, and only browser fullscreen opened by the framework is exited. Manual buttons and Escape win until the next page; changing query/hash on the same path does not reapply the mode. Adjacent fullscreen pages keep fullscreen active. No opening-mode state is stored in the browser.
|
|
55
|
+
|
|
56
|
+
The router requests fullscreen before lazy-loading the page, within the user activation from menu, tab or search clicks. Browsers may reject fullscreen after a refresh, direct address navigation, restored tab, expired activation, or on unsupported devices. The page then fills the window and shows a dismissible **Click to enter fullscreen** button. Clicking retries the native API; a failed retry keeps the fallback. This requires no platform-specific click handler.
|
|
57
|
+
|
|
58
|
+
The demo's Feature menu includes five pages at `/feature/open-mode/{normal|collapsePanel|collapseAll|content|screen}` for switching between modes.
|
|
59
|
+
|
|
42
60
|
## WeChat scan sign-in
|
|
43
61
|
|
|
44
62
|
Since 2.0.2 the split login page's WeChat tab can show the platform's own QR code: add `wechat: { mount(el) }` to your `AuthProvider`. The framework only provides the container: `mount` is called when the tab is visible and its returned cleanup runs when the tab is hidden or the page is left; a failing `mount` shows a retry prompt. After your own callback gets a token, call `completeLogin({ token, user }, redirect)`. Without `wechat` the tab stays a placeholder, as in 2.0.1. The login page also accepts `login.panel.title`, `login.panel.background`, `login.card` and `login.fields`; see `docs/06-微信扫码登录.md` in the source repository.
|
package/dist/context.d.ts
CHANGED
|
@@ -35,18 +35,7 @@ export declare function campusPaths(options: Pick<CampusOptions, 'paths'>): {
|
|
|
35
35
|
/** 侧栏只筛选可见入口,不改变路由和固定标签的数据。 */
|
|
36
36
|
export declare function sideMenus(options: CampusOptions, can: (permission?: string) => boolean): {
|
|
37
37
|
home: FlatPage | undefined;
|
|
38
|
-
apps:
|
|
39
|
-
children: (MenuPage | {
|
|
40
|
-
children: MenuPage[];
|
|
41
|
-
key: string;
|
|
42
|
-
title: string;
|
|
43
|
-
icon?: import("@campus-admin/ui").IconValue;
|
|
44
|
-
badge?: number | (() => number);
|
|
45
|
-
})[];
|
|
46
|
-
key: string;
|
|
47
|
-
title: string;
|
|
48
|
-
icon?: import("@campus-admin/ui").IconValue;
|
|
49
|
-
}[];
|
|
38
|
+
apps: MenuApp[];
|
|
50
39
|
accountStandalone: boolean;
|
|
51
40
|
};
|
|
52
41
|
/** 名称与路径分别配置,平台不必避开默认系统名称。 */
|
package/dist/i18n.d.ts
CHANGED
|
@@ -8,6 +8,36 @@ import type { CampusOptions } from './types.js';
|
|
|
8
8
|
export declare function createCampusI18n(options: CampusOptions): import("vue-i18n").I18n<{
|
|
9
9
|
'zh-CN': {
|
|
10
10
|
campus: {
|
|
11
|
+
doc: {
|
|
12
|
+
sheetjsDependency: string;
|
|
13
|
+
title: string;
|
|
14
|
+
download: string;
|
|
15
|
+
retry: string;
|
|
16
|
+
empty: string;
|
|
17
|
+
unsupported: string;
|
|
18
|
+
convert: string;
|
|
19
|
+
dependency: string;
|
|
20
|
+
tooLarge: string;
|
|
21
|
+
invalidSize: string;
|
|
22
|
+
invalidFile: string;
|
|
23
|
+
fetchFailed: string;
|
|
24
|
+
renderFailed: string;
|
|
25
|
+
complex: string;
|
|
26
|
+
timeout: string;
|
|
27
|
+
diagramFailed: string;
|
|
28
|
+
toc: string;
|
|
29
|
+
sheets: string;
|
|
30
|
+
more: string;
|
|
31
|
+
rows: string;
|
|
32
|
+
previous: string;
|
|
33
|
+
next: string;
|
|
34
|
+
page: string;
|
|
35
|
+
zoom: string;
|
|
36
|
+
fit: string;
|
|
37
|
+
word: string;
|
|
38
|
+
expand: string;
|
|
39
|
+
restore: string;
|
|
40
|
+
};
|
|
11
41
|
notify: {
|
|
12
42
|
success: string;
|
|
13
43
|
info: string;
|
|
@@ -126,6 +156,8 @@ export declare function createCampusI18n(options: CampusOptions): import("vue-i1
|
|
|
126
156
|
current: string;
|
|
127
157
|
};
|
|
128
158
|
tabs: {
|
|
159
|
+
enterScreen: string;
|
|
160
|
+
dismissScreen: string;
|
|
129
161
|
refresh: string;
|
|
130
162
|
close: string;
|
|
131
163
|
closeLeft: string;
|
|
@@ -174,6 +206,36 @@ export declare function createCampusI18n(options: CampusOptions): import("vue-i1
|
|
|
174
206
|
};
|
|
175
207
|
'en-US': {
|
|
176
208
|
campus: {
|
|
209
|
+
doc: {
|
|
210
|
+
sheetjsDependency: string;
|
|
211
|
+
title: string;
|
|
212
|
+
download: string;
|
|
213
|
+
retry: string;
|
|
214
|
+
empty: string;
|
|
215
|
+
unsupported: string;
|
|
216
|
+
convert: string;
|
|
217
|
+
dependency: string;
|
|
218
|
+
tooLarge: string;
|
|
219
|
+
invalidSize: string;
|
|
220
|
+
invalidFile: string;
|
|
221
|
+
fetchFailed: string;
|
|
222
|
+
renderFailed: string;
|
|
223
|
+
complex: string;
|
|
224
|
+
timeout: string;
|
|
225
|
+
diagramFailed: string;
|
|
226
|
+
toc: string;
|
|
227
|
+
sheets: string;
|
|
228
|
+
more: string;
|
|
229
|
+
rows: string;
|
|
230
|
+
previous: string;
|
|
231
|
+
next: string;
|
|
232
|
+
page: string;
|
|
233
|
+
zoom: string;
|
|
234
|
+
fit: string;
|
|
235
|
+
word: string;
|
|
236
|
+
expand: string;
|
|
237
|
+
restore: string;
|
|
238
|
+
};
|
|
177
239
|
notify: {
|
|
178
240
|
success: string;
|
|
179
241
|
info: string;
|
|
@@ -292,6 +354,8 @@ export declare function createCampusI18n(options: CampusOptions): import("vue-i1
|
|
|
292
354
|
current: string;
|
|
293
355
|
};
|
|
294
356
|
tabs: {
|
|
357
|
+
enterScreen: string;
|
|
358
|
+
dismissScreen: string;
|
|
295
359
|
refresh: string;
|
|
296
360
|
close: string;
|
|
297
361
|
closeLeft: string;
|