@ditari/bsui 1.0.30 → 1.0.31
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/dist/cjs/components/menu/Menu.cjs.js +1 -1
- package/dist/cjs/components/select/dic.worker.cjs.js +1 -1
- package/dist/esm/components/menu/Menu.esm.js +33 -32
- package/dist/esm/components/select/dic.worker.esm.js +6 -6
- package/package.json +1 -1
- package/src/components/menu/Menu.jsx +4 -0
- package/src/components/select/dic.worker.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),S=require("vue-router"),V=require("pinia"),C=require("../../store/modules/Menu.cjs.js"),b=require("../../store/modules/Settings.cjs.js");function y(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const M=e.defineComponent({name:"DMenu",setup(){const o=S.useRouter(),{componentName:s,prop:K}=e.inject("menuIcon"),{list:d}=C.useMenuStore(),p=b.useSettingsStore(),{getCollapsed:v}=V.storeToRefs(p),l=e.ref([]),c=e.ref([]),m=({item:t,key:n,keyPath:r})=>{console.log(t,n,r),l.value=r,c.value=[n],o.push(n).then(a=>a?console.warn(a):null)},f=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-menu-item"),{key:t.url},{icon:()=>u(t),default:()=>t.title})]),g=["anticon","anticon-menu","ant-menu-item-icon"],u=t=>e.createVNode(e.Fragment,null,[t.icon?h(t.icon):e.withDirectives(e.createVNode("div",{className:g},[t.title.substring(0,1)]),[[e.vShow,v.value]])]),h=t=>s==="nativeHtml"?e.createVNode("span",{innerHTML:t},null):e.h(e.resolveComponent(s),{prop:t}),i=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-sub-menu"),{key:t.url},{title:()=>t.title,icon:()=>u(t),default:()=>t.children.map(n=>!n.children||n.children.length===0?N(n):i(n))})]),N=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-menu-item"),{key:t.url},{default:()=>t.title})]);return()=>{let t;return e.createVNode(e.resolveComponent("a-menu"),{mode:"inline",theme:"dark",openKeys:l.value,"onUpdate:openKeys":n=>l.value=n,selectedKeys:c.value,"onUpdate:selectedKeys":n=>c.value=n,onClick:m},y(t=d.map(n=>{var r;return!n.children||((r=n.children)==null?void 0:r.length)===0?f(n):i(n)}))?t:{default:()=>[t]})}}});exports.default=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIGk7Y29uc3QgbD10LmRhdGEua2V5d29yZHM/PyIiO2xldCBlPUpTT04ucGFyc2UoKChpPXQuZGF0YSk9PW51bGw/dm9pZCAwOmkubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUobj0+bj09PXMudmFsdWUpKSk7Y29uc3Qgbz1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtvLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShvLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==",b=typeof window<"u"&&window.Blob&&new Blob([atob(e)],{type:"text/javascript;charset=utf-8"});function n(){const l=b&&(window.URL||window.webkitURL).createObjectURL(b);try{return l?new Worker(l):new Worker("data:application/javascript;base64,"+e)}finally{l&&(window.URL||window.webkitURL).revokeObjectURL(l)}}exports.default=n;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { defineComponent as K, inject as M, ref as f, createVNode as n, resolveComponent as l, isVNode as j, Fragment as s, withDirectives as w, vShow as N, h as k } from "vue";
|
|
2
|
+
import { useRouter as I } from "vue-router";
|
|
3
|
+
import { storeToRefs as D } from "pinia";
|
|
4
|
+
import { useMenuStore as H } from "../../store/modules/Menu.esm.js";
|
|
5
|
+
import { useSettingsStore as O } from "../../store/modules/Settings.esm.js";
|
|
6
|
+
function R(o) {
|
|
7
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !j(o);
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
+
const L = /* @__PURE__ */ K({
|
|
9
10
|
name: "DMenu",
|
|
10
11
|
setup() {
|
|
11
|
-
const {
|
|
12
|
-
componentName:
|
|
13
|
-
prop:
|
|
14
|
-
} =
|
|
15
|
-
list:
|
|
16
|
-
} =
|
|
17
|
-
getCollapsed:
|
|
18
|
-
} =
|
|
12
|
+
const o = I(), {
|
|
13
|
+
componentName: i,
|
|
14
|
+
prop: T
|
|
15
|
+
} = M("menuIcon"), {
|
|
16
|
+
list: m
|
|
17
|
+
} = H(), h = O(), {
|
|
18
|
+
getCollapsed: v
|
|
19
|
+
} = D(h), c = f([]), u = f([]), S = ({
|
|
19
20
|
item: e,
|
|
20
21
|
key: t,
|
|
21
22
|
keyPath: r
|
|
22
23
|
}) => {
|
|
23
|
-
console.log(e, t, r), c.value = r,
|
|
24
|
-
},
|
|
24
|
+
console.log(e, t, r), c.value = r, u.value = [t], o.push(t).then((p) => p ? console.warn(p) : null);
|
|
25
|
+
}, g = (e) => n(s, null, [n(l("a-menu-item"), {
|
|
25
26
|
key: e.url
|
|
26
27
|
}, {
|
|
27
|
-
icon: () =>
|
|
28
|
+
icon: () => a(e),
|
|
28
29
|
default: () => e.title
|
|
29
|
-
})]),
|
|
30
|
-
className:
|
|
31
|
-
}, [e.title.substring(0, 1)]), [[
|
|
30
|
+
})]), y = ["anticon", "anticon-menu", "ant-menu-item-icon"], a = (e) => n(s, null, [e.icon ? b(e.icon) : w(n("div", {
|
|
31
|
+
className: y
|
|
32
|
+
}, [e.title.substring(0, 1)]), [[N, v.value]])]), b = (e) => i === "nativeHtml" ? n("span", {
|
|
32
33
|
innerHTML: e
|
|
33
|
-
}, null) : k(l(
|
|
34
|
+
}, null) : k(l(i), {
|
|
34
35
|
prop: e
|
|
35
|
-
}),
|
|
36
|
+
}), d = (e) => n(s, null, [n(l("a-sub-menu"), {
|
|
36
37
|
key: e.url
|
|
37
38
|
}, {
|
|
38
39
|
title: () => e.title,
|
|
39
|
-
icon: () =>
|
|
40
|
+
icon: () => a(e),
|
|
40
41
|
default: () => e.children.map(
|
|
41
|
-
(t) => !t.children || t.children.length === 0 ?
|
|
42
|
+
(t) => !t.children || t.children.length === 0 ? C(t) : d(t)
|
|
42
43
|
// 递归调用
|
|
43
44
|
)
|
|
44
|
-
})]),
|
|
45
|
+
})]), C = (e) => n(s, null, [n(l("a-menu-item"), {
|
|
45
46
|
key: e.url
|
|
46
47
|
}, {
|
|
47
48
|
default: () => e.title
|
|
@@ -53,12 +54,12 @@ const _ = /* @__PURE__ */ b({
|
|
|
53
54
|
theme: "dark",
|
|
54
55
|
openKeys: c.value,
|
|
55
56
|
"onUpdate:openKeys": (t) => c.value = t,
|
|
56
|
-
selectedKeys:
|
|
57
|
-
"onUpdate:selectedKeys": (t) =>
|
|
58
|
-
onClick:
|
|
59
|
-
},
|
|
57
|
+
selectedKeys: u.value,
|
|
58
|
+
"onUpdate:selectedKeys": (t) => u.value = t,
|
|
59
|
+
onClick: S
|
|
60
|
+
}, R(e = m.map((t) => {
|
|
60
61
|
var r;
|
|
61
|
-
return !t.children || ((r = t.children) == null ? void 0 : r.length) === 0 ?
|
|
62
|
+
return !t.children || ((r = t.children) == null ? void 0 : r.length) === 0 ? g(t) : d(t);
|
|
62
63
|
})) ? e : {
|
|
63
64
|
default: () => [e]
|
|
64
65
|
});
|
|
@@ -66,5 +67,5 @@ const _ = /* @__PURE__ */ b({
|
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
L as default
|
|
70
71
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
const l = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIGk7Y29uc3QgbD10LmRhdGEua2V5d29yZHM/PyIiO2xldCBlPUpTT04ucGFyc2UoKChpPXQuZGF0YSk9PW51bGw/dm9pZCAwOmkubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUobj0+bj09PXMudmFsdWUpKSk7Y29uc3Qgbz1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtvLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShvLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==", n = typeof window < "u" && window.Blob && new Blob([atob(l)], { type: "text/javascript;charset=utf-8" });
|
|
2
|
+
function c() {
|
|
3
|
+
const b = n && (window.URL || window.webkitURL).createObjectURL(n);
|
|
4
4
|
try {
|
|
5
|
-
return
|
|
5
|
+
return b ? new Worker(b) : new Worker("data:application/javascript;base64," + l);
|
|
6
6
|
} finally {
|
|
7
|
-
|
|
7
|
+
b && (window.URL || window.webkitURL).revokeObjectURL(b);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
c as default
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, inject, ref, resolveComponent } from "vue";
|
|
2
|
+
import { useRouter } from "vue-router";
|
|
3
|
+
|
|
2
4
|
import { storeToRefs } from "pinia";
|
|
3
5
|
|
|
4
6
|
import { useMenuStore } from "../../store/modules/Menu";
|
|
@@ -7,6 +9,7 @@ import { useSettingsStore } from "../../store/modules/Settings";
|
|
|
7
9
|
export default defineComponent({
|
|
8
10
|
name: "DMenu",
|
|
9
11
|
setup() {
|
|
12
|
+
const router = useRouter();
|
|
10
13
|
const { componentName, prop } = inject("menuIcon");
|
|
11
14
|
const { list } = useMenuStore();
|
|
12
15
|
const settingsStore = useSettingsStore();
|
|
@@ -27,6 +30,7 @@ export default defineComponent({
|
|
|
27
30
|
console.log(item, key, keyPath);
|
|
28
31
|
openKeys.value = keyPath;
|
|
29
32
|
selectedKeys.value = [key];
|
|
33
|
+
router.push(key).then((r) => (r ? console.warn(r) : null));
|
|
30
34
|
};
|
|
31
35
|
/**
|
|
32
36
|
* 监听菜单展开事件
|
|
@@ -7,7 +7,7 @@ self.addEventListener(
|
|
|
7
7
|
"message",
|
|
8
8
|
function (e) {
|
|
9
9
|
const keyword = e.data.keywords ?? "";
|
|
10
|
-
let dicList = JSON.parse(e.data
|
|
10
|
+
let dicList = JSON.parse(e.data?.list || []) ?? [];
|
|
11
11
|
const include = JSON.parse(e.data.include);
|
|
12
12
|
if (include.length > 0) {
|
|
13
13
|
// 只过滤出来include包含的数据
|