vue-layout-gitcode 1.5.17 → 1.5.19

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,8 +1,8 @@
1
1
  import { defineComponent, inject, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString, createVNode, unref, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
2
2
  import "vue-devui-lal/icon";
3
3
  import "vue-devui-lal/icon/style.css";
4
- import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-BC7yRqLn.js";
5
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DjBhmkYN.js";
4
+ import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-CERylfaB.js";
5
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DfCAV_j6.js";
6
6
  import "vue-devui-lal/tooltip";
7
7
  import "vue-devui-lal/tooltip/style.css";
8
8
  import "vue-router";
@@ -0,0 +1,97 @@
1
+ import { ref, computed, createElementBlock, openBlock, normalizeClass, createBlock, createElementVNode, toDisplayString } from "vue";
2
+ import { _ as _export_sfc, y as ThemeType, z as currentTheme, j as LANG_ZH, A as LANG_EN, B as getLocaleLang, G as GIcon, C as isHttps } from "./index-CERylfaB.js";
3
+ import { useRouter } from "vue-router";
4
+ const _hoisted_1 = ["src"];
5
+ const _sfc_main = {
6
+ __name: "MenuItem",
7
+ props: {
8
+ item: {
9
+ type: Object,
10
+ default: () => {
11
+ }
12
+ },
13
+ active: {
14
+ type: Boolean,
15
+ default: false
16
+ }
17
+ },
18
+ setup(__props) {
19
+ const router = useRouter();
20
+ const props = __props;
21
+ const isHover = ref(false);
22
+ const isSelected = computed(() => {
23
+ return props.active || isHover.value;
24
+ });
25
+ const currentImg = computed(() => {
26
+ const imgMap = {
27
+ [ThemeType.WHITE]: {
28
+ selected: props.item.left_menu_logo_hover,
29
+ unselected: props.item.left_menu_logo
30
+ },
31
+ [ThemeType.BLACK]: {
32
+ selected: props.item.left_menu_logo_hover_black,
33
+ unselected: props.item.left_menu_logo_black
34
+ }
35
+ };
36
+ if (isSelected.value) {
37
+ return imgMap[currentTheme.value].selected;
38
+ } else {
39
+ return imgMap[currentTheme.value].unselected;
40
+ }
41
+ });
42
+ const currentName = computed(() => {
43
+ const nameMap = {
44
+ [LANG_EN]: props.item.left_menu_name_en,
45
+ [LANG_ZH]: props.item.left_menu_name_cn
46
+ };
47
+ return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
48
+ });
49
+ const handleMouseEnter = () => {
50
+ isHover.value = true;
51
+ };
52
+ const handleMouseLeave = () => {
53
+ isHover.value = false;
54
+ };
55
+ const handleMenuClick = () => {
56
+ const currentHref = window.location.href;
57
+ if (props.item.left_menu_url === currentHref) {
58
+ return;
59
+ }
60
+ if (props.item.is_open_new_tab) {
61
+ window.open(props.item.left_menu_url, "_blank");
62
+ } else if (isHttps(props.item.left_menu_url)) {
63
+ window.location.href = props.item.left_menu_url;
64
+ } else {
65
+ router.push({
66
+ path: props.item.left_menu_url
67
+ });
68
+ }
69
+ };
70
+ return (_ctx, _cache) => {
71
+ return openBlock(), createElementBlock("div", {
72
+ class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
73
+ onMouseenter: handleMouseEnter,
74
+ onMouseleave: handleMouseLeave,
75
+ onClick: handleMenuClick
76
+ }, [
77
+ props.item.isIcon ? (openBlock(), createBlock(GIcon, {
78
+ key: 0,
79
+ name: currentImg.value,
80
+ class: "default-icon",
81
+ size: "16",
82
+ color: "var(--theme-menu-icon-fill)"
83
+ }, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
84
+ key: 1,
85
+ class: "menu-item__icon",
86
+ src: currentImg.value,
87
+ alt: ""
88
+ }, null, 8, _hoisted_1)),
89
+ createElementVNode("span", null, toDisplayString(currentName.value), 1)
90
+ ], 34);
91
+ };
92
+ }
93
+ };
94
+ const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
95
+ export {
96
+ MenuItem as default
97
+ };
@@ -1,5 +1,5 @@
1
1
  import { ref, inject, computed, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-BC7yRqLn.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-CERylfaB.js";
3
3
  import { useRoute, useRouter } from "vue-router";
4
4
  import "vue-devui-lal/icon";
5
5
  import "vue-devui-lal/icon/style.css";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-BC7yRqLn.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-CERylfaB.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "history-list" };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createElementBlock, openBlock, createElementVNode, withDirectives, toDisplayString, withModifiers, createVNode, vShow } from "vue";
2
- import { G as GIcon, _ as _export_sfc } from "./index-BC7yRqLn.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-CERylfaB.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "ellipsis" };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createBlock, createVNode, withCtx } from "vue";
2
- import { u as useReportRepo, S as SearchRepoCard } from "./index-DjBhmkYN.js";
3
- import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-BC7yRqLn.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-DfCAV_j6.js";
3
+ import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-CERylfaB.js";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { SkeletonItem } from "vue-devui-lal/skeleton";
6
6
  import "vue-devui-lal/grid/style.css";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createElementVNode, createVNode, createCommentVNode, toDisplayString, unref } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-BC7yRqLn.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-CERylfaB.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = ["onClick"];
@@ -1,5 +1,5 @@
1
1
  import { inject, ref, watch, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, G as GIcon } from "./index-BC7yRqLn.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-CERylfaB.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };