sinosoft-common-button 1.2.4 → 1.2.5
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 +30 -31
- 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 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,
|
|
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 m, renderSlot as $, createBlock as k } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.1.0 */
|
|
3
|
-
var
|
|
3
|
+
var z = (e, t) => {
|
|
4
4
|
let i = e.__vccOpts || e;
|
|
5
5
|
for (let [o, r] of t)
|
|
6
6
|
i[o] = r;
|
|
7
7
|
return i;
|
|
8
|
-
},
|
|
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,13 +19,13 @@ var x = (e, t) => {
|
|
|
19
19
|
null,
|
|
20
20
|
-1
|
|
21
21
|
/* HOISTED */
|
|
22
|
-
),
|
|
23
|
-
|
|
22
|
+
), B = [
|
|
23
|
+
A
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
return a(), c("svg",
|
|
25
|
+
function W(e, t, i, o, r, n) {
|
|
26
|
+
return a(), c("svg", x, B);
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var L = /* @__PURE__ */ z(F, [["render", W], ["__file", "loading.vue"]]);
|
|
29
29
|
function g(e, t, i) {
|
|
30
30
|
for (var o = [], r = Math.max(e.length, t.length), n = 0, l = 0; l < r || n; ) {
|
|
31
31
|
var s = l < e.length ? e[l] : 0, d = l < t.length ? t[l] : 0, b = n + s + d;
|
|
@@ -42,7 +42,7 @@ function v(e, t, i) {
|
|
|
42
42
|
r = g(r, r, i);
|
|
43
43
|
return o;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function O(e, t) {
|
|
46
46
|
for (var i = e.split(""), o = [], r = i.length - 1; r >= 0; r--) {
|
|
47
47
|
var n = parseInt(i[r], t);
|
|
48
48
|
if (isNaN(n))
|
|
@@ -51,8 +51,8 @@ function q(e, t) {
|
|
|
51
51
|
}
|
|
52
52
|
return o;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
var o =
|
|
54
|
+
function q(e, t, i) {
|
|
55
|
+
var o = O(e, t);
|
|
56
56
|
if (o === null)
|
|
57
57
|
return null;
|
|
58
58
|
for (var r = [], n = [1], l = 0; l < o.length; l++)
|
|
@@ -65,10 +65,10 @@ function R(e, t, i) {
|
|
|
65
65
|
s += r[l].toString(i);
|
|
66
66
|
return s;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(),
|
|
68
|
+
function D(e) {
|
|
69
|
+
return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(), q(e, 16, 10);
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class R {
|
|
72
72
|
constructor(t) {
|
|
73
73
|
t = t || {}, this.seq = 0, this.mid = (t.mid || 1) % 1023, this.offset = t.offset || 0, this.lastTime = 0;
|
|
74
74
|
}
|
|
@@ -84,15 +84,15 @@ class T {
|
|
|
84
84
|
let l = "";
|
|
85
85
|
for (let s = n.length; s > 0; s -= 4)
|
|
86
86
|
l = parseInt(n.substring(s - 4, s), 2).toString(16) + l;
|
|
87
|
-
return
|
|
87
|
+
return D(l);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const N = new R({
|
|
91
91
|
mid: 42,
|
|
92
92
|
offset: (2019 - 1970) * 31536e3 * 1e3
|
|
93
|
-
}),
|
|
93
|
+
}), M = S({
|
|
94
94
|
components: {
|
|
95
|
-
Loading:
|
|
95
|
+
Loading: L
|
|
96
96
|
},
|
|
97
97
|
props: {
|
|
98
98
|
disabled: {
|
|
@@ -295,7 +295,7 @@ const M = new T({
|
|
|
295
295
|
setup(e, t) {
|
|
296
296
|
return {
|
|
297
297
|
handleClick: (o) => {
|
|
298
|
-
let r =
|
|
298
|
+
let r = N.generate(), n = `${e.btnCode}_${r}`;
|
|
299
299
|
console.log(
|
|
300
300
|
"按钮组件点击事件获取到事件对象及事件唯一标识符",
|
|
301
301
|
o,
|
|
@@ -305,16 +305,16 @@ const M = new T({
|
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
|
-
const
|
|
308
|
+
const T = (e, t) => {
|
|
309
309
|
const i = e.__vccOpts || e;
|
|
310
310
|
for (const [o, r] of t)
|
|
311
311
|
i[o] = r;
|
|
312
312
|
return i;
|
|
313
|
-
},
|
|
313
|
+
}, V = {
|
|
314
314
|
key: 0,
|
|
315
315
|
class: "s-icon"
|
|
316
|
-
},
|
|
317
|
-
function
|
|
316
|
+
}, j = ["src"];
|
|
317
|
+
function E(e, t, i, o, r, n) {
|
|
318
318
|
const l = h("Loading"), s = h("el-icon"), d = h("el-button");
|
|
319
319
|
return a(), c("div", null, [
|
|
320
320
|
y(d, {
|
|
@@ -326,20 +326,19 @@ function H(e, t, i, o, r, n) {
|
|
|
326
326
|
btnCode: e.btnCode
|
|
327
327
|
}, {
|
|
328
328
|
default: C(() => [
|
|
329
|
-
|
|
330
|
-
e.icon ? (a(), c("i", E, [
|
|
329
|
+
e.icon ? (a(), c("i", V, [
|
|
331
330
|
u("img", {
|
|
332
331
|
src: e.geturl,
|
|
333
332
|
alt: "",
|
|
334
333
|
style: f(e.styleObject)
|
|
335
|
-
}, null, 12,
|
|
334
|
+
}, null, 12, j)
|
|
336
335
|
])) : m("", !0),
|
|
337
336
|
u("span", {
|
|
338
337
|
style: f({ color: e.color })
|
|
339
338
|
}, [
|
|
340
|
-
|
|
339
|
+
$(e.$slots, "default", {}, void 0, !0)
|
|
341
340
|
], 4),
|
|
342
|
-
e.loading ? (a(),
|
|
341
|
+
e.loading ? (a(), k(s, {
|
|
343
342
|
key: 1,
|
|
344
343
|
class: "is-loading",
|
|
345
344
|
color: e.loadingColor
|
|
@@ -354,7 +353,7 @@ function H(e, t, i, o, r, n) {
|
|
|
354
353
|
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"])
|
|
355
354
|
]);
|
|
356
355
|
}
|
|
357
|
-
const _ = /* @__PURE__ */
|
|
356
|
+
const _ = /* @__PURE__ */ T(M, [["render", E], ["__scopeId", "data-v-06acef51"]]);
|
|
358
357
|
function p(e, t = {}) {
|
|
359
358
|
p.installed || (p.installed = !0, e.component("common-button", _));
|
|
360
359
|
}
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,
|
|
1
|
+
(function(t,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(t=typeof globalThis<"u"?globalThis:t||self,t.button=d(t.Vue))})(this,function(t){"use strict";/*! Element Plus Icons Vue v2.1.0 */var d=(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=d(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 a=n<e.length?e[n]:0,u=n<o.length?o[n]:0,g=s+a+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 a="",n=r.length-1;n>=0;n--)a+=r[n].toString(l);return a}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 a=s.length;a>0;a-=4)n=parseInt(s.substring(a-4,a),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`${this.icon}`}else return"";return`${this.icon}`},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"),a=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(a,{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-06acef51"]]);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-06acef51]:hover{box-shadow:0 0 15px #2461cc4d;opacity:.95;background-color:#641438}.s-button[data-v-06acef51]{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-06acef51]{margin-left:15px}.s-button span[data-v-06acef51]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-06acef51]{vertical-align:middle}.plain[data-v-06acef51]{background:#fff}.plain-icon[data-v-06acef51]{margin-right:4px}.loading[data-v-06acef51]{opacity:.8}.s-icon[data-v-06acef51]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-06acef51]{float:left;width:25px;height:25px}
|