mamba-layout 0.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 +47 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/assets/logo.png.js +4 -0
- package/dist/components/UserAvatar/index.d.ts +2 -0
- package/dist/components/UserAvatar/index.js +5 -0
- package/dist/components/UserAvatar/src/UserAvatar.css +1 -0
- package/dist/components/UserAvatar/src/UserAvatar.vue.d.ts +9 -0
- package/dist/components/UserAvatar/src/UserAvatar.vue.js +7 -0
- package/dist/components/UserAvatar/src/UserAvatar.vue2.js +61 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +51 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +80 -0
- package/dist/layout/BaseLayout.css +1 -0
- package/dist/layout/BaseLayout.vue.d.ts +23 -0
- package/dist/layout/BaseLayout.vue.js +7 -0
- package/dist/layout/BaseLayout.vue2.js +75 -0
- package/dist/layout/components/AppSelect.css +1 -0
- package/dist/layout/components/AppSelect.vue.d.ts +2 -0
- package/dist/layout/components/AppSelect.vue.js +7 -0
- package/dist/layout/components/AppSelect.vue2.js +69 -0
- package/dist/layout/components/AsideBar.css +1 -0
- package/dist/layout/components/AsideBar.vue.d.ts +21 -0
- package/dist/layout/components/AsideBar.vue.js +7 -0
- package/dist/layout/components/AsideBar.vue2.js +49 -0
- package/dist/layout/components/AsideSubMenuItem.vue.d.ts +25 -0
- package/dist/layout/components/AsideSubMenuItem.vue.js +84 -0
- package/dist/layout/components/AsideSubMenuItem.vue2.js +4 -0
- package/dist/layout/components/AsideSubMenus.vue.d.ts +16 -0
- package/dist/layout/components/AsideSubMenus.vue.js +36 -0
- package/dist/layout/components/AsideSubMenus.vue2.js +4 -0
- package/dist/layout/components/AsideTabMenus.vue.d.ts +2 -0
- package/dist/layout/components/AsideTabMenus.vue.js +41 -0
- package/dist/layout/components/AsideTabMenus.vue2.js +4 -0
- package/dist/layout/components/AsideUser.vue.d.ts +2 -0
- package/dist/layout/components/AsideUser.vue.js +58 -0
- package/dist/layout/components/AsideUser.vue2.js +4 -0
- package/dist/layout/components/HeaderBar.css +1 -0
- package/dist/layout/components/HeaderBar.vue.d.ts +17 -0
- package/dist/layout/components/HeaderBar.vue.js +7 -0
- package/dist/layout/components/HeaderBar.vue2.js +55 -0
- package/dist/layout/components/HeaderMenuToggle.vue.d.ts +25 -0
- package/dist/layout/components/HeaderMenuToggle.vue.js +40 -0
- package/dist/layout/components/HeaderMenuToggle.vue2.js +4 -0
- package/dist/layout/components/LanguageSelect.css +1 -0
- package/dist/layout/components/LanguageSelect.vue.d.ts +22 -0
- package/dist/layout/components/LanguageSelect.vue.js +8 -0
- package/dist/layout/components/LanguageSelect.vue2.js +101 -0
- package/dist/layout/components/LanguageSelect2.css +1 -0
- package/dist/layout/components/LayoutBreadcrumb.css +1 -0
- package/dist/layout/components/LayoutBreadcrumb.vue.d.ts +29 -0
- package/dist/layout/components/LayoutBreadcrumb.vue.js +7 -0
- package/dist/layout/components/LayoutBreadcrumb.vue2.js +189 -0
- package/dist/layout/components/MenuDrawer.css +1 -0
- package/dist/layout/components/MenuDrawer.vue.d.ts +12 -0
- package/dist/layout/components/MenuDrawer.vue.js +163 -0
- package/dist/layout/components/MenuDrawer.vue3.js +5 -0
- package/dist/layout/components/MenuItemIcon.css +1 -0
- package/dist/layout/components/MenuItemIcon.vue.d.ts +7 -0
- package/dist/layout/components/MenuItemIcon.vue.js +7 -0
- package/dist/layout/components/MenuItemIcon.vue2.js +23 -0
- package/dist/layout/components/NavIconBtn.css +1 -0
- package/dist/layout/components/NavIconBtn.vue.d.ts +26 -0
- package/dist/layout/components/NavIconBtn.vue.js +7 -0
- package/dist/layout/components/NavIconBtn.vue2.js +23 -0
- package/dist/layout/components/SHeaderRight.css +1 -0
- package/dist/layout/components/SHeaderRight.vue.d.ts +2 -0
- package/dist/layout/components/SHeaderRight.vue.js +7 -0
- package/dist/layout/components/SHeaderRight.vue2.js +80 -0
- package/dist/layout/components/ThemeToggle.css +1 -0
- package/dist/layout/components/ThemeToggle.vue.d.ts +2 -0
- package/dist/layout/components/ThemeToggle.vue.js +7 -0
- package/dist/layout/components/ThemeToggle.vue2.js +30 -0
- package/dist/layout/components/TimezoneSelect.css +1 -0
- package/dist/layout/components/TimezoneSelect.vue.d.ts +7 -0
- package/dist/layout/components/TimezoneSelect.vue.js +8 -0
- package/dist/layout/components/TimezoneSelect.vue2.js +78 -0
- package/dist/layout/components/TimezoneSelect2.css +1 -0
- package/dist/layout/components/UserInfo.css +1 -0
- package/dist/layout/components/UserInfo.vue.d.ts +2 -0
- package/dist/layout/components/UserInfo.vue.js +8 -0
- package/dist/layout/components/UserInfo.vue2.js +111 -0
- package/dist/layout/components/UserInfo2.css +1 -0
- package/dist/layout/components/index.d.ts +23 -0
- package/dist/layout/components/index.js +49 -0
- package/dist/layout/components/mobile/AppSelectMobile.vue.d.ts +2 -0
- package/dist/layout/components/mobile/AppSelectMobile.vue.js +60 -0
- package/dist/layout/components/mobile/AppSelectMobile.vue2.js +4 -0
- package/dist/layout/components/mobile/AsideBarMobile.css +1 -0
- package/dist/layout/components/mobile/AsideBarMobile.vue.d.ts +21 -0
- package/dist/layout/components/mobile/AsideBarMobile.vue.js +7 -0
- package/dist/layout/components/mobile/AsideBarMobile.vue2.js +47 -0
- package/dist/layout/components/mobile/AsideUserMobile.css +1 -0
- package/dist/layout/components/mobile/AsideUserMobile.vue.d.ts +2 -0
- package/dist/layout/components/mobile/AsideUserMobile.vue.js +7 -0
- package/dist/layout/components/mobile/AsideUserMobile.vue2.js +56 -0
- package/dist/layout/components/mobile/AsideUserMobilePopover.css +1 -0
- package/dist/layout/components/mobile/AsideUserMobilePopover.vue.d.ts +17 -0
- package/dist/layout/components/mobile/AsideUserMobilePopover.vue.js +7 -0
- package/dist/layout/components/mobile/AsideUserMobilePopover.vue2.js +52 -0
- package/dist/layout/components/mobile/HeaderRightMobile.css +1 -0
- package/dist/layout/components/mobile/HeaderRightMobile.vue.d.ts +2 -0
- package/dist/layout/components/mobile/HeaderRightMobile.vue.js +7 -0
- package/dist/layout/components/mobile/HeaderRightMobile.vue2.js +50 -0
- package/dist/layout/components/mobile/MobileMenuToggle.css +1 -0
- package/dist/layout/components/mobile/MobileMenuToggle.vue.d.ts +2 -0
- package/dist/layout/components/mobile/MobileMenuToggle.vue.js +7 -0
- package/dist/layout/components/mobile/MobileMenuToggle.vue2.js +31 -0
- package/dist/layout/hooks/index.d.ts +4 -0
- package/dist/layout/hooks/index.js +17 -0
- package/dist/layout/hooks/useApp.d.ts +6 -0
- package/dist/layout/hooks/useApp.js +20 -0
- package/dist/layout/hooks/useSetting.d.ts +62 -0
- package/dist/layout/hooks/useSetting.js +24 -0
- package/dist/layout/hooks/useState.d.ts +763 -0
- package/dist/layout/hooks/useState.js +99 -0
- package/dist/layout/hooks/useTheme.d.ts +15 -0
- package/dist/layout/hooks/useTheme.js +44 -0
- package/dist/layout/utils/index.d.ts +7 -0
- package/dist/layout/utils/index.js +59 -0
- package/dist/layout.css +1 -0
- package/dist/layout.es.js +53770 -0
- package/dist/layout.global.js +78 -0
- package/dist/locales/en/account.d.ts +10 -0
- package/dist/locales/en/account.js +12 -0
- package/dist/locales/en/admin.d.ts +207 -0
- package/dist/locales/en/admin.js +209 -0
- package/dist/locales/en/common.d.ts +40 -0
- package/dist/locales/en/common.js +42 -0
- package/dist/locales/en/components.d.ts +37 -0
- package/dist/locales/en/components.js +39 -0
- package/dist/locales/en/constant.d.ts +151 -0
- package/dist/locales/en/constant.js +153 -0
- package/dist/locales/en/filterBox.d.ts +11 -0
- package/dist/locales/en/filterBox.js +13 -0
- package/dist/locales/en/index.d.ts +487 -0
- package/dist/locales/en/index.js +22 -0
- package/dist/locales/en/instanceForm.d.ts +17 -0
- package/dist/locales/en/instanceForm.js +19 -0
- package/dist/locales/en/password.d.ts +18 -0
- package/dist/locales/en/password.js +20 -0
- package/dist/locales/index.d.ts +973 -0
- package/dist/locales/index.js +12 -0
- package/dist/locales/messages.d.ts +973 -0
- package/dist/locales/messages.js +9 -0
- package/dist/locales/zh-cn/account.d.ts +10 -0
- package/dist/locales/zh-cn/account.js +12 -0
- package/dist/locales/zh-cn/admin.d.ts +205 -0
- package/dist/locales/zh-cn/admin.js +207 -0
- package/dist/locales/zh-cn/common.d.ts +40 -0
- package/dist/locales/zh-cn/common.js +42 -0
- package/dist/locales/zh-cn/components.d.ts +37 -0
- package/dist/locales/zh-cn/components.js +39 -0
- package/dist/locales/zh-cn/constant.d.ts +151 -0
- package/dist/locales/zh-cn/constant.js +153 -0
- package/dist/locales/zh-cn/filterBox.d.ts +11 -0
- package/dist/locales/zh-cn/filterBox.js +13 -0
- package/dist/locales/zh-cn/index.d.ts +485 -0
- package/dist/locales/zh-cn/index.js +22 -0
- package/dist/locales/zh-cn/instanceForm.d.ts +17 -0
- package/dist/locales/zh-cn/instanceForm.js +19 -0
- package/dist/locales/zh-cn/password.d.ts +18 -0
- package/dist/locales/zh-cn/password.js +20 -0
- package/dist/standalone.d.ts +0 -0
- package/dist/utils/createContext.d.ts +8 -0
- package/dist/utils/createContext.js +14 -0
- package/dist/utils/repoUtils.d.ts +59 -0
- package/dist/utils/repoUtils.js +160 -0
- package/package.json +110 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as u, computed as d, createElementBlock as _, openBlock as r, createVNode as i, createBlock as l, withCtx as n, createElementVNode as s } from "vue";
|
|
2
|
+
import { useSetting as p } from "../../hooks/useSetting.js";
|
|
3
|
+
import { redirectToLayoutLogin as f } from "../../utils/index.js";
|
|
4
|
+
import a from "../NavIconBtn.vue.js";
|
|
5
|
+
import g from "../ThemeToggle.vue.js";
|
|
6
|
+
import h from "../TimezoneSelect.vue.js";
|
|
7
|
+
import v from "./AsideUserMobilePopover.vue.js";
|
|
8
|
+
const k = { class: "header-right-mobile" }, E = /* @__PURE__ */ u({
|
|
9
|
+
__name: "HeaderRightMobile",
|
|
10
|
+
setup(b) {
|
|
11
|
+
const t = p(), m = d(
|
|
12
|
+
() => {
|
|
13
|
+
var o, e;
|
|
14
|
+
return !!((o = t.value.user) != null && o.id || (e = t.value.user) != null && e.userId);
|
|
15
|
+
}
|
|
16
|
+
), c = () => {
|
|
17
|
+
var o, e;
|
|
18
|
+
(e = (o = t.value).onLogin) != null && e.call(o) || f(t.value);
|
|
19
|
+
};
|
|
20
|
+
return (o, e) => (r(), _("div", k, [
|
|
21
|
+
i(h),
|
|
22
|
+
i(g),
|
|
23
|
+
m.value ? (r(), l(v, { key: 0 }, {
|
|
24
|
+
reference: n(() => [
|
|
25
|
+
i(a, { class: "header-right-mobile__action" }, {
|
|
26
|
+
default: n(() => e[0] || (e[0] = [
|
|
27
|
+
s("i", { class: "metisicon-yonghu1" }, null, -1)
|
|
28
|
+
])),
|
|
29
|
+
_: 1,
|
|
30
|
+
__: [0]
|
|
31
|
+
})
|
|
32
|
+
]),
|
|
33
|
+
_: 1
|
|
34
|
+
})) : (r(), l(a, {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "header-right-mobile__action",
|
|
37
|
+
onClick: c
|
|
38
|
+
}, {
|
|
39
|
+
default: n(() => e[1] || (e[1] = [
|
|
40
|
+
s("i", { class: "metisicon-yonghu1" }, null, -1)
|
|
41
|
+
])),
|
|
42
|
+
_: 1,
|
|
43
|
+
__: [1]
|
|
44
|
+
}))
|
|
45
|
+
]));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
E as default
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mobile-menu-toggle[data-v-3aac408b]{width:52px;height:52px;display:inline-flex;align-items:center;justify-content:center;border:0;border-right:1px solid var(--ui-topnav-border);background:var(--ui-topnav-accent);color:var(--ui-topnav-foreground);cursor:pointer;transition:background var(--ui-transition-fast),color var(--ui-transition-fast)}.mobile-menu-toggle[data-v-3aac408b]:hover{background:var(--ui-topnav-hover)}.mobile-menu-toggle__icon[data-v-3aac408b]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;font-size:18px}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent as l, resolveComponent as c, createElementBlock as i, openBlock as m, createElementVNode as r, createVNode as o, withCtx as s, unref as _ } from "vue";
|
|
2
|
+
import { Expand as a } from "@element-plus/icons-vue";
|
|
3
|
+
import { injectLayoutContext as p } from "../../hooks/useState.js";
|
|
4
|
+
const u = { class: "mobile-menu-toggle__icon" }, v = /* @__PURE__ */ l({
|
|
5
|
+
__name: "MobileMenuToggle",
|
|
6
|
+
setup(d) {
|
|
7
|
+
const { sideOpen: e } = p(), t = () => {
|
|
8
|
+
e.value = !e.value;
|
|
9
|
+
};
|
|
10
|
+
return (f, g) => {
|
|
11
|
+
const n = c("el-icon");
|
|
12
|
+
return m(), i("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
class: "mobile-menu-toggle",
|
|
15
|
+
onClick: t
|
|
16
|
+
}, [
|
|
17
|
+
r("div", u, [
|
|
18
|
+
o(n, null, {
|
|
19
|
+
default: s(() => [
|
|
20
|
+
o(_(a))
|
|
21
|
+
]),
|
|
22
|
+
_: 1
|
|
23
|
+
})
|
|
24
|
+
])
|
|
25
|
+
]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
v as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useApp as o } from "./useApp.js";
|
|
2
|
+
import { provideSetting as m, useSetting as i } from "./useSetting.js";
|
|
3
|
+
import { injectLayoutContext as p, provideLayoutContext as s, useStateHook as u } from "./useState.js";
|
|
4
|
+
import { initTheme as g, setTheme as h, syncThemeFromSetting as T, toggleTheme as f, useTheme as S } from "./useTheme.js";
|
|
5
|
+
export {
|
|
6
|
+
g as initTheme,
|
|
7
|
+
p as injectLayoutContext,
|
|
8
|
+
s as provideLayoutContext,
|
|
9
|
+
m as provideSetting,
|
|
10
|
+
h as setTheme,
|
|
11
|
+
T as syncThemeFromSetting,
|
|
12
|
+
f as toggleTheme,
|
|
13
|
+
o as useApp,
|
|
14
|
+
i as useSetting,
|
|
15
|
+
u as useStateHook,
|
|
16
|
+
S as useTheme
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { computed as p } from "vue";
|
|
2
|
+
import { useSetting as s } from "./useSetting.js";
|
|
3
|
+
function d() {
|
|
4
|
+
const o = s(), n = p(() => o.value.appList || []);
|
|
5
|
+
return {
|
|
6
|
+
appList: n,
|
|
7
|
+
getAppPath: (t) => (t == null ? void 0 : t.path) || "",
|
|
8
|
+
findAppById: (t) => {
|
|
9
|
+
if (t)
|
|
10
|
+
return r(n.value, t);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const r = (o, n) => o.reduce(
|
|
15
|
+
(i, e) => i || (e.appId === n ? e : r(e.children || [], n)),
|
|
16
|
+
void 0
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
d as useApp
|
|
20
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { RouteItem } from '../../utils/repoUtils';
|
|
3
|
+
export type { RouteItem };
|
|
4
|
+
export type LayoutMenuItem = RouteItem;
|
|
5
|
+
export interface LayoutUser {
|
|
6
|
+
id?: string;
|
|
7
|
+
userId?: string;
|
|
8
|
+
username?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
nickname?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
avatar?: string;
|
|
13
|
+
userType?: string;
|
|
14
|
+
roles?: string[];
|
|
15
|
+
permissions?: string[];
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface LayoutApp {
|
|
19
|
+
appId: string;
|
|
20
|
+
displayAppId?: string;
|
|
21
|
+
name: string;
|
|
22
|
+
desc?: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
children?: LayoutApp[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export declare function useSetting(): Ref<SettingConfig, SettingConfig>;
|
|
29
|
+
export declare const provideSetting: (config: Partial<SettingConfig>) => Partial<SettingConfig> | undefined;
|
|
30
|
+
export interface SettingConfig {
|
|
31
|
+
layout: "vertical" | "classic" | "transverse" | "columns" | "comprehensive" | "idc";
|
|
32
|
+
menus?: LayoutMenuItem[];
|
|
33
|
+
accountMenu?: LayoutMenuItem[];
|
|
34
|
+
user?: LayoutUser | null;
|
|
35
|
+
appList?: LayoutApp[];
|
|
36
|
+
onLogin?: () => unknown;
|
|
37
|
+
onLogout?: () => unknown | Promise<unknown>;
|
|
38
|
+
theme?: "dark" | "light";
|
|
39
|
+
title: string;
|
|
40
|
+
logo: string;
|
|
41
|
+
themeColor?: Partial<ThemeColor>;
|
|
42
|
+
tabs?: boolean | string;
|
|
43
|
+
pageType?: "card" | "common";
|
|
44
|
+
logoPath?: string;
|
|
45
|
+
hideDoc?: boolean;
|
|
46
|
+
docOperatorPath?: string;
|
|
47
|
+
docUserPath?: string;
|
|
48
|
+
loginPath?: string;
|
|
49
|
+
userCenterPath?: string;
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
export interface TabItem {
|
|
53
|
+
path: string;
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ThemeColor extends Record<string, string> {
|
|
57
|
+
colorPrimary: string;
|
|
58
|
+
headerBg: string;
|
|
59
|
+
headerColor: string;
|
|
60
|
+
asideBg: string;
|
|
61
|
+
asideColor: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { unref as m, ref as n } from "vue";
|
|
2
|
+
import { deepMerge as u } from "../../utils/repoUtils.js";
|
|
3
|
+
import { syncThemeFromSetting as a } from "./useTheme.js";
|
|
4
|
+
import { setLayoutStyle as i } from "../utils/index.js";
|
|
5
|
+
const t = n({
|
|
6
|
+
menus: [],
|
|
7
|
+
layout: "classic",
|
|
8
|
+
title: "",
|
|
9
|
+
logo: "",
|
|
10
|
+
tabs: "tab",
|
|
11
|
+
pageType: "common"
|
|
12
|
+
});
|
|
13
|
+
function l() {
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
const g = (o) => {
|
|
17
|
+
const e = l(), r = o && m(o) || {};
|
|
18
|
+
if (!(e != null && e.value)) return r;
|
|
19
|
+
t.value = u(e.value, r), a(t.value.theme), i(t.value);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
g as provideSetting,
|
|
23
|
+
l as useSetting
|
|
24
|
+
};
|