vue-layout-gitcode 1.5.71 → 1.5.72
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/{GloabarSearch-BVc018QM.js → GloabarSearch-BGHVFOpy.js} +5 -3
- package/MenuItem-DgySN0tc.js +156 -0
- package/ProjectMenuList-poL8mpQl.js +402 -0
- package/ProjectMenuListV2-CoEGuG7M.js +221 -0
- package/{ProjectSearch-OYQR1jQ1.js → ProjectSearch-DVREBWeh.js} +1 -1
- package/SearchHistoryList-WPti_fKV.js +161 -0
- package/{SearchPrefixTag-BFhDidRA.js → SearchPrefixTag-C8vz2Bsp.js} +2 -2
- package/{SearchRecommed-c-THl16l.js → SearchRecommed-DJnpxtaq.js} +5 -5
- package/{SearchScopeList-BypAkGfx.js → SearchScopeList-B8t89QHm.js} +2 -2
- package/{UserSearch-Dtgpli89.js → UserSearch-BQwvWAYp.js} +1 -1
- package/{index-Ba99LRw5.js → index-B66_WJIL.js} +2028 -3509
- package/{index-Cqo1SLWx.js → index-CN1Ye7W1.js} +11 -9
- package/{index-B5WuOGOg.js → index-CNRcityj.js} +2 -2
- package/index.d.ts +45 -4
- package/index.js +11 -11
- package/{notice-BUVKdd9a.js → notice-BqfzMtaO.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/transWebUrl-CdGkJDeO.js +21 -0
- package/SearchHistoryList-DcJLzYiO.js +0 -99
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { q as useLayoutConfig } from "./index-B66_WJIL.js";
|
|
2
|
+
const layoutConfig = useLayoutConfig();
|
|
3
|
+
const transWebUrl = (url, params) => {
|
|
4
|
+
if (!url) return url;
|
|
5
|
+
let processedUrl = url;
|
|
6
|
+
if (layoutConfig.VITE_ENV !== "production") {
|
|
7
|
+
const regex = /^(?:https?:\/\/)?(?:www\.)?([^\/]+)(\/.*)$/;
|
|
8
|
+
const match = url.match(regex);
|
|
9
|
+
processedUrl = match ? match[2] : url || "/";
|
|
10
|
+
}
|
|
11
|
+
if (!params) return processedUrl;
|
|
12
|
+
const separator = processedUrl.includes("?") ? "&" : "?";
|
|
13
|
+
if (typeof params === "string") {
|
|
14
|
+
return `${processedUrl}${separator}${params}`;
|
|
15
|
+
}
|
|
16
|
+
const queryString = Object.entries(params).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
|
|
17
|
+
return queryString ? `${processedUrl}${separator}${queryString}` : processedUrl;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
transWebUrl as t
|
|
21
|
+
};
|
|
@@ -1,99 +0,0 @@
|
|
|
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-Ba99LRw5.js";
|
|
3
|
-
import "vue-devui-lal/icon";
|
|
4
|
-
import "vue-devui-lal/icon/style.css";
|
|
5
|
-
const _hoisted_1 = { class: "history-list" };
|
|
6
|
-
const _hoisted_2 = ["onClick", "onMouseenter"];
|
|
7
|
-
const _hoisted_3 = { class: "history-list-box__content flex items-center w-full" };
|
|
8
|
-
const _hoisted_4 = ["title"];
|
|
9
|
-
const _hoisted_5 = ["title"];
|
|
10
|
-
const _hoisted_6 = { class: "item-tx" };
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
__name: "SearchHistoryList",
|
|
13
|
-
props: {
|
|
14
|
-
searchHistoryList: {},
|
|
15
|
-
visitHistoryList: {},
|
|
16
|
-
activeIndex: {}
|
|
17
|
-
},
|
|
18
|
-
emits: [
|
|
19
|
-
"clearHistoryData",
|
|
20
|
-
"toSearch",
|
|
21
|
-
"onDeleteHistory",
|
|
22
|
-
"onDeleteVist",
|
|
23
|
-
"onVistPage",
|
|
24
|
-
"onSearchEnter",
|
|
25
|
-
"resetIndex"
|
|
26
|
-
],
|
|
27
|
-
setup(__props, { emit: __emit }) {
|
|
28
|
-
const { t } = i18n.global;
|
|
29
|
-
const props = __props;
|
|
30
|
-
const emits = __emit;
|
|
31
|
-
const historyList = computed(() => {
|
|
32
|
-
var _a;
|
|
33
|
-
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((item) => {
|
|
34
|
-
const repoTitle = item.repo ? `${t("gitCodeLayout.header.repo")} ${decodeURIComponent(item.repo)}:` : "";
|
|
35
|
-
const namespaceTitle = item.namespace ? `${item.scope === "group" ? t("gitCodeLayout.header.org") : t("gitCodeLayout.header.user")} ${decodeURIComponent(item.namespace)}:` : "";
|
|
36
|
-
return { ...item, repoTitle, namespaceTitle };
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
computed(() => {
|
|
40
|
-
return props.visitHistoryList;
|
|
41
|
-
});
|
|
42
|
-
const resetIndex = () => {
|
|
43
|
-
emits("resetIndex");
|
|
44
|
-
};
|
|
45
|
-
const toSearch = (item) => {
|
|
46
|
-
emits("toSearch", item);
|
|
47
|
-
};
|
|
48
|
-
const onDeleteHistory = (index) => {
|
|
49
|
-
emits("onDeleteHistory", index);
|
|
50
|
-
};
|
|
51
|
-
const onSearchEnter = (index) => {
|
|
52
|
-
emits("onSearchEnter", index);
|
|
53
|
-
};
|
|
54
|
-
return (_ctx, _cache) => {
|
|
55
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
|
-
_ctx.searchHistoryList.length ? (openBlock(), createElementBlock("ul", {
|
|
57
|
-
key: 0,
|
|
58
|
-
class: "history-list-box mt-[16px]",
|
|
59
|
-
onMouseleave: resetIndex
|
|
60
|
-
}, [
|
|
61
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
|
|
62
|
-
return openBlock(), createElementBlock("li", {
|
|
63
|
-
key: item,
|
|
64
|
-
class: normalizeClass(_ctx.activeIndex === index ? "hoverbg" : ""),
|
|
65
|
-
onClick: ($event) => toSearch(item),
|
|
66
|
-
onMouseenter: ($event) => onSearchEnter(index)
|
|
67
|
-
}, [
|
|
68
|
-
createElementVNode("div", _hoisted_3, [
|
|
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)
|
|
83
|
-
]),
|
|
84
|
-
createVNode(GIcon, {
|
|
85
|
-
name: "gt-line-close",
|
|
86
|
-
class: "itemClose",
|
|
87
|
-
onClick: withModifiers(($event) => onDeleteHistory(index), ["stop"])
|
|
88
|
-
}, null, 8, ["onClick"])
|
|
89
|
-
], 42, _hoisted_2);
|
|
90
|
-
}), 128))
|
|
91
|
-
], 32)) : createCommentVNode("", true)
|
|
92
|
-
]);
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
const SearchHistoryList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
|
|
97
|
-
export {
|
|
98
|
-
SearchHistoryList as default
|
|
99
|
-
};
|