vue-layout-gitcode 1.3.0 → 1.3.2

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,5 +1,5 @@
1
- import { ref, watchEffect, defineComponent, toDisplayString, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, unref, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
- import { d as debounce, 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$8, o as isIncubationRepo, p as highlightWords, t as transWebUrl, q as _frEventTrack, E as EVENT_NAME, b as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-BmW1sJe6.js";
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, reactive, withCtx } 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$8, o as isIncubationRepo, p as highlightWords, q as transWebUrl, v as _frEventTrack, E as EVENT_NAME, b as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-BGQbIqtf.js";
3
3
  import { useRouter } from "vue-router";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
@@ -79,37 +79,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
79
79
  props: {
80
80
  number: {},
81
81
  fixed: { default: 2 },
82
- byte: { type: Boolean }
82
+ byte: { type: Boolean },
83
+ gt100: { type: Boolean }
83
84
  },
84
85
  setup(__props) {
85
- const props = __props;
86
- const DECIMAL_PACE = [
87
- { unit: "K", base: 1e3 },
88
- { unit: "M", base: 1e6 }
89
- // 百万
90
- ];
91
- const BYTE_PACE = [
92
- { unit: "B", base: 1 },
93
- { unit: "KB", base: Math.pow(2, 10) },
94
- { unit: "MB", base: Math.pow(2, 20) },
95
- { unit: "GB", base: Math.pow(2, 30) }
96
- ];
97
- const transfer = (val) => {
98
- try {
99
- const pace = props.byte ? BYTE_PACE : DECIMAL_PACE;
100
- return pace.reduce((res, { base, unit }) => {
101
- if (val >= base) {
102
- const fixedBase = Math.pow(10, props.fixed);
103
- res = `${parseFloat((Math.round(val * fixedBase / base) / fixedBase).toFixed(props.fixed))} ${unit}`;
104
- }
105
- return res;
106
- }, `${val}`);
107
- } catch (err) {
108
- }
109
- return `${val}`;
110
- };
111
86
  return (_ctx, _cache) => {
112
- return toDisplayString(transfer(_ctx.number));
87
+ return toDisplayString(unref(transferNumber)({ number: _ctx.number, fixed: _ctx.fixed, byte: _ctx.byte, gt100: _ctx.gt100 }));
113
88
  };
114
89
  }
115
90
  });
@@ -312,7 +287,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
312
287
  }
313
288
  });
314
289
  const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
315
- const _hoisted_1$2 = { class: "github-star-num" };
290
+ const _hoisted_1$2 = {
291
+ key: 0,
292
+ class: "github-star-num"
293
+ };
316
294
  const _hoisted_2$2 = { class: "leading-none" };
317
295
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
318
296
  ...{ name: "GithubStarNum" },
@@ -321,8 +299,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
321
299
  count: {}
322
300
  },
323
301
  setup(__props) {
302
+ const props = __props;
303
+ const starVisible = computed(() => {
304
+ return props.count && props.count >= 100;
305
+ });
324
306
  return (_ctx, _cache) => {
325
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
307
+ return starVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
326
308
  createVNode(GIcon, {
327
309
  name: "gt-line-github",
328
310
  color: "var(--theme-home-card-color-placeholder)",
@@ -331,10 +313,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
331
313
  createElementVNode("span", _hoisted_2$2, [
332
314
  _cache[0] || (_cache[0] = createTextVNode("Star ")),
333
315
  createVNode(_sfc_main$7, {
334
- number: _ctx.count || 0
316
+ number: _ctx.count || 0,
317
+ gt100: true
335
318
  }, null, 8, ["number"])
336
319
  ])
337
- ]);
320
+ ])) : createCommentVNode("", true);
338
321
  };
339
322
  }
340
323
  });
@@ -406,7 +389,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
406
389
  key: 5,
407
390
  starCountOne: _ctx.repoInfo.star_count_one
408
391
  }, null, 8, ["starCountOne"])) : createCommentVNode("", true),
409
- _ctx.repoInfo.show_recommend_icon ? (openBlock(), createBlock(GithubStarNum, {
392
+ _ctx.repoInfo.is_gh_mirrors ? (openBlock(), createBlock(GithubStarNum, {
410
393
  key: 6,
411
394
  count: _ctx.repoInfo.import_star_count
412
395
  }, null, 8, ["count"])) : createCommentVNode("", true)
@@ -566,7 +549,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
566
549
  default: withCtx(() => _cache[0] || (_cache[0] = [
567
550
  createTextVNode("G-Star ")
568
551
  ])),
569
- _: 1
552
+ _: 1,
553
+ __: [0]
570
554
  }, 8, ["message"])
571
555
  ])) : createCommentVNode("", true),
572
556
  unref(isIncubationRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_4, [
@@ -579,7 +563,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
579
563
  default: withCtx(() => _cache[1] || (_cache[1] = [
580
564
  createTextVNode(" G-Star ")
581
565
  ])),
582
- _: 1
566
+ _: 1,
567
+ __: [1]
583
568
  }, 8, ["message"])
584
569
  ])) : createCommentVNode("", true)
585
570
  ]),
@@ -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 { v as useLayoutConfig, _ as _export_sfc } from "./index-BmW1sJe6.js";
3
+ import { w as useLayoutConfig, _ as _export_sfc } from "./index-BGQbIqtf.js";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "index",
@@ -49,7 +49,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
49
  default: withCtx(() => _cache[0] || (_cache[0] = [
50
50
  createElementVNode("div", { id: "captcha-box" }, null, -1)
51
51
  ])),
52
- _: 1
52
+ _: 1,
53
+ __: [0]
53
54
  });
54
55
  };
55
56
  }
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { y, z, C, x, S, w, D, H, B, F, A } from "./index-BmW1sJe6.js";
1
+ import { z, A, D, y, S, x, F, I, C, H, B } from "./index-BGQbIqtf.js";
2
2
  export {
3
- y as GitCodeAside,
4
- z as GitCodeHeader,
5
- C as GitCodeLayoutEmitter,
6
- x as Login,
3
+ z as GitCodeAside,
4
+ A as GitCodeHeader,
5
+ D as GitCodeLayoutEmitter,
6
+ y as Login,
7
7
  S as SceneValue,
8
- w as ToolsFloat,
9
- D as currentTheme,
10
- H as default,
11
- B as setLayoutConfig,
12
- F as setTheme,
13
- A as useLogin
8
+ x as ToolsFloat,
9
+ F as currentTheme,
10
+ I as default,
11
+ C as setLayoutConfig,
12
+ H as setTheme,
13
+ B as useLogin
14
14
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createBlock, openBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel } from "./index-BmW1sJe6.js";
2
+ import { i as isPhone, u as useModel } from "./index-BGQbIqtf.js";
3
3
  import { Notification } from "vue-devui-lal/notification";
4
4
  import { Button } from "vue-devui-lal/button";
5
5
  import "vue-devui-lal/notification/style.css";
@@ -39,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  default: withCtx(() => _cache[1] || (_cache[1] = [
40
40
  createTextVNode("忽略")
41
41
  ])),
42
- _: 1
42
+ _: 1,
43
+ __: [1]
43
44
  }, 8, ["size", "onClick"]),
44
45
  createVNode(unref(Button), {
45
46
  variant: "solid",
@@ -50,7 +51,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
50
51
  default: withCtx(() => _cache[2] || (_cache[2] = [
51
52
  createTextVNode("修改")
52
53
  ])),
53
- _: 1
54
+ _: 1,
55
+ __: [2]
54
56
  }, 8, ["size"])
55
57
  ], 2)
56
58
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",