jky-component-lib 0.0.146 → 0.0.148
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/es/amap/style.css +5 -12
- package/dist/es/amap/style2.css +13 -2
- package/dist/es/amap/style3.css +2 -6
- package/dist/es/menu/Menu.vue.js +20 -9
- package/dist/es/menu/MenuItem.vue.js +19 -8
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-layout/PageLayout.vue.d.ts +7 -1
- package/dist/es/page-layout/PageLayout.vue.js +29 -7
- package/dist/es/resolver.d.ts +2 -0
- package/dist/es/resolver.js +23 -2
- package/dist/lib/amap/style.css +5 -12
- package/dist/lib/amap/style2.css +13 -2
- package/dist/lib/amap/style3.css +2 -6
- package/dist/lib/menu/Menu.vue.js +19 -8
- package/dist/lib/menu/MenuItem.vue.js +19 -8
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-layout/PageLayout.vue.d.ts +7 -1
- package/dist/lib/page-layout/PageLayout.vue.js +28 -6
- package/dist/lib/resolver.d.ts +2 -0
- package/dist/lib/resolver.js +23 -2
- package/package.json +1 -1
package/dist/es/amap/style.css
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/* AMap 高德地图组件样式 */
|
|
2
|
-
.jky-amap-container {
|
|
3
|
-
/* 地图容器样式 */
|
|
4
|
-
position: relative;
|
|
5
|
-
overflow: hidden;
|
|
6
1
|
|
|
7
|
-
|
|
8
|
-
.amap-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
2
|
+
/* JkyAMarker 组件样式 - 参考高德官方示例 */
|
|
3
|
+
.amap-icon img,
|
|
4
|
+
.amap-marker-content img {
|
|
5
|
+
width: 25px;
|
|
6
|
+
height: 34px;
|
|
14
7
|
}
|
package/dist/es/amap/style2.css
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/* AMap 高德地图组件样式 */
|
|
2
|
+
.jky-amap-container {
|
|
3
|
+
/* 地图容器样式 */
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
1
6
|
|
|
2
|
-
/*
|
|
3
|
-
|
|
7
|
+
/* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
|
|
8
|
+
.amap-logo {
|
|
9
|
+
display: none !important;
|
|
10
|
+
}
|
|
11
|
+
.amap-copyright {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/es/amap/style3.css
CHANGED
package/dist/es/menu/Menu.vue.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, useAttrs, openBlock, createBlock, unref, mergeProps, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
20
|
+
import { defineComponent, useAttrs, resolveComponent, openBlock, createBlock, unref, mergeProps, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
21
21
|
import { ElMenu, ElSubMenu, ElMenuItem } from "element-plus";
|
|
22
22
|
import _sfc_main$1 from "./MenuItem.vue.js";
|
|
23
23
|
const _hoisted_1 = {
|
|
@@ -62,6 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
62
62
|
const props = __props;
|
|
63
63
|
const attrs = useAttrs();
|
|
64
64
|
return (_ctx, _cache) => {
|
|
65
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
65
66
|
return openBlock(), createBlock(unref(ElMenu), mergeProps({ class: "jky-menu" }, __spreadValues(__spreadValues({}, unref(attrs)), props)), {
|
|
66
67
|
default: withCtx(() => [
|
|
67
68
|
props.menuData && props.menuData.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.menuData, (item) => {
|
|
@@ -78,10 +79,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
78
79
|
"popper-offset": item.popperOffset
|
|
79
80
|
}, {
|
|
80
81
|
title: withCtx(() => [
|
|
81
|
-
item.icon ? (openBlock(),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
item.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
83
|
+
default: withCtx(() => [
|
|
84
|
+
item.icon ? (openBlock(), createElementBlock("span", {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
87
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
88
|
+
]),
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1024)) : createCommentVNode("", true),
|
|
85
91
|
item.title ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(item.title), 1)) : createCommentVNode("", true)
|
|
86
92
|
]),
|
|
87
93
|
default: withCtx(() => [
|
|
@@ -102,10 +108,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
102
108
|
route: item.route
|
|
103
109
|
}, {
|
|
104
110
|
default: withCtx(() => [
|
|
105
|
-
item.icon ? (openBlock(),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
item.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
112
|
+
default: withCtx(() => [
|
|
113
|
+
item.icon ? (openBlock(), createElementBlock("span", {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
116
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
117
|
+
]),
|
|
118
|
+
_: 2
|
|
119
|
+
}, 1024)) : createCommentVNode("", true),
|
|
109
120
|
item.title ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(item.title), 1)) : createCommentVNode("", true)
|
|
110
121
|
]),
|
|
111
122
|
_: 2
|
|
@@ -18,6 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
const props = __props;
|
|
19
19
|
return (_ctx, _cache) => {
|
|
20
20
|
var _a, _b;
|
|
21
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
21
22
|
const _component_MenuItem = resolveComponent("MenuItem", true);
|
|
22
23
|
return !props.item.hideMenu ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
23
24
|
props.item.children && props.item.children.length > 0 ? (openBlock(), createBlock(unref(ElSubMenu), {
|
|
@@ -28,10 +29,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
29
|
"popper-offset": props.item.popperOffset
|
|
29
30
|
}, {
|
|
30
31
|
title: withCtx(() => [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
__props.item.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
33
|
+
default: withCtx(() => [
|
|
34
|
+
__props.item.icon ? (openBlock(), createElementBlock("span", {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: normalizeClass([__props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
37
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
})) : createCommentVNode("", true),
|
|
35
41
|
props.item.title ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(props.item.title), 1)) : createCommentVNode("", true)
|
|
36
42
|
]),
|
|
37
43
|
default: withCtx(() => [
|
|
@@ -52,10 +58,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
58
|
route: props.item.route
|
|
53
59
|
}, {
|
|
54
60
|
default: withCtx(() => [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
__props.item.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
__props.item.icon ? (openBlock(), createElementBlock("span", {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: normalizeClass([__props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
66
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
67
|
+
]),
|
|
68
|
+
_: 1
|
|
69
|
+
})) : createCommentVNode("", true),
|
|
59
70
|
props.item.title ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.item.title), 1)) : createCommentVNode("", true)
|
|
60
71
|
]),
|
|
61
72
|
_: 1
|
package/dist/es/package.json.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { PageLayoutProps } from './types';
|
|
2
|
-
declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}
|
|
2
|
+
declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
menuOpen: () => any;
|
|
4
|
+
menuClose: () => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<PageLayoutProps> & Readonly<{
|
|
6
|
+
onMenuOpen?: (() => any) | undefined;
|
|
7
|
+
onMenuClose?: (() => any) | undefined;
|
|
8
|
+
}>, {
|
|
3
9
|
cachable: boolean;
|
|
4
10
|
roundTabs: boolean;
|
|
5
11
|
showTopMenu: boolean;
|
|
@@ -29,7 +29,8 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { defineComponent, useAttrs,
|
|
32
|
+
import { defineComponent, useAttrs, computed, ref, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, unref, withCtx, createElementVNode, createVNode, createCommentVNode, normalizeStyle, resolveDynamicComponent, Transition, KeepAlive } from "vue";
|
|
33
|
+
import { useWindowSize } from "@vueuse/core";
|
|
33
34
|
import { ElCard, ElAside, ElScrollbar } from "element-plus";
|
|
34
35
|
import { cloneDeep } from "lodash-es";
|
|
35
36
|
import { useRouter, useRoute, RouterView } from "vue-router";
|
|
@@ -67,9 +68,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
67
68
|
topMenuSingleLevel: { type: Boolean, default: true },
|
|
68
69
|
sideMenuWithParent: { type: Boolean, default: true }
|
|
69
70
|
},
|
|
70
|
-
|
|
71
|
+
emits: ["menuOpen", "menuClose"],
|
|
72
|
+
setup(__props, { emit: __emit }) {
|
|
71
73
|
var _a, _b;
|
|
72
74
|
const props = __props;
|
|
75
|
+
const emit = __emit;
|
|
73
76
|
const router = useRouter();
|
|
74
77
|
const route = useRoute();
|
|
75
78
|
const attrs = useAttrs();
|
|
@@ -77,6 +80,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
77
80
|
enableCache: (_b = (_a = props.cachable) != null ? _a : attrs.cachable) != null ? _b : true
|
|
78
81
|
});
|
|
79
82
|
const tabsStore = useTabsStore();
|
|
83
|
+
const { width: vw } = useWindowSize();
|
|
84
|
+
const isCollapse = computed(() => {
|
|
85
|
+
return vw.value < 768;
|
|
86
|
+
});
|
|
87
|
+
function handleOpenMenu() {
|
|
88
|
+
emit("menuOpen");
|
|
89
|
+
}
|
|
90
|
+
function handleCloseMenu() {
|
|
91
|
+
emit("menuClose");
|
|
92
|
+
}
|
|
80
93
|
const activeTopMenu = ref("");
|
|
81
94
|
const activeSideMenu = ref("");
|
|
82
95
|
const routes = router.getRoutes();
|
|
@@ -169,6 +182,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
169
182
|
});
|
|
170
183
|
const computedAsideWidth = computed(() => {
|
|
171
184
|
if (showSideMenu.value && displayedSideMenu.value.length > 0) {
|
|
185
|
+
if (isCollapse.value) {
|
|
186
|
+
return "64px";
|
|
187
|
+
}
|
|
172
188
|
return props.asideWidth;
|
|
173
189
|
}
|
|
174
190
|
return "0";
|
|
@@ -227,7 +243,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
227
243
|
})) : createCommentVNode("", true),
|
|
228
244
|
createElementVNode("div", _hoisted_2, [
|
|
229
245
|
createVNode(unref(ElAside), {
|
|
230
|
-
class: "shrink-0 overflow-hidden h-full",
|
|
246
|
+
class: "shrink-0 overflow-hidden h-full transition-all",
|
|
231
247
|
style: normalizeStyle({ "--el-aside-width": computedAsideWidth.value })
|
|
232
248
|
}, {
|
|
233
249
|
default: withCtx(() => [
|
|
@@ -244,8 +260,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
244
260
|
"default-active": activeSideMenu.value,
|
|
245
261
|
"menu-data": displayedSideMenu.value,
|
|
246
262
|
class: "jky-page-layout__side-menu",
|
|
247
|
-
|
|
248
|
-
|
|
263
|
+
collapse: isCollapse.value,
|
|
264
|
+
onSelect: handleMenuSelect,
|
|
265
|
+
onOpen: handleOpenMenu,
|
|
266
|
+
onClose: handleCloseMenu
|
|
267
|
+
}, null, 8, ["default-active", "menu-data", "collapse"])
|
|
249
268
|
]),
|
|
250
269
|
_: 1
|
|
251
270
|
})) : (openBlock(), createBlock(_sfc_main$1, {
|
|
@@ -254,8 +273,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
254
273
|
"default-active": activeSideMenu.value,
|
|
255
274
|
"menu-data": displayedSideMenu.value,
|
|
256
275
|
class: "jky-page-layout__side-menu",
|
|
257
|
-
|
|
258
|
-
|
|
276
|
+
collapse: isCollapse.value,
|
|
277
|
+
onSelect: handleMenuSelect,
|
|
278
|
+
onOpen: handleOpenMenu,
|
|
279
|
+
onClose: handleCloseMenu
|
|
280
|
+
}, null, 8, ["default-active", "menu-data", "collapse"]))
|
|
259
281
|
]),
|
|
260
282
|
_: 1
|
|
261
283
|
}, 8, ["style"])) : createCommentVNode("", true)
|
package/dist/es/resolver.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ import { ComponentResolver } from 'unplugin-vue-components';
|
|
|
2
2
|
export interface JkyComponentLibResolverOptions {
|
|
3
3
|
/** 不自动加载样式的组件白名单(组件名,不带 Jky 前缀) */
|
|
4
4
|
excludeStyleList?: string[];
|
|
5
|
+
/** 自定义样式映射 */
|
|
6
|
+
styleMap?: Record<string, string>;
|
|
5
7
|
}
|
|
6
8
|
export declare function JkyComponentLibResolver(options?: JkyComponentLibResolverOptions): ComponentResolver;
|
package/dist/es/resolver.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
const defaultExcludeStyleList = [
|
|
2
18
|
// AMap 相关子组件,共用 amap 目录的样式
|
|
3
19
|
"AMapPicker",
|
|
@@ -11,9 +27,13 @@ const defaultExcludeStyleList = [
|
|
|
11
27
|
"AMarkerCluster"
|
|
12
28
|
// AClusterMarker 的常见误写
|
|
13
29
|
];
|
|
30
|
+
const defaultStyleMap = {
|
|
31
|
+
AnimatedTransition: "animated"
|
|
32
|
+
};
|
|
14
33
|
function JkyComponentLibResolver(options = {}) {
|
|
15
|
-
const { excludeStyleList = [] } = options;
|
|
34
|
+
const { excludeStyleList = [], styleMap = {} } = options;
|
|
16
35
|
const excludeStyleSet = /* @__PURE__ */ new Set([...defaultExcludeStyleList, ...excludeStyleList]);
|
|
36
|
+
const styleMapLib = __spreadValues(__spreadValues({}, defaultStyleMap), styleMap);
|
|
17
37
|
return {
|
|
18
38
|
type: "component",
|
|
19
39
|
resolve: (name) => {
|
|
@@ -27,11 +47,12 @@ function JkyComponentLibResolver(options = {}) {
|
|
|
27
47
|
// 白名单中的组件不自动加载样式
|
|
28
48
|
};
|
|
29
49
|
}
|
|
50
|
+
const stylePath = styleMapLib[componentName] || kebabName;
|
|
30
51
|
return {
|
|
31
52
|
name,
|
|
32
53
|
from: "jky-component-lib",
|
|
33
54
|
sideEffects: [
|
|
34
|
-
`jky-component-lib/dist/es/${
|
|
55
|
+
`jky-component-lib/dist/es/${stylePath}/style.css`
|
|
35
56
|
]
|
|
36
57
|
};
|
|
37
58
|
}
|
package/dist/lib/amap/style.css
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/* AMap 高德地图组件样式 */
|
|
2
|
-
.jky-amap-container {
|
|
3
|
-
/* 地图容器样式 */
|
|
4
|
-
position: relative;
|
|
5
|
-
overflow: hidden;
|
|
6
1
|
|
|
7
|
-
|
|
8
|
-
.amap-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
2
|
+
/* JkyAMarker 组件样式 - 参考高德官方示例 */
|
|
3
|
+
.amap-icon img,
|
|
4
|
+
.amap-marker-content img {
|
|
5
|
+
width: 25px;
|
|
6
|
+
height: 34px;
|
|
14
7
|
}
|
package/dist/lib/amap/style2.css
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/* AMap 高德地图组件样式 */
|
|
2
|
+
.jky-amap-container {
|
|
3
|
+
/* 地图容器样式 */
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
1
6
|
|
|
2
|
-
/*
|
|
3
|
-
|
|
7
|
+
/* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
|
|
8
|
+
.amap-logo {
|
|
9
|
+
display: none !important;
|
|
10
|
+
}
|
|
11
|
+
.amap-copyright {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/lib/amap/style3.css
CHANGED
|
@@ -64,6 +64,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
64
64
|
const props = __props;
|
|
65
65
|
const attrs = vue.useAttrs();
|
|
66
66
|
return (_ctx, _cache) => {
|
|
67
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
67
68
|
return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElMenu), vue.mergeProps({ class: "jky-menu" }, __spreadValues(__spreadValues({}, vue.unref(attrs)), props)), {
|
|
68
69
|
default: vue.withCtx(() => [
|
|
69
70
|
props.menuData && props.menuData.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(props.menuData, (item) => {
|
|
@@ -80,10 +81,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
80
81
|
"popper-offset": item.popperOffset
|
|
81
82
|
}, {
|
|
82
83
|
title: vue.withCtx(() => [
|
|
83
|
-
item.icon ? (vue.openBlock(), vue.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
item.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
|
|
85
|
+
default: vue.withCtx(() => [
|
|
86
|
+
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
89
|
+
}, null, 2)) : vue.createCommentVNode("", true)
|
|
90
|
+
]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
87
93
|
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
88
94
|
]),
|
|
89
95
|
default: vue.withCtx(() => [
|
|
@@ -104,10 +110,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
104
110
|
route: item.route
|
|
105
111
|
}, {
|
|
106
112
|
default: vue.withCtx(() => [
|
|
107
|
-
item.icon ? (vue.openBlock(), vue.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
item.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
|
|
114
|
+
default: vue.withCtx(() => [
|
|
115
|
+
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: vue.normalizeClass([item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
118
|
+
}, null, 2)) : vue.createCommentVNode("", true)
|
|
119
|
+
]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
111
122
|
item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(item.title), 1)) : vue.createCommentVNode("", true)
|
|
112
123
|
]),
|
|
113
124
|
_: 2
|
|
@@ -20,6 +20,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
20
20
|
const props = __props;
|
|
21
21
|
return (_ctx, _cache) => {
|
|
22
22
|
var _a, _b;
|
|
23
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
23
24
|
const _component_MenuItem = vue.resolveComponent("MenuItem", true);
|
|
24
25
|
return !props.item.hideMenu ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
25
26
|
props.item.children && props.item.children.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSubMenu), {
|
|
@@ -30,10 +31,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
30
31
|
"popper-offset": props.item.popperOffset
|
|
31
32
|
}, {
|
|
32
33
|
title: vue.withCtx(() => [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
__props.item.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
|
|
35
|
+
default: vue.withCtx(() => [
|
|
36
|
+
__props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: vue.normalizeClass([__props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
39
|
+
}, null, 2)) : vue.createCommentVNode("", true)
|
|
40
|
+
]),
|
|
41
|
+
_: 1
|
|
42
|
+
})) : vue.createCommentVNode("", true),
|
|
37
43
|
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
38
44
|
]),
|
|
39
45
|
default: vue.withCtx(() => [
|
|
@@ -54,10 +60,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
54
60
|
route: props.item.route
|
|
55
61
|
}, {
|
|
56
62
|
default: vue.withCtx(() => [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
__props.item.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
|
|
64
|
+
default: vue.withCtx(() => [
|
|
65
|
+
__props.item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: vue.normalizeClass([__props.item.icon, "text-lg mr-1 jky-menu-item__icon"])
|
|
68
|
+
}, null, 2)) : vue.createCommentVNode("", true)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
})) : vue.createCommentVNode("", true),
|
|
61
72
|
props.item.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(props.item.title), 1)) : vue.createCommentVNode("", true)
|
|
62
73
|
]),
|
|
63
74
|
_: 1
|
package/dist/lib/package.json.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { PageLayoutProps } from './types';
|
|
2
|
-
declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}
|
|
2
|
+
declare const _default: import('vue').DefineComponent<PageLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
menuOpen: () => any;
|
|
4
|
+
menuClose: () => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<PageLayoutProps> & Readonly<{
|
|
6
|
+
onMenuOpen?: (() => any) | undefined;
|
|
7
|
+
onMenuClose?: (() => any) | undefined;
|
|
8
|
+
}>, {
|
|
3
9
|
cachable: boolean;
|
|
4
10
|
roundTabs: boolean;
|
|
5
11
|
showTopMenu: boolean;
|
|
@@ -32,6 +32,7 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
34
34
|
const vue = require("vue");
|
|
35
|
+
const core = require("@vueuse/core");
|
|
35
36
|
const ElementPlus = require("element-plus");
|
|
36
37
|
const lodashEs = require("lodash-es");
|
|
37
38
|
const vueRouter = require("vue-router");
|
|
@@ -69,9 +70,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
69
70
|
topMenuSingleLevel: { type: Boolean, default: true },
|
|
70
71
|
sideMenuWithParent: { type: Boolean, default: true }
|
|
71
72
|
},
|
|
72
|
-
|
|
73
|
+
emits: ["menuOpen", "menuClose"],
|
|
74
|
+
setup(__props, { emit: __emit }) {
|
|
73
75
|
var _a, _b;
|
|
74
76
|
const props = __props;
|
|
77
|
+
const emit = __emit;
|
|
75
78
|
const router = vueRouter.useRouter();
|
|
76
79
|
const route = vueRouter.useRoute();
|
|
77
80
|
const attrs = vue.useAttrs();
|
|
@@ -79,6 +82,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
79
82
|
enableCache: (_b = (_a = props.cachable) != null ? _a : attrs.cachable) != null ? _b : true
|
|
80
83
|
});
|
|
81
84
|
const tabsStore = useTabsStore$1();
|
|
85
|
+
const { width: vw } = core.useWindowSize();
|
|
86
|
+
const isCollapse = vue.computed(() => {
|
|
87
|
+
return vw.value < 768;
|
|
88
|
+
});
|
|
89
|
+
function handleOpenMenu() {
|
|
90
|
+
emit("menuOpen");
|
|
91
|
+
}
|
|
92
|
+
function handleCloseMenu() {
|
|
93
|
+
emit("menuClose");
|
|
94
|
+
}
|
|
82
95
|
const activeTopMenu = vue.ref("");
|
|
83
96
|
const activeSideMenu = vue.ref("");
|
|
84
97
|
const routes = router.getRoutes();
|
|
@@ -171,6 +184,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
171
184
|
});
|
|
172
185
|
const computedAsideWidth = vue.computed(() => {
|
|
173
186
|
if (showSideMenu.value && displayedSideMenu.value.length > 0) {
|
|
187
|
+
if (isCollapse.value) {
|
|
188
|
+
return "64px";
|
|
189
|
+
}
|
|
174
190
|
return props.asideWidth;
|
|
175
191
|
}
|
|
176
192
|
return "0";
|
|
@@ -229,7 +245,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
229
245
|
})) : vue.createCommentVNode("", true),
|
|
230
246
|
vue.createElementVNode("div", _hoisted_2, [
|
|
231
247
|
vue.createVNode(vue.unref(ElementPlus.ElAside), {
|
|
232
|
-
class: "shrink-0 overflow-hidden h-full",
|
|
248
|
+
class: "shrink-0 overflow-hidden h-full transition-all",
|
|
233
249
|
style: vue.normalizeStyle({ "--el-aside-width": computedAsideWidth.value })
|
|
234
250
|
}, {
|
|
235
251
|
default: vue.withCtx(() => [
|
|
@@ -246,8 +262,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
246
262
|
"default-active": activeSideMenu.value,
|
|
247
263
|
"menu-data": displayedSideMenu.value,
|
|
248
264
|
class: "jky-page-layout__side-menu",
|
|
249
|
-
|
|
250
|
-
|
|
265
|
+
collapse: isCollapse.value,
|
|
266
|
+
onSelect: handleMenuSelect,
|
|
267
|
+
onOpen: handleOpenMenu,
|
|
268
|
+
onClose: handleCloseMenu
|
|
269
|
+
}, null, 8, ["default-active", "menu-data", "collapse"])
|
|
251
270
|
]),
|
|
252
271
|
_: 1
|
|
253
272
|
})) : (vue.openBlock(), vue.createBlock(Menu_vue_vue_type_script_setup_true_lang.default, {
|
|
@@ -256,8 +275,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
256
275
|
"default-active": activeSideMenu.value,
|
|
257
276
|
"menu-data": displayedSideMenu.value,
|
|
258
277
|
class: "jky-page-layout__side-menu",
|
|
259
|
-
|
|
260
|
-
|
|
278
|
+
collapse: isCollapse.value,
|
|
279
|
+
onSelect: handleMenuSelect,
|
|
280
|
+
onOpen: handleOpenMenu,
|
|
281
|
+
onClose: handleCloseMenu
|
|
282
|
+
}, null, 8, ["default-active", "menu-data", "collapse"]))
|
|
261
283
|
]),
|
|
262
284
|
_: 1
|
|
263
285
|
}, 8, ["style"])) : vue.createCommentVNode("", true)
|
package/dist/lib/resolver.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ import { ComponentResolver } from 'unplugin-vue-components';
|
|
|
2
2
|
export interface JkyComponentLibResolverOptions {
|
|
3
3
|
/** 不自动加载样式的组件白名单(组件名,不带 Jky 前缀) */
|
|
4
4
|
excludeStyleList?: string[];
|
|
5
|
+
/** 自定义样式映射 */
|
|
6
|
+
styleMap?: Record<string, string>;
|
|
5
7
|
}
|
|
6
8
|
export declare function JkyComponentLibResolver(options?: JkyComponentLibResolverOptions): ComponentResolver;
|
package/dist/lib/resolver.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
2
18
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
19
|
const defaultExcludeStyleList = [
|
|
4
20
|
// AMap 相关子组件,共用 amap 目录的样式
|
|
@@ -13,9 +29,13 @@ const defaultExcludeStyleList = [
|
|
|
13
29
|
"AMarkerCluster"
|
|
14
30
|
// AClusterMarker 的常见误写
|
|
15
31
|
];
|
|
32
|
+
const defaultStyleMap = {
|
|
33
|
+
AnimatedTransition: "animated"
|
|
34
|
+
};
|
|
16
35
|
function JkyComponentLibResolver(options = {}) {
|
|
17
|
-
const { excludeStyleList = [] } = options;
|
|
36
|
+
const { excludeStyleList = [], styleMap = {} } = options;
|
|
18
37
|
const excludeStyleSet = /* @__PURE__ */ new Set([...defaultExcludeStyleList, ...excludeStyleList]);
|
|
38
|
+
const styleMapLib = __spreadValues(__spreadValues({}, defaultStyleMap), styleMap);
|
|
19
39
|
return {
|
|
20
40
|
type: "component",
|
|
21
41
|
resolve: (name) => {
|
|
@@ -29,11 +49,12 @@ function JkyComponentLibResolver(options = {}) {
|
|
|
29
49
|
// 白名单中的组件不自动加载样式
|
|
30
50
|
};
|
|
31
51
|
}
|
|
52
|
+
const stylePath = styleMapLib[componentName] || kebabName;
|
|
32
53
|
return {
|
|
33
54
|
name,
|
|
34
55
|
from: "jky-component-lib",
|
|
35
56
|
sideEffects: [
|
|
36
|
-
`jky-component-lib/dist/es/${
|
|
57
|
+
`jky-component-lib/dist/es/${stylePath}/style.css`
|
|
37
58
|
]
|
|
38
59
|
};
|
|
39
60
|
}
|