vue-layout-gitcode 1.5.25 → 1.5.27

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,9 @@
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-CvX499j4.js";
5
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-BIBX1cai.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-D39m35CB.js";
5
+ import "lodash/debounce";
6
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-BMAZjy98.js";
6
7
  import "vue-devui-lal/tooltip";
7
8
  import "vue-devui-lal/tooltip/style.css";
8
9
  import "vue-router";
@@ -0,0 +1,118 @@
1
+ import { defineComponent, inject, ref, computed, createElementBlock, openBlock, normalizeClass, createBlock, createElementVNode, toDisplayString } from "vue";
2
+ import { x as currentTheme, y as ThemeType, g as LANG_ZH, z as LANG_EN, A as getLocaleLang, G as GIcon, B as isHttps, C as emitEvent, b as REPO_EVENT, _ as _export_sfc } from "./index-D39m35CB.js";
3
+ import { useRouter } from "vue-router";
4
+ const _hoisted_1 = ["src"];
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "MenuItem",
7
+ props: {
8
+ item: {
9
+ type: Object,
10
+ default: () => {
11
+ }
12
+ },
13
+ active: {
14
+ type: Boolean,
15
+ default: false
16
+ },
17
+ isLogin: {
18
+ type: Boolean,
19
+ default: false
20
+ }
21
+ },
22
+ setup(__props) {
23
+ const useReport = inject("useReport");
24
+ const router = useRouter();
25
+ const props = __props;
26
+ const isHover = ref(false);
27
+ const isSelected = computed(() => {
28
+ return props.active || isHover.value;
29
+ });
30
+ const currentImg = computed(() => {
31
+ console.log("currentTheme", currentTheme.value, "left_menu_logo_black", props.item.left_menu_logo_black);
32
+ const imgMap = {
33
+ [ThemeType.WHITE]: {
34
+ selected: props.item.left_menu_logo_hover,
35
+ unselected: props.item.left_menu_logo
36
+ },
37
+ [ThemeType.BLACK]: {
38
+ selected: props.item.left_menu_logo_hover_black,
39
+ unselected: props.item.left_menu_logo_black
40
+ }
41
+ };
42
+ if (isSelected.value) {
43
+ return imgMap[currentTheme.value].selected;
44
+ } else {
45
+ return imgMap[currentTheme.value].unselected;
46
+ }
47
+ });
48
+ console.log("currentImg", currentImg.value);
49
+ const currentName = computed(() => {
50
+ const nameMap = {
51
+ [LANG_EN]: props.item.left_menu_name_en,
52
+ [LANG_ZH]: props.item.left_menu_name_cn
53
+ };
54
+ return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
55
+ });
56
+ const handleMouseEnter = () => {
57
+ isHover.value = true;
58
+ };
59
+ const handleMouseLeave = () => {
60
+ isHover.value = false;
61
+ };
62
+ const clickMenuReport = () => {
63
+ if (!useReport) {
64
+ return;
65
+ }
66
+ const reportName = props.item.left_menu_name_cn;
67
+ if (reportName) {
68
+ useReport(REPO_EVENT.CLICK, { module_name: `侧边栏_${reportName}` });
69
+ }
70
+ };
71
+ const handleMenuClick = () => {
72
+ const currentHref = window.location.href;
73
+ if (props.item.left_menu_url === currentHref) {
74
+ return;
75
+ }
76
+ if (props.item.is_open_new_tab) {
77
+ window.open(props.item.left_menu_url, "_blank");
78
+ } else if (isHttps(props.item.left_menu_url)) {
79
+ window.location.href = props.item.left_menu_url;
80
+ } else {
81
+ if (props.item.left_menu_url != "/" && !props.isLogin) {
82
+ emitEvent("login", { loginTriggerSource: `aside_${props.item.left_menu_url}` });
83
+ return;
84
+ }
85
+ router.push({
86
+ path: props.item.left_menu_url
87
+ });
88
+ }
89
+ clickMenuReport();
90
+ };
91
+ return (_ctx, _cache) => {
92
+ return openBlock(), createElementBlock("div", {
93
+ class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
94
+ onMouseenter: handleMouseEnter,
95
+ onMouseleave: handleMouseLeave,
96
+ onClick: handleMenuClick
97
+ }, [
98
+ props.item.isIcon ? (openBlock(), createBlock(GIcon, {
99
+ key: 0,
100
+ name: currentImg.value,
101
+ class: "default-icon",
102
+ size: "16",
103
+ color: "var(--theme-menu-icon-fill)"
104
+ }, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
105
+ key: 1,
106
+ class: "menu-item__icon",
107
+ src: currentImg.value,
108
+ alt: ""
109
+ }, null, 8, _hoisted_1)),
110
+ createElementVNode("span", null, toDisplayString(currentName.value), 1)
111
+ ], 34);
112
+ };
113
+ }
114
+ });
115
+ const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
116
+ export {
117
+ MenuItem as default
118
+ };
@@ -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-CvX499j4.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-D39m35CB.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-CvX499j4.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-D39m35CB.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-CvX499j4.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-D39m35CB.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-BIBX1cai.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-CvX499j4.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-BMAZjy98.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-D39m35CB.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-CvX499j4.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-D39m35CB.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-CvX499j4.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-D39m35CB.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]" };
@@ -1,5 +1,6 @@
1
1
  import { ref, watchEffect, defineComponent, toDisplayString, unref, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, withCtx, reactive } from "vue";
2
- import { d as debounce, t as transferNumber, G as GIcon, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, L as LANG_KEY, j as LANG_ZH, k as usePageResize, m as isGstarRepo, n as _sfc_main$9, o as isIncubationRepo, p as highlightWords, q as transWebUrl, w as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-CvX499j4.js";
2
+ import debounce from "lodash/debounce";
3
+ import { t as transferNumber, G as GIcon, s as setLoginTriggerSource, d as useRequestReport, r as reqCatch, h as headRequest, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, f as useTimeFormat, L as LANG_KEY, g as LANG_ZH, j as usePageResize, k as isGstarRepo, m as _sfc_main$9, n as isIncubationRepo, o as highlightWords, p as transWebUrl, q as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-D39m35CB.js";
3
4
  import { useRouter } from "vue-router";
4
5
  import { Row, Col } from "vue-devui-lal/grid";
5
6
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";