@keyblade/pro-components 1.4.5 → 1.4.6

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,27 +1,16 @@
1
- import _sfc_main from "./pro-layout.vue.js";
1
+ import e from "./pro-layout.vue.js";
2
2
  import "./pro-layout.vue2.js";
3
- import { Layout, Space, Typography, Button, Affix } from "@arco-design/web-vue";
4
- import { ProKeepAliveRouterView } from "../pro-keep-alive-router-view/index.js";
5
- import { ProMenu } from "../pro-menu/index.js";
6
- import { ProReuseTabs } from "../pro-reuse-tabs/index.js";
7
- import { IconMenuFold, IconMenuUnfold } from "@arco-design/web-vue/es/icon";
8
- const ProLayout = Object.assign(_sfc_main, {
9
- install: (app) => {
10
- app.use(Layout);
11
- app.use(Space);
12
- app.use(Typography);
13
- app.use(Button);
14
- app.use(Affix);
15
- app.use(ProKeepAliveRouterView);
16
- app.use(ProMenu);
17
- app.use(ProReuseTabs);
18
- app.use(IconMenuFold);
19
- app.use(IconMenuUnfold);
20
- app.component("KbProLayout", _sfc_main);
3
+ import { Layout as r, Space as t, Typography as u, Button as s, Affix as m } from "@arco-design/web-vue";
4
+ import { ProKeepAliveRouterView as n } from "../pro-keep-alive-router-view/index.js";
5
+ import { ProMenu as i } from "../pro-menu/index.js";
6
+ import { ProReuseTabs as f } from "../pro-reuse-tabs/index.js";
7
+ import { IconMenuFold as c, IconMenuUnfold as l } from "@arco-design/web-vue/es/icon";
8
+ const y = Object.assign(e, {
9
+ install: (o) => {
10
+ o.use(r), o.use(t), o.use(u), o.use(s), o.use(m), o.use(n), o.use(i), o.use(f), o.use(c), o.use(l), o.component("KbProLayout", e);
21
11
  }
22
- });
23
- const ProLayout$1 = ProLayout;
12
+ }), x = y;
24
13
  export {
25
- ProLayout,
26
- ProLayout$1 as default
14
+ y as ProLayout,
15
+ x as default
27
16
  };
@@ -1,270 +1,243 @@
1
- import { defineComponent, useCssVars, toRefs, useSlots, provide, ref, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createVNode, createElementVNode, unref, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
- import { useHooks } from "./hooks.js";
3
- const _hoisted_1 = ["src"];
4
- const _hoisted_2 = ["src"];
5
- const prefixClsName = "keyblade-pro-layout";
6
- const siderCollapsedWidth = 48;
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as U, useCssVars as X, toRefs as Y, useSlots as Z, provide as q, ref as ee, watch as B, resolveComponent as o, openBlock as s, createBlock as c, normalizeClass as t, withCtx as a, createVNode as i, createElementVNode as f, unref as d, renderSlot as m, createElementBlock as k, Fragment as S, createTextVNode as b, toDisplayString as g, createCommentVNode as p } from "vue";
2
+ import { useHooks as te } from "./hooks.js";
3
+ const le = ["src"], oe = ["src"], e = "keyblade-pro-layout", ae = 48, re = /* @__PURE__ */ U({
8
4
  __name: "pro-layout",
9
5
  props: {
10
6
  /** 布局类型 */
11
7
  layout: {
12
8
  type: String,
13
- required: false,
9
+ required: !1,
14
10
  default: "mix"
15
11
  },
16
12
  /** 头部高度 */
17
13
  headerHeight: {
18
14
  type: Number,
19
- required: false,
15
+ required: !1,
20
16
  default: 60
21
17
  },
22
18
  /** 右上角标题 */
23
19
  title: {
24
20
  type: String,
25
- required: false,
21
+ required: !1,
26
22
  default: "KeyBlade Pro"
27
23
  },
28
24
  /** 右上角logo */
29
25
  logo: {
30
26
  type: String,
31
- required: false,
27
+ required: !1,
32
28
  default: "http://p3-armor.byteimg.com/tos-cn-i-49unhts6dw/dfdba5317c0c20ce20e64fac803d52bc.svg~tplv-49unhts6dw-image.image"
33
29
  },
34
30
  /** 侧边栏宽度 */
35
31
  siderWidth: {
36
32
  type: Number,
37
- required: false,
33
+ required: !1,
38
34
  default: 220
39
35
  },
40
36
  /** 侧边栏响应式的断点 */
41
37
  siderBreakpoint: {
42
38
  type: String,
43
- required: false,
39
+ required: !1,
44
40
  default: "xl"
45
41
  },
46
42
  /** 侧边栏是否收缩,会受 siderBreakpoint 影响 */
47
43
  siderCollapsed: {
48
44
  type: Boolean,
49
- required: false,
50
- default: false
45
+ required: !1,
46
+ default: !1
51
47
  },
52
48
  /** 菜单项 */
53
49
  menuItems: {
54
50
  type: Array,
55
- required: false,
51
+ required: !1,
56
52
  default: () => []
57
53
  },
58
54
  /** 页脚标题 */
59
55
  footerTitle: {
60
56
  type: String,
61
- required: false,
57
+ required: !1,
62
58
  default: "KeyBlade Pro"
63
59
  },
64
60
  /** 是否显示多页签 */
65
61
  showTabs: {
66
62
  type: Boolean,
67
- required: false,
68
- default: true
63
+ required: !1,
64
+ default: !0
69
65
  }
70
66
  },
71
67
  emits: {
72
68
  /** 收缩事件 */
73
- "collapse": (collapsed) => true,
69
+ collapse: (l) => !0,
74
70
  /** keepAlive改变事件 */
75
- "keepAliveIncludeChange": (keepAliveInclude) => true
71
+ keepAliveIncludeChange: (l) => !0
76
72
  },
77
- setup(__props, { emit }) {
78
- const props = __props;
79
- useCssVars((_ctx) => ({
80
- "79d837bc": headerHeightWidthPx,
81
- "51986431": siderWidthPx,
82
- "2cc12c98": siderCollapsedWidthPx
73
+ setup(l, { emit: v }) {
74
+ const u = l;
75
+ X((r) => ({
76
+ "79d837bc": V,
77
+ 51986431: D,
78
+ "2cc12c98": K
83
79
  }));
84
- const { menuItems } = toRefs(props);
85
- const slots = useSlots();
86
- const {
87
- menuSelectedKeys,
88
- breadcrumbItems,
89
- tabs,
90
- keepAliveInclude,
91
- onMenuItemClick,
92
- onTabClick,
93
- onTabDelete
94
- } = useHooks(menuItems, {
95
- showTabs: props.showTabs
80
+ const { menuItems: $ } = Y(u), y = Z(), {
81
+ menuSelectedKeys: N,
82
+ breadcrumbItems: P,
83
+ tabs: C,
84
+ keepAliveInclude: h,
85
+ onMenuItemClick: W,
86
+ onTabClick: A,
87
+ onTabDelete: H
88
+ } = te($, {
89
+ showTabs: u.showTabs
96
90
  });
97
- provide("ProBreadcrumbItems", breadcrumbItems);
98
- provide("ProKeepAliveInclude", keepAliveInclude);
99
- const headerHeightWidthPx = `${props.headerHeight}px`;
100
- const siderWidthPx = `${props.siderWidth}px`;
101
- const siderCollapsedWidthPx = `${siderCollapsedWidth}px`;
102
- const siderCollapsed = ref(props.siderCollapsed);
103
- const onSiderCollapse = (val) => {
104
- siderCollapsed.value = val;
105
- emit("collapse", val);
91
+ q("ProBreadcrumbItems", P), q("ProKeepAliveInclude", h);
92
+ const V = `${u.headerHeight}px`, D = `${u.siderWidth}px`, K = `${ae}px`, n = ee(u.siderCollapsed), T = (r) => {
93
+ n.value = r, v("collapse", r);
106
94
  };
107
- watch(() => props.siderCollapsed, () => {
108
- siderCollapsed.value = props.siderCollapsed;
109
- }, { immediate: true });
110
- watch(keepAliveInclude, () => {
111
- emit("keepAliveIncludeChange", keepAliveInclude.value);
112
- }, { immediate: true });
113
- return (_ctx, _cache) => {
114
- const _component_a_typography_title = resolveComponent("a-typography-title");
115
- const _component_a_space = resolveComponent("a-space");
116
- const _component_a_layout_header = resolveComponent("a-layout-header");
117
- const _component_kb_pro_menu = resolveComponent("kb-pro-menu");
118
- const _component_icon_menu_unfold = resolveComponent("icon-menu-unfold");
119
- const _component_icon_menu_fold = resolveComponent("icon-menu-fold");
120
- const _component_a_button = resolveComponent("a-button");
121
- const _component_a_layout_sider = resolveComponent("a-layout-sider");
122
- const _component_kb_pro_reuse_tabs = resolveComponent("kb-pro-reuse-tabs");
123
- const _component_a_affix = resolveComponent("a-affix");
124
- const _component_kb_pro_keep_alive_router_view = resolveComponent("kb-pro-keep-alive-router-view");
125
- const _component_a_layout_content = resolveComponent("a-layout-content");
126
- const _component_a_layout_footer = resolveComponent("a-layout-footer");
127
- const _component_a_layout = resolveComponent("a-layout");
128
- return openBlock(), createBlock(_component_a_layout, {
129
- class: normalizeClass(`${prefixClsName} ${prefixClsName}-${__props.layout}`)
95
+ return B(() => u.siderCollapsed, () => {
96
+ n.value = u.siderCollapsed;
97
+ }, { immediate: !0 }), B(h, () => {
98
+ v("keepAliveIncludeChange", h.value);
99
+ }, { immediate: !0 }), (r, w) => {
100
+ const x = o("a-typography-title"), I = o("a-space"), M = o("a-layout-header"), z = o("kb-pro-menu"), E = o("icon-menu-unfold"), F = o("icon-menu-fold"), R = o("a-button"), j = o("a-layout-sider"), G = o("kb-pro-reuse-tabs"), J = o("a-affix"), L = o("kb-pro-keep-alive-router-view"), O = o("a-layout-content"), Q = o("a-layout-footer"), _ = o("a-layout");
101
+ return s(), c(_, {
102
+ class: t(`${e} ${e}-${l.layout}`)
130
103
  }, {
131
- default: withCtx(() => [
132
- createVNode(_component_a_layout_header, {
133
- class: normalizeClass(`${prefixClsName}-header` + (siderCollapsed.value ? ` ${prefixClsName}-header-collapsed` : ""))
104
+ default: a(() => [
105
+ i(M, {
106
+ class: t(`${e}-header` + (n.value ? ` ${e}-header-collapsed` : ""))
134
107
  }, {
135
- default: withCtx(() => [
136
- createElementVNode("div", {
137
- class: normalizeClass(`${prefixClsName}-header-left`)
108
+ default: a(() => [
109
+ f("div", {
110
+ class: t(`${e}-header-left`)
138
111
  }, [
139
- unref(slots)["header-left"] ? renderSlot(_ctx.$slots, "header-left", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
140
- __props.layout !== "side" ? (openBlock(), createBlock(_component_a_space, { key: 0 }, {
141
- default: withCtx(() => [
142
- createElementVNode("img", {
143
- class: normalizeClass(`${prefixClsName}-header-left-logo`),
112
+ d(y)["header-left"] ? m(r.$slots, "header-left", { key: 0 }) : (s(), k(S, { key: 1 }, [
113
+ l.layout !== "side" ? (s(), c(I, { key: 0 }, {
114
+ default: a(() => [
115
+ f("img", {
116
+ class: t(`${e}-header-left-logo`),
144
117
  alt: "logo",
145
- src: __props.logo
146
- }, null, 10, _hoisted_1),
147
- !siderCollapsed.value ? (openBlock(), createBlock(_component_a_typography_title, {
118
+ src: l.logo
119
+ }, null, 10, le),
120
+ n.value ? p("", !0) : (s(), c(x, {
148
121
  key: 0,
149
- class: normalizeClass(`${prefixClsName}-header-left-title`),
122
+ class: t(`${e}-header-left-title`),
150
123
  heading: 5
151
124
  }, {
152
- default: withCtx(() => [
153
- createTextVNode(toDisplayString(__props.title), 1)
125
+ default: a(() => [
126
+ b(g(l.title), 1)
154
127
  ]),
155
128
  _: 1
156
- }, 8, ["class"])) : createCommentVNode("", true)
129
+ }, 8, ["class"]))
157
130
  ]),
158
131
  _: 1
159
- })) : createCommentVNode("", true)
132
+ })) : p("", !0)
160
133
  ], 64))
161
134
  ], 2),
162
- createElementVNode("div", {
163
- class: normalizeClass(`${prefixClsName}-header-center`)
135
+ f("div", {
136
+ class: t(`${e}-header-center`)
164
137
  }, [
165
- unref(slots)["header-center"] ? renderSlot(_ctx.$slots, "header-center", { key: 0 }) : createCommentVNode("", true)
138
+ d(y)["header-center"] ? m(r.$slots, "header-center", { key: 0 }) : p("", !0)
166
139
  ], 2),
167
- createElementVNode("div", {
168
- class: normalizeClass(`${prefixClsName}-header-right`)
140
+ f("div", {
141
+ class: t(`${e}-header-right`)
169
142
  }, [
170
- renderSlot(_ctx.$slots, "header-right")
143
+ m(r.$slots, "header-right")
171
144
  ], 2)
172
145
  ]),
173
146
  _: 3
174
147
  }, 8, ["class"]),
175
- createVNode(_component_a_layout, null, {
176
- default: withCtx(() => [
177
- createVNode(_component_a_layout_sider, {
178
- class: normalizeClass(`${prefixClsName}-sider` + (siderCollapsed.value ? ` ${prefixClsName}-sider-collapsed` : "")),
179
- width: __props.siderWidth,
180
- collapsible: true,
181
- breakpoint: __props.siderBreakpoint,
182
- collapsed: siderCollapsed.value,
183
- "hide-trigger": true,
184
- onCollapse: onSiderCollapse
148
+ i(_, null, {
149
+ default: a(() => [
150
+ i(j, {
151
+ class: t(`${e}-sider` + (n.value ? ` ${e}-sider-collapsed` : "")),
152
+ width: l.siderWidth,
153
+ collapsible: !0,
154
+ breakpoint: l.siderBreakpoint,
155
+ collapsed: n.value,
156
+ "hide-trigger": !0,
157
+ onCollapse: T
185
158
  }, {
186
- default: withCtx(() => [
187
- createElementVNode("div", {
188
- class: normalizeClass(`${prefixClsName}-sider-content`)
159
+ default: a(() => [
160
+ f("div", {
161
+ class: t(`${e}-sider-content`)
189
162
  }, [
190
- unref(slots)["sider-top"] ? renderSlot(_ctx.$slots, "sider-top", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
191
- __props.layout === "side" ? (openBlock(), createElementBlock("div", {
163
+ d(y)["sider-top"] ? m(r.$slots, "sider-top", { key: 0 }) : (s(), k(S, { key: 1 }, [
164
+ l.layout === "side" ? (s(), k("div", {
192
165
  key: 0,
193
- class: normalizeClass(`${prefixClsName}-sider-content-top`)
166
+ class: t(`${e}-sider-content-top`)
194
167
  }, [
195
- createVNode(_component_a_space, null, {
196
- default: withCtx(() => [
197
- createElementVNode("img", {
198
- class: normalizeClass(`${prefixClsName}-sider-content-top-logo`),
168
+ i(I, null, {
169
+ default: a(() => [
170
+ f("img", {
171
+ class: t(`${e}-sider-content-top-logo`),
199
172
  alt: "logo",
200
- src: __props.logo
201
- }, null, 10, _hoisted_2),
202
- !siderCollapsed.value ? (openBlock(), createBlock(_component_a_typography_title, {
173
+ src: l.logo
174
+ }, null, 10, oe),
175
+ n.value ? p("", !0) : (s(), c(x, {
203
176
  key: 0,
204
- class: normalizeClass(`${prefixClsName}-sider-content-top-title`),
177
+ class: t(`${e}-sider-content-top-title`),
205
178
  heading: 5
206
179
  }, {
207
- default: withCtx(() => [
208
- createTextVNode(toDisplayString(__props.title), 1)
180
+ default: a(() => [
181
+ b(g(l.title), 1)
209
182
  ]),
210
183
  _: 1
211
- }, 8, ["class"])) : createCommentVNode("", true)
184
+ }, 8, ["class"]))
212
185
  ]),
213
186
  _: 1
214
187
  })
215
- ], 2)) : createCommentVNode("", true)
188
+ ], 2)) : p("", !0)
216
189
  ], 64)),
217
- createVNode(_component_kb_pro_menu, {
218
- collapsed: siderCollapsed.value,
219
- "selected-keys": unref(menuSelectedKeys),
220
- items: unref(menuItems),
221
- onMenuItemClick: unref(onMenuItemClick)
190
+ i(z, {
191
+ collapsed: n.value,
192
+ "selected-keys": d(N),
193
+ items: d($),
194
+ onMenuItemClick: d(W)
222
195
  }, null, 8, ["collapsed", "selected-keys", "items", "onMenuItemClick"])
223
196
  ], 2),
224
- createVNode(_component_a_button, {
197
+ i(R, {
225
198
  size: "mini",
226
- class: normalizeClass(`${prefixClsName}-sider-collapsed-icon`),
227
- onClick: _cache[0] || (_cache[0] = ($event) => onSiderCollapse(!siderCollapsed.value))
199
+ class: t(`${e}-sider-collapsed-icon`),
200
+ onClick: w[0] || (w[0] = (se) => T(!n.value))
228
201
  }, {
229
- icon: withCtx(() => [
230
- siderCollapsed.value ? (openBlock(), createBlock(_component_icon_menu_unfold, { key: 0 })) : (openBlock(), createBlock(_component_icon_menu_fold, { key: 1 }))
202
+ icon: a(() => [
203
+ n.value ? (s(), c(E, { key: 0 })) : (s(), c(F, { key: 1 }))
231
204
  ]),
232
205
  _: 1
233
206
  }, 8, ["class"])
234
207
  ]),
235
208
  _: 3
236
209
  }, 8, ["class", "width", "breakpoint", "collapsed"]),
237
- createVNode(_component_a_layout, {
238
- class: normalizeClass(`${prefixClsName}-body` + (siderCollapsed.value ? ` ${prefixClsName}-body-collapsed` : ""))
210
+ i(_, {
211
+ class: t(`${e}-body` + (n.value ? ` ${e}-body-collapsed` : ""))
239
212
  }, {
240
- default: withCtx(() => [
241
- __props.showTabs ? (openBlock(), createBlock(_component_a_affix, {
213
+ default: a(() => [
214
+ l.showTabs ? (s(), c(J, {
242
215
  key: 0,
243
- class: normalizeClass(`${prefixClsName}-body-affix`),
244
- offsetTop: __props.headerHeight
216
+ class: t(`${e}-body-affix`),
217
+ offsetTop: l.headerHeight
245
218
  }, {
246
- default: withCtx(() => [
247
- unref(tabs).length > 0 ? (openBlock(), createBlock(_component_kb_pro_reuse_tabs, {
219
+ default: a(() => [
220
+ d(C).length > 0 ? (s(), c(G, {
248
221
  key: 0,
249
- tabs: unref(tabs),
250
- onTabClick: unref(onTabClick),
251
- onTabDelete: unref(onTabDelete)
252
- }, null, 8, ["tabs", "onTabClick", "onTabDelete"])) : createCommentVNode("", true)
222
+ tabs: d(C),
223
+ onTabClick: d(A),
224
+ onTabDelete: d(H)
225
+ }, null, 8, ["tabs", "onTabClick", "onTabDelete"])) : p("", !0)
253
226
  ]),
254
227
  _: 1
255
- }, 8, ["class", "offsetTop"])) : createCommentVNode("", true),
256
- createVNode(_component_a_layout_content, null, {
257
- default: withCtx(() => [
258
- createVNode(_component_kb_pro_keep_alive_router_view)
228
+ }, 8, ["class", "offsetTop"])) : p("", !0),
229
+ i(O, null, {
230
+ default: a(() => [
231
+ i(L)
259
232
  ]),
260
233
  _: 1
261
234
  }),
262
- unref(slots)["footer"] !== void 0 ? renderSlot(_ctx.$slots, "footer", { key: 1 }) : (openBlock(), createBlock(_component_a_layout_footer, {
235
+ d(y).footer !== void 0 ? m(r.$slots, "footer", { key: 1 }) : (s(), c(Q, {
263
236
  key: 2,
264
- class: normalizeClass(`${prefixClsName}-body-footer`)
237
+ class: t(`${e}-body-footer`)
265
238
  }, {
266
- default: withCtx(() => [
267
- createTextVNode(toDisplayString(__props.footerTitle), 1)
239
+ default: a(() => [
240
+ b(g(l.footerTitle), 1)
268
241
  ]),
269
242
  _: 1
270
243
  }, 8, ["class"]))
@@ -281,5 +254,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
281
254
  }
282
255
  });
283
256
  export {
284
- _sfc_main as default
257
+ re as default
285
258
  };
@@ -1,4 +1,4 @@
1
- const proLayout_vue_vue_type_style_index_0_lang = "";
1
+ const e = "";
2
2
  export {
3
- proLayout_vue_vue_type_style_index_0_lang as default
3
+ e as default
4
4
  };
@@ -1,5 +1,5 @@
1
- import _sfc_main from "./pro-layout.vue.js";
1
+ import o from "./pro-layout.vue.js";
2
2
  import "./pro-layout.vue2.js";
3
3
  export {
4
- _sfc_main as default
4
+ o as default
5
5
  };
@@ -1,13 +1,11 @@
1
- import _sfc_main from "./pro-menu.vue.js";
2
- import { Menu } from "@arco-design/web-vue";
3
- const ProMenu = Object.assign(_sfc_main, {
4
- install: (app) => {
5
- app.use(Menu);
6
- app.component("KbProMenu", _sfc_main);
1
+ import n from "./pro-menu.vue.js";
2
+ import { Menu as e } from "@arco-design/web-vue";
3
+ const t = Object.assign(n, {
4
+ install: (o) => {
5
+ o.use(e), o.component("KbProMenu", n);
7
6
  }
8
- });
9
- const ProMenu$1 = ProMenu;
7
+ }), m = t;
10
8
  export {
11
- ProMenu,
12
- ProMenu$1 as default
9
+ t as ProMenu,
10
+ m as default
13
11
  };