sinosoft-common-button 1.1.9 → 1.2.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/common-button.es.js +117 -54
- 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 a, createElementBlock as c, createElementVNode as u, defineComponent as S, resolveComponent as h, createVNode as y, normalizeClass as w, normalizeStyle as f, withCtx as C, createCommentVNode as v, renderSlot as $, createBlock as k } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.1.0 */
|
|
3
|
-
var
|
|
4
|
-
let
|
|
5
|
-
for (let [
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
},
|
|
3
|
+
var z = (e, t) => {
|
|
4
|
+
let i = e.__vccOpts || e;
|
|
5
|
+
for (let [o, r] of t)
|
|
6
|
+
i[o] = r;
|
|
7
|
+
return i;
|
|
8
|
+
}, F = {
|
|
9
9
|
name: "Loading"
|
|
10
|
-
},
|
|
10
|
+
}, x = {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
viewBox: "0 0 1024 1024"
|
|
13
|
-
},
|
|
13
|
+
}, A = /* @__PURE__ */ u(
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
16
16
|
fill: "currentColor",
|
|
@@ -19,16 +19,80 @@ var v = (e, o) => {
|
|
|
19
19
|
null,
|
|
20
20
|
-1
|
|
21
21
|
/* HOISTED */
|
|
22
|
-
),
|
|
23
|
-
|
|
22
|
+
), B = [
|
|
23
|
+
A
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function W(e, t, i, o, r, n) {
|
|
26
|
+
return a(), c("svg", x, B);
|
|
27
27
|
}
|
|
28
|
-
var
|
|
29
|
-
|
|
28
|
+
var L = /* @__PURE__ */ z(F, [["render", W], ["__file", "loading.vue"]]);
|
|
29
|
+
function g(e, t, i) {
|
|
30
|
+
for (var o = [], r = Math.max(e.length, t.length), n = 0, l = 0; l < r || n; ) {
|
|
31
|
+
var s = l < e.length ? e[l] : 0, d = l < t.length ? t[l] : 0, b = n + s + d;
|
|
32
|
+
o.push(b % i), n = Math.floor(b / i), l++;
|
|
33
|
+
}
|
|
34
|
+
return o;
|
|
35
|
+
}
|
|
36
|
+
function m(e, t, i) {
|
|
37
|
+
if (e < 0)
|
|
38
|
+
return null;
|
|
39
|
+
if (e == 0)
|
|
40
|
+
return [];
|
|
41
|
+
for (var o = [], r = t; e & 1 && (o = g(o, r, i)), e = e >> 1, e !== 0; )
|
|
42
|
+
r = g(r, r, i);
|
|
43
|
+
return o;
|
|
44
|
+
}
|
|
45
|
+
function O(e, t) {
|
|
46
|
+
for (var i = e.split(""), o = [], r = i.length - 1; r >= 0; r--) {
|
|
47
|
+
var n = parseInt(i[r], t);
|
|
48
|
+
if (isNaN(n))
|
|
49
|
+
return null;
|
|
50
|
+
o.push(n);
|
|
51
|
+
}
|
|
52
|
+
return o;
|
|
53
|
+
}
|
|
54
|
+
function q(e, t, i) {
|
|
55
|
+
var o = O(e, t);
|
|
56
|
+
if (o === null)
|
|
57
|
+
return null;
|
|
58
|
+
for (var r = [], n = [1], l = 0; l < o.length; l++)
|
|
59
|
+
o[l] && (r = g(
|
|
60
|
+
r,
|
|
61
|
+
m(o[l], n, i),
|
|
62
|
+
i
|
|
63
|
+
)), n = m(t, n, i);
|
|
64
|
+
for (var s = "", l = r.length - 1; l >= 0; l--)
|
|
65
|
+
s += r[l].toString(i);
|
|
66
|
+
return s;
|
|
67
|
+
}
|
|
68
|
+
function D(e) {
|
|
69
|
+
return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(), q(e, 16, 10);
|
|
70
|
+
}
|
|
71
|
+
class R {
|
|
72
|
+
constructor(t) {
|
|
73
|
+
t = t || {}, this.seq = 0, this.mid = (t.mid || 1) % 1023, this.offset = t.offset || 0, this.lastTime = 0;
|
|
74
|
+
}
|
|
75
|
+
generate() {
|
|
76
|
+
const t = Date.now(), i = (t - this.offset).toString(2);
|
|
77
|
+
this.lastTime == t ? (this.seq++, this.seq > 4095 && (this.seq = 0)) : this.seq = 0, this.lastTime = t;
|
|
78
|
+
let o = this.seq.toString(2), r = this.mid.toString(2);
|
|
79
|
+
for (; o.length < 12; )
|
|
80
|
+
o = "0" + o;
|
|
81
|
+
for (; r.length < 10; )
|
|
82
|
+
r = "0" + r;
|
|
83
|
+
const n = i + r + o;
|
|
84
|
+
let l = "";
|
|
85
|
+
for (let s = n.length; s > 0; s -= 4)
|
|
86
|
+
l = parseInt(n.substring(s - 4, s), 2).toString(16) + l;
|
|
87
|
+
return D(l);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const N = new R({
|
|
91
|
+
mid: 42,
|
|
92
|
+
offset: (2019 - 1970) * 31536e3 * 1e3
|
|
93
|
+
}), M = S({
|
|
30
94
|
components: {
|
|
31
|
-
Loading:
|
|
95
|
+
Loading: L
|
|
32
96
|
},
|
|
33
97
|
props: {
|
|
34
98
|
disabled: {
|
|
@@ -228,73 +292,72 @@ const W = _({
|
|
|
228
292
|
}
|
|
229
293
|
},
|
|
230
294
|
emits: ["handleClick"],
|
|
231
|
-
setup(e,
|
|
295
|
+
setup(e, t) {
|
|
232
296
|
return {
|
|
233
|
-
handleClick: (
|
|
234
|
-
|
|
235
|
-
let { timeStamp: s } = i, l = `${e.btnCode}_${s}`;
|
|
297
|
+
handleClick: (o) => {
|
|
298
|
+
let r = N.generate(), n = `${e.btnCode}_${r}`;
|
|
236
299
|
console.log(
|
|
237
300
|
"按钮组件点击事件获取到事件对象及事件唯一标识符",
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
), e.btnCode ?
|
|
301
|
+
o,
|
|
302
|
+
n
|
|
303
|
+
), e.btnCode ? t.emit("handleClick", n) : t.emit("handleClick", "");
|
|
241
304
|
}
|
|
242
305
|
};
|
|
243
306
|
}
|
|
244
307
|
});
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
for (const [
|
|
248
|
-
|
|
249
|
-
return
|
|
250
|
-
},
|
|
308
|
+
const T = (e, t) => {
|
|
309
|
+
const i = e.__vccOpts || e;
|
|
310
|
+
for (const [o, r] of t)
|
|
311
|
+
i[o] = r;
|
|
312
|
+
return i;
|
|
313
|
+
}, V = {
|
|
251
314
|
key: 0,
|
|
252
315
|
class: "s-icon"
|
|
253
|
-
},
|
|
254
|
-
function
|
|
255
|
-
const l =
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
class:
|
|
316
|
+
}, j = ["src"];
|
|
317
|
+
function E(e, t, i, o, r, n) {
|
|
318
|
+
const l = h("Loading"), s = h("el-icon"), d = h("el-button");
|
|
319
|
+
return a(), c("div", null, [
|
|
320
|
+
y(d, {
|
|
321
|
+
class: w(["s-button", { plain: e.plain, btnhover: !e.plain, loading: e.loading }]),
|
|
259
322
|
disabled: e.disabled,
|
|
260
323
|
loading: e.loading,
|
|
261
|
-
style:
|
|
324
|
+
style: f(e.styleOjb),
|
|
262
325
|
onClick: e.handleClick,
|
|
263
326
|
btnCode: e.btnCode
|
|
264
327
|
}, {
|
|
265
|
-
default:
|
|
266
|
-
e.icon ? (
|
|
267
|
-
|
|
328
|
+
default: C(() => [
|
|
329
|
+
e.icon ? (a(), c("i", V, [
|
|
330
|
+
u("img", {
|
|
268
331
|
src: e.geturl,
|
|
269
332
|
alt: "",
|
|
270
|
-
style:
|
|
271
|
-
}, null, 12,
|
|
272
|
-
])) :
|
|
273
|
-
|
|
274
|
-
style:
|
|
333
|
+
style: f(e.styleObject)
|
|
334
|
+
}, null, 12, j)
|
|
335
|
+
])) : v("", !0),
|
|
336
|
+
u("span", {
|
|
337
|
+
style: f({ color: e.color })
|
|
275
338
|
}, [
|
|
276
|
-
|
|
339
|
+
$(e.$slots, "default", {}, void 0, !0)
|
|
277
340
|
], 4),
|
|
278
|
-
e.loading ? (
|
|
341
|
+
e.loading ? (a(), k(s, {
|
|
279
342
|
key: 1,
|
|
280
343
|
class: "is-loading",
|
|
281
344
|
color: e.loadingColor
|
|
282
345
|
}, {
|
|
283
|
-
default:
|
|
284
|
-
|
|
346
|
+
default: C(() => [
|
|
347
|
+
y(l)
|
|
285
348
|
]),
|
|
286
349
|
_: 1
|
|
287
|
-
}, 8, ["color"])) :
|
|
350
|
+
}, 8, ["color"])) : v("", !0)
|
|
288
351
|
]),
|
|
289
352
|
_: 3
|
|
290
353
|
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"])
|
|
291
354
|
]);
|
|
292
355
|
}
|
|
293
|
-
const
|
|
294
|
-
function
|
|
295
|
-
|
|
356
|
+
const _ = /* @__PURE__ */ T(M, [["render", E], ["__scopeId", "data-v-d0c067b2"]]);
|
|
357
|
+
function p(e, t = {}) {
|
|
358
|
+
p.installed || (p.installed = !0, e.component("common-button", _));
|
|
296
359
|
}
|
|
297
|
-
|
|
360
|
+
_.install = p;
|
|
298
361
|
export {
|
|
299
|
-
|
|
362
|
+
_ as default
|
|
300
363
|
};
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue")):typeof define=="function"&&define.amd?define(["vue"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.button=a(t.Vue))})(this,function(t){"use strict";/*! Element Plus Icons Vue v2.1.0 */var a=(e,o)=>{let l=e.__vccOpts||e;for(let[i,r]of o)l[i]=r;return l},b={name:"Loading"},y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},C=t.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),m=[C];function _(e,o,l,i,r,s){return t.openBlock(),t.createElementBlock("svg",y,m)}var S=a(b,[["render",_],["__file","loading.vue"]]);function h(e,o,l){for(var i=[],r=Math.max(e.length,o.length),s=0,n=0;n<r||s;){var d=n<e.length?e[n]:0,u=n<o.length?o[n]:0,g=s+d+u;i.push(g%l),s=Math.floor(g/l),n++}return i}function p(e,o,l){if(e<0)return null;if(e==0)return[];for(var i=[],r=o;e&1&&(i=h(i,r,l)),e=e>>1,e!==0;)r=h(r,r,l);return i}function w(e,o){for(var l=e.split(""),i=[],r=l.length-1;r>=0;r--){var s=parseInt(l[r],o);if(isNaN(s))return null;i.push(s)}return i}function k(e,o,l){var i=w(e,o);if(i===null)return null;for(var r=[],s=[1],n=0;n<i.length;n++)i[n]&&(r=h(r,p(i[n],s,l),l)),s=p(o,s,l);for(var d="",n=r.length-1;n>=0;n--)d+=r[n].toString(l);return d}function $(e){return e.substring(0,2)==="0x"&&(e=e.substring(2)),e=e.toLowerCase(),k(e,16,10)}class v{constructor(o){o=o||{},this.seq=0,this.mid=(o.mid||1)%1023,this.offset=o.offset||0,this.lastTime=0}generate(){const o=Date.now(),l=(o-this.offset).toString(2);this.lastTime==o?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=o;let i=this.seq.toString(2),r=this.mid.toString(2);for(;i.length<12;)i="0"+i;for(;r.length<10;)r="0"+r;const s=l+r+i;let n="";for(let d=s.length;d>0;d-=4)n=parseInt(s.substring(d-4,d),2).toString(16)+n;return $(n)}}const z=new v({mid:42,offset:(2019-1970)*31536e3*1e3}),F=t.defineComponent({components:{Loading:S},props:{disabled:{type:Boolean,default:!1},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:""},borderColor:{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.borderColor||this.color||"#99004A"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle}:this.primary?{background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle}:this.primaryOrdinary?{background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:"190px",height:"52px",borderRadius:this.circle,fontSize:"16px",fontWeight:600}:this.primaryDialog?{width:"176px",height:"46px",background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",borderRadius:"8px",fontSize:"16px",fontWeight:600}:this.default?{background:"#ffffff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle}:this.info?{background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.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.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.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:"8px",fontSize:"16px",fontWeight:600}:{color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,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"}}},emits:["handleClick"],setup(e,o){return{handleClick:i=>{let r=z.generate(),s=`${e.btnCode}_${r}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",i,s),e.btnCode?o.emit("handleClick",s):o.emit("handleClick","")}}}}),L="",B=(e,o)=>{const l=e.__vccOpts||e;for(const[i,r]of o)l[i]=r;return l},x={key:0,class:"s-icon"},A=["src"];function W(e,o,l,i,r,s){const n=t.resolveComponent("Loading"),d=t.resolveComponent("el-icon"),u=t.resolveComponent("el-button");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(u,{class:t.normalizeClass(["s-button",{plain:e.plain,btnhover:!e.plain,loading:e.loading}]),disabled:e.disabled,loading:e.loading,style:t.normalizeStyle(e.styleOjb),onClick:e.handleClick,btnCode:e.btnCode},{default:t.withCtx(()=>[e.icon?(t.openBlock(),t.createElementBlock("i",x,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,A)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(t.openBlock(),t.createBlock(d,{key:1,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(n)]),_:1},8,["color"])):t.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"])])}const f=B(F,[["render",W],["__scopeId","data-v-d0c067b2"]]);function c(e,o={}){c.installed||(c.installed=!0,e.component("common-button",f))}return f.install=c,f});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.btnhover[data-v-
|
|
1
|
+
.btnhover[data-v-d0c067b2]:hover{box-shadow:0 0 15px #2461cc4d;opacity:.95}.s-button[data-v-d0c067b2]{display:inline-block;height:36px;line-height:1;border:none;background:#99004A;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-d0c067b2]{margin-left:15px}.s-button span[data-v-d0c067b2]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-d0c067b2]{vertical-align:middle}.plain[data-v-d0c067b2]{background:#fff}.plain-icon[data-v-d0c067b2]{margin-right:4px}.loading[data-v-d0c067b2]{opacity:.8}.s-icon[data-v-d0c067b2]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-d0c067b2]{float:left}
|