vue-layout-gitcode 1.5.5 → 1.5.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.
@@ -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-CIXpjuw1.js";
5
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-QIBZOsu-.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-B5hDQCLx.js";
5
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DJ1DVGP9.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,91 @@
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-B5hDQCLx.js";
3
+ const _hoisted_1 = ["src"];
4
+ const _sfc_main = {
5
+ __name: "MenuItem",
6
+ props: {
7
+ item: {
8
+ type: Object,
9
+ default: () => {
10
+ }
11
+ },
12
+ active: {
13
+ type: Boolean,
14
+ default: false
15
+ }
16
+ },
17
+ setup(__props) {
18
+ const props = __props;
19
+ const isHover = ref(false);
20
+ const isSelected = computed(() => {
21
+ return props.active || isHover.value;
22
+ });
23
+ const currentImg = computed(() => {
24
+ const imgMap = {
25
+ [ThemeType.WHITE]: {
26
+ selected: props.item.left_menu_logo_hover,
27
+ unselected: props.item.left_menu_logo
28
+ },
29
+ [ThemeType.BLACK]: {
30
+ selected: props.item.left_menu_logo_hover_black,
31
+ unselected: props.item.left_menu_logo_black
32
+ }
33
+ };
34
+ if (isSelected.value) {
35
+ return imgMap[currentTheme.value].selected;
36
+ } else {
37
+ return imgMap[currentTheme.value].unselected;
38
+ }
39
+ });
40
+ const currentName = computed(() => {
41
+ const nameMap = {
42
+ [LANG_EN]: props.item.left_menu_name_en,
43
+ [LANG_ZH]: props.item.left_menu_name_cn
44
+ };
45
+ return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
46
+ });
47
+ const handleMouseEnter = () => {
48
+ isHover.value = true;
49
+ };
50
+ const handleMouseLeave = () => {
51
+ isHover.value = false;
52
+ };
53
+ const handleMenuClick = () => {
54
+ if (props.item.is_open_new_tab) {
55
+ window.open(props.item.left_menu_url, "_blank");
56
+ } else if (isHttps(props.item.left_menu_url)) {
57
+ window.location.href = props.item.left_menu_url;
58
+ } else {
59
+ router.push({
60
+ path: props.item.left_menu_url
61
+ });
62
+ }
63
+ };
64
+ return (_ctx, _cache) => {
65
+ return openBlock(), createElementBlock("div", {
66
+ class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
67
+ onMouseenter: handleMouseEnter,
68
+ onMouseleave: handleMouseLeave,
69
+ onClick: handleMenuClick
70
+ }, [
71
+ props.item.isIcon ? (openBlock(), createBlock(GIcon, {
72
+ key: 0,
73
+ name: currentImg.value,
74
+ class: "default-icon",
75
+ size: "16",
76
+ color: "var(--theme-menu-icon-fill)"
77
+ }, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
78
+ key: 1,
79
+ class: "menu-item__icon",
80
+ src: currentImg.value,
81
+ alt: ""
82
+ }, null, 8, _hoisted_1)),
83
+ createElementVNode("span", null, toDisplayString(currentName.value), 1)
84
+ ], 34);
85
+ };
86
+ }
87
+ };
88
+ const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
89
+ export {
90
+ MenuItem as default
91
+ };
@@ -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-CIXpjuw1.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-B5hDQCLx.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-CIXpjuw1.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-B5hDQCLx.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-CIXpjuw1.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-B5hDQCLx.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-QIBZOsu-.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-CIXpjuw1.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-DJ1DVGP9.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-B5hDQCLx.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-CIXpjuw1.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-B5hDQCLx.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-CIXpjuw1.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-B5hDQCLx.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]" };