@jnrs/vue-core 1.2.47 → 1.2.48

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # 发版日志
2
2
 
3
+ ## [1.2.48] - 2026-08-21 【latest】
4
+
5
+ ### Features
6
+
7
+ - `useMenuStore.asyncSetMenus` 路由生成使用完整菜单「隐藏项仍可访问」,侧边栏展示过滤 `meta.hidden` 的菜单项(`filterVisibleMenus` 递归过滤)
8
+
9
+ ### Chore
10
+
11
+ - `createVueRouter` 的 `handleRouter` JSDoc 注释修正
12
+
3
13
  ## [1.2.47] - 2026-08-15 【latest】
4
14
 
5
15
  ### Features
@@ -2,7 +2,7 @@
2
2
  import { defineComponent as q, ref as V, createBlock as F, openBlock as d, unref as l, withCtx as p, createElementVNode as j, createVNode as E, toDisplayString as C, isRef as ta, createElementBlock as k, Fragment as J, renderList as Z, createTextVNode as H, computed as X, normalizeClass as te, normalizeStyle as ke, createCommentVNode as T, renderSlot as fe, withDirectives as Xe, vShow as aa, nextTick as se, withModifiers as He, watch as de, onMounted as jt, mergeProps as na } from "vue";
3
3
  import { storeToRefs as la } from "pinia";
4
4
  import { ElDrawer as ia, ElSwitch as oa, ElRadioGroup as Ue, ElRadio as ze, ElImage as ra, ElIcon as G, ElButton as R, ElDialog as Tt, ElUpload as sa, vLoading as Oe, ElMessage as Y, ElForm as Ut, ElFormItem as ua, ElMessageBox as lt, ElLoading as Fe, ElPagination as zt, ElTable as Ft, ElTableColumn as Ie, ElSelect as Lt, ElOption as Vt, ElCheckbox as ca, ElButtonGroup as da, ElDatePicker as Aa } from "element-plus";
5
- import { u as fa, a as ga, L as ma, M as va, C as ha } from "../index-Ca5AgDYs.js";
5
+ import { u as fa, a as ga, L as ma, M as va, C as ha } from "../index-DLqUnm8-.js";
6
6
  import { Back as ya, Right as pa, DArrowRight as ba, ZoomOut as Ia, ZoomIn as Ca, Switch as Ea, RefreshLeft as wa, Refresh as Sa, Download as Ne, View as ka, Delete as it, Upload as Qa, ArrowLeft as Da, ArrowRight as Ba } from "@element-plus/icons-vue";
7
7
  import { downloadByUrl as xt, downloadByBlob as ot, objectToFormData as Pa } from "@jnrs/shared";
8
8
  import { useI18n as he } from "vue-i18n";
@@ -1,12 +1,12 @@
1
1
  import "pinia-plugin-persistedstate";
2
- import { defineStore as m } from "pinia";
3
- import { ref as i, computed as b, watch as h } from "vue";
2
+ import { defineStore as d } from "pinia";
3
+ import { ref as c, computed as b, watch as v } from "vue";
4
4
  import { Fullscreen as S } from "@jnrs/shared";
5
5
  import { usePreferredDark as f } from "@vueuse/core";
6
6
  import { a as k } from "./index-B3d_yqVP.js";
7
- const O = m(
7
+ const O = d(
8
8
  "@jnrs/vue-core/pinia:mock",
9
- () => ({ useMockServe: i(!1) }),
9
+ () => ({ useMockServe: c(!1) }),
10
10
  {
11
11
  persist: {
12
12
  pick: ["useMockServe"]
@@ -52,38 +52,38 @@ function U(e) {
52
52
  function j(e) {
53
53
  return typeof e == "string" && e.trim() !== "";
54
54
  }
55
- const x = m(
55
+ const x = d(
56
56
  "@jnrs/vue-core/pinia:system",
57
57
  () => {
58
- const e = i(!1), o = () => e.value = !e.value, s = new S(), l = i(!1), p = async () => {
59
- await s.toggle(), l.value = s.isFullscreen();
60
- }, n = i({
58
+ const e = c(!1), o = () => e.value = !e.value, i = new S(), l = c(!1), m = async () => {
59
+ await i.toggle(), l.value = i.isFullscreen();
60
+ }, a = c({
61
61
  locale: C[0].value,
62
62
  mode: M[0].value,
63
63
  primaryColor: w[0].value
64
- }), a = b(() => n.value.mode === "auto" ? d.value ? "dark" : "light" : n.value.mode), d = f();
65
- return h(
66
- [() => n.value.mode, d, () => n.value.primaryColor],
67
- ([r, v, g]) => {
64
+ }), s = b(() => a.value.mode === "auto" ? n.value ? "dark" : "light" : a.value.mode), n = f();
65
+ return v(
66
+ [() => a.value.mode, n, () => a.value.primaryColor],
67
+ ([r, y, g]) => {
68
68
  const u = document.documentElement;
69
- u.classList.remove("light", "dark"), r === "auto" ? u.classList.add(v ? "dark" : "light") : u.classList.add(r), g ? u.style.setProperty("--jnrs-color-primary", g) : u.style.removeProperty("--jnrs-color-primary");
69
+ u.classList.remove("light", "dark"), r === "auto" ? u.classList.add(y ? "dark" : "light") : u.classList.add(r), g ? u.style.setProperty("--jnrs-color-primary", g) : u.style.removeProperty("--jnrs-color-primary");
70
70
  },
71
71
  { immediate: !0 }
72
72
  ), {
73
- theme: n,
74
- computedThemeMode: a,
73
+ theme: a,
74
+ computedThemeMode: s,
75
75
  menuCollapse: e,
76
76
  documentFullscreen: l,
77
77
  toggleCollapse: o,
78
- toggleFullScreen: p,
78
+ toggleFullScreen: m,
79
79
  setLocale: (r) => {
80
- G(r) && (n.value.locale = r);
80
+ G(r) && (a.value.locale = r);
81
81
  },
82
82
  setMode: (r) => {
83
- U(r) && (n.value.mode = r);
83
+ U(r) && (a.value.mode = r);
84
84
  },
85
85
  setPrimaryColor: (r) => {
86
- j(r) && (n.value.primaryColor = r);
86
+ j(r) && (a.value.primaryColor = r);
87
87
  }
88
88
  };
89
89
  },
@@ -98,45 +98,47 @@ for (let e = 0; e < 256; ++e)
98
98
  function L(e, o = 0) {
99
99
  return (t[e[o + 0]] + t[e[o + 1]] + t[e[o + 2]] + t[e[o + 3]] + "-" + t[e[o + 4]] + t[e[o + 5]] + "-" + t[e[o + 6]] + t[e[o + 7]] + "-" + t[e[o + 8]] + t[e[o + 9]] + "-" + t[e[o + 10]] + t[e[o + 11]] + t[e[o + 12]] + t[e[o + 13]] + t[e[o + 14]] + t[e[o + 15]]).toLowerCase();
100
100
  }
101
- let c;
101
+ let p;
102
102
  const P = new Uint8Array(16);
103
103
  function R() {
104
- if (!c) {
104
+ if (!p) {
105
105
  if (typeof crypto > "u" || !crypto.getRandomValues)
106
106
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
107
- c = crypto.getRandomValues.bind(crypto);
107
+ p = crypto.getRandomValues.bind(crypto);
108
108
  }
109
- return c(P);
109
+ return p(P);
110
110
  }
111
- const D = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), y = { randomUUID: D };
112
- function I(e, o, s) {
111
+ const D = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), h = { randomUUID: D };
112
+ function I(e, o, i) {
113
113
  e = e || {};
114
114
  const l = e.random ?? e.rng?.() ?? R();
115
115
  if (l.length < 16)
116
116
  throw new Error("Random bytes length must be >= 16");
117
117
  return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, L(l);
118
118
  }
119
- function _(e, o, s) {
120
- return y.randomUUID && !e ? y.randomUUID() : I(e);
119
+ function _(e, o, i) {
120
+ return h.randomUUID && !e ? h.randomUUID() : I(e);
121
121
  }
122
- const T = m(
122
+ const T = d(
123
123
  "@jnrs/vue-core/pinia:menu",
124
124
  () => {
125
- const e = i(!1), o = i([]), s = async (n) => {
125
+ const e = c(!1), o = c([]), i = async (s) => {
126
126
  if (e.value)
127
127
  return o.value;
128
- l(n), o.value = n, e.value = !0;
128
+ l(s);
129
129
  try {
130
- await k(o.value);
131
- } catch (a) {
132
- throw a;
130
+ await k(s);
131
+ } catch (n) {
132
+ throw n;
133
133
  }
134
- return o.value;
135
- }, l = (n) => {
136
- for (const a of n)
137
- a.meta.uuid = _(), a.children && l(a.children);
138
- };
139
- return { hasFetchedAsyncMenus: e, menus: o, asyncSetMenus: s, clearMenu: () => {
134
+ return o.value = m(s), e.value = !0, o.value;
135
+ }, l = (s) => {
136
+ for (const n of s)
137
+ n.meta.uuid = _(), n.children && l(n.children);
138
+ }, m = (s) => s.filter((n) => !n.meta.hidden).map(
139
+ (n) => n.children ? { ...n, children: m(n.children) } : n
140
+ );
141
+ return { hasFetchedAsyncMenus: e, menus: o, asyncSetMenus: i, clearMenu: () => {
140
142
  e.value = !1, o.value = [];
141
143
  } };
142
144
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { c as r } from "./index-B3d_yqVP.js";
2
- import { i } from "./index-Ca5AgDYs.js";
2
+ import { i } from "./index-DLqUnm8-.js";
3
3
  console.log(
4
4
  "%c✨ 欢迎使用 @jnrs/vue-core",
5
5
  'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
@@ -1,5 +1,5 @@
1
1
  import "pinia-plugin-persistedstate";
2
- import { b as r, u as t, a as u } from "../index-Ca5AgDYs.js";
2
+ import { b as r, u as t, a as u } from "../index-DLqUnm8-.js";
3
3
  export {
4
4
  r as useMenuStore,
5
5
  t as useMockStore,
@@ -14,7 +14,7 @@ declare const createVueRouter: ({ options, fileModules, layoutName, globalCompon
14
14
  /**
15
15
  * 路由跳转、替换或新开标签页
16
16
  * @param to 路由跳转参数
17
- * @param type 默认为push push | replace | blank
17
+ * @param type 默认为 'push',可选值为 'push' | 'replace' | '_blank'
18
18
  * @returns Promise<boolean | void>
19
19
  */
20
20
  declare const handleRouter: (to: RouteLocationRaw, type?: "push" | "replace" | "_blank") => Promise<void | import('vue-router').NavigationFailure>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/vue-core",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "巨能(JNRS)前端工程化开发,Vue 专用核心功能包。",
5
5
  "keywords": [
6
6
  "jnrs",