customs-ui-kit 1.0.4 → 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 +17 -13
- package/dist/customs-ui-kit.umd.js +2 -2
- package/package.json +2 -2
- 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
- package/dist/index.css +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
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
|
+
const k = /* @__PURE__ */ i({
|
|
5
|
+
name: "MyButton",
|
|
4
6
|
__name: "Button",
|
|
5
7
|
props: {
|
|
6
8
|
highlight: { type: Boolean }
|
|
7
9
|
},
|
|
8
10
|
setup(t) {
|
|
9
|
-
return (a, o) => (l(), s(r(
|
|
11
|
+
return (a, o) => (l(), s(r(h), n(a.$attrs, {
|
|
10
12
|
class: ["myButton", { isHighlight: t.highlight }]
|
|
11
13
|
}), {
|
|
12
14
|
default: d(() => [
|
|
@@ -20,15 +22,16 @@ import './index.css';const k = /* @__PURE__ */ i({
|
|
|
20
22
|
for (const [e, p] of a)
|
|
21
23
|
o[e] = p;
|
|
22
24
|
return o;
|
|
23
|
-
},
|
|
25
|
+
}, C = /* @__PURE__ */ b(k, [["__scopeId", "data-v-930320b7"]]), S = /* @__PURE__ */ i({
|
|
26
|
+
name: "MySelect",
|
|
24
27
|
__name: "Select",
|
|
25
28
|
props: {
|
|
26
29
|
options: {}
|
|
27
30
|
},
|
|
28
31
|
setup(t) {
|
|
29
|
-
return (a, o) => (l(), s(r(
|
|
32
|
+
return (a, o) => (l(), s(r(v), n(a.$attrs, { class: "mySelect" }), {
|
|
30
33
|
default: d(() => [
|
|
31
|
-
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), {
|
|
32
35
|
key: e.value,
|
|
33
36
|
label: e.label,
|
|
34
37
|
value: e.value,
|
|
@@ -38,7 +41,8 @@ import './index.css';const k = /* @__PURE__ */ i({
|
|
|
38
41
|
_: 3
|
|
39
42
|
}, 16));
|
|
40
43
|
}
|
|
41
|
-
}),
|
|
44
|
+
}), I = /* @__PURE__ */ b(S, [["__scopeId", "data-v-baf73093"]]), T = { class: "myTableWrapper" }, E = /* @__PURE__ */ i({
|
|
45
|
+
name: "MyTable",
|
|
42
46
|
__name: "Table",
|
|
43
47
|
props: {
|
|
44
48
|
data: { default: () => [] },
|
|
@@ -47,7 +51,7 @@ import './index.css';const k = /* @__PURE__ */ i({
|
|
|
47
51
|
},
|
|
48
52
|
setup(t) {
|
|
49
53
|
return (a, o) => (l(), c("div", T, [
|
|
50
|
-
_(r(
|
|
54
|
+
_(r(g), n({
|
|
51
55
|
data: t.data,
|
|
52
56
|
border: t.border
|
|
53
57
|
}, a.$attrs, { class: "myTable" }), {
|
|
@@ -58,7 +62,7 @@ import './index.css';const k = /* @__PURE__ */ i({
|
|
|
58
62
|
label: e.label,
|
|
59
63
|
width: e.width,
|
|
60
64
|
sortable: e.sortable
|
|
61
|
-
},
|
|
65
|
+
}, y({ _: 2 }, [
|
|
62
66
|
a.$slots[e.prop] ? {
|
|
63
67
|
name: "default",
|
|
64
68
|
fn: d((p) => [
|
|
@@ -73,9 +77,9 @@ import './index.css';const k = /* @__PURE__ */ i({
|
|
|
73
77
|
}, 16, ["data", "border"])
|
|
74
78
|
]));
|
|
75
79
|
}
|
|
76
|
-
}), O = /* @__PURE__ */ b(E, [["__scopeId", "data-v-
|
|
80
|
+
}), O = /* @__PURE__ */ b(E, [["__scopeId", "data-v-930831ed"]]);
|
|
77
81
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
C as MyButton,
|
|
83
|
+
I as MySelect,
|
|
80
84
|
O as MyTable
|
|
81
85
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "customs-ui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"main": "dist/customs-ui-kit.umd.js",
|
|
5
5
|
"module": "dist/customs-ui-kit.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"ts-node": "^10.9.2",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vite": "^7.3.1",
|
|
49
|
-
"vite-plugin-
|
|
49
|
+
"vite-plugin-css-injected-by-js": "^4.0.1",
|
|
50
50
|
"vue-tsc": "^3.2.5"
|
|
51
51
|
},
|
|
52
52
|
"description": ""
|
|
@@ -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>
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.isHighlight[data-v-ae952d65]{box-shadow:0 0 8px #409effcc;transform:scale(1.02);transition:all .3s ease}.myTableWrapper[data-v-160d151c]{width:100%;overflow:hidden}.myTable[data-v-160d151c]{--el-table-header-bg-color: #f5f7fa}
|