sinosoft-common-button 1.0.6 → 1.0.8
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/common-button.es.js +130 -51
- package/common-button.umd.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/common-button.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { openBlock as
|
|
1
|
+
import { openBlock as l, createElementBlock as d, createElementVNode as a, defineComponent as _, resolveComponent as n, createVNode as c, normalizeClass as m, normalizeStyle as s, withCtx as f, createCommentVNode as u, renderSlot as S, createBlock as $ } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.1.0 */
|
|
3
|
-
var
|
|
4
|
-
let
|
|
5
|
-
for (let [r,
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
},
|
|
3
|
+
var F = (e, o) => {
|
|
4
|
+
let t = e.__vccOpts || e;
|
|
5
|
+
for (let [r, i] of o)
|
|
6
|
+
t[r] = i;
|
|
7
|
+
return t;
|
|
8
|
+
}, v = {
|
|
9
9
|
name: "Loading"
|
|
10
|
-
},
|
|
10
|
+
}, w = {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
viewBox: "0 0 1024 1024"
|
|
13
|
-
},
|
|
13
|
+
}, k = /* @__PURE__ */ a(
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
16
16
|
fill: "currentColor",
|
|
@@ -19,17 +19,17 @@ var $ = (e, t) => {
|
|
|
19
19
|
null,
|
|
20
20
|
-1
|
|
21
21
|
/* HOISTED */
|
|
22
|
-
),
|
|
23
|
-
|
|
22
|
+
), z = [
|
|
23
|
+
k
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function x(e, o, t, r, i, g) {
|
|
26
|
+
return l(), d("svg", w, z);
|
|
27
27
|
}
|
|
28
|
-
var
|
|
29
|
-
const
|
|
28
|
+
var D = /* @__PURE__ */ F(v, [["render", x], ["__file", "loading.vue"]]);
|
|
29
|
+
const E = _({
|
|
30
30
|
components: {
|
|
31
31
|
// sIcon,
|
|
32
|
-
Loading:
|
|
32
|
+
Loading: D
|
|
33
33
|
},
|
|
34
34
|
props: {
|
|
35
35
|
plain: {
|
|
@@ -44,11 +44,29 @@ const L = m({
|
|
|
44
44
|
type: Boolean,
|
|
45
45
|
default: !1
|
|
46
46
|
},
|
|
47
|
+
// 弹窗提交按钮
|
|
48
|
+
primaryDialog: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
},
|
|
52
|
+
// 普通提交
|
|
53
|
+
primaryOrdinary: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
47
57
|
info: {
|
|
48
58
|
type: Boolean,
|
|
49
59
|
default: !1
|
|
50
60
|
},
|
|
51
|
-
|
|
61
|
+
infoDialog: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
infoOrdinary: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
btnCode: {
|
|
52
70
|
type: String,
|
|
53
71
|
default: ""
|
|
54
72
|
},
|
|
@@ -100,32 +118,88 @@ const L = m({
|
|
|
100
118
|
borderWidth: "1px",
|
|
101
119
|
borderStyle: `${this.borderStyle}`,
|
|
102
120
|
borderColor: `${this.color || "#216FED"}`,
|
|
103
|
-
color: this.color || "#216FED"
|
|
121
|
+
color: this.color || "#216FED",
|
|
122
|
+
width: this.width,
|
|
123
|
+
height: this.height,
|
|
124
|
+
borderRadius: this.circle
|
|
104
125
|
} : this.primary ? {
|
|
105
126
|
background: "#216FED",
|
|
106
127
|
borderWidth: "1px",
|
|
107
128
|
borderStyle: `${this.borderStyle}`,
|
|
108
129
|
borderColor: `${this.color || "#4E6DFD"}`,
|
|
109
|
-
color: this.color || "#ffffff"
|
|
130
|
+
color: this.color || "#ffffff",
|
|
131
|
+
width: this.width,
|
|
132
|
+
height: this.height,
|
|
133
|
+
borderRadius: this.circle
|
|
134
|
+
} : this.primaryOrdinary ? {
|
|
135
|
+
background: "#216FED",
|
|
136
|
+
borderWidth: "1px",
|
|
137
|
+
borderStyle: `${this.borderStyle}`,
|
|
138
|
+
borderColor: `${this.color || "#4E6DFD"}`,
|
|
139
|
+
color: this.color || "#ffffff",
|
|
140
|
+
width: "190px",
|
|
141
|
+
height: "52px",
|
|
142
|
+
borderRadius: this.circle,
|
|
143
|
+
fontSize: "16px",
|
|
144
|
+
fontWeight: 600
|
|
145
|
+
} : this.primaryDialog ? {
|
|
146
|
+
width: "176px",
|
|
147
|
+
height: "46px",
|
|
148
|
+
background: "#216FED",
|
|
149
|
+
borderWidth: "1px",
|
|
150
|
+
borderStyle: `${this.borderStyle}`,
|
|
151
|
+
borderColor: `${this.color || "#4E6DFD"}`,
|
|
152
|
+
color: this.color || "#ffffff",
|
|
153
|
+
borderRadius: "8px",
|
|
154
|
+
fontSize: "16px",
|
|
155
|
+
fontWeight: 600
|
|
110
156
|
} : this.default ? {
|
|
111
157
|
background: "#ffffff",
|
|
112
158
|
borderWidth: "1px",
|
|
113
159
|
borderStyle: `${this.borderStyle}`,
|
|
114
160
|
borderColor: `${this.color || "#DDE2E6"}`,
|
|
115
|
-
color: this.color || "#2C3C4D"
|
|
161
|
+
color: this.color || "#2C3C4D",
|
|
162
|
+
width: this.width,
|
|
163
|
+
height: this.height,
|
|
164
|
+
borderRadius: this.circle
|
|
116
165
|
} : this.info ? {
|
|
117
166
|
background: "#C4C4C4",
|
|
118
167
|
borderWidth: "1px",
|
|
119
168
|
borderStyle: `${this.borderStyle}`,
|
|
120
169
|
borderColor: `${this.color || "#C4C4C4"}`,
|
|
121
|
-
color: this.color || "#FFFFFF"
|
|
170
|
+
color: this.color || "#FFFFFF",
|
|
171
|
+
width: this.width,
|
|
172
|
+
height: this.height,
|
|
173
|
+
borderRadius: this.circle
|
|
174
|
+
} : this.infoDialog ? {
|
|
175
|
+
width: "190px",
|
|
176
|
+
height: "46px ",
|
|
177
|
+
background: "#C4C4C4",
|
|
178
|
+
borderWidth: "1px",
|
|
179
|
+
borderStyle: `${this.borderStyle}`,
|
|
180
|
+
borderColor: `${this.color || "#C4C4C4"}`,
|
|
181
|
+
color: this.color || "#FFFFFF",
|
|
182
|
+
borderRadius: "8px",
|
|
183
|
+
fontSize: "16px",
|
|
184
|
+
fontWeight: 600
|
|
185
|
+
} : this.infoOrdinary ? {
|
|
186
|
+
width: "176px",
|
|
187
|
+
height: "52px",
|
|
188
|
+
background: "#C4C4C4",
|
|
189
|
+
borderWidth: "1px",
|
|
190
|
+
borderStyle: `${this.borderStyle}`,
|
|
191
|
+
borderColor: `${this.color || "#C4C4C4"}`,
|
|
192
|
+
color: this.color || "#FFFFFF",
|
|
193
|
+
borderRadius: "8px",
|
|
194
|
+
fontSize: "16px",
|
|
195
|
+
fontWeight: 600
|
|
122
196
|
} : {
|
|
123
197
|
color: this.color || "#ffffff",
|
|
124
198
|
background: this.bgColor || "#216FED",
|
|
125
199
|
borderStyle: `${this.borderStyle}`,
|
|
126
200
|
borderColor: `${this.color || "#216FED"}`,
|
|
127
|
-
height: this.height,
|
|
128
201
|
width: this.width,
|
|
202
|
+
height: this.height,
|
|
129
203
|
borderRadius: this.circle
|
|
130
204
|
};
|
|
131
205
|
},
|
|
@@ -145,60 +219,65 @@ const L = m({
|
|
|
145
219
|
height: typeof this.size == "string" ? this.size : this.size + "px"
|
|
146
220
|
};
|
|
147
221
|
}
|
|
222
|
+
},
|
|
223
|
+
methods: {
|
|
224
|
+
handleClick() {
|
|
225
|
+
this.$emit("handleClick");
|
|
226
|
+
}
|
|
148
227
|
}
|
|
149
228
|
});
|
|
150
|
-
const B = (e,
|
|
151
|
-
const
|
|
152
|
-
for (const [r,
|
|
153
|
-
|
|
154
|
-
return
|
|
155
|
-
},
|
|
229
|
+
const B = (e, o) => {
|
|
230
|
+
const t = e.__vccOpts || e;
|
|
231
|
+
for (const [r, i] of o)
|
|
232
|
+
t[r] = i;
|
|
233
|
+
return t;
|
|
234
|
+
}, W = {
|
|
156
235
|
key: 0,
|
|
157
236
|
class: "s-icon"
|
|
158
|
-
},
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
class:
|
|
237
|
+
}, L = ["src"];
|
|
238
|
+
function O(e, o, t, r, i, g) {
|
|
239
|
+
const b = n("Loading"), y = n("el-icon"), C = n("el-button");
|
|
240
|
+
return l(), d("div", null, [
|
|
241
|
+
c(C, {
|
|
242
|
+
class: m(["s-button", { plain: e.plain, btnhover: !e.plain, loading: e.loading }]),
|
|
164
243
|
disabled: e.loading,
|
|
165
244
|
style: s(e.styleOjb),
|
|
166
|
-
onClick:
|
|
167
|
-
|
|
245
|
+
onClick: e.handleClick,
|
|
246
|
+
btnCode: e.btnCode
|
|
168
247
|
}, {
|
|
169
248
|
default: f(() => [
|
|
170
|
-
e.icon ? (
|
|
171
|
-
|
|
249
|
+
e.icon ? (l(), d("i", W, [
|
|
250
|
+
a("img", {
|
|
172
251
|
src: e.geturl,
|
|
173
252
|
alt: "",
|
|
174
253
|
style: s(e.styleObject)
|
|
175
|
-
}, null, 12,
|
|
176
|
-
])) :
|
|
177
|
-
|
|
254
|
+
}, null, 12, L)
|
|
255
|
+
])) : u("", !0),
|
|
256
|
+
a("span", {
|
|
178
257
|
style: s({ color: e.color })
|
|
179
258
|
}, [
|
|
180
|
-
|
|
259
|
+
S(e.$slots, "default", {}, void 0, !0)
|
|
181
260
|
], 4),
|
|
182
|
-
e.loading ? (
|
|
261
|
+
e.loading ? (l(), $(y, {
|
|
183
262
|
key: 1,
|
|
184
263
|
class: "is-loading",
|
|
185
264
|
color: e.loadingColor
|
|
186
265
|
}, {
|
|
187
266
|
default: f(() => [
|
|
188
|
-
|
|
267
|
+
c(b)
|
|
189
268
|
]),
|
|
190
269
|
_: 1
|
|
191
|
-
}, 8, ["color"])) :
|
|
270
|
+
}, 8, ["color"])) : u("", !0)
|
|
192
271
|
]),
|
|
193
272
|
_: 3
|
|
194
|
-
}, 8, ["class", "disabled", "style", "
|
|
273
|
+
}, 8, ["class", "disabled", "style", "onClick", "btnCode"])
|
|
195
274
|
]);
|
|
196
275
|
}
|
|
197
|
-
const
|
|
198
|
-
function
|
|
199
|
-
|
|
276
|
+
const p = /* @__PURE__ */ B(E, [["render", O], ["__scopeId", "data-v-90828534"]]);
|
|
277
|
+
function h(e, o = {}) {
|
|
278
|
+
h.installed || (h.installed = !0, e.component("common-button", p));
|
|
200
279
|
}
|
|
201
|
-
|
|
280
|
+
p.install = h;
|
|
202
281
|
export {
|
|
203
|
-
|
|
282
|
+
p as default
|
|
204
283
|
};
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.button=i(e.Vue))})(this,function(e){"use strict";/*! Element Plus Icons Vue v2.1.0 */var i=(t,r)=>{let o=t.__vccOpts||t;for(let[l,n]of r)o[l]=n;return o},a={name:"Loading"},h={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},c=e.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),f=[c];function p(t,r,o,l,n,_){return e.openBlock(),e.createElementBlock("svg",h,f)}var u=i(a,[["render",p],["__file","loading.vue"]]);const b=e.defineComponent({components:{Loading:u},props:{plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},primaryDialog:{type:Boolean,default:!1},primaryOrdinary:{type:Boolean,default:!1},info:{type:Boolean,default:!1},infoDialog:{type:Boolean,default:!1},infoOrdinary:{type:Boolean,default:!1},btnCode:{type:String,default:""},circle:{type:String,default:""},height:{type:String,default:""},width:{type:String,default:""},color:{type:String,default:""},loadingColor:{type:String,default:"#333333"},bgColor:{type:String,default:""},loading:{type:Boolean,default:!1},borderStyle:{type:String,default:"solid"},icon:{type:String,required:!1},size:{type:[Number,String],default:"auto"}},computed:{styleOjb(){return this.plain?{background:"#fff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#216FED"}`,color:this.color||"#216FED",width:this.width,height:this.height,borderRadius:this.circle}:this.primary?{background:"#216FED",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#4E6DFD"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle}:this.primaryOrdinary?{background:"#216FED",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#4E6DFD"}`,color:this.color||"#ffffff",width:"190px",height:"52px",borderRadius:this.circle,fontSize:"16px",fontWeight:600}:this.primaryDialog?{width:"176px",height:"46px",background:"#216FED",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#4E6DFD"}`,color:this.color||"#ffffff",borderRadius:"8px",fontSize:"16px",fontWeight:600}:this.default?{background:"#ffffff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#DDE2E6"}`,color:this.color||"#2C3C4D",width:this.width,height:this.height,borderRadius:this.circle}:this.info?{background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle}:this.infoDialog?{width:"190px",height:"46px ",background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:"8px",fontSize:"16px",fontWeight:600}:this.infoOrdinary?{width:"176px",height:"52px",background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:"8px",fontSize:"16px",fontWeight:600}:{color:this.color||"#ffffff",background:this.bgColor||"#216FED",borderStyle:`${this.borderStyle}`,borderColor:`${this.color||"#216FED"}`,width:this.width,height:this.height,borderRadius:this.circle}},geturl(){if(this.icon){if(this.icon.includes("/")||this.icon.includes("base64"))return this.icon;if(this.icon.includes("svg"))return`@icons/svg/${this.icon}`}else return"";return`@icons/png/${this.icon}.png`},styleObject:function(){return{width:typeof this.size=="string"?this.size:this.size+"px",height:typeof this.size=="string"?this.size:this.size+"px"}}},methods:{handleClick(){this.$emit("handleClick")}}}),k="",g=(t,r)=>{const o=t.__vccOpts||t;for(const[l,n]of r)o[l]=n;return o},y={key:0,class:"s-icon"},C=["src"];function m(t,r,o,l,n,_){const S=e.resolveComponent("Loading"),$=e.resolveComponent("el-icon"),F=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(F,{class:e.normalizeClass(["s-button",{plain:t.plain,btnhover:!t.plain,loading:t.loading}]),disabled:t.loading,style:e.normalizeStyle(t.styleOjb),onClick:t.handleClick,btnCode:t.btnCode},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createElementBlock("i",y,[e.createElementVNode("img",{src:t.geturl,alt:"",style:e.normalizeStyle(t.styleObject)},null,12,C)])):e.createCommentVNode("",!0),e.createElementVNode("span",{style:e.normalizeStyle({color:t.color})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4),t.loading?(e.openBlock(),e.createBlock($,{key:1,class:"is-loading",color:t.loadingColor},{default:e.withCtx(()=>[e.createVNode(S)]),_:1},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class","disabled","style","onClick","btnCode"])])}const s=g(b,[["render",m],["__scopeId","data-v-90828534"]]);function d(t,r={}){d.installed||(d.installed=!0,t.component("common-button",s))}return s.install=d,s});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.btnhover[data-v-
|
|
1
|
+
.btnhover[data-v-90828534]:hover{box-shadow:0 0 15px #2461cc4d;opacity:.95}.s-button[data-v-90828534]{display:inline-block;height:36px;line-height:1;border:none;background:linear-gradient(350deg,#4A60FF 0%,#64B0F3 100%,#64B0F3 100%);padding:0 19px;border-radius:7px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .5s ease-in-out;user-select:none}.s-button+.s-button[data-v-90828534]{margin-left:15px}.s-button span[data-v-90828534]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-90828534]{vertical-align:middle}.plain[data-v-90828534]{background:#fff}.plain-icon[data-v-90828534]{margin-right:4px}.loading[data-v-90828534]{opacity:.8}.s-icon[data-v-90828534]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-90828534]{float:left}
|