customs-ui-kit 1.0.1 → 1.0.2
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.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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}
|
|
@@ -1,76 +1,62 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElButton as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as i, openBlock as o, createBlock as c, unref as s, mergeProps as n, withCtx as d, renderSlot as u, createElementBlock as p, createVNode as f, Fragment as b, renderList as _, createSlots as h } from "vue";
|
|
2
|
+
import { ElButton as y, ElTable as B, ElTableColumn as g } from "element-plus";
|
|
3
|
+
const v = /* @__PURE__ */ i({
|
|
4
4
|
__name: "Button",
|
|
5
5
|
props: {
|
|
6
6
|
highlight: { type: Boolean }
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
return (e,
|
|
10
|
-
class: [
|
|
8
|
+
setup(r) {
|
|
9
|
+
return (e, a) => (o(), c(s(y), n(e.$attrs, {
|
|
10
|
+
class: ["myButton", { isHighlight: r.highlight }]
|
|
11
11
|
}), {
|
|
12
|
-
default:
|
|
13
|
-
u(e.$slots, "default")
|
|
12
|
+
default: d(() => [
|
|
13
|
+
u(e.$slots, "default", {}, void 0, !0)
|
|
14
14
|
]),
|
|
15
15
|
_: 3
|
|
16
16
|
}, 16, ["class"]));
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
l[t] = a;
|
|
25
|
-
return l;
|
|
26
|
-
}, v = {
|
|
27
|
-
$style: M
|
|
28
|
-
}, L = /* @__PURE__ */ c(T, [["__cssModules", v]]), C = /* @__PURE__ */ d({
|
|
18
|
+
}), m = (r, e) => {
|
|
19
|
+
const a = r.__vccOpts || r;
|
|
20
|
+
for (const [t, l] of e)
|
|
21
|
+
a[t] = l;
|
|
22
|
+
return a;
|
|
23
|
+
}, E = /* @__PURE__ */ m(v, [["__scopeId", "data-v-ae952d65"]]), T = { class: "myTableWrapper" }, $ = /* @__PURE__ */ i({
|
|
29
24
|
__name: "Table",
|
|
30
25
|
props: {
|
|
31
26
|
data: { default: () => [] },
|
|
32
27
|
columns: { default: () => [] },
|
|
33
28
|
border: { type: Boolean, default: !0 }
|
|
34
29
|
},
|
|
35
|
-
setup(
|
|
36
|
-
return (e,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class: e.$style.myTable
|
|
44
|
-
}), {
|
|
45
|
-
default: p(() => [
|
|
46
|
-
(o(!0), i(_, null, h(s.columns, (t) => (o(), m(r(B), {
|
|
30
|
+
setup(r) {
|
|
31
|
+
return (e, a) => (o(), p("div", T, [
|
|
32
|
+
f(s(B), n({
|
|
33
|
+
data: r.data,
|
|
34
|
+
border: r.border
|
|
35
|
+
}, e.$attrs, { class: "myTable" }), {
|
|
36
|
+
default: d(() => [
|
|
37
|
+
(o(!0), p(b, null, _(r.columns, (t) => (o(), c(s(g), {
|
|
47
38
|
key: t.prop,
|
|
48
39
|
prop: t.prop,
|
|
49
40
|
label: t.label,
|
|
50
41
|
width: t.width,
|
|
51
42
|
sortable: t.sortable
|
|
52
|
-
},
|
|
43
|
+
}, h({ _: 2 }, [
|
|
53
44
|
e.$slots[t.prop] ? {
|
|
54
45
|
name: "default",
|
|
55
|
-
fn:
|
|
56
|
-
u(e.$slots, t.prop, n({ ref_for: !0 },
|
|
46
|
+
fn: d((l) => [
|
|
47
|
+
u(e.$slots, t.prop, n({ ref_for: !0 }, l), void 0, !0)
|
|
57
48
|
]),
|
|
58
49
|
key: "0"
|
|
59
50
|
} : void 0
|
|
60
51
|
]), 1032, ["prop", "label", "width", "sortable"]))), 128)),
|
|
61
|
-
u(e.$slots, "append")
|
|
52
|
+
u(e.$slots, "append", {}, void 0, !0)
|
|
62
53
|
]),
|
|
63
54
|
_: 3
|
|
64
|
-
}, 16, ["data", "border"
|
|
65
|
-
]
|
|
55
|
+
}, 16, ["data", "border"])
|
|
56
|
+
]));
|
|
66
57
|
}
|
|
67
|
-
}),
|
|
68
|
-
myTableWrapper: E,
|
|
69
|
-
myTable: H
|
|
70
|
-
}, S = {
|
|
71
|
-
$style: W
|
|
72
|
-
}, N = /* @__PURE__ */ c(C, [["__cssModules", S]]);
|
|
58
|
+
}), C = /* @__PURE__ */ m($, [["__scopeId", "data-v-160d151c"]]);
|
|
73
59
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
E as MyButton,
|
|
61
|
+
C as MyTable
|
|
76
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,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):(t=typeof globalThis<"u"?globalThis:t||self,e(t.CustomsUIKit={},t.Vue,t.ElementPlus))})(this,(function(t,e,l){"use strict";const i=e.defineComponent({__name:"Button",props:{highlight:{type:Boolean}},setup(n){return(o,a)=>(e.openBlock(),e.createBlock(e.unref(l.ElButton),e.mergeProps(o.$attrs,{class:["myButton",{isHighlight:n.highlight}]}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},16,["class"]))}}),d=(n,o)=>{const a=n.__vccOpts||n;for(const[r,s]of o)a[r]=s;return a},p=d(i,[["__scopeId","data-v-ae952d65"]]),c={class:"myTableWrapper"},f=d(e.defineComponent({__name:"Table",props:{data:{default:()=>[]},columns:{default:()=>[]},border:{type:Boolean,default:!0}},setup(n){return(o,a)=>(e.openBlock(),e.createElementBlock("div",c,[e.createVNode(e.unref(l.ElTable),e.mergeProps({data:n.data,border:n.border},o.$attrs,{class:"myTable"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,r=>(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:r.prop,prop:r.prop,label:r.label,width:r.width,sortable:r.sortable},e.createSlots({_:2},[o.$slots[r.prop]?{name:"default",fn:e.withCtx(s=>[e.renderSlot(o.$slots,r.prop,e.mergeProps({ref_for:!0},s),void 0,!0)]),key:"0"}:void 0]),1032,["prop","label","width","sortable"]))),128)),e.renderSlot(o.$slots,"append",{},void 0,!0)]),_:3},16,["data","border"])]))}}),[["__scopeId","data-v-160d151c"]]);t.MyButton=p,t.MyTable=f,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ElButton } from 'element-plus';
|
|
3
3
|
import type { ButtonProps as ElButtonProps } from 'element-plus';
|
|
4
|
-
import { useCssModule } from 'vue';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* 自定义按钮组件属性 (继承并扩展 Element Plus)
|
|
@@ -18,12 +17,12 @@ defineProps<MyButtonProps>();
|
|
|
18
17
|
</script>
|
|
19
18
|
|
|
20
19
|
<template>
|
|
21
|
-
<el-button v-bind="$attrs"
|
|
20
|
+
<el-button v-bind="$attrs" class="myButton" :class="{ 'isHighlight': highlight }">
|
|
22
21
|
<slot />
|
|
23
22
|
</el-button>
|
|
24
23
|
</template>
|
|
25
24
|
|
|
26
|
-
<style
|
|
25
|
+
<style scoped>
|
|
27
26
|
.myButton {
|
|
28
27
|
/* 在这里可以添加基础的自定义样式 */
|
|
29
28
|
}
|
|
@@ -45,8 +45,8 @@ withDefaults(defineProps<MyTableProps>(), {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
|
-
<div
|
|
49
|
-
<el-table :data="data" :border="border" v-bind="$attrs"
|
|
48
|
+
<div class="myTableWrapper">
|
|
49
|
+
<el-table :data="data" :border="border" v-bind="$attrs" class="myTable">
|
|
50
50
|
<el-table-column
|
|
51
51
|
v-for="col in columns"
|
|
52
52
|
:key="col.prop"
|
|
@@ -67,7 +67,7 @@ withDefaults(defineProps<MyTableProps>(), {
|
|
|
67
67
|
</div>
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
|
-
<style
|
|
70
|
+
<style scoped>
|
|
71
71
|
.myTableWrapper {
|
|
72
72
|
width: 100%;
|
|
73
73
|
overflow: hidden;
|