@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,103 +1,88 @@
1
- import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createBlock, createSlots, withCtx, createTextVNode, toDisplayString, renderList, createCommentVNode, resolveDynamicComponent, normalizeClass } from "vue";
2
- import { useRouter } from "vue-router";
3
- const _hoisted_1 = ["src"];
4
- const _hoisted_2 = ["src"];
5
- const __default__ = {
1
+ import { defineComponent as z, computed as E, resolveComponent as a, openBlock as t, createElementBlock as s, Fragment as _, createBlock as o, createSlots as I, withCtx as r, createTextVNode as M, toDisplayString as w, renderList as F, createCommentVNode as n, resolveDynamicComponent as B, normalizeClass as N } from "vue";
2
+ import { useRouter as K } from "vue-router";
3
+ const L = ["src"], P = ["src"], R = {
6
4
  name: "KbProMenuItem"
7
- };
8
- const _sfc_main = /* @__PURE__ */ defineComponent({
9
- ...__default__,
5
+ }, A = /* @__PURE__ */ z({
6
+ ...R,
10
7
  props: {
11
8
  item: {}
12
9
  },
13
- setup(__props) {
14
- const props = __props;
15
- const prefixItemClsName = "keyblade-pro-menu-item";
16
- const router = useRouter();
17
- const iconType = computed(() => {
18
- var _a;
19
- const icon = (_a = props.item) == null ? void 0 : _a.icon;
20
- if (icon == null ? void 0 : icon.startsWith("icon")) {
21
- return "icon";
22
- }
23
- return "url";
24
- });
25
- const onMenuItemClick = (item) => {
26
- if (!(item == null ? void 0 : item.path)) {
27
- return;
28
- }
29
- if (item.path.startsWith("http") || item.path.startsWith("https")) {
30
- window.open(item.path);
31
- return;
10
+ setup(W) {
11
+ const $ = W, c = "keyblade-pro-menu-item", u = K(), m = E(() => {
12
+ var i;
13
+ const e = (i = $.item) == null ? void 0 : i.icon;
14
+ return e != null && e.startsWith("icon") ? "icon" : "url";
15
+ }), D = (e) => {
16
+ if (e != null && e.path) {
17
+ if (e.path.startsWith("http") || e.path.startsWith("https")) {
18
+ window.open(e.path);
19
+ return;
20
+ }
21
+ u == null || u.push({ path: e.path });
32
22
  }
33
- router.push({ path: item.path });
34
23
  };
35
- return (_ctx, _cache) => {
36
- var _a, _b, _c, _d, _e, _f, _g, _h;
37
- const _component_kb_pro_menu_item = resolveComponent("kb-pro-menu-item");
38
- const _component_a_sub_menu = resolveComponent("a-sub-menu");
39
- const _component_a_menu_item = resolveComponent("a-menu-item");
40
- return _ctx.item && !_ctx.item.hideInMenu ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
41
- ((_a = _ctx.item) == null ? void 0 : _a.children) && ((_c = (_b = _ctx.item) == null ? void 0 : _b.children) == null ? void 0 : _c.length) > 0 ? (openBlock(), createBlock(_component_a_sub_menu, {
42
- key: _ctx.item.name
43
- }, createSlots({
44
- title: withCtx(() => [
45
- createTextVNode(toDisplayString(_ctx.item.title), 1)
24
+ return (e, i) => {
25
+ var p, h, d, k, y, f, C, v;
26
+ const S = a("kb-pro-menu-item"), T = a("a-sub-menu"), V = a("a-menu-item");
27
+ return e.item && !e.item.hideInMenu ? (t(), s(_, { key: 0 }, [
28
+ (p = e.item) != null && p.children && ((d = (h = e.item) == null ? void 0 : h.children) == null ? void 0 : d.length) > 0 ? (t(), o(T, {
29
+ key: e.item.name
30
+ }, I({
31
+ title: r(() => [
32
+ M(w(e.item.title), 1)
46
33
  ]),
47
- default: withCtx(() => {
48
- var _a2, _b2;
34
+ default: r(() => {
35
+ var l, g;
49
36
  return [
50
- !((_a2 = _ctx.item) == null ? void 0 : _a2.hideChildrenInMenu) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(((_b2 = _ctx.item) == null ? void 0 : _b2.children) || [], (childItem) => {
51
- return openBlock(), createBlock(_component_kb_pro_menu_item, {
52
- key: childItem.name,
53
- item: childItem
54
- }, null, 8, ["item"]);
55
- }), 128)) : createCommentVNode("", true)
37
+ (l = e.item) != null && l.hideChildrenInMenu ? n("", !0) : (t(!0), s(_, { key: 0 }, F(((g = e.item) == null ? void 0 : g.children) || [], (b) => (t(), o(S, {
38
+ key: b.name,
39
+ item: b
40
+ }, null, 8, ["item"]))), 128))
56
41
  ];
57
42
  }),
58
43
  _: 2
59
44
  }, [
60
- ((_d = _ctx.item) == null ? void 0 : _d.icon) ? {
45
+ (k = e.item) != null && k.icon ? {
61
46
  name: "icon",
62
- fn: withCtx(() => [
63
- iconType.value === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.item.icon), { key: 0 })) : createCommentVNode("", true),
64
- iconType.value === "url" ? (openBlock(), createElementBlock("img", {
47
+ fn: r(() => [
48
+ m.value === "icon" ? (t(), o(B(e.item.icon), { key: 0 })) : n("", !0),
49
+ m.value === "url" ? (t(), s("img", {
65
50
  key: 1,
66
- class: normalizeClass(`${prefixItemClsName}-img`),
67
- src: _ctx.item.icon,
51
+ class: N(`${c}-img`),
52
+ src: e.item.icon,
68
53
  alt: ""
69
- }, null, 10, _hoisted_1)) : createCommentVNode("", true)
54
+ }, null, 10, L)) : n("", !0)
70
55
  ]),
71
56
  key: "0"
72
57
  } : void 0
73
- ]), 1024)) : createCommentVNode("", true),
74
- !((_e = _ctx.item) == null ? void 0 : _e.children) || ((_g = (_f = _ctx.item) == null ? void 0 : _f.children) == null ? void 0 : _g.length) === 0 ? (openBlock(), createBlock(_component_a_menu_item, {
75
- key: _ctx.item.name,
76
- onClick: _cache[0] || (_cache[0] = ($event) => onMenuItemClick(_ctx.item))
77
- }, createSlots({
78
- default: withCtx(() => [
79
- createTextVNode(" " + toDisplayString(_ctx.item.title), 1)
58
+ ]), 1024)) : n("", !0),
59
+ !((y = e.item) != null && y.children) || ((C = (f = e.item) == null ? void 0 : f.children) == null ? void 0 : C.length) === 0 ? (t(), o(V, {
60
+ key: e.item.name,
61
+ onClick: i[0] || (i[0] = (l) => D(e.item))
62
+ }, I({
63
+ default: r(() => [
64
+ M(" " + w(e.item.title), 1)
80
65
  ]),
81
66
  _: 2
82
67
  }, [
83
- ((_h = _ctx.item) == null ? void 0 : _h.icon) ? {
68
+ (v = e.item) != null && v.icon ? {
84
69
  name: "icon",
85
- fn: withCtx(() => [
86
- iconType.value === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.item.icon), { key: 0 })) : createCommentVNode("", true),
87
- iconType.value === "url" ? (openBlock(), createElementBlock("img", {
70
+ fn: r(() => [
71
+ m.value === "icon" ? (t(), o(B(e.item.icon), { key: 0 })) : n("", !0),
72
+ m.value === "url" ? (t(), s("img", {
88
73
  key: 1,
89
- class: normalizeClass(`${prefixItemClsName}-img`),
90
- src: _ctx.item.icon,
74
+ class: N(`${c}-img`),
75
+ src: e.item.icon,
91
76
  alt: ""
92
- }, null, 10, _hoisted_2)) : createCommentVNode("", true)
77
+ }, null, 10, P)) : n("", !0)
93
78
  ]),
94
79
  key: "0"
95
80
  } : void 0
96
- ]), 1024)) : createCommentVNode("", true)
97
- ], 64)) : createCommentVNode("", true);
81
+ ]), 1024)) : n("", !0)
82
+ ], 64)) : n("", !0);
98
83
  };
99
84
  }
100
85
  });
101
86
  export {
102
- _sfc_main as default
87
+ A as default
103
88
  };
@@ -1,4 +1,4 @@
1
- const proMenuItem_vue_vue_type_style_index_0_lang = "";
1
+ const e = "";
2
2
  export {
3
- proMenuItem_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-menu-item.vue.js";
1
+ import o from "./pro-menu-item.vue.js";
2
2
  import "./pro-menu-item.vue2.js";
3
3
  export {
4
- _sfc_main as default
4
+ o as default
5
5
  };
@@ -1,65 +1,55 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, Fragment, renderList } from "vue";
2
- import _sfc_main$1 from "./pro-menu-item.vue.js";
1
+ import { defineComponent as p, resolveComponent as f, openBlock as o, createBlock as i, normalizeClass as h, withCtx as y, createElementBlock as k, Fragment as C, renderList as _ } from "vue";
2
+ import x from "./pro-menu-item.vue.js";
3
3
  import "./pro-menu-item.vue2.js";
4
- const prefixClsName = "keyblade-pro-menu";
5
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ const B = "keyblade-pro-menu", I = /* @__PURE__ */ p({
6
5
  __name: "pro-menu",
7
6
  props: {
8
7
  collapsed: {
9
8
  type: Boolean,
10
- required: true
9
+ required: !0
11
10
  },
12
11
  selectedKeys: {
13
12
  type: Array,
14
- required: true
13
+ required: !0
15
14
  },
16
15
  items: {
17
16
  type: Array,
18
- required: true
17
+ required: !0
19
18
  }
20
19
  },
21
20
  emits: {
22
- "menu-item-click": (key) => true
21
+ "menu-item-click": (t) => !0
23
22
  },
24
- setup(__props, { emit }) {
25
- const props = __props;
26
- const onMenuItemClick = (key) => {
27
- let findItem;
28
- const find = (items) => {
29
- var _a;
30
- for (let i = 0; i < items.length; i++) {
31
- const item = items[i];
32
- if (item.name === key) {
33
- findItem = item;
23
+ setup(t, { emit: m }) {
24
+ const u = t, d = (s) => {
25
+ let n;
26
+ const l = (r) => {
27
+ var a;
28
+ for (let c = 0; c < r.length; c++) {
29
+ const e = r[c];
30
+ if (e.name === s) {
31
+ n = e;
34
32
  return;
35
33
  }
36
- if ((item == null ? void 0 : item.children) && ((_a = item.children) == null ? void 0 : _a.length) > 0) {
37
- find(item.children);
38
- }
34
+ e != null && e.children && ((a = e.children) == null ? void 0 : a.length) > 0 && l(e.children);
39
35
  }
40
36
  };
41
- find(props.items);
42
- if (findItem && (findItem.path.startsWith("http") || findItem.path.startsWith("https"))) {
43
- return;
44
- }
45
- emit("menu-item-click", key);
37
+ l(u.items), !(n && (n.path.startsWith("http") || n.path.startsWith("https"))) && m("menu-item-click", s);
46
38
  };
47
- return (_ctx, _cache) => {
48
- const _component_a_menu = resolveComponent("a-menu");
49
- return openBlock(), createBlock(_component_a_menu, {
50
- class: normalizeClass(prefixClsName),
51
- collapsed: __props.collapsed,
52
- "selected-keys": __props.selectedKeys,
39
+ return (s, n) => {
40
+ const l = f("a-menu");
41
+ return o(), i(l, {
42
+ class: h(B),
43
+ collapsed: t.collapsed,
44
+ "selected-keys": t.selectedKeys,
53
45
  "auto-open-selected": "",
54
- onMenuItemClick
46
+ onMenuItemClick: d
55
47
  }, {
56
- default: withCtx(() => [
57
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
58
- return openBlock(), createBlock(_sfc_main$1, {
59
- key: item.name,
60
- item
61
- }, null, 8, ["item"]);
62
- }), 128))
48
+ default: y(() => [
49
+ (o(!0), k(C, null, _(t.items, (r) => (o(), i(x, {
50
+ key: r.name,
51
+ item: r
52
+ }, null, 8, ["item"]))), 128))
63
53
  ]),
64
54
  _: 1
65
55
  }, 8, ["collapsed", "selected-keys"]);
@@ -67,5 +57,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
57
  }
68
58
  });
69
59
  export {
70
- _sfc_main as default
60
+ I as default
71
61
  };
@@ -1,4 +1,4 @@
1
- import _sfc_main from "./pro-menu.vue.js";
1
+ import f from "./pro-menu.vue.js";
2
2
  export {
3
- _sfc_main as default
3
+ f as default
4
4
  };
@@ -1,14 +1,12 @@
1
- import _sfc_main from "./pro-page-container.vue.js";
1
+ import r from "./pro-page-container.vue.js";
2
2
  import "./pro-page-container.vue2.js";
3
- import { ProBreadcrumb } from "../pro-breadcrumb/index.js";
4
- const ProPageContainer = Object.assign(_sfc_main, {
5
- install: (app) => {
6
- app.use(ProBreadcrumb);
7
- app.component("KbProPageContainer", _sfc_main);
3
+ import { ProBreadcrumb as n } from "../pro-breadcrumb/index.js";
4
+ const t = Object.assign(r, {
5
+ install: (o) => {
6
+ o.use(n), o.component("KbProPageContainer", r);
8
7
  }
9
- });
10
- const ProPageContainer$1 = ProPageContainer;
8
+ }), m = t;
11
9
  export {
12
- ProPageContainer,
13
- ProPageContainer$1 as default
10
+ t as ProPageContainer,
11
+ m as default
14
12
  };
@@ -1,71 +1,70 @@
1
- import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot } from "vue";
2
- const prefixClsName = "keyblade-pro-page-container";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as l, resolveComponent as o, openBlock as r, createElementBlock as u, normalizeClass as c, createBlock as d, createCommentVNode as i, renderSlot as n } from "vue";
2
+ const b = "keyblade-pro-page-container", f = /* @__PURE__ */ l({
4
3
  __name: "pro-page-container",
5
4
  props: {
6
5
  /** 是否隐藏面包屑 */
7
6
  hideBreadcrumb: {
8
7
  type: Boolean,
9
- required: false,
10
- default: false
8
+ required: !1,
9
+ default: !1
11
10
  },
12
11
  /** 面包屑是否显示图标 */
13
12
  breadcrumbShowIcon: {
14
13
  type: Boolean,
15
- required: false,
16
- default: true
14
+ required: !1,
15
+ default: !0
17
16
  },
18
17
  /** 面包屑图标类型 */
19
18
  breadcrumbIcon: {
20
19
  type: String,
21
- required: false,
20
+ required: !1,
22
21
  default: "icon-apps"
23
22
  },
24
23
  /** 面包屑项目 */
25
24
  breadcrumbItems: {
26
25
  type: Array,
27
- required: false,
26
+ required: !1,
28
27
  default: () => []
29
28
  },
30
29
  /** 面包屑是否显示标题 */
31
30
  breadcrumbShowTitle: {
32
31
  type: Boolean,
33
- required: false,
34
- default: true
32
+ required: !1,
33
+ default: !0
35
34
  },
36
35
  /** 面包屑标题,不传默认展示面包屑标题最后一项 */
37
36
  breadcrumbTitle: {
38
37
  type: String,
39
- required: false,
38
+ required: !1,
40
39
  default: ""
41
40
  },
42
41
  /** 面包屑副标题,不传默认不展示 */
43
42
  breadcrumbSubTitle: {
44
43
  type: String,
45
- required: false,
44
+ required: !1,
46
45
  default: ""
47
46
  }
48
47
  },
49
- setup(__props) {
50
- return (_ctx, _cache) => {
51
- const _component_kb_pro_breadcrumb = resolveComponent("kb-pro-breadcrumb");
52
- return openBlock(), createElementBlock("div", {
53
- class: normalizeClass(prefixClsName)
48
+ setup(e) {
49
+ return (t, m) => {
50
+ const a = o("kb-pro-breadcrumb");
51
+ return r(), u("div", {
52
+ class: c(b)
54
53
  }, [
55
- !__props.hideBreadcrumb ? (openBlock(), createBlock(_component_kb_pro_breadcrumb, {
54
+ e.hideBreadcrumb ? i("", !0) : (r(), d(a, {
56
55
  key: 0,
57
- "show-icon": __props.breadcrumbShowIcon,
58
- icon: __props.breadcrumbIcon,
59
- items: __props.breadcrumbItems,
60
- "show-title": __props.breadcrumbShowTitle,
61
- title: __props.breadcrumbTitle,
62
- "sub-title": __props.breadcrumbSubTitle
63
- }, null, 8, ["show-icon", "icon", "items", "show-title", "title", "sub-title"])) : createCommentVNode("", true),
64
- renderSlot(_ctx.$slots, "default")
56
+ "show-icon": e.breadcrumbShowIcon,
57
+ icon: e.breadcrumbIcon,
58
+ items: e.breadcrumbItems,
59
+ "show-title": e.breadcrumbShowTitle,
60
+ title: e.breadcrumbTitle,
61
+ "sub-title": e.breadcrumbSubTitle
62
+ }, null, 8, ["show-icon", "icon", "items", "show-title", "title", "sub-title"])),
63
+ n(t.$slots, "default")
65
64
  ]);
66
65
  };
67
66
  }
68
67
  });
69
68
  export {
70
- _sfc_main as default
69
+ f as default
71
70
  };
@@ -1,4 +1,4 @@
1
- const proPageContainer_vue_vue_type_style_index_0_lang = "";
1
+ const e = "";
2
2
  export {
3
- proPageContainer_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-page-container.vue.js";
1
+ import o from "./pro-page-container.vue.js";
2
2
  import "./pro-page-container.vue2.js";
3
3
  export {
4
- _sfc_main as default
4
+ o as default
5
5
  };
@@ -1,14 +1,12 @@
1
- import _sfc_main from "./pro-reuse-tabs.vue.js";
1
+ import o from "./pro-reuse-tabs.vue.js";
2
2
  import "./pro-reuse-tabs.vue2.js";
3
- import { Tabs } from "@arco-design/web-vue";
4
- const ProReuseTabs = Object.assign(_sfc_main, {
5
- install: (app) => {
6
- app.use(Tabs);
7
- app.component("KbProReuseTabs", _sfc_main);
3
+ import { Tabs as e } from "@arco-design/web-vue";
4
+ const t = Object.assign(o, {
5
+ install: (s) => {
6
+ s.use(e), s.component("KbProReuseTabs", o);
8
7
  }
9
- });
10
- const ProReuseTabs$1 = ProReuseTabs;
8
+ }), n = t;
11
9
  export {
12
- ProReuseTabs,
13
- ProReuseTabs$1 as default
10
+ t as ProReuseTabs,
11
+ n as default
14
12
  };
@@ -1,53 +1,46 @@
1
- import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, Fragment, renderList, createBlock } from "vue";
2
- const prefixClsName = "keyblade-pro-reuse-tabs";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as p, computed as k, resolveComponent as c, openBlock as a, createElementBlock as l, normalizeClass as y, createVNode as _, withCtx as f, Fragment as v, renderList as C, createBlock as h } from "vue";
2
+ const g = "keyblade-pro-reuse-tabs", B = /* @__PURE__ */ p({
4
3
  __name: "pro-reuse-tabs",
5
4
  props: {
6
5
  tabs: {
7
6
  type: Array,
8
- required: true,
7
+ required: !0,
9
8
  default: () => []
10
9
  }
11
10
  },
12
11
  emits: {
13
- "tab-click": (key) => true,
14
- "tab-delete": (key) => true
12
+ "tab-click": (t) => !0,
13
+ "tab-delete": (t) => !0
15
14
  },
16
- setup(__props, { emit }) {
17
- const props = __props;
18
- const activeKey = computed(() => {
19
- var _a;
20
- return ((_a = props.tabs.find((v) => v.active)) == null ? void 0 : _a.name) ?? void 0;
21
- });
22
- const onTabClick = (key) => {
23
- emit("tab-click", String(key));
15
+ setup(t, { emit: n }) {
16
+ const s = t, i = k(() => {
17
+ var e;
18
+ return ((e = s.tabs.find((o) => o.active)) == null ? void 0 : e.name) ?? void 0;
19
+ }), d = (e) => {
20
+ n("tab-click", String(e));
21
+ }, u = (e) => {
22
+ n("tab-delete", String(e));
24
23
  };
25
- const onTabDelete = (key) => {
26
- emit("tab-delete", String(key));
27
- };
28
- return (_ctx, _cache) => {
29
- const _component_a_tab_pane = resolveComponent("a-tab-pane");
30
- const _component_a_tabs = resolveComponent("a-tabs");
31
- return openBlock(), createElementBlock("div", {
32
- class: normalizeClass(prefixClsName)
24
+ return (e, o) => {
25
+ const b = c("a-tab-pane"), m = c("a-tabs");
26
+ return a(), l("div", {
27
+ class: y(g)
33
28
  }, [
34
- createVNode(_component_a_tabs, {
35
- "active-key": activeKey.value,
29
+ _(m, {
30
+ "active-key": i.value,
36
31
  size: "mini",
37
32
  type: "rounded",
38
- editable: __props.tabs.length > 1,
33
+ editable: t.tabs.length > 1,
39
34
  "hide-content": "",
40
35
  "destroy-on-hide": "",
41
- onTabClick,
42
- onDelete: onTabDelete
36
+ onTabClick: d,
37
+ onDelete: u
43
38
  }, {
44
- default: withCtx(() => [
45
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.tabs, (tab) => {
46
- return openBlock(), createBlock(_component_a_tab_pane, {
47
- key: tab.name,
48
- title: tab.title
49
- }, null, 8, ["title"]);
50
- }), 128))
39
+ default: f(() => [
40
+ (a(!0), l(v, null, C(t.tabs, (r) => (a(), h(b, {
41
+ key: r.name,
42
+ title: r.title
43
+ }, null, 8, ["title"]))), 128))
51
44
  ]),
52
45
  _: 1
53
46
  }, 8, ["active-key", "editable"])
@@ -56,5 +49,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
49
  }
57
50
  });
58
51
  export {
59
- _sfc_main as default
52
+ B as default
60
53
  };
@@ -1,4 +1,4 @@
1
- const proReuseTabs_vue_vue_type_style_index_0_lang = "";
1
+ const e = "";
2
2
  export {
3
- proReuseTabs_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-reuse-tabs.vue.js";
1
+ import o from "./pro-reuse-tabs.vue.js";
2
2
  import "./pro-reuse-tabs.vue2.js";
3
3
  export {
4
- _sfc_main as default
4
+ o as default
5
5
  };