sinosoft-common-button 1.3.7 → 1.3.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 +11 -15
- package/common-button.umd.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/common-button.es.js
CHANGED
|
@@ -26,7 +26,7 @@ function ae(e, t, i, r, o, l) {
|
|
|
26
26
|
return c(), y("svg", ne, se);
|
|
27
27
|
}
|
|
28
28
|
var de = /* @__PURE__ */ re(oe, [["render", ae], ["__file", "loading.vue"]]);
|
|
29
|
-
function
|
|
29
|
+
function W(e, t, i) {
|
|
30
30
|
for (var r = [], o = Math.max(e.length, t.length), l = 0, n = 0; n < o || l; ) {
|
|
31
31
|
var s = n < e.length ? e[n] : 0, d = n < t.length ? t[n] : 0, f = l + s + d;
|
|
32
32
|
r.push(f % i), l = Math.floor(f / i), n++;
|
|
@@ -38,8 +38,8 @@ function F(e, t, i) {
|
|
|
38
38
|
return null;
|
|
39
39
|
if (e == 0)
|
|
40
40
|
return [];
|
|
41
|
-
for (var r = [], o = t; e & 1 && (r =
|
|
42
|
-
o =
|
|
41
|
+
for (var r = [], o = t; e & 1 && (r = W(r, o, i)), e = e >> 1, e !== 0; )
|
|
42
|
+
o = W(o, o, i);
|
|
43
43
|
return r;
|
|
44
44
|
}
|
|
45
45
|
function fe(e, t) {
|
|
@@ -56,7 +56,7 @@ function he(e, t, i) {
|
|
|
56
56
|
if (r === null)
|
|
57
57
|
return null;
|
|
58
58
|
for (var o = [], l = [1], n = 0; n < r.length; n++)
|
|
59
|
-
r[n] && (o =
|
|
59
|
+
r[n] && (o = W(
|
|
60
60
|
o,
|
|
61
61
|
F(r[n], l, i),
|
|
62
62
|
i
|
|
@@ -104,10 +104,10 @@ function we(e) {
|
|
|
104
104
|
return t;
|
|
105
105
|
}
|
|
106
106
|
var Te = we, ze = Te, je = /^\s+/;
|
|
107
|
-
function
|
|
107
|
+
function We(e) {
|
|
108
108
|
return e && e.slice(0, ze(e) + 1).replace(je, "");
|
|
109
109
|
}
|
|
110
|
-
var
|
|
110
|
+
var Oe = We, Ie = V, Le = Ie.Symbol, U = Le, H = U, X = Object.prototype, Ee = X.hasOwnProperty, Ae = X.toString, p = H ? H.toStringTag : void 0;
|
|
111
111
|
function Ne(e) {
|
|
112
112
|
var t = Ee.call(e, p), i = e[p];
|
|
113
113
|
try {
|
|
@@ -134,7 +134,7 @@ var Xe = Ue, Je = Ve, Ke = Xe, Qe = "[object Symbol]";
|
|
|
134
134
|
function Ye(e) {
|
|
135
135
|
return typeof e == "symbol" || Ke(e) && Je(e) == Qe;
|
|
136
136
|
}
|
|
137
|
-
var Ze = Ye, et =
|
|
137
|
+
var Ze = Ye, et = Oe, q = P, tt = Ze, D = 0 / 0, it = /^[-+]0x[0-9a-f]+$/i, rt = /^0b[01]+$/i, ot = /^0o[0-7]+$/i, nt = parseInt;
|
|
138
138
|
function lt(e) {
|
|
139
139
|
if (typeof e == "number")
|
|
140
140
|
return e;
|
|
@@ -200,7 +200,7 @@ function ct(e, t, i) {
|
|
|
200
200
|
}
|
|
201
201
|
var ut = ct;
|
|
202
202
|
const gt = /* @__PURE__ */ ge(ut);
|
|
203
|
-
var
|
|
203
|
+
var O;
|
|
204
204
|
((e) => {
|
|
205
205
|
e.debouncedFun = (t, i) => gt(t, i, {
|
|
206
206
|
leading: !0,
|
|
@@ -208,7 +208,7 @@ var W;
|
|
|
208
208
|
trailing: !1
|
|
209
209
|
// 延长结束前调用
|
|
210
210
|
});
|
|
211
|
-
})(
|
|
211
|
+
})(O || (O = {}));
|
|
212
212
|
const bt = new ue({
|
|
213
213
|
mid: 42,
|
|
214
214
|
offset: (2019 - 1970) * 31536e3 * 1e3
|
|
@@ -312,10 +312,6 @@ const bt = new ue({
|
|
|
312
312
|
borderWidth: {
|
|
313
313
|
type: String,
|
|
314
314
|
default: ""
|
|
315
|
-
},
|
|
316
|
-
styleOjb: {
|
|
317
|
-
type: Object,
|
|
318
|
-
default: {}
|
|
319
315
|
}
|
|
320
316
|
},
|
|
321
317
|
computed: {
|
|
@@ -430,7 +426,7 @@ const bt = new ue({
|
|
|
430
426
|
l,
|
|
431
427
|
s
|
|
432
428
|
), e.btnCode ? t.emit("handleClick", s) : t.emit("handleClick", "");
|
|
433
|
-
}, r =
|
|
429
|
+
}, r = O.debouncedFun((l) => {
|
|
434
430
|
i(l);
|
|
435
431
|
}, 3e3), o = (l) => {
|
|
436
432
|
e.debounced ? r(l) : i(l);
|
|
@@ -524,7 +520,7 @@ function kt(e, t, i, r, o, l) {
|
|
|
524
520
|
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"]))
|
|
525
521
|
]);
|
|
526
522
|
}
|
|
527
|
-
const J = /* @__PURE__ */ yt(pt, [["render", kt], ["__scopeId", "data-v-
|
|
523
|
+
const J = /* @__PURE__ */ yt(pt, [["render", kt], ["__scopeId", "data-v-7b5f45b1"]]);
|
|
528
524
|
function I(e, t = {}) {
|
|
529
525
|
I.installed || (I.installed = !0, e.component("common-button", J));
|
|
530
526
|
}
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("vue")):typeof define=="function"&&define.amd?define(["vue"],u):(i=typeof globalThis<"u"?globalThis:i||self,i.button=u(i.Vue))})(this,function(i){"use strict";/*! Element Plus Icons Vue v2.1.0 */var u=(e,t)=>{let o=e.__vccOpts||e;for(let[r,n]of t)o[r]=n;return o},M={name:"Loading"},q={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},D=i.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),G=[D];function P(e,t,o,r,n,s){return i.openBlock(),i.createElementBlock("svg",q,G)}var U=u(M,[["render",P],["__file","loading.vue"]]);function C(e,t,o){for(var r=[],n=Math.max(e.length,t.length),s=0,l=0;l<n||s;){var a=l<e.length?e[l]:0,f=l<t.length?t[l]:0,c=s+a+f;r.push(c%o),s=Math.floor(c/o),l++}return r}function z(e,t,o){if(e<0)return null;if(e==0)return[];for(var r=[],n=t;e&1&&(r=C(r,n,o)),e=e>>1,e!==0;)n=C(n,n,o);return r}function X(e,t){for(var o=e.split(""),r=[],n=o.length-1;n>=0;n--){var s=parseInt(o[n],t);if(isNaN(s))return null;r.push(s)}return r}function J(e,t,o){var r=X(e,t);if(r===null)return null;for(var n=[],s=[1],l=0;l<r.length;l++)r[l]&&(n=C(n,z(r[l],s,o),o)),s=z(t,s,o);for(var a="",l=n.length-1;l>=0;l--)a+=n[l].toString(o);return a}function K(e){return e.substring(0,2)==="0x"&&(e=e.substring(2)),e=e.toLowerCase(),J(e,16,10)}class Q{constructor(t){t=t||{},this.seq=0,this.mid=(t.mid||1)%1023,this.offset=t.offset||0,this.lastTime=0}generate(){const t=Date.now(),o=(t-this.offset).toString(2);this.lastTime==t?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=t;let r=this.seq.toString(2),n=this.mid.toString(2);for(;r.length<12;)r="0"+r;for(;n.length<10;)n="0"+n;const s=o+n+r;let l="";for(let a=s.length;a>0;a-=4)l=parseInt(s.substring(a-4,a),2).toString(16)+l;return K(l)}}var m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var j=Z,ee=typeof m=="object"&&m&&m.Object===Object&&m,te=ee,ie=te,oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ie||oe||Function("return this")(),O=re,ne=O,le=function(){return ne.Date.now()},se=le,ae=/\s/;function de(e){for(var t=e.length;t--&&ae.test(e.charAt(t)););return t}var fe=de,ce=fe,he=/^\s+/;function ue(e){return e&&e.slice(0,ce(e)+1).replace(he,"")}var ge=ue,be=O,pe=be.Symbol,W=pe,B=W,E=Object.prototype,me=E.hasOwnProperty,ye=E.toString,g=B?B.toStringTag:void 0;function Ce(e){var t=me.call(e,g),o=e[g];try{e[g]=void 0;var r=!0}catch{}var n=ye.call(e);return r&&(t?e[g]=o:delete e[g]),n}var Se=Ce,ke=Object.prototype,_e=ke.toString;function $e(e){return _e.call(e)}var ve=$e,N=W,we=Se,Te=ve,ze="[object Null]",je="[object Undefined]",I=N?N.toStringTag:void 0;function Oe(e){return e==null?e===void 0?je:ze:I&&I in Object(e)?we(e):Te(e)}var We=Oe;function Be(e){return e!=null&&typeof e=="object"}var Ee=Be,Ne=We,Ie=Ee,Le="[object Symbol]";function Ae(e){return typeof e=="symbol"||Ie(e)&&Ne(e)==Le}var Ve=Ae,xe=ge,L=j,Re=Ve,A=0/0,Fe=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,qe=parseInt;function De(e){if(typeof e=="number")return e;if(Re(e))return A;if(L(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=L(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xe(e);var o=He.test(e);return o||Me.test(e)?qe(e.slice(2),o?2:8):Fe.test(e)?A:+e}var Ge=De,Pe=j,S=se,V=Ge,Ue="Expected a function",Xe=Math.max,Je=Math.min;function Ke(e,t,o){var r,n,s,l,a,f,c=0,x=!1,b=!1,v=!0;if(typeof e!="function")throw new TypeError(Ue);t=V(t)||0,Pe(o)&&(x=!!o.leading,b="maxWait"in o,s=b?Xe(V(o.maxWait)||0,t):s,v="trailing"in o?!!o.trailing:v);function w(d){var h=r,p=n;return r=n=void 0,c=d,l=e.apply(p,h),l}function dt(d){return c=d,a=setTimeout(y,t),x?w(d):l}function ft(d){var h=d-f,p=d-c,H=t-h;return b?Je(H,s-p):H}function R(d){var h=d-f,p=d-c;return f===void 0||h>=t||h<0||b&&p>=s}function y(){var d=S();if(R(d))return F(d);a=setTimeout(y,ft(d))}function F(d){return a=void 0,v&&r?w(d):(r=n=void 0,l)}function ct(){a!==void 0&&clearTimeout(a),c=0,r=f=n=a=void 0}function ht(){return a===void 0?l:F(S())}function T(){var d=S(),h=R(d);if(r=arguments,n=this,f=d,h){if(a===void 0)return dt(f);if(b)return clearTimeout(a),a=setTimeout(y,t),w(f)}return a===void 0&&(a=setTimeout(y,t)),l}return T.cancel=ct,T.flush=ht,T}var Qe=Ke;const Ye=Y(Qe);var k;(e=>{e.debouncedFun=(t,o)=>Ye(t,o,{leading:!0,trailing:!1})})(k||(k={}));const Ze=new Q({mid:42,offset:(2019-1970)*31536e3*1e3}),et=i.defineComponent({components:{Loading:U},props:{disabled:{type:Boolean,default:!1},debounced:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},info:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},fontSize:{type:String,default:""},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"},fontWeight:{type:Number,default:500},lineHeight:{type:String,default:""},borderWidth:{type:String,default:""},styleOjb:{type:Object,default:{}}},computed:{styleOjb(){return this.plain?{background:this.bgColor||"#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,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size}:this.primary?{background:this.bgColor||"#99004A",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.default?{background:this.bgColor||"#ffffff",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.info?{background:this.bgColor||"#C4C4C4",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.text?{width:`${this.width||"41px"}`,height:`${this.height||"24px"}`,background:this.bgColor||"#ffffff",borderWidth:this.borderWidth||"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:this.link?{width:this.width,height:this.height,borderWidth:this.borderWidth||"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:{width:this.width,height:this.height,color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size||"20",borderWidth:this.borderWidth||"0px"}},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,t){const o=s=>{let l=Ze.generate(),a=`${e.btnCode}_${l}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",s,a),e.btnCode?t.emit("handleClick",a):t.emit("handleClick","")},r=k.debouncedFun(s=>{o(s)},3e3),n=s=>{e.debounced?r(s):o(s)};return i.onUnmounted(()=>{r.cancel()}),{getHandleClick:n,handleClick:o}}}),ut="",tt=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o},it={class:"common-button"},ot={key:0,class:"s-icon"},rt=["src"],nt=["btnCode"],lt={key:0,class:"s-icon padding-icon"},st=["src"];function at(e,t,o,r,n,s){const l=i.resolveComponent("Loading"),a=i.resolveComponent("el-icon"),f=i.resolveComponent("el-button");return i.openBlock(),i.createElementBlock("div",it,[e.link?(i.openBlock(),i.createElementBlock("span",{key:1,class:"link",style:i.normalizeStyle(e.styleOjb),btnCode:e.btnCode,onClick:t[0]||(t[0]=(...c)=>e.getHandleClick&&e.getHandleClick(...c))},[e.icon?(i.openBlock(),i.createElementBlock("i",lt,[i.createElementVNode("img",{src:e.geturl,alt:"",style:i.normalizeStyle(e.styleObject)},null,12,st)])):i.createCommentVNode("",!0),i.createElementVNode("span",{style:i.normalizeStyle({color:e.color})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(i.openBlock(),i.createBlock(a,{key:1,class:"is-loading",color:e.loadingColor},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["color"])):i.createCommentVNode("",!0)],12,nt)):(i.openBlock(),i.createBlock(f,{key:0,class:i.normalizeClass(["s-button",{plain:e.plain,btnhover:!e.plain,loading:e.loading}]),disabled:e.disabled,loading:e.loading,style:i.normalizeStyle(e.styleOjb),onClick:e.getHandleClick,btnCode:e.btnCode},{default:i.withCtx(()=>[e.icon?(i.openBlock(),i.createElementBlock("i",ot,[i.createElementVNode("img",{src:e.geturl,alt:"",style:i.normalizeStyle(e.styleObject)},null,12,rt)])):i.createCommentVNode("",!0),i.createElementVNode("span",{style:i.normalizeStyle({color:e.color})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(i.openBlock(),i.createBlock(a,{key:1,class:"is-loading",color:e.loadingColor},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["color"])):i.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"]))])}const _=tt(et,[["render",at],["__scopeId","data-v-84dd6716"]]);function $(e,t={}){$.installed||($.installed=!0,e.component("common-button",_))}return _.install=$,_});
|
|
1
|
+
(function(i,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("vue")):typeof define=="function"&&define.amd?define(["vue"],u):(i=typeof globalThis<"u"?globalThis:i||self,i.button=u(i.Vue))})(this,function(i){"use strict";/*! Element Plus Icons Vue v2.1.0 */var u=(e,t)=>{let o=e.__vccOpts||e;for(let[r,n]of t)o[r]=n;return o},M={name:"Loading"},q={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},D=i.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),G=[D];function P(e,t,o,r,n,s){return i.openBlock(),i.createElementBlock("svg",q,G)}var U=u(M,[["render",P],["__file","loading.vue"]]);function C(e,t,o){for(var r=[],n=Math.max(e.length,t.length),s=0,l=0;l<n||s;){var a=l<e.length?e[l]:0,f=l<t.length?t[l]:0,c=s+a+f;r.push(c%o),s=Math.floor(c/o),l++}return r}function z(e,t,o){if(e<0)return null;if(e==0)return[];for(var r=[],n=t;e&1&&(r=C(r,n,o)),e=e>>1,e!==0;)n=C(n,n,o);return r}function X(e,t){for(var o=e.split(""),r=[],n=o.length-1;n>=0;n--){var s=parseInt(o[n],t);if(isNaN(s))return null;r.push(s)}return r}function J(e,t,o){var r=X(e,t);if(r===null)return null;for(var n=[],s=[1],l=0;l<r.length;l++)r[l]&&(n=C(n,z(r[l],s,o),o)),s=z(t,s,o);for(var a="",l=n.length-1;l>=0;l--)a+=n[l].toString(o);return a}function K(e){return e.substring(0,2)==="0x"&&(e=e.substring(2)),e=e.toLowerCase(),J(e,16,10)}class Q{constructor(t){t=t||{},this.seq=0,this.mid=(t.mid||1)%1023,this.offset=t.offset||0,this.lastTime=0}generate(){const t=Date.now(),o=(t-this.offset).toString(2);this.lastTime==t?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=t;let r=this.seq.toString(2),n=this.mid.toString(2);for(;r.length<12;)r="0"+r;for(;n.length<10;)n="0"+n;const s=o+n+r;let l="";for(let a=s.length;a>0;a-=4)l=parseInt(s.substring(a-4,a),2).toString(16)+l;return K(l)}}var m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var j=Z,ee=typeof m=="object"&&m&&m.Object===Object&&m,te=ee,ie=te,oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ie||oe||Function("return this")(),W=re,ne=W,le=function(){return ne.Date.now()},se=le,ae=/\s/;function de(e){for(var t=e.length;t--&&ae.test(e.charAt(t)););return t}var fe=de,ce=fe,he=/^\s+/;function ue(e){return e&&e.slice(0,ce(e)+1).replace(he,"")}var ge=ue,be=W,pe=be.Symbol,O=pe,B=O,E=Object.prototype,me=E.hasOwnProperty,ye=E.toString,g=B?B.toStringTag:void 0;function Ce(e){var t=me.call(e,g),o=e[g];try{e[g]=void 0;var r=!0}catch{}var n=ye.call(e);return r&&(t?e[g]=o:delete e[g]),n}var Se=Ce,ke=Object.prototype,_e=ke.toString;function $e(e){return _e.call(e)}var ve=$e,N=O,we=Se,Te=ve,ze="[object Null]",je="[object Undefined]",I=N?N.toStringTag:void 0;function We(e){return e==null?e===void 0?je:ze:I&&I in Object(e)?we(e):Te(e)}var Oe=We;function Be(e){return e!=null&&typeof e=="object"}var Ee=Be,Ne=Oe,Ie=Ee,Le="[object Symbol]";function Ae(e){return typeof e=="symbol"||Ie(e)&&Ne(e)==Le}var Ve=Ae,xe=ge,L=j,Re=Ve,A=0/0,Fe=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Me=/^0o[0-7]+$/i,qe=parseInt;function De(e){if(typeof e=="number")return e;if(Re(e))return A;if(L(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=L(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xe(e);var o=He.test(e);return o||Me.test(e)?qe(e.slice(2),o?2:8):Fe.test(e)?A:+e}var Ge=De,Pe=j,S=se,V=Ge,Ue="Expected a function",Xe=Math.max,Je=Math.min;function Ke(e,t,o){var r,n,s,l,a,f,c=0,x=!1,b=!1,v=!0;if(typeof e!="function")throw new TypeError(Ue);t=V(t)||0,Pe(o)&&(x=!!o.leading,b="maxWait"in o,s=b?Xe(V(o.maxWait)||0,t):s,v="trailing"in o?!!o.trailing:v);function w(d){var h=r,p=n;return r=n=void 0,c=d,l=e.apply(p,h),l}function dt(d){return c=d,a=setTimeout(y,t),x?w(d):l}function ft(d){var h=d-f,p=d-c,H=t-h;return b?Je(H,s-p):H}function R(d){var h=d-f,p=d-c;return f===void 0||h>=t||h<0||b&&p>=s}function y(){var d=S();if(R(d))return F(d);a=setTimeout(y,ft(d))}function F(d){return a=void 0,v&&r?w(d):(r=n=void 0,l)}function ct(){a!==void 0&&clearTimeout(a),c=0,r=f=n=a=void 0}function ht(){return a===void 0?l:F(S())}function T(){var d=S(),h=R(d);if(r=arguments,n=this,f=d,h){if(a===void 0)return dt(f);if(b)return clearTimeout(a),a=setTimeout(y,t),w(f)}return a===void 0&&(a=setTimeout(y,t)),l}return T.cancel=ct,T.flush=ht,T}var Qe=Ke;const Ye=Y(Qe);var k;(e=>{e.debouncedFun=(t,o)=>Ye(t,o,{leading:!0,trailing:!1})})(k||(k={}));const Ze=new Q({mid:42,offset:(2019-1970)*31536e3*1e3}),et=i.defineComponent({components:{Loading:U},props:{disabled:{type:Boolean,default:!1},debounced:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},info:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},fontSize:{type:String,default:""},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"},fontWeight:{type:Number,default:500},lineHeight:{type:String,default:""},borderWidth:{type:String,default:""}},computed:{styleOjb(){return this.plain?{background:this.bgColor||"#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,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size}:this.primary?{background:this.bgColor||"#99004A",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.default?{background:this.bgColor||"#ffffff",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.info?{background:this.bgColor||"#C4C4C4",borderWidth:this.borderWidth||"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.text?{width:`${this.width||"41px"}`,height:`${this.height||"24px"}`,background:this.bgColor||"#ffffff",borderWidth:this.borderWidth||"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:this.link?{width:this.width,height:this.height,borderWidth:this.borderWidth||"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:{width:this.width,height:this.height,color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size||"20",borderWidth:this.borderWidth||"0px"}},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,t){const o=s=>{let l=Ze.generate(),a=`${e.btnCode}_${l}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",s,a),e.btnCode?t.emit("handleClick",a):t.emit("handleClick","")},r=k.debouncedFun(s=>{o(s)},3e3),n=s=>{e.debounced?r(s):o(s)};return i.onUnmounted(()=>{r.cancel()}),{getHandleClick:n,handleClick:o}}}),ut="",tt=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o},it={class:"common-button"},ot={key:0,class:"s-icon"},rt=["src"],nt=["btnCode"],lt={key:0,class:"s-icon padding-icon"},st=["src"];function at(e,t,o,r,n,s){const l=i.resolveComponent("Loading"),a=i.resolveComponent("el-icon"),f=i.resolveComponent("el-button");return i.openBlock(),i.createElementBlock("div",it,[e.link?(i.openBlock(),i.createElementBlock("span",{key:1,class:"link",style:i.normalizeStyle(e.styleOjb),btnCode:e.btnCode,onClick:t[0]||(t[0]=(...c)=>e.getHandleClick&&e.getHandleClick(...c))},[e.icon?(i.openBlock(),i.createElementBlock("i",lt,[i.createElementVNode("img",{src:e.geturl,alt:"",style:i.normalizeStyle(e.styleObject)},null,12,st)])):i.createCommentVNode("",!0),i.createElementVNode("span",{style:i.normalizeStyle({color:e.color})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(i.openBlock(),i.createBlock(a,{key:1,class:"is-loading",color:e.loadingColor},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["color"])):i.createCommentVNode("",!0)],12,nt)):(i.openBlock(),i.createBlock(f,{key:0,class:i.normalizeClass(["s-button",{plain:e.plain,btnhover:!e.plain,loading:e.loading}]),disabled:e.disabled,loading:e.loading,style:i.normalizeStyle(e.styleOjb),onClick:e.getHandleClick,btnCode:e.btnCode},{default:i.withCtx(()=>[e.icon?(i.openBlock(),i.createElementBlock("i",ot,[i.createElementVNode("img",{src:e.geturl,alt:"",style:i.normalizeStyle(e.styleObject)},null,12,rt)])):i.createCommentVNode("",!0),i.createElementVNode("span",{style:i.normalizeStyle({color:e.color})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(i.openBlock(),i.createBlock(a,{key:1,class:"is-loading",color:e.loadingColor},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["color"])):i.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"]))])}const _=tt(et,[["render",at],["__scopeId","data-v-7b5f45b1"]]);function $(e,t={}){$.installed||($.installed=!0,e.component("common-button",_))}return _.install=$,_});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.s-button[data-v-
|
|
1
|
+
.s-button[data-v-7b5f45b1]{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-7b5f45b1]{margin-left:15px}.s-button span[data-v-7b5f45b1]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-7b5f45b1]{vertical-align:middle}.link[data-v-7b5f45b1]{align-items:center;display:inline-flex}.link[data-v-7b5f45b1]:hover{cursor:pointer;color:red}.plain[data-v-7b5f45b1]{background:#fff}.plain-icon[data-v-7b5f45b1]{margin-right:4px}.loading[data-v-7b5f45b1]{opacity:.8}.s-icon[data-v-7b5f45b1]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden;vertical-align:middle}.s-icon img[data-v-7b5f45b1]{float:left;width:25px;height:25px}.padding-icon[data-v-7b5f45b1]{padding-right:5px}
|