@cghbcf/xp-ui 1.0.0
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/style.css +1 -0
- package/dist/xp-ui.cjs.js +1 -0
- package/dist/xp-ui.es.js +274 -0
- package/package.json +41 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;color:#303133;background-color:#f2f3f5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100vh}input,button,textarea,select{font-family:inherit;font-size:inherit;line-height:inherit}button{border:none;background:none;cursor:pointer}input[type=text],input[type=password],input[type=number],textarea{-moz-appearance:none;appearance:none;-webkit-appearance:none}a{color:#409eff;text-decoration:none}a:hover{text-decoration:underline}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}img{max-width:100%;vertical-align:middle}.xp-button[data-v-8bb35629]{display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;font-size:14px;font-weight:500;border:none;border-radius:4px;cursor:pointer;transition:all .2s ease;outline:none}.xp-button[data-v-8bb35629]:focus{outline:none}.xp-button--primary[data-v-8bb35629]{background-color:#409eff;color:#fff}.xp-button--primary[data-v-8bb35629]:hover:not(:disabled){background-color:#66b1ff}.xp-button--primary[data-v-8bb35629]:active:not(:disabled){background-color:#3a8ee6}.xp-button--default[data-v-8bb35629]{background-color:#fff;color:#606266;border:1px solid #dcdfe6}.xp-button--default[data-v-8bb35629]:hover:not(:disabled){color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.xp-button--default[data-v-8bb35629]:active:not(:disabled){border-color:#409eff}.xp-button--success[data-v-8bb35629]{background-color:#67c23a;color:#fff}.xp-button--success[data-v-8bb35629]:hover:not(:disabled){background-color:#85ce61}.xp-button--success[data-v-8bb35629]:active:not(:disabled){background-color:#5daf34}.xp-button--warning[data-v-8bb35629]{background-color:#e6a23c;color:#fff}.xp-button--warning[data-v-8bb35629]:hover:not(:disabled){background-color:#ebb563}.xp-button--warning[data-v-8bb35629]:active:not(:disabled){background-color:#cf9236}.xp-button--danger[data-v-8bb35629]{background-color:#f56c6c;color:#fff}.xp-button--danger[data-v-8bb35629]:hover:not(:disabled){background-color:#f78989}.xp-button--danger[data-v-8bb35629]:active:not(:disabled){background-color:#e45656}.xp-button--small[data-v-8bb35629]{padding:4px 12px;font-size:12px}.xp-button--medium[data-v-8bb35629]{padding:8px 16px;font-size:14px}.xp-button--large[data-v-8bb35629]{padding:12px 24px;font-size:16px}.xp-button--disabled[data-v-8bb35629],.xp-button--loading[data-v-8bb35629]{cursor:not-allowed;opacity:.6}.xp-button__loading[data-v-8bb35629]{width:14px;height:14px;border:2px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#fff;animation:spin-8bb35629 .6s linear infinite;margin-right:6px}.xp-button--default .xp-button__loading[data-v-8bb35629]{border-color:#6062664d;border-top-color:#606266}.xp-button__text[data-v-8bb35629]{display:inline-flex;align-items:center}@keyframes spin-8bb35629{to{transform:rotate(360deg)}}.xp-input[data-v-d69c9b60]{position:relative;display:inline-flex;align-items:center;width:100%;max-width:320px}.xp-input__inner[data-v-d69c9b60]{width:100%;height:40px;padding:0 15px;font-size:14px;color:#303133;background-color:#fff;border:1px solid #dcdfe6;border-radius:4px;outline:none;transition:all .2s ease}.xp-input__inner[data-v-d69c9b60]:focus{border-color:#409eff;box-shadow:0 0 0 2px #409eff1a}.xp-input__inner[data-v-d69c9b60]::placeholder{color:#c0c4cc}.xp-input--small .xp-input__inner[data-v-d69c9b60]{height:32px;padding:0 12px;font-size:12px}.xp-input--medium .xp-input__inner[data-v-d69c9b60]{height:40px;padding:0 15px;font-size:14px}.xp-input--large .xp-input__inner[data-v-d69c9b60]{height:48px;padding:0 15px;font-size:16px}.xp-input--disabled .xp-input__inner[data-v-d69c9b60]{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.xp-input--prefix .xp-input__inner[data-v-d69c9b60]{padding-left:35px}.xp-input--suffix .xp-input__inner[data-v-d69c9b60]{padding-right:35px}.xp-input__prefix[data-v-d69c9b60],.xp-input__suffix[data-v-d69c9b60]{position:absolute;width:25px;height:100%;display:flex;align-items:center;justify-content:center;color:#909399;font-size:14px}.xp-input__prefix[data-v-d69c9b60]{left:0}.xp-input__suffix[data-v-d69c9b60]{right:0}.xp-card[data-v-60989cba]{background-color:#fff;border-radius:4px;border:1px solid #ebeef5;overflow:hidden;transition:box-shadow .2s ease}.xp-card--always[data-v-60989cba]{box-shadow:0 2px 12px #0000001a}.xp-card--hover[data-v-60989cba]{box-shadow:none}.xp-card--hover[data-v-60989cba]:hover{box-shadow:0 2px 12px #0000001a}.xp-card--never[data-v-60989cba]{box-shadow:none}.xp-card__header[data-v-60989cba]{padding:18px 20px;border-bottom:1px solid #ebeef5;box-sizing:border-box}.xp-card__title[data-v-60989cba]{margin:0;font-size:16px;font-weight:600;color:#303133}.xp-card__body[data-v-60989cba]{padding:20px;color:#606266;font-size:14px;line-height:1.8}.xp-card__footer[data-v-60989cba]{padding:18px 20px;border-top:1px solid #ebeef5;box-sizing:border-box}.xp-dialog__wrapper[data-v-7015aab1]{position:fixed;top:0;left:0;right:0;bottom:0;z-index:2000;display:flex;align-items:center;justify-content:center}.xp-dialog__mask[data-v-7015aab1]{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#00000080}.xp-dialog[data-v-7015aab1]{position:relative;background-color:#fff;border-radius:4px;box-shadow:0 2px 12px #0000001a;width:500px;margin:0 auto;overflow:hidden}.xp-dialog__header[data-v-7015aab1]{padding:18px 20px;border-bottom:1px solid #ebeef5;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box}.xp-dialog__title[data-v-7015aab1]{margin:0;font-size:16px;font-weight:600;color:#303133}.xp-dialog__close[data-v-7015aab1]{background:none;border:none;font-size:24px;color:#909399;cursor:pointer;padding:0;line-height:1;transition:color .2s ease}.xp-dialog__close[data-v-7015aab1]:hover{color:#606266}.xp-dialog__body[data-v-7015aab1]{padding:20px;color:#606266;font-size:14px;line-height:1.8}.xp-dialog__footer[data-v-7015aab1]{padding:18px 20px;border-top:1px solid #ebeef5;display:flex;justify-content:flex-end;gap:12px;box-sizing:border-box}.xp-dialog-fade-enter-active[data-v-7015aab1],.xp-dialog-fade-leave-active[data-v-7015aab1]{transition:opacity .2s ease}.xp-dialog-fade-enter-from[data-v-7015aab1],.xp-dialog-fade-leave-to[data-v-7015aab1]{opacity:0}.xp-dialog-slide-enter-active[data-v-7015aab1],.xp-dialog-slide-leave-active[data-v-7015aab1]{transition:all .3s ease}.xp-dialog-slide-enter-from[data-v-7015aab1],.xp-dialog-slide-leave-to[data-v-7015aab1]{opacity:0;transform:translateY(-20px) scale(.95)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=(t,l)=>{const a=t.__vccOpts||t;for(const[d,n]of l)a[d]=n;return a},y=["disabled"],g={key:0,class:"xp-button__loading"},k={class:"xp-button__text"},b={__name:"Button",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:l}){const a=t,d=l,n=s=>{!a.disabled&&!a.loading&&d("click",s)};return(s,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["xp-button",[`xp-button--${t.type}`,`xp-button--${t.size}`,{"xp-button--disabled":t.disabled,"xp-button--loading":t.loading}]]),disabled:t.disabled||t.loading,onClick:n},[t.loading?(e.openBlock(),e.createElementBlock("span",g)):e.createCommentVNode("",!0),e.createElementVNode("span",k,[e.renderSlot(s.$slots,"default",{},void 0,!0)])],10,y))}},i=c(b,[["__scopeId","data-v-8bb35629"]]),B={key:0,class:"xp-input__prefix"},v=["type","value","placeholder","disabled"],$={key:1,class:"xp-input__suffix"},C={__name:"Input",props:{modelValue:{type:String,default:""},type:{type:String,default:"text",validator:t=>["text","password","number"].includes(t)},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)}},emits:["update:modelValue","focus","blur"],setup(t,{emit:l}){const a=l,d=o=>{a("update:modelValue",o.target.value)},n=o=>{a("focus",o)},s=o=>{a("blur",o)};return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":o.$slots.prefix,"xp-input--suffix":o.$slots.suffix}]])},[o.$slots.prefix?(e.openBlock(),e.createElementBlock("span",B,[e.renderSlot(o.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{class:"xp-input__inner",type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,onInput:d,onFocus:n,onBlur:s},null,40,v),o.$slots.suffix?(e.openBlock(),e.createElementBlock("span",$,[e.renderSlot(o.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},p=c(C,[["__scopeId","data-v-d69c9b60"]]),V={key:0,class:"xp-card__header"},S={class:"xp-card__title"},N={class:"xp-card__body"},E={key:1,class:"xp-card__footer"},w={__name:"Card",props:{title:{type:String,default:""},shadow:{type:String,default:"always",validator:t=>["always","hover","never"].includes(t)}},setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-card",[`xp-card--${t.shadow}`]])},[t.title||l.$slots.header?(e.openBlock(),e.createElementBlock("div",V,[e.renderSlot(l.$slots,"header",{},()=>[e.createElementVNode("h3",S,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",N,[e.renderSlot(l.$slots,"default",{},void 0,!0)]),l.$slots.footer?(e.openBlock(),e.createElementBlock("div",E,[e.renderSlot(l.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},m=c(w,[["__scopeId","data-v-60989cba"]]),T={class:"xp-dialog__header"},I={class:"xp-dialog__title"},z={class:"xp-dialog__body"},X={class:"xp-dialog__footer"},D={__name:"Dialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},confirmButtonText:{type:String,default:"确定"},cancelButtonText:{type:String,default:"取消"},closeOnClickModal:{type:Boolean,default:!0}},emits:["confirm","cancel","update:visible"],setup(t,{emit:l}){const a=t,d=l,n=()=>{d("update:visible",!1)},s=()=>{a.closeOnClickModal&&n()},o=()=>{d("confirm"),n()},r=()=>{d("cancel"),n()};return(h,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dialog-fade"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog__wrapper",onClick:e.withModifiers(s,["self"])},[u[0]||(u[0]=e.createElementVNode("div",{class:"xp-dialog__mask"},null,-1)),e.createVNode(e.Transition,{name:"xp-dialog-slide"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",T,[e.createElementVNode("h3",I,e.toDisplayString(t.title),1),e.createElementVNode("button",{class:"xp-dialog__close",onClick:n}," × ")]),e.createElementVNode("div",z,[e.renderSlot(h.$slots,"default",{},void 0,!0)]),e.createElementVNode("div",X,[e.createVNode(i,{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(i,{type:"primary",onClick:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText),1)]),_:1})])],4)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}},f=c(D,[["__scopeId","data-v-7015aab1"]]),x={XpButton:i,XpInput:p,XpCard:m,XpDialog:f},_=t=>{Object.entries(x).forEach(([l,a])=>{t.component(l,a)})},M={install:_,...x};exports.XpButton=i;exports.XpCard=m;exports.XpDialog=f;exports.XpInput=p;exports.default=M;exports.install=_;
|
package/dist/xp-ui.es.js
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { openBlock as s, createElementBlock as i, normalizeClass as h, createCommentVNode as r, createElementVNode as d, renderSlot as u, toDisplayString as m, createBlock as C, Teleport as B, createVNode as p, Transition as g, withCtx as f, withModifiers as S, normalizeStyle as w, createTextVNode as v } from "vue";
|
|
2
|
+
const x = (e, t) => {
|
|
3
|
+
const a = e.__vccOpts || e;
|
|
4
|
+
for (const [o, n] of t)
|
|
5
|
+
a[o] = n;
|
|
6
|
+
return a;
|
|
7
|
+
}, I = ["disabled"], V = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "xp-button__loading"
|
|
10
|
+
}, T = { class: "xp-button__text" }, z = {
|
|
11
|
+
__name: "Button",
|
|
12
|
+
props: {
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "default",
|
|
16
|
+
validator: (e) => ["primary", "default", "success", "warning", "danger"].includes(e)
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "medium",
|
|
21
|
+
validator: (e) => ["small", "medium", "large"].includes(e)
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["click"],
|
|
33
|
+
setup(e, { emit: t }) {
|
|
34
|
+
const a = e, o = t, n = (c) => {
|
|
35
|
+
!a.disabled && !a.loading && o("click", c);
|
|
36
|
+
};
|
|
37
|
+
return (c, l) => (s(), i("button", {
|
|
38
|
+
class: h(["xp-button", [
|
|
39
|
+
`xp-button--${e.type}`,
|
|
40
|
+
`xp-button--${e.size}`,
|
|
41
|
+
{
|
|
42
|
+
"xp-button--disabled": e.disabled,
|
|
43
|
+
"xp-button--loading": e.loading
|
|
44
|
+
}
|
|
45
|
+
]]),
|
|
46
|
+
disabled: e.disabled || e.loading,
|
|
47
|
+
onClick: n
|
|
48
|
+
}, [
|
|
49
|
+
e.loading ? (s(), i("span", V)) : r("", !0),
|
|
50
|
+
d("span", T, [
|
|
51
|
+
u(c.$slots, "default", {}, void 0, !0)
|
|
52
|
+
])
|
|
53
|
+
], 10, I));
|
|
54
|
+
}
|
|
55
|
+
}, _ = /* @__PURE__ */ x(z, [["__scopeId", "data-v-8bb35629"]]), M = {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: "xp-input__prefix"
|
|
58
|
+
}, N = ["type", "value", "placeholder", "disabled"], O = {
|
|
59
|
+
key: 1,
|
|
60
|
+
class: "xp-input__suffix"
|
|
61
|
+
}, X = {
|
|
62
|
+
__name: "Input",
|
|
63
|
+
props: {
|
|
64
|
+
modelValue: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ""
|
|
67
|
+
},
|
|
68
|
+
type: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "text",
|
|
71
|
+
validator: (e) => ["text", "password", "number"].includes(e)
|
|
72
|
+
},
|
|
73
|
+
placeholder: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: ""
|
|
76
|
+
},
|
|
77
|
+
disabled: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
size: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "medium",
|
|
84
|
+
validator: (e) => ["small", "medium", "large"].includes(e)
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
emits: ["update:modelValue", "focus", "blur"],
|
|
88
|
+
setup(e, { emit: t }) {
|
|
89
|
+
const a = t, o = (l) => {
|
|
90
|
+
a("update:modelValue", l.target.value);
|
|
91
|
+
}, n = (l) => {
|
|
92
|
+
a("focus", l);
|
|
93
|
+
}, c = (l) => {
|
|
94
|
+
a("blur", l);
|
|
95
|
+
};
|
|
96
|
+
return (l, y) => (s(), i("div", {
|
|
97
|
+
class: h(["xp-input", [
|
|
98
|
+
`xp-input--${e.size}`,
|
|
99
|
+
{
|
|
100
|
+
"xp-input--disabled": e.disabled,
|
|
101
|
+
"xp-input--prefix": l.$slots.prefix,
|
|
102
|
+
"xp-input--suffix": l.$slots.suffix
|
|
103
|
+
}
|
|
104
|
+
]])
|
|
105
|
+
}, [
|
|
106
|
+
l.$slots.prefix ? (s(), i("span", M, [
|
|
107
|
+
u(l.$slots, "prefix", {}, void 0, !0)
|
|
108
|
+
])) : r("", !0),
|
|
109
|
+
d("input", {
|
|
110
|
+
class: "xp-input__inner",
|
|
111
|
+
type: e.type,
|
|
112
|
+
value: e.modelValue,
|
|
113
|
+
placeholder: e.placeholder,
|
|
114
|
+
disabled: e.disabled,
|
|
115
|
+
onInput: o,
|
|
116
|
+
onFocus: n,
|
|
117
|
+
onBlur: c
|
|
118
|
+
}, null, 40, N),
|
|
119
|
+
l.$slots.suffix ? (s(), i("span", O, [
|
|
120
|
+
u(l.$slots, "suffix", {}, void 0, !0)
|
|
121
|
+
])) : r("", !0)
|
|
122
|
+
], 2));
|
|
123
|
+
}
|
|
124
|
+
}, D = /* @__PURE__ */ x(X, [["__scopeId", "data-v-d69c9b60"]]), E = {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "xp-card__header"
|
|
127
|
+
}, F = { class: "xp-card__title" }, j = { class: "xp-card__body" }, q = {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "xp-card__footer"
|
|
130
|
+
}, A = {
|
|
131
|
+
__name: "Card",
|
|
132
|
+
props: {
|
|
133
|
+
title: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: ""
|
|
136
|
+
},
|
|
137
|
+
shadow: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: "always",
|
|
140
|
+
validator: (e) => ["always", "hover", "never"].includes(e)
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
setup(e) {
|
|
144
|
+
return (t, a) => (s(), i("div", {
|
|
145
|
+
class: h(["xp-card", [
|
|
146
|
+
`xp-card--${e.shadow}`
|
|
147
|
+
]])
|
|
148
|
+
}, [
|
|
149
|
+
e.title || t.$slots.header ? (s(), i("div", E, [
|
|
150
|
+
u(t.$slots, "header", {}, () => [
|
|
151
|
+
d("h3", F, m(e.title), 1)
|
|
152
|
+
], !0)
|
|
153
|
+
])) : r("", !0),
|
|
154
|
+
d("div", j, [
|
|
155
|
+
u(t.$slots, "default", {}, void 0, !0)
|
|
156
|
+
]),
|
|
157
|
+
t.$slots.footer ? (s(), i("div", q, [
|
|
158
|
+
u(t.$slots, "footer", {}, void 0, !0)
|
|
159
|
+
])) : r("", !0)
|
|
160
|
+
], 2));
|
|
161
|
+
}
|
|
162
|
+
}, G = /* @__PURE__ */ x(A, [["__scopeId", "data-v-60989cba"]]), H = { class: "xp-dialog__header" }, J = { class: "xp-dialog__title" }, K = { class: "xp-dialog__body" }, L = { class: "xp-dialog__footer" }, P = {
|
|
163
|
+
__name: "Dialog",
|
|
164
|
+
props: {
|
|
165
|
+
visible: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: !1
|
|
168
|
+
},
|
|
169
|
+
title: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: ""
|
|
172
|
+
},
|
|
173
|
+
width: {
|
|
174
|
+
type: String,
|
|
175
|
+
default: "500px"
|
|
176
|
+
},
|
|
177
|
+
confirmButtonText: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: "确定"
|
|
180
|
+
},
|
|
181
|
+
cancelButtonText: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: "取消"
|
|
184
|
+
},
|
|
185
|
+
closeOnClickModal: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: !0
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
emits: ["confirm", "cancel", "update:visible"],
|
|
191
|
+
setup(e, { emit: t }) {
|
|
192
|
+
const a = e, o = t, n = () => {
|
|
193
|
+
o("update:visible", !1);
|
|
194
|
+
}, c = () => {
|
|
195
|
+
a.closeOnClickModal && n();
|
|
196
|
+
}, l = () => {
|
|
197
|
+
o("confirm"), n();
|
|
198
|
+
}, y = () => {
|
|
199
|
+
o("cancel"), n();
|
|
200
|
+
};
|
|
201
|
+
return (k, b) => (s(), C(B, { to: "body" }, [
|
|
202
|
+
p(g, { name: "xp-dialog-fade" }, {
|
|
203
|
+
default: f(() => [
|
|
204
|
+
e.visible ? (s(), i("div", {
|
|
205
|
+
key: 0,
|
|
206
|
+
class: "xp-dialog__wrapper",
|
|
207
|
+
onClick: S(c, ["self"])
|
|
208
|
+
}, [
|
|
209
|
+
b[0] || (b[0] = d("div", { class: "xp-dialog__mask" }, null, -1)),
|
|
210
|
+
p(g, { name: "xp-dialog-slide" }, {
|
|
211
|
+
default: f(() => [
|
|
212
|
+
e.visible ? (s(), i("div", {
|
|
213
|
+
key: 0,
|
|
214
|
+
class: "xp-dialog",
|
|
215
|
+
style: w({ width: e.width })
|
|
216
|
+
}, [
|
|
217
|
+
d("div", H, [
|
|
218
|
+
d("h3", J, m(e.title), 1),
|
|
219
|
+
d("button", {
|
|
220
|
+
class: "xp-dialog__close",
|
|
221
|
+
onClick: n
|
|
222
|
+
}, " × ")
|
|
223
|
+
]),
|
|
224
|
+
d("div", K, [
|
|
225
|
+
u(k.$slots, "default", {}, void 0, !0)
|
|
226
|
+
]),
|
|
227
|
+
d("div", L, [
|
|
228
|
+
p(_, { onClick: y }, {
|
|
229
|
+
default: f(() => [
|
|
230
|
+
v(m(e.cancelButtonText), 1)
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}),
|
|
234
|
+
p(_, {
|
|
235
|
+
type: "primary",
|
|
236
|
+
onClick: l
|
|
237
|
+
}, {
|
|
238
|
+
default: f(() => [
|
|
239
|
+
v(m(e.confirmButtonText), 1)
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
})
|
|
243
|
+
])
|
|
244
|
+
], 4)) : r("", !0)
|
|
245
|
+
]),
|
|
246
|
+
_: 3
|
|
247
|
+
})
|
|
248
|
+
])) : r("", !0)
|
|
249
|
+
]),
|
|
250
|
+
_: 3
|
|
251
|
+
})
|
|
252
|
+
]));
|
|
253
|
+
}
|
|
254
|
+
}, Q = /* @__PURE__ */ x(P, [["__scopeId", "data-v-7015aab1"]]), $ = {
|
|
255
|
+
XpButton: _,
|
|
256
|
+
XpInput: D,
|
|
257
|
+
XpCard: G,
|
|
258
|
+
XpDialog: Q
|
|
259
|
+
}, R = (e) => {
|
|
260
|
+
Object.entries($).forEach(([t, a]) => {
|
|
261
|
+
e.component(t, a);
|
|
262
|
+
});
|
|
263
|
+
}, W = {
|
|
264
|
+
install: R,
|
|
265
|
+
...$
|
|
266
|
+
};
|
|
267
|
+
export {
|
|
268
|
+
_ as XpButton,
|
|
269
|
+
G as XpCard,
|
|
270
|
+
Q as XpDialog,
|
|
271
|
+
D as XpInput,
|
|
272
|
+
W as default,
|
|
273
|
+
R as install
|
|
274
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cghbcf/xp-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Vue3 component library - A modern UI component library for Vue 3",
|
|
5
|
+
"keywords": ["vue", "vue3", "component", "ui", "library"],
|
|
6
|
+
"author": "Xp UI Team",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/xp-ui.cjs.js",
|
|
10
|
+
"module": "dist/xp-ui.es.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/xp-ui.es.js",
|
|
14
|
+
"require": "./dist/xp-ui.cjs.js"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/style.css",
|
|
17
|
+
"./dist/style.css": "./dist/style.css"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"docs:dev": "vitepress dev docs",
|
|
29
|
+
"docs:build": "vitepress build docs",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"vue": "^3.4.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"vite": "^5.2.0",
|
|
37
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
38
|
+
"sass": "^1.71.0",
|
|
39
|
+
"vitepress": "^1.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|