customs-ui-kit 1.0.5 → 1.0.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.
- package/dist/customs-ui-kit.es.js +16 -13
- package/dist/customs-ui-kit.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/Button/Button.stories.ts +17 -0
- package/src/components/Button/Button.vue +3 -1
- package/src/components/Button/examples/Default.vue +9 -0
- package/src/components/Button/examples/Highlighted.vue +9 -0
- package/src/components/Select/Select.stories.ts +9 -0
- package/src/components/Select/Select.vue +3 -0
- package/src/components/Select/examples/Default.vue +22 -0
- package/src/components/Table/Table.stories.ts +9 -0
- package/src/components/Table/Table.vue +3 -0
- package/src/components/Table/examples/Default.vue +23 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".isHighlight[data-v-
|
|
2
|
-
import { defineComponent as i, openBlock as l, createBlock as s, unref as r, mergeProps as n, withCtx as d, renderSlot as u, createElementBlock as c, Fragment as f, renderList as m, createVNode as _, createSlots as
|
|
3
|
-
import { ElButton as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".isHighlight[data-v-930320b7]{box-shadow:0 0 8px #409effcc;transform:scale(1.02);transition:all .3s ease}.myTableWrapper[data-v-930831ed]{width:100%;overflow:hidden}.myTable[data-v-930831ed]{--el-table-header-bg-color: #f5f7fa}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
import { defineComponent as i, openBlock as l, createBlock as s, unref as r, mergeProps as n, withCtx as d, renderSlot as u, createElementBlock as c, Fragment as f, renderList as m, createVNode as _, createSlots as y } from "vue";
|
|
3
|
+
import { ElButton as h, ElSelect as v, ElOption as B, ElTable as g, ElTableColumn as $ } from "element-plus";
|
|
4
4
|
const k = /* @__PURE__ */ i({
|
|
5
|
+
name: "MyButton",
|
|
5
6
|
__name: "Button",
|
|
6
7
|
props: {
|
|
7
8
|
highlight: { type: Boolean }
|
|
8
9
|
},
|
|
9
10
|
setup(t) {
|
|
10
|
-
return (a, o) => (l(), s(r(
|
|
11
|
+
return (a, o) => (l(), s(r(h), n(a.$attrs, {
|
|
11
12
|
class: ["myButton", { isHighlight: t.highlight }]
|
|
12
13
|
}), {
|
|
13
14
|
default: d(() => [
|
|
@@ -21,15 +22,16 @@ const k = /* @__PURE__ */ i({
|
|
|
21
22
|
for (const [e, p] of a)
|
|
22
23
|
o[e] = p;
|
|
23
24
|
return o;
|
|
24
|
-
},
|
|
25
|
+
}, C = /* @__PURE__ */ b(k, [["__scopeId", "data-v-930320b7"]]), S = /* @__PURE__ */ i({
|
|
26
|
+
name: "MySelect",
|
|
25
27
|
__name: "Select",
|
|
26
28
|
props: {
|
|
27
29
|
options: {}
|
|
28
30
|
},
|
|
29
31
|
setup(t) {
|
|
30
|
-
return (a, o) => (l(), s(r(
|
|
32
|
+
return (a, o) => (l(), s(r(v), n(a.$attrs, { class: "mySelect" }), {
|
|
31
33
|
default: d(() => [
|
|
32
|
-
t.options && t.options.length ? (l(!0), c(f, { key: 0 }, m(t.options, (e) => (l(), s(r(
|
|
34
|
+
t.options && t.options.length ? (l(!0), c(f, { key: 0 }, m(t.options, (e) => (l(), s(r(B), {
|
|
33
35
|
key: e.value,
|
|
34
36
|
label: e.label,
|
|
35
37
|
value: e.value,
|
|
@@ -39,7 +41,8 @@ const k = /* @__PURE__ */ i({
|
|
|
39
41
|
_: 3
|
|
40
42
|
}, 16));
|
|
41
43
|
}
|
|
42
|
-
}),
|
|
44
|
+
}), I = /* @__PURE__ */ b(S, [["__scopeId", "data-v-baf73093"]]), T = { class: "myTableWrapper" }, E = /* @__PURE__ */ i({
|
|
45
|
+
name: "MyTable",
|
|
43
46
|
__name: "Table",
|
|
44
47
|
props: {
|
|
45
48
|
data: { default: () => [] },
|
|
@@ -48,7 +51,7 @@ const k = /* @__PURE__ */ i({
|
|
|
48
51
|
},
|
|
49
52
|
setup(t) {
|
|
50
53
|
return (a, o) => (l(), c("div", T, [
|
|
51
|
-
_(r(
|
|
54
|
+
_(r(g), n({
|
|
52
55
|
data: t.data,
|
|
53
56
|
border: t.border
|
|
54
57
|
}, a.$attrs, { class: "myTable" }), {
|
|
@@ -59,7 +62,7 @@ const k = /* @__PURE__ */ i({
|
|
|
59
62
|
label: e.label,
|
|
60
63
|
width: e.width,
|
|
61
64
|
sortable: e.sortable
|
|
62
|
-
},
|
|
65
|
+
}, y({ _: 2 }, [
|
|
63
66
|
a.$slots[e.prop] ? {
|
|
64
67
|
name: "default",
|
|
65
68
|
fn: d((p) => [
|
|
@@ -74,9 +77,9 @@ const k = /* @__PURE__ */ i({
|
|
|
74
77
|
}, 16, ["data", "border"])
|
|
75
78
|
]));
|
|
76
79
|
}
|
|
77
|
-
}), O = /* @__PURE__ */ b(E, [["__scopeId", "data-v-
|
|
80
|
+
}), O = /* @__PURE__ */ b(E, [["__scopeId", "data-v-930831ed"]]);
|
|
78
81
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
C as MyButton,
|
|
83
|
+
I as MySelect,
|
|
81
84
|
O as MyTable
|
|
82
85
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".isHighlight[data-v-
|
|
2
|
-
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.CustomsUIKit={},r.Vue,r.ElementPlus))})(this,(function(r,e,l){"use strict";const c=e.defineComponent({__name:"Button",props:{highlight:{type:Boolean}},setup(o){return(n,a)=>(e.openBlock(),e.createBlock(e.unref(l.ElButton),e.mergeProps(n.$attrs,{class:["myButton",{isHighlight:o.highlight}]}),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},16,["class"]))}}),s=(o,n)=>{const a=o.__vccOpts||o;for(const[t,d]of n)a[t]=d;return a},i=s(c,[["__scopeId","data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".isHighlight[data-v-930320b7]{box-shadow:0 0 8px #409effcc;transform:scale(1.02);transition:all .3s ease}.myTableWrapper[data-v-930831ed]{width:100%;overflow:hidden}.myTable[data-v-930831ed]{--el-table-header-bg-color: #f5f7fa}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.CustomsUIKit={},r.Vue,r.ElementPlus))})(this,(function(r,e,l){"use strict";const c=e.defineComponent({name:"MyButton",__name:"Button",props:{highlight:{type:Boolean}},setup(o){return(n,a)=>(e.openBlock(),e.createBlock(e.unref(l.ElButton),e.mergeProps(n.$attrs,{class:["myButton",{isHighlight:o.highlight}]}),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},16,["class"]))}}),s=(o,n)=>{const a=o.__vccOpts||o;for(const[t,d]of n)a[t]=d;return a},i=s(c,[["__scopeId","data-v-930320b7"]]),p=s(e.defineComponent({name:"MySelect",__name:"Select",props:{options:{}},setup(o){return(n,a)=>(e.openBlock(),e.createBlock(e.unref(l.ElSelect),e.mergeProps(n.$attrs,{class:"mySelect"}),{default:e.withCtx(()=>[o.options&&o.options.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.options,t=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:t.value,label:t.label,value:t.value,disabled:t.disabled},null,8,["label","value","disabled"]))),128)):e.renderSlot(n.$slots,"default",{key:1},void 0,!0)]),_:3},16))}}),[["__scopeId","data-v-baf73093"]]),f={class:"myTableWrapper"},m=s(e.defineComponent({name:"MyTable",__name:"Table",props:{data:{default:()=>[]},columns:{default:()=>[]},border:{type:Boolean,default:!0}},setup(o){return(n,a)=>(e.openBlock(),e.createElementBlock("div",f,[e.createVNode(e.unref(l.ElTable),e.mergeProps({data:o.data,border:o.border},n.$attrs,{class:"myTable"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,t=>(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:t.prop,prop:t.prop,label:t.label,width:t.width,sortable:t.sortable},e.createSlots({_:2},[n.$slots[t.prop]?{name:"default",fn:e.withCtx(d=>[e.renderSlot(n.$slots,t.prop,e.mergeProps({ref_for:!0},d),void 0,!0)]),key:"0"}:void 0]),1032,["prop","label","width","sortable"]))),128)),e.renderSlot(n.$slots,"append",{},void 0,!0)]),_:3},16,["data","border"])]))}}),[["__scopeId","data-v-930831ed"]]);r.MyButton=i,r.MySelect=p,r.MyTable=m,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
2
|
import { MyButton } from './index';
|
|
3
3
|
|
|
4
|
+
import DefaultExampleCode from './examples/Default.vue?raw';
|
|
5
|
+
import HighlightedExampleCode from './examples/Highlighted.vue?raw';
|
|
6
|
+
|
|
4
7
|
const meta = {
|
|
5
8
|
title: 'Components/MyButton',
|
|
6
9
|
component: MyButton,
|
|
@@ -34,6 +37,13 @@ export const Default: Story = {
|
|
|
34
37
|
},
|
|
35
38
|
template: '<my-button v-bind="args">{{ args.default }}</my-button>',
|
|
36
39
|
}),
|
|
40
|
+
parameters: {
|
|
41
|
+
docs: {
|
|
42
|
+
source: {
|
|
43
|
+
code: DefaultExampleCode
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
37
47
|
};
|
|
38
48
|
|
|
39
49
|
export const Highlighted: Story = {
|
|
@@ -49,4 +59,11 @@ export const Highlighted: Story = {
|
|
|
49
59
|
},
|
|
50
60
|
template: '<my-button v-bind="args">{{ args.default }}</my-button>',
|
|
51
61
|
}),
|
|
62
|
+
parameters: {
|
|
63
|
+
docs: {
|
|
64
|
+
source: {
|
|
65
|
+
code: HighlightedExampleCode
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
52
69
|
};
|
|
@@ -2,6 +2,8 @@ import type { Meta, StoryObj } from '@storybook/vue3';
|
|
|
2
2
|
import { MySelect } from './index';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
4
|
|
|
5
|
+
import DefaultExampleCode from './examples/Default.vue?raw';
|
|
6
|
+
|
|
5
7
|
const meta = {
|
|
6
8
|
title: 'Components/MySelect',
|
|
7
9
|
component: MySelect,
|
|
@@ -37,4 +39,11 @@ export const Default: Story = {
|
|
|
37
39
|
},
|
|
38
40
|
template: '<my-select v-model="value" v-bind="args" style="width: 240px" />',
|
|
39
41
|
}),
|
|
42
|
+
parameters: {
|
|
43
|
+
docs: {
|
|
44
|
+
source: {
|
|
45
|
+
code: DefaultExampleCode
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
40
49
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<my-select
|
|
3
|
+
v-model="value"
|
|
4
|
+
:clearable="true"
|
|
5
|
+
placeholder="请选择"
|
|
6
|
+
:options="options"
|
|
7
|
+
style="width: 240px"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { ref } from 'vue';
|
|
13
|
+
import { MySelect } from 'customs-ui-kit';
|
|
14
|
+
|
|
15
|
+
const value = ref('');
|
|
16
|
+
|
|
17
|
+
const options = [
|
|
18
|
+
{ label: '选项一', value: '1' },
|
|
19
|
+
{ label: '选项二', value: '2' },
|
|
20
|
+
{ label: '选项三', value: '3', disabled: true },
|
|
21
|
+
];
|
|
22
|
+
</script>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
2
|
import { MyTable } from './index';
|
|
3
3
|
|
|
4
|
+
import DefaultExampleCode from './examples/Default.vue?raw';
|
|
5
|
+
|
|
4
6
|
const meta = {
|
|
5
7
|
title: 'Components/MyTable',
|
|
6
8
|
component: MyTable,
|
|
@@ -46,4 +48,11 @@ export const Default: Story = {
|
|
|
46
48
|
},
|
|
47
49
|
template: '<my-table v-bind="args" />',
|
|
48
50
|
}),
|
|
51
|
+
parameters: {
|
|
52
|
+
docs: {
|
|
53
|
+
source: {
|
|
54
|
+
code: DefaultExampleCode
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
49
58
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<my-table
|
|
3
|
+
:border="true"
|
|
4
|
+
:columns="columns"
|
|
5
|
+
:data="data"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { MyTable } from 'customs-ui-kit';
|
|
11
|
+
|
|
12
|
+
const columns = [
|
|
13
|
+
{ prop: 'date', label: 'Date', width: '180' },
|
|
14
|
+
{ prop: 'name', label: 'Name', width: '180' },
|
|
15
|
+
{ prop: 'address', label: 'Address' },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const data = [
|
|
19
|
+
{ date: '2026-05-03', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
20
|
+
{ date: '2026-05-02', name: 'John', address: 'No. 189, Grove St, Los Angeles' },
|
|
21
|
+
{ date: '2026-05-04', name: 'Morgan', address: 'No. 189, Grove St, Los Angeles' },
|
|
22
|
+
];
|
|
23
|
+
</script>
|