@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.
@@ -1,9 +1,10 @@
1
- import _ProReuseTabs from "./pro-reuse-tabs.vue.js";
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(_ProReuseTabs, {
4
+ const ProReuseTabs = Object.assign(_sfc_main, {
4
5
  install: (app) => {
5
6
  app.use(Tabs);
6
- app.component("KbProReuseTabs", _ProReuseTabs);
7
+ app.component("KbProReuseTabs", _sfc_main);
7
8
  }
8
9
  });
9
10
  export {
@@ -1,7 +1,57 @@
1
- import _sfc_main from "./pro-reuse-tabs.vue2.js";
2
- import "./pro-reuse-tabs.vue3.js";
3
- import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _ProReuseTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-65af5f68"]]);
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
- _ProReuseTabs as default
56
+ _sfc_main as default
7
57
  };
@@ -1,57 +1,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
- });
1
+ const proReuseTabs_vue_vue_type_style_index_0_lang = "";
55
2
  export {
56
- _sfc_main as default
3
+ proReuseTabs_vue_vue_type_style_index_0_lang as default
57
4
  };
@@ -1,4 +1,6 @@
1
- const proReuseTabs_vue_vue_type_style_index_0_scoped_65af5f68_lang = "";
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
- proReuseTabs_vue_vue_type_style_index_0_scoped_65af5f68_lang as default
5
+ default2 as default
4
6
  };
package/es/style.css CHANGED
@@ -1,4 +1,4 @@
1
- .keyblade-pro-reuse-tabs[data-v-65af5f68] {
1
+ .keyblade-pro-reuse-tabs {
2
2
  position: relative;
3
3
  background-color: var(--color-bg-2);
4
4
  padding: 4px 20px;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keyblade/pro-components",
3
3
  "description": "KeyBlade Pro Components",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "0.0.1-alpha.3",
5
+ "version": "0.0.1-alpha.4",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",
@@ -1,10 +0,0 @@
1
- const _export_sfc = (sfc, props) => {
2
- const target = sfc.__vccOpts || sfc;
3
- for (const [key, val] of props) {
4
- target[key] = val;
5
- }
6
- return target;
7
- };
8
- export {
9
- _export_sfc as default
10
- };