vue-layout-gitcode 1.5.32 → 1.5.33

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,10 +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-CC0cR_JR.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-DMsSwmUp.js";
5
5
  import "lodash/debounce";
6
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DPJnmrwS.js";
7
- import "./transWebUrl-Bv5ODcE7.js";
6
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-QlmVZGjv.js";
8
7
  import "vue-devui-lal/tooltip";
9
8
  import "vue-devui-lal/tooltip/style.css";
10
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-DMsSwmUp.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-CC0cR_JR.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-DMsSwmUp.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,14 +1,13 @@
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-CC0cR_JR.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DMsSwmUp.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" };
6
6
  const _hoisted_2 = ["onClick", "onMouseenter"];
7
- const _hoisted_3 = { class: "history-list-box__content flex items-center justify-between w-full" };
8
- const _hoisted_4 = { class: "flex items-center" };
7
+ const _hoisted_3 = { class: "history-list-box__content flex items-center w-full" };
8
+ const _hoisted_4 = ["title"];
9
9
  const _hoisted_5 = ["title"];
10
- const _hoisted_6 = ["title"];
11
- const _hoisted_7 = { class: "item-tx" };
10
+ const _hoisted_6 = { class: "item-tx" };
12
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
12
  __name: "SearchHistoryList",
14
13
  props: {
@@ -67,23 +66,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
66
  onMouseenter: ($event) => onSearchEnter(index)
68
67
  }, [
69
68
  createElementVNode("div", _hoisted_3, [
70
- createElementVNode("div", _hoisted_4, [
71
- createVNode(GIcon, {
72
- name: "gt-line-time",
73
- color: "var(--devui-aide-text)",
74
- class: "mr-[8px]"
75
- }),
76
- createElementVNode("span", {
77
- class: "whitespace-nowrap overflow-hidden text-ellipsis",
78
- title: item.repoTitle
79
- }, toDisplayString(item.repoTitle), 9, _hoisted_5),
80
- createElementVNode("span", {
81
- class: "whitespace-nowrap overflow-hidden text-ellipsis",
82
- title: item.namespaceTitle
83
- }, toDisplayString(item.namespaceTitle), 9, _hoisted_6),
84
- createElementVNode("span", _hoisted_7, toDisplayString(item.q || item), 1)
85
- ]),
86
- _cache[0] || (_cache[0] = createElementVNode("span", null, "项目", -1))
69
+ createVNode(GIcon, {
70
+ name: "gt-line-time",
71
+ color: "var(--devui-aide-text)",
72
+ class: "mr-[8px]"
73
+ }),
74
+ createElementVNode("span", {
75
+ class: "whitespace-nowrap overflow-hidden text-ellipsis",
76
+ title: item.repoTitle
77
+ }, toDisplayString(item.repoTitle), 9, _hoisted_4),
78
+ createElementVNode("span", {
79
+ class: "whitespace-nowrap overflow-hidden text-ellipsis",
80
+ title: item.namespaceTitle
81
+ }, toDisplayString(item.namespaceTitle), 9, _hoisted_5),
82
+ createElementVNode("span", _hoisted_6, toDisplayString(item.q || item), 1)
87
83
  ]),
88
84
  createVNode(GIcon, {
89
85
  name: "gt-line-close",
@@ -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-CC0cR_JR.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-DMsSwmUp.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-DPJnmrwS.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-CC0cR_JR.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-QlmVZGjv.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-DMsSwmUp.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-CC0cR_JR.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DMsSwmUp.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-CC0cR_JR.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-DMsSwmUp.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,6 +1,6 @@
1
1
  import { defineComponent, onMounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
2
  import { FixedOverlay } from "vue-devui-lal/overlay";
3
- import { q as useLayoutConfig, _ as _export_sfc } from "./index-CC0cR_JR.js";
3
+ import { w as useLayoutConfig, _ as _export_sfc } from "./index-DMsSwmUp.js";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "index",