@keyblade/pro-components 0.0.1-alpha.3 → 0.0.1-alpha.4
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/es/pro-reuse-tabs/index.js +4 -3
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +55 -5
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue2.js +2 -55
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue3.js +4 -2
- package/es/style.css +1 -1
- package/package.json +1 -1
- package/es/_virtual/_plugin-vue_export-helper.js +0 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _sfc_main from "./pro-reuse-tabs.vue.js";
|
|
2
|
+
import "./pro-reuse-tabs.vue2.js";
|
|
2
3
|
import { Tabs } from "@arco-design/web-vue";
|
|
3
|
-
const ProReuseTabs = Object.assign(
|
|
4
|
+
const ProReuseTabs = Object.assign(_sfc_main, {
|
|
4
5
|
install: (app) => {
|
|
5
6
|
app.use(Tabs);
|
|
6
|
-
app.component("KbProReuseTabs",
|
|
7
|
+
app.component("KbProReuseTabs", _sfc_main);
|
|
7
8
|
}
|
|
8
9
|
});
|
|
9
10
|
export {
|
|
@@ -1,7 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, unref, withCtx, Fragment, renderList, createBlock } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "pro-reuse-tabs",
|
|
4
|
+
props: {
|
|
5
|
+
tabs: {
|
|
6
|
+
type: Array,
|
|
7
|
+
required: true,
|
|
8
|
+
default: () => []
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
emits: ["tab-click", "tab-delete"],
|
|
12
|
+
setup(__props, { emit }) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const prefixClsName = "keyblade-pro-reuse-tabs";
|
|
15
|
+
const activeKey = computed(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = props.tabs.find((v) => v.active)) == null ? void 0 : _a.name) ?? void 0;
|
|
18
|
+
});
|
|
19
|
+
const onTabClick = (key) => {
|
|
20
|
+
emit("tab-click", String(key));
|
|
21
|
+
};
|
|
22
|
+
const onTabDelete = (key) => {
|
|
23
|
+
emit("tab-delete", String(key));
|
|
24
|
+
};
|
|
25
|
+
return (_ctx, _cache) => {
|
|
26
|
+
const _component_a_tab_pane = resolveComponent("a-tab-pane");
|
|
27
|
+
const _component_a_tabs = resolveComponent("a-tabs");
|
|
28
|
+
return openBlock(), createElementBlock("div", {
|
|
29
|
+
class: normalizeClass(prefixClsName)
|
|
30
|
+
}, [
|
|
31
|
+
createVNode(_component_a_tabs, {
|
|
32
|
+
"active-key": unref(activeKey),
|
|
33
|
+
size: "mini",
|
|
34
|
+
type: "rounded",
|
|
35
|
+
editable: __props.tabs.length > 1,
|
|
36
|
+
"hide-content": "",
|
|
37
|
+
"destroy-on-hide": "",
|
|
38
|
+
onTabClick,
|
|
39
|
+
onDelete: onTabDelete
|
|
40
|
+
}, {
|
|
41
|
+
default: withCtx(() => [
|
|
42
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tabs, (tab) => {
|
|
43
|
+
return openBlock(), createBlock(_component_a_tab_pane, {
|
|
44
|
+
key: tab.name,
|
|
45
|
+
title: tab.title
|
|
46
|
+
}, null, 8, ["title"]);
|
|
47
|
+
}), 128))
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["active-key", "editable"])
|
|
51
|
+
]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
5
55
|
export {
|
|
6
|
-
|
|
56
|
+
_sfc_main as default
|
|
7
57
|
};
|
|
@@ -1,57 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
-
__name: "pro-reuse-tabs",
|
|
4
|
-
props: {
|
|
5
|
-
tabs: {
|
|
6
|
-
type: Array,
|
|
7
|
-
required: true,
|
|
8
|
-
default: () => []
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
emits: ["tab-click", "tab-delete"],
|
|
12
|
-
setup(__props, { emit }) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const prefixClsName = "keyblade-pro-reuse-tabs";
|
|
15
|
-
const activeKey = computed(() => {
|
|
16
|
-
var _a;
|
|
17
|
-
return ((_a = props.tabs.find((v) => v.active)) == null ? void 0 : _a.name) ?? void 0;
|
|
18
|
-
});
|
|
19
|
-
const onTabClick = (key) => {
|
|
20
|
-
emit("tab-click", String(key));
|
|
21
|
-
};
|
|
22
|
-
const onTabDelete = (key) => {
|
|
23
|
-
emit("tab-delete", String(key));
|
|
24
|
-
};
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
const _component_a_tab_pane = resolveComponent("a-tab-pane");
|
|
27
|
-
const _component_a_tabs = resolveComponent("a-tabs");
|
|
28
|
-
return openBlock(), createElementBlock("div", {
|
|
29
|
-
class: normalizeClass(prefixClsName)
|
|
30
|
-
}, [
|
|
31
|
-
createVNode(_component_a_tabs, {
|
|
32
|
-
"active-key": unref(activeKey),
|
|
33
|
-
size: "mini",
|
|
34
|
-
type: "rounded",
|
|
35
|
-
editable: __props.tabs.length > 1,
|
|
36
|
-
"hide-content": "",
|
|
37
|
-
"destroy-on-hide": "",
|
|
38
|
-
onTabClick,
|
|
39
|
-
onDelete: onTabDelete
|
|
40
|
-
}, {
|
|
41
|
-
default: withCtx(() => [
|
|
42
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tabs, (tab) => {
|
|
43
|
-
return openBlock(), createBlock(_component_a_tab_pane, {
|
|
44
|
-
key: tab.name,
|
|
45
|
-
title: tab.title
|
|
46
|
-
}, null, 8, ["title"]);
|
|
47
|
-
}), 128))
|
|
48
|
-
]),
|
|
49
|
-
_: 1
|
|
50
|
-
}, 8, ["active-key", "editable"])
|
|
51
|
-
]);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
1
|
+
const proReuseTabs_vue_vue_type_style_index_0_lang = "";
|
|
55
2
|
export {
|
|
56
|
-
|
|
3
|
+
proReuseTabs_vue_vue_type_style_index_0_lang as default
|
|
57
4
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import _sfc_main from "./pro-reuse-tabs.vue.js";
|
|
2
|
+
import { default as default2 } from "./pro-reuse-tabs.vue.js";
|
|
3
|
+
import "./pro-reuse-tabs.vue2.js";
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
default2 as default
|
|
4
6
|
};
|
package/es/style.css
CHANGED
package/package.json
CHANGED