vue-layout-gitcode 1.5.39 → 1.5.40
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-BFpDrALP.js → GloabarSearch-D__e3zw1.js} +2 -3
- package/MenuItem-DnSLaxJH.js +118 -0
- package/{ProjectSearch-DEq1RGBn.js → ProjectSearch-Dk7fNm1o.js} +1 -1
- package/{SearchHistoryList-BOBIaBMH.js → SearchHistoryList-CMwsyUtO.js} +18 -80
- package/{SearchPrefixTag--a-9m1PF.js → SearchPrefixTag-C__8boi7.js} +1 -1
- package/{SearchRecommed-XTYOsYhU.js → SearchRecommed-CC4IKY86.js} +4 -4
- package/{SearchScopeList-COxlPf-9.js → SearchScopeList-CchityQU.js} +1 -1
- package/{UserSearch-gFIu4tn5.js → UserSearch-BQPcYFsF.js} +1 -1
- package/{index-BoBr_WCM.js → index-B811122P.js} +2311 -1268
- package/{index-DaDQV5c1.js → index-C63Fujt-.js} +2 -3
- package/{index-BGTTACBc.js → index-CRLLxvwN.js} +4 -8
- package/index.js +10 -10
- package/{notice-CcsnyEPz.js → notice-CJ_zldUJ.js} +3 -5
- package/package.json +1 -1
- package/style.css +1 -1
- package/MenuItem-BFDRD4oM.js +0 -156
- package/ProjectMenuList-TzEaRVhf.js +0 -389
- package/ProjectMenuListV2-DJX-l0Ns.js +0 -209
- package/transWebUrl-BGhTRg9b.js +0 -21
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, reactive, computed, watch, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withDirectives, toDisplayString, unref, withModifiers, normalizeClass, withCtx, Fragment, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
-
import { a as i18n, G as GIcon, s as setLoginTriggerSource, d as useRequestReport, _ as _export_sfc } from "./index-BoBr_WCM.js";
|
|
3
|
-
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-BGhTRg9b.js";
|
|
5
|
-
import { Input } from "vue-devui-lal/input";
|
|
6
|
-
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
7
|
-
import { MenuItem } from "vue-devui-lal/menu";
|
|
8
|
-
import { Button } from "vue-devui-lal/button";
|
|
9
|
-
import "vue-devui-lal/input/style.css";
|
|
10
|
-
import "vue-devui-lal/skeleton/style.css";
|
|
11
|
-
import "vue-devui-lal/menu/style.css";
|
|
12
|
-
import "vue-devui-lal/button/style.css";
|
|
13
|
-
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
|
|
14
|
-
const _hoisted_2 = {
|
|
15
|
-
class: "devui-submenu-title layer_2",
|
|
16
|
-
style: { "padding": "0px 24px" }
|
|
17
|
-
};
|
|
18
|
-
const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
|
|
19
|
-
const _hoisted_4 = { class: "project-label" };
|
|
20
|
-
const _hoisted_5 = { class: "project-label flex-1 min-w-0 ellipsis" };
|
|
21
|
-
const INIT_SHOW_COUNT = 4;
|
|
22
|
-
const LOAD_MORE_COUNT = 10;
|
|
23
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
|
-
__name: "ProjectMenuListV2",
|
|
25
|
-
props: {
|
|
26
|
-
buttonText: { default: "" },
|
|
27
|
-
subShow: { type: Boolean, default: false },
|
|
28
|
-
defaultData: {},
|
|
29
|
-
isLogin: { type: Boolean, default: false },
|
|
30
|
-
username: { default: "" }
|
|
31
|
-
},
|
|
32
|
-
setup(__props) {
|
|
33
|
-
const { t } = i18n.global;
|
|
34
|
-
const request = inject("request");
|
|
35
|
-
const globalStore = inject("globalStore");
|
|
36
|
-
const { useReport } = useRequestReport(request, globalStore);
|
|
37
|
-
const props = __props;
|
|
38
|
-
const btnLoading = ref(false);
|
|
39
|
-
const pageQuery = reactive({
|
|
40
|
-
size: INIT_SHOW_COUNT
|
|
41
|
-
});
|
|
42
|
-
const firstLoading = ref(false);
|
|
43
|
-
const showSearch = ref(false);
|
|
44
|
-
const searchKey = ref("");
|
|
45
|
-
const totalNum = ref(0);
|
|
46
|
-
const inputIng = ref(false);
|
|
47
|
-
const originList = ref([]);
|
|
48
|
-
const filteredList = computed(() => {
|
|
49
|
-
if (!searchKey.value) return originList.value;
|
|
50
|
-
const key = searchKey.value.toLowerCase();
|
|
51
|
-
return originList.value.filter((item) => {
|
|
52
|
-
return item.label && item.label.toLowerCase().includes(key) || item.namespace && item.namespace.toLowerCase().includes(key);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
const projectList = computed(() => {
|
|
56
|
-
return filteredList.value.slice(0, pageQuery.size);
|
|
57
|
-
});
|
|
58
|
-
watch(
|
|
59
|
-
() => props.defaultData,
|
|
60
|
-
() => {
|
|
61
|
-
firstLoading.value = !!props.defaultData.loading;
|
|
62
|
-
if (props.defaultData && props.defaultData.list) {
|
|
63
|
-
originList.value = [...props.defaultData.list];
|
|
64
|
-
totalNum.value = props.defaultData.totalNum || 0;
|
|
65
|
-
pageQuery.size = INIT_SHOW_COUNT;
|
|
66
|
-
searchKey.value = "";
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{ immediate: true, deep: true }
|
|
70
|
-
);
|
|
71
|
-
watch(
|
|
72
|
-
searchKey,
|
|
73
|
-
() => {
|
|
74
|
-
if (inputIng.value) return;
|
|
75
|
-
pageQuery.size = INIT_SHOW_COUNT;
|
|
76
|
-
},
|
|
77
|
-
{ flush: "post" }
|
|
78
|
-
);
|
|
79
|
-
const showExpandMore = computed(() => {
|
|
80
|
-
return filteredList.value.length > pageQuery.size;
|
|
81
|
-
});
|
|
82
|
-
const loadMoreData = () => {
|
|
83
|
-
btnLoading.value = true;
|
|
84
|
-
setTimeout(() => {
|
|
85
|
-
const remain = filteredList.value.length - pageQuery.size;
|
|
86
|
-
if (remain > 0) {
|
|
87
|
-
if (pageQuery.size === INIT_SHOW_COUNT) {
|
|
88
|
-
const target = LOAD_MORE_COUNT * 2;
|
|
89
|
-
pageQuery.size = Math.min(target, filteredList.value.length);
|
|
90
|
-
} else {
|
|
91
|
-
pageQuery.size = Math.min(pageQuery.size + LOAD_MORE_COUNT, filteredList.value.length);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
btnLoading.value = false;
|
|
95
|
-
}, 200);
|
|
96
|
-
};
|
|
97
|
-
const router = useRouter();
|
|
98
|
-
const fastToLink = () => {
|
|
99
|
-
router.push({ name: "userRepos", params: { namespace: props.username } });
|
|
100
|
-
};
|
|
101
|
-
const createRepoOrOrg = () => {
|
|
102
|
-
if (!props.isLogin) {
|
|
103
|
-
setLoginTriggerSource("aside_createRepo");
|
|
104
|
-
useReport("login_exposure", { source: "aside_createRepo" });
|
|
105
|
-
}
|
|
106
|
-
router.push({
|
|
107
|
-
name: "newRepo",
|
|
108
|
-
query: { position: "nav_top" }
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
return (_ctx, _cache) => {
|
|
112
|
-
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
113
|
-
createElementVNode("div", _hoisted_2, [
|
|
114
|
-
_cache[6] || (_cache[6] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
115
|
-
createElementVNode("span", _hoisted_3, [
|
|
116
|
-
createElementVNode("div", {
|
|
117
|
-
class: "fast-click-button",
|
|
118
|
-
onClick: _cache[0] || (_cache[0] = ($event) => fastToLink())
|
|
119
|
-
}, toDisplayString(unref(t)("gitCodeLayout.org.project")), 1)
|
|
120
|
-
])
|
|
121
|
-
]),
|
|
122
|
-
createVNode(GIcon, {
|
|
123
|
-
class: "my-work-platform-searchicon",
|
|
124
|
-
color: "var(--theme-menu-icon-fill)",
|
|
125
|
-
name: "gt-search",
|
|
126
|
-
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => showSearch.value = !showSearch.value, ["stop"]))
|
|
127
|
-
}),
|
|
128
|
-
createElementVNode("div", {
|
|
129
|
-
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
130
|
-
onClick: _cache[5] || (_cache[5] = withModifiers(() => {
|
|
131
|
-
}, ["stop"]))
|
|
132
|
-
}, [
|
|
133
|
-
createVNode(unref(Input), {
|
|
134
|
-
modelValue: searchKey.value,
|
|
135
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchKey.value = $event),
|
|
136
|
-
placeholder: unref(t)("gitCodeLayout.common.search"),
|
|
137
|
-
onCompositionstart: _cache[3] || (_cache[3] = ($event) => inputIng.value = true),
|
|
138
|
-
onCompositionend: _cache[4] || (_cache[4] = ($event) => inputIng.value = false)
|
|
139
|
-
}, {
|
|
140
|
-
prefix: withCtx(() => [
|
|
141
|
-
createVNode(GIcon, {
|
|
142
|
-
name: "gt-search",
|
|
143
|
-
color: "var(--theme-menu-icon-fill)"
|
|
144
|
-
})
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
}, 8, ["modelValue", "placeholder"])
|
|
148
|
-
], 2),
|
|
149
|
-
firstLoading.value ? (openBlock(), createBlock(unref(Skeleton), {
|
|
150
|
-
key: 0,
|
|
151
|
-
rows: 4
|
|
152
|
-
})) : createCommentVNode("", true),
|
|
153
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(projectList.value, (item) => {
|
|
154
|
-
return openBlock(), createBlock(unref(MenuItem), {
|
|
155
|
-
key: item.key,
|
|
156
|
-
"data-openBlank": true,
|
|
157
|
-
"data-href": unref(transWebUrl)(item.web_url),
|
|
158
|
-
class: "text",
|
|
159
|
-
title: `${item.namespace}/${item.label}`
|
|
160
|
-
}, {
|
|
161
|
-
icon: withCtx(() => [
|
|
162
|
-
createVNode(GIcon, {
|
|
163
|
-
name: "gt-line-project",
|
|
164
|
-
color: "var(--theme-menu-icon-fill)",
|
|
165
|
-
size: "16"
|
|
166
|
-
})
|
|
167
|
-
]),
|
|
168
|
-
default: withCtx(() => [
|
|
169
|
-
createElementVNode("span", null, [
|
|
170
|
-
createElementVNode("span", _hoisted_4, toDisplayString((item.namespace || "").slice(0, 10)) + toDisplayString((item.namespace || "").length > 10 ? "..." : ""), 1),
|
|
171
|
-
createElementVNode("span", _hoisted_5, "/" + toDisplayString(item.label), 1)
|
|
172
|
-
])
|
|
173
|
-
]),
|
|
174
|
-
_: 2
|
|
175
|
-
}, 1032, ["data-href", "title"]);
|
|
176
|
-
}), 128)),
|
|
177
|
-
!totalNum.value && !firstLoading.value ? (openBlock(), createBlock(unref(Button), {
|
|
178
|
-
key: 1,
|
|
179
|
-
variant: "text",
|
|
180
|
-
class: "more-btn",
|
|
181
|
-
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
182
|
-
}, {
|
|
183
|
-
default: withCtx(() => [
|
|
184
|
-
createTextVNode(toDisplayString(_ctx.buttonText), 1)
|
|
185
|
-
]),
|
|
186
|
-
_: 1
|
|
187
|
-
})) : createCommentVNode("", true),
|
|
188
|
-
withDirectives(createVNode(unref(Button), {
|
|
189
|
-
variant: "text",
|
|
190
|
-
class: "more-btn",
|
|
191
|
-
onClick: withModifiers(loadMoreData, ["stop"]),
|
|
192
|
-
loading: btnLoading.value,
|
|
193
|
-
disabled: btnLoading.value
|
|
194
|
-
}, {
|
|
195
|
-
default: withCtx(() => [
|
|
196
|
-
createTextVNode(toDisplayString(unref(t)("gitCodeLayout.org.expand_more")), 1)
|
|
197
|
-
]),
|
|
198
|
-
_: 1
|
|
199
|
-
}, 8, ["loading", "disabled"]), [
|
|
200
|
-
[vShow, showExpandMore.value && props.subShow]
|
|
201
|
-
])
|
|
202
|
-
]);
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
const ProjectMenuListV2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
|
|
207
|
-
export {
|
|
208
|
-
ProjectMenuListV2 as default
|
|
209
|
-
};
|
package/transWebUrl-BGhTRg9b.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { q as useLayoutConfig } from "./index-BoBr_WCM.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
|
-
};
|