sinosoft-common-button 1.4.0 → 1.4.1
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 +83 -77
- package/common-button.umd.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/common-button.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock as
|
|
1
|
+
import { openBlock as f, createElementBlock as v, createElementVNode as g, defineComponent as te, onUnmounted as ie, resolveComponent as z, createBlock as S, normalizeClass as A, normalizeStyle as u, withCtx as $, createCommentVNode as b, renderSlot as N, createVNode as F } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.1.0 */
|
|
3
3
|
var re = (e, t) => {
|
|
4
4
|
let i = e.__vccOpts || e;
|
|
@@ -23,13 +23,13 @@ var re = (e, t) => {
|
|
|
23
23
|
se
|
|
24
24
|
];
|
|
25
25
|
function ae(e, t, i, r, o, s) {
|
|
26
|
-
return
|
|
26
|
+
return f(), v("svg", ne, le);
|
|
27
27
|
}
|
|
28
28
|
var de = /* @__PURE__ */ re(oe, [["render", ae], ["__file", "loading.vue"]]);
|
|
29
29
|
function O(e, t, i) {
|
|
30
30
|
for (var r = [], o = Math.max(e.length, t.length), s = 0, n = 0; n < o || s; ) {
|
|
31
|
-
var l = n < e.length ? e[n] : 0, d = n < t.length ? t[n] : 0,
|
|
32
|
-
r.push(
|
|
31
|
+
var l = n < e.length ? e[n] : 0, d = n < t.length ? t[n] : 0, h = s + l + d;
|
|
32
|
+
r.push(h % i), s = Math.floor(h / i), n++;
|
|
33
33
|
}
|
|
34
34
|
return r;
|
|
35
35
|
}
|
|
@@ -87,7 +87,7 @@ class ue {
|
|
|
87
87
|
return ce(n);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var _ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
91
91
|
function ge(e) {
|
|
92
92
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
93
93
|
}
|
|
@@ -95,7 +95,7 @@ function be(e) {
|
|
|
95
95
|
var t = typeof e;
|
|
96
96
|
return e != null && (t == "object" || t == "function");
|
|
97
97
|
}
|
|
98
|
-
var U = be, pe = typeof
|
|
98
|
+
var U = be, pe = typeof _ == "object" && _ && _.Object === Object && _, ye = pe, me = ye, ve = typeof self == "object" && self && self.Object === Object && self, Ce = me || ve || Function("return this")(), X = Ce, Se = X, $e = function() {
|
|
99
99
|
return Se.Date.now();
|
|
100
100
|
}, _e = $e, ke = /\s/;
|
|
101
101
|
function we(e) {
|
|
@@ -107,30 +107,30 @@ var Te = we, ze = Te, je = /^\s+/;
|
|
|
107
107
|
function Oe(e) {
|
|
108
108
|
return e && e.slice(0, ze(e) + 1).replace(je, "");
|
|
109
109
|
}
|
|
110
|
-
var We = Oe, Le =
|
|
110
|
+
var We = Oe, Le = X, Ie = Le.Symbol, x = Ie, M = x, J = Object.prototype, Re = J.hasOwnProperty, Ee = J.toString, m = M ? M.toStringTag : void 0;
|
|
111
111
|
function Be(e) {
|
|
112
|
-
var t = Re.call(e,
|
|
112
|
+
var t = Re.call(e, m), i = e[m];
|
|
113
113
|
try {
|
|
114
|
-
e[
|
|
114
|
+
e[m] = void 0;
|
|
115
115
|
var r = !0;
|
|
116
116
|
} catch {
|
|
117
117
|
}
|
|
118
118
|
var o = Ee.call(e);
|
|
119
|
-
return r && (t ? e[
|
|
119
|
+
return r && (t ? e[m] = i : delete e[m]), o;
|
|
120
120
|
}
|
|
121
121
|
var Ae = Be, Ne = Object.prototype, Fe = Ne.toString;
|
|
122
122
|
function He(e) {
|
|
123
123
|
return Fe.call(e);
|
|
124
124
|
}
|
|
125
|
-
var Me = He, q =
|
|
125
|
+
var Me = He, q = x, qe = Ae, De = Me, Ge = "[object Null]", Pe = "[object Undefined]", D = q ? q.toStringTag : void 0;
|
|
126
126
|
function Ve(e) {
|
|
127
127
|
return e == null ? e === void 0 ? Pe : Ge : D && D in Object(e) ? qe(e) : De(e);
|
|
128
128
|
}
|
|
129
129
|
var Ue = Ve;
|
|
130
|
-
function
|
|
130
|
+
function Xe(e) {
|
|
131
131
|
return e != null && typeof e == "object";
|
|
132
132
|
}
|
|
133
|
-
var
|
|
133
|
+
var xe = Xe, Je = Ue, Ke = xe, Qe = "[object Symbol]";
|
|
134
134
|
function Ye(e) {
|
|
135
135
|
return typeof e == "symbol" || Ke(e) && Je(e) == Qe;
|
|
136
136
|
}
|
|
@@ -152,24 +152,24 @@ function st(e) {
|
|
|
152
152
|
}
|
|
153
153
|
var lt = st, at = U, j = _e, V = lt, dt = "Expected a function", ft = Math.max, ht = Math.min;
|
|
154
154
|
function ct(e, t, i) {
|
|
155
|
-
var r, o, s, n, l, d,
|
|
155
|
+
var r, o, s, n, l, d, h = 0, I = !1, p = !1, k = !0;
|
|
156
156
|
if (typeof e != "function")
|
|
157
157
|
throw new TypeError(dt);
|
|
158
|
-
t = V(t) || 0, at(i) && (I = !!i.leading,
|
|
159
|
-
function
|
|
160
|
-
var c = r,
|
|
161
|
-
return r = o = void 0,
|
|
158
|
+
t = V(t) || 0, at(i) && (I = !!i.leading, p = "maxWait" in i, s = p ? ft(V(i.maxWait) || 0, t) : s, k = "trailing" in i ? !!i.trailing : k);
|
|
159
|
+
function w(a) {
|
|
160
|
+
var c = r, y = o;
|
|
161
|
+
return r = o = void 0, h = a, n = e.apply(y, c), n;
|
|
162
162
|
}
|
|
163
163
|
function Q(a) {
|
|
164
|
-
return
|
|
164
|
+
return h = a, l = setTimeout(C, t), I ? w(a) : n;
|
|
165
165
|
}
|
|
166
166
|
function Y(a) {
|
|
167
|
-
var c = a - d,
|
|
168
|
-
return
|
|
167
|
+
var c = a - d, y = a - h, B = t - c;
|
|
168
|
+
return p ? ht(B, s - y) : B;
|
|
169
169
|
}
|
|
170
170
|
function R(a) {
|
|
171
|
-
var c = a - d,
|
|
172
|
-
return d === void 0 || c >= t || c < 0 ||
|
|
171
|
+
var c = a - d, y = a - h;
|
|
172
|
+
return d === void 0 || c >= t || c < 0 || p && y >= s;
|
|
173
173
|
}
|
|
174
174
|
function C() {
|
|
175
175
|
var a = j();
|
|
@@ -178,25 +178,25 @@ function ct(e, t, i) {
|
|
|
178
178
|
l = setTimeout(C, Y(a));
|
|
179
179
|
}
|
|
180
180
|
function E(a) {
|
|
181
|
-
return l = void 0,
|
|
181
|
+
return l = void 0, k && r ? w(a) : (r = o = void 0, n);
|
|
182
182
|
}
|
|
183
183
|
function Z() {
|
|
184
|
-
l !== void 0 && clearTimeout(l),
|
|
184
|
+
l !== void 0 && clearTimeout(l), h = 0, r = d = o = l = void 0;
|
|
185
185
|
}
|
|
186
186
|
function ee() {
|
|
187
187
|
return l === void 0 ? n : E(j());
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function T() {
|
|
190
190
|
var a = j(), c = R(a);
|
|
191
191
|
if (r = arguments, o = this, d = a, c) {
|
|
192
192
|
if (l === void 0)
|
|
193
193
|
return Q(d);
|
|
194
|
-
if (
|
|
195
|
-
return clearTimeout(l), l = setTimeout(C, t),
|
|
194
|
+
if (p)
|
|
195
|
+
return clearTimeout(l), l = setTimeout(C, t), w(d);
|
|
196
196
|
}
|
|
197
197
|
return l === void 0 && (l = setTimeout(C, t)), n;
|
|
198
198
|
}
|
|
199
|
-
return
|
|
199
|
+
return T.cancel = Z, T.flush = ee, T;
|
|
200
200
|
}
|
|
201
201
|
var ut = ct;
|
|
202
202
|
const gt = /* @__PURE__ */ ge(ut);
|
|
@@ -465,52 +465,58 @@ const yt = (e, t) => {
|
|
|
465
465
|
}, vt = ["src"], Ct = {
|
|
466
466
|
key: 1,
|
|
467
467
|
class: "s-icon"
|
|
468
|
-
}, St = ["src"], $t =
|
|
468
|
+
}, St = ["src"], $t = {
|
|
469
469
|
key: 0,
|
|
470
|
-
class: "s-icon
|
|
471
|
-
},
|
|
470
|
+
class: "s-icon"
|
|
471
|
+
}, _t = ["src"], kt = {
|
|
472
472
|
key: 1,
|
|
473
|
-
class: "s-icon
|
|
474
|
-
},
|
|
475
|
-
function
|
|
476
|
-
const n =
|
|
477
|
-
return e.link ? (
|
|
473
|
+
class: "s-icon"
|
|
474
|
+
}, wt = ["src"];
|
|
475
|
+
function Tt(e, t, i, r, o, s) {
|
|
476
|
+
const n = z("Loading"), l = z("el-icon"), d = z("el-button");
|
|
477
|
+
return e.link ? (f(), S(d, {
|
|
478
478
|
key: 1,
|
|
479
|
-
|
|
479
|
+
link: "",
|
|
480
|
+
class: A(["s-button", e.$attrs.class]),
|
|
480
481
|
style: u(e.styleOjb),
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
482
|
+
disabled: e.disabled,
|
|
483
|
+
loading: e.loadingLeft,
|
|
484
|
+
onClick: e.getHandleClick,
|
|
485
|
+
btnCode: e.btnCode
|
|
486
|
+
}, {
|
|
487
|
+
default: $(() => [
|
|
488
|
+
e.icon && !e.iconRight ? (f(), v("i", $t, [
|
|
489
|
+
g("img", {
|
|
490
|
+
src: e.geturl,
|
|
491
|
+
alt: "",
|
|
492
|
+
style: u(e.styleObject)
|
|
493
|
+
}, null, 12, _t)
|
|
494
|
+
])) : b("", !0),
|
|
495
|
+
g("span", {
|
|
496
|
+
style: u({ color: e.color })
|
|
497
|
+
}, [
|
|
498
|
+
N(e.$slots, "default", {}, void 0, !0)
|
|
499
|
+
], 4),
|
|
500
|
+
e.icon && e.iconRight ? (f(), v("i", kt, [
|
|
501
|
+
g("img", {
|
|
502
|
+
src: e.geturl,
|
|
503
|
+
alt: "",
|
|
504
|
+
style: u(e.styleObject)
|
|
505
|
+
}, null, 12, wt)
|
|
506
|
+
])) : b("", !0),
|
|
507
|
+
e.loading ? (f(), S(l, {
|
|
508
|
+
key: 2,
|
|
509
|
+
class: "is-loading",
|
|
510
|
+
color: e.loadingColor
|
|
511
|
+
}, {
|
|
512
|
+
default: $(() => [
|
|
513
|
+
F(n)
|
|
514
|
+
]),
|
|
515
|
+
_: 1
|
|
516
|
+
}, 8, ["color"])) : b("", !0)
|
|
517
|
+
]),
|
|
518
|
+
_: 3
|
|
519
|
+
}, 8, ["class", "style", "disabled", "loading", "onClick", "btnCode"])) : (f(), S(d, {
|
|
514
520
|
key: 0,
|
|
515
521
|
class: A(["s-button", e.$attrs.class]),
|
|
516
522
|
style: u(e.styleOjb),
|
|
@@ -519,8 +525,8 @@ function zt(e, t, i, r, o, s) {
|
|
|
519
525
|
onClick: e.getHandleClick,
|
|
520
526
|
btnCode: e.btnCode
|
|
521
527
|
}, {
|
|
522
|
-
default:
|
|
523
|
-
e.icon && !e.iconRight ? (
|
|
528
|
+
default: $(() => [
|
|
529
|
+
e.icon && !e.iconRight ? (f(), v("i", mt, [
|
|
524
530
|
g("img", {
|
|
525
531
|
src: e.geturl,
|
|
526
532
|
alt: "",
|
|
@@ -532,19 +538,19 @@ function zt(e, t, i, r, o, s) {
|
|
|
532
538
|
}, [
|
|
533
539
|
N(e.$slots, "default", {}, void 0, !0)
|
|
534
540
|
], 4),
|
|
535
|
-
e.icon && e.iconRight ? (
|
|
541
|
+
e.icon && e.iconRight ? (f(), v("i", Ct, [
|
|
536
542
|
g("img", {
|
|
537
543
|
src: e.geturl,
|
|
538
544
|
alt: "",
|
|
539
545
|
style: u(e.styleObject)
|
|
540
546
|
}, null, 12, St)
|
|
541
547
|
])) : b("", !0),
|
|
542
|
-
e.loading ? (
|
|
548
|
+
e.loading ? (f(), S(l, {
|
|
543
549
|
key: 2,
|
|
544
550
|
class: "is-loading",
|
|
545
551
|
color: e.loadingColor
|
|
546
552
|
}, {
|
|
547
|
-
default:
|
|
553
|
+
default: $(() => [
|
|
548
554
|
F(n)
|
|
549
555
|
]),
|
|
550
556
|
_: 1
|
|
@@ -553,7 +559,7 @@ function zt(e, t, i, r, o, s) {
|
|
|
553
559
|
_: 3
|
|
554
560
|
}, 8, ["class", "style", "disabled", "loading", "onClick", "btnCode"]));
|
|
555
561
|
}
|
|
556
|
-
const K = /* @__PURE__ */ yt(pt, [["render",
|
|
562
|
+
const K = /* @__PURE__ */ yt(pt, [["render", Tt], ["__scopeId", "data-v-57ec66a1"]]);
|
|
557
563
|
function L(e, t = {}) {
|
|
558
564
|
L.installed || (L.installed = !0, e.component("common-button", K));
|
|
559
565
|
}
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("vue")):typeof define=="function"&&define.amd?define(["vue"],g):(t=typeof globalThis<"u"?globalThis:t||self,t.button=g(t.Vue))})(this,function(t){"use strict";/*! Element Plus Icons Vue v2.1.0 */var g=(e,i)=>{let o=e.__vccOpts||e;for(let[r,n]of i)o[r]=n;return o},q={name:"Loading"},D={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},G=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),P=[G];function x(e,i,o,r,n,s){return t.openBlock(),t.createElementBlock("svg",D,P)}var U=g(q,[["render",x],["__file","loading.vue"]]);function C(e,i,o){for(var r=[],n=Math.max(e.length,i.length),s=0,l=0;l<n||s;){var a=l<e.length?e[l]:0,c=l<i.length?i[l]:0,f=s+a+c;r.push(f%o),s=Math.floor(f/o),l++}return r}function j(e,i,o){if(e<0)return null;if(e==0)return[];for(var r=[],n=i;e&1&&(r=C(r,n,o)),e=e>>1,e!==0;)n=C(n,n,o);return r}function X(e,i){for(var o=e.split(""),r=[],n=o.length-1;n>=0;n--){var s=parseInt(o[n],i);if(isNaN(s))return null;r.push(s)}return r}function J(e,i,o){var r=X(e,i);if(r===null)return null;for(var n=[],s=[1],l=0;l<r.length;l++)r[l]&&(n=C(n,j(r[l],s,o),o)),s=j(i,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(i){i=i||{},this.seq=0,this.mid=(i.mid||1)%1023,this.offset=i.offset||0,this.lastTime=0}generate(){const i=Date.now(),o=(i-this.offset).toString(2);this.lastTime==i?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=i;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 i=typeof e;return e!=null&&(i=="object"||i=="function")}var v=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 i=e.length;i--&&ae.test(e.charAt(i)););return i}var ce=de,fe=ce,he=/^\s+/;function ge(e){return e&&e.slice(0,fe(e)+1).replace(he,"")}var ue=ge,be=O,pe=be.Symbol,W=pe,B=W,E=Object.prototype,me=E.hasOwnProperty,ye=E.toString,u=B?B.toStringTag:void 0;function Ce(e){var i=me.call(e,u),o=e[u];try{e[u]=void 0;var r=!0}catch{}var n=ye.call(e);return r&&(i?e[u]=o:delete e[u]),n}var Se=Ce,ke=Object.prototype,$e=ke.toString;function _e(e){return $e.call(e)}var ze=_e,N=W,we=Se,Te=ze,je="[object Null]",ve="[object Undefined]",L=N?N.toStringTag:void 0;function Oe(e){return e==null?e===void 0?ve:je:L&&L in Object(e)?we(e):Te(e)}var We=Oe;function Be(e){return e!=null&&typeof e=="object"}var Ee=Be,Ne=We,Le=Ee,Ie="[object Symbol]";function Re(e){return typeof e=="symbol"||Le(e)&&Ne(e)==Ie}var Ve=Re,Ae=ue,I=v,Fe=Ve,R=0/0,He=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,qe=/^0o[0-7]+$/i,De=parseInt;function Ge(e){if(typeof e=="number")return e;if(Fe(e))return R;if(I(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=I(i)?i+"":i}if(typeof e!="string")return e===0?e:+e;e=Ae(e);var o=Me.test(e);return o||qe.test(e)?De(e.slice(2),o?2:8):He.test(e)?R:+e}var Pe=Ge,xe=v,S=se,V=Pe,Ue="Expected a function",Xe=Math.max,Je=Math.min;function Ke(e,i,o){var r,n,s,l,a,c,f=0,A=!1,b=!1,z=!0;if(typeof e!="function")throw new TypeError(Ue);i=V(i)||0,xe(o)&&(A=!!o.leading,b="maxWait"in o,s=b?Xe(V(o.maxWait)||0,i):s,z="trailing"in o?!!o.trailing:z);function w(d){var h=r,p=n;return r=n=void 0,f=d,l=e.apply(p,h),l}function ht(d){return f=d,a=setTimeout(y,i),A?w(d):l}function gt(d){var h=d-c,p=d-f,M=i-h;return b?Je(M,s-p):M}function F(d){var h=d-c,p=d-f;return c===void 0||h>=i||h<0||b&&p>=s}function y(){var d=S();if(F(d))return H(d);a=setTimeout(y,gt(d))}function H(d){return a=void 0,z&&r?w(d):(r=n=void 0,l)}function ut(){a!==void 0&&clearTimeout(a),f=0,r=c=n=a=void 0}function bt(){return a===void 0?l:H(S())}function T(){var d=S(),h=F(d);if(r=arguments,n=this,c=d,h){if(a===void 0)return ht(c);if(b)return clearTimeout(a),a=setTimeout(y,i),w(c)}return a===void 0&&(a=setTimeout(y,i)),l}return T.cancel=ut,T.flush=bt,T}var Qe=Ke;const Ye=Y(Qe);var k;(e=>{e.debouncedFun=(i,o)=>Ye(i,o,{leading:!0,trailing:!1})})(k||(k={}));const Ze=new Q({mid:42,offset:(2019-1970)*31536e3*1e3}),et=t.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},buttonClass:{type:String},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},loadingLeft:{type:Boolean,default:!1},borderStyle:{type:String,default:"solid"},icon:{type:String,required:!1},iconRight:{type:Boolean,default:!1},size:{type:[Number,String],default:"auto"},fontWeight:{type:[Number,String],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,i){const o=s=>{let l=Ze.generate(),a=`${e.btnCode}_${l}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",s,a),e.btnCode?i.emit("handleClick",a):i.emit("handleClick","")},r=k.debouncedFun(s=>{o(s)},3e3),n=s=>{e.debounced?r(s):o(s)};return t.onUnmounted(()=>{r.cancel()}),{getHandleClick:n,handleClick:o}}}),pt="",tt=(e,i)=>{const o=e.__vccOpts||e;for(const[r,n]of i)o[r]=n;return o},it={key:0,class:"s-icon"},ot=["src"],rt={key:1,class:"s-icon"},nt=["src"],lt=["btnCode"],st={key:0,class:"s-icon padding-icon"},at=["src"],dt={key:1,class:"s-icon padding-icon-right"},ct=["src"];function ft(e,i,o,r,n,s){const l=t.resolveComponent("Loading"),a=t.resolveComponent("el-icon"),c=t.resolveComponent("el-button");return e.link?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["link",e.$attrs.class]),style:t.normalizeStyle(e.styleOjb),btnCode:e.btnCode,onClick:i[0]||(i[0]=(...f)=>e.getHandleClick&&e.getHandleClick(...f))},[e.icon&&!e.iconRight?(t.openBlock(),t.createElementBlock("i",st,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,at)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(t.openBlock(),t.createElementBlock("i",dt,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,ct)])):t.createCommentVNode("",!0),e.loading?(t.openBlock(),t.createBlock(a,{key:2,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["color"])):t.createCommentVNode("",!0)],14,lt)):(t.openBlock(),t.createBlock(c,{key:0,class:t.normalizeClass(["s-button",e.$attrs.class]),style:t.normalizeStyle(e.styleOjb),disabled:e.disabled,loading:e.loadingLeft,onClick:e.getHandleClick,btnCode:e.btnCode},{default:t.withCtx(()=>[e.icon&&!e.iconRight?(t.openBlock(),t.createElementBlock("i",it,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,ot)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(t.openBlock(),t.createElementBlock("i",rt,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,nt)])):t.createCommentVNode("",!0),e.loading?(t.openBlock(),t.createBlock(a,{key:2,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["color"])):t.createCommentVNode("",!0)]),_:3},8,["class","style","disabled","loading","onClick","btnCode"]))}const $=tt(et,[["render",ft],["__scopeId","data-v-e26f913d"]]);function _(e,i={}){_.installed||(_.installed=!0,e.component("common-button",$))}return $.install=_,$});
|
|
1
|
+
(function(t,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("vue")):typeof define=="function"&&define.amd?define(["vue"],g):(t=typeof globalThis<"u"?globalThis:t||self,t.button=g(t.Vue))})(this,function(t){"use strict";/*! Element Plus Icons Vue v2.1.0 */var g=(e,i)=>{let o=e.__vccOpts||e;for(let[r,n]of i)o[r]=n;return o},q={name:"Loading"},D={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},G=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),P=[G];function x(e,i,o,r,n,s){return t.openBlock(),t.createElementBlock("svg",D,P)}var U=g(q,[["render",x],["__file","loading.vue"]]);function C(e,i,o){for(var r=[],n=Math.max(e.length,i.length),s=0,l=0;l<n||s;){var a=l<e.length?e[l]:0,c=l<i.length?i[l]:0,f=s+a+c;r.push(f%o),s=Math.floor(f/o),l++}return r}function j(e,i,o){if(e<0)return null;if(e==0)return[];for(var r=[],n=i;e&1&&(r=C(r,n,o)),e=e>>1,e!==0;)n=C(n,n,o);return r}function X(e,i){for(var o=e.split(""),r=[],n=o.length-1;n>=0;n--){var s=parseInt(o[n],i);if(isNaN(s))return null;r.push(s)}return r}function J(e,i,o){var r=X(e,i);if(r===null)return null;for(var n=[],s=[1],l=0;l<r.length;l++)r[l]&&(n=C(n,j(r[l],s,o),o)),s=j(i,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(i){i=i||{},this.seq=0,this.mid=(i.mid||1)%1023,this.offset=i.offset||0,this.lastTime=0}generate(){const i=Date.now(),o=(i-this.offset).toString(2);this.lastTime==i?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=i;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 y=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 i=typeof e;return e!=null&&(i=="object"||i=="function")}var v=Z,ee=typeof y=="object"&&y&&y.Object===Object&&y,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 i=e.length;i--&&ae.test(e.charAt(i)););return i}var ce=de,fe=ce,he=/^\s+/;function ge(e){return e&&e.slice(0,fe(e)+1).replace(he,"")}var ue=ge,be=O,pe=be.Symbol,W=pe,B=W,E=Object.prototype,ye=E.hasOwnProperty,me=E.toString,u=B?B.toStringTag:void 0;function Ce(e){var i=ye.call(e,u),o=e[u];try{e[u]=void 0;var r=!0}catch{}var n=me.call(e);return r&&(i?e[u]=o:delete e[u]),n}var Se=Ce,ke=Object.prototype,$e=ke.toString;function _e(e){return $e.call(e)}var we=_e,N=W,ze=Se,Te=we,je="[object Null]",ve="[object Undefined]",L=N?N.toStringTag:void 0;function Oe(e){return e==null?e===void 0?ve:je:L&&L in Object(e)?ze(e):Te(e)}var We=Oe;function Be(e){return e!=null&&typeof e=="object"}var Ee=Be,Ne=We,Le=Ee,Ie="[object Symbol]";function Re(e){return typeof e=="symbol"||Le(e)&&Ne(e)==Ie}var Ve=Re,Ae=ue,I=v,Fe=Ve,R=0/0,He=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,qe=/^0o[0-7]+$/i,De=parseInt;function Ge(e){if(typeof e=="number")return e;if(Fe(e))return R;if(I(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=I(i)?i+"":i}if(typeof e!="string")return e===0?e:+e;e=Ae(e);var o=Me.test(e);return o||qe.test(e)?De(e.slice(2),o?2:8):He.test(e)?R:+e}var Pe=Ge,xe=v,S=se,V=Pe,Ue="Expected a function",Xe=Math.max,Je=Math.min;function Ke(e,i,o){var r,n,s,l,a,c,f=0,A=!1,b=!1,w=!0;if(typeof e!="function")throw new TypeError(Ue);i=V(i)||0,xe(o)&&(A=!!o.leading,b="maxWait"in o,s=b?Xe(V(o.maxWait)||0,i):s,w="trailing"in o?!!o.trailing:w);function z(d){var h=r,p=n;return r=n=void 0,f=d,l=e.apply(p,h),l}function ft(d){return f=d,a=setTimeout(m,i),A?z(d):l}function ht(d){var h=d-c,p=d-f,M=i-h;return b?Je(M,s-p):M}function F(d){var h=d-c,p=d-f;return c===void 0||h>=i||h<0||b&&p>=s}function m(){var d=S();if(F(d))return H(d);a=setTimeout(m,ht(d))}function H(d){return a=void 0,w&&r?z(d):(r=n=void 0,l)}function gt(){a!==void 0&&clearTimeout(a),f=0,r=c=n=a=void 0}function ut(){return a===void 0?l:H(S())}function T(){var d=S(),h=F(d);if(r=arguments,n=this,c=d,h){if(a===void 0)return ft(c);if(b)return clearTimeout(a),a=setTimeout(m,i),z(c)}return a===void 0&&(a=setTimeout(m,i)),l}return T.cancel=gt,T.flush=ut,T}var Qe=Ke;const Ye=Y(Qe);var k;(e=>{e.debouncedFun=(i,o)=>Ye(i,o,{leading:!0,trailing:!1})})(k||(k={}));const Ze=new Q({mid:42,offset:(2019-1970)*31536e3*1e3}),et=t.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},buttonClass:{type:String},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},loadingLeft:{type:Boolean,default:!1},borderStyle:{type:String,default:"solid"},icon:{type:String,required:!1},iconRight:{type:Boolean,default:!1},size:{type:[Number,String],default:"auto"},fontWeight:{type:[Number,String],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,i){const o=s=>{let l=Ze.generate(),a=`${e.btnCode}_${l}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",s,a),e.btnCode?i.emit("handleClick",a):i.emit("handleClick","")},r=k.debouncedFun(s=>{o(s)},3e3),n=s=>{e.debounced?r(s):o(s)};return t.onUnmounted(()=>{r.cancel()}),{getHandleClick:n,handleClick:o}}}),bt="",tt=(e,i)=>{const o=e.__vccOpts||e;for(const[r,n]of i)o[r]=n;return o},it={key:0,class:"s-icon"},ot=["src"],rt={key:1,class:"s-icon"},nt=["src"],lt={key:0,class:"s-icon"},st=["src"],at={key:1,class:"s-icon"},dt=["src"];function ct(e,i,o,r,n,s){const l=t.resolveComponent("Loading"),a=t.resolveComponent("el-icon"),c=t.resolveComponent("el-button");return e.link?(t.openBlock(),t.createBlock(c,{key:1,link:"",class:t.normalizeClass(["s-button",e.$attrs.class]),style:t.normalizeStyle(e.styleOjb),disabled:e.disabled,loading:e.loadingLeft,onClick:e.getHandleClick,btnCode:e.btnCode},{default:t.withCtx(()=>[e.icon&&!e.iconRight?(t.openBlock(),t.createElementBlock("i",lt,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,st)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(t.openBlock(),t.createElementBlock("i",at,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,dt)])):t.createCommentVNode("",!0),e.loading?(t.openBlock(),t.createBlock(a,{key:2,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["color"])):t.createCommentVNode("",!0)]),_:3},8,["class","style","disabled","loading","onClick","btnCode"])):(t.openBlock(),t.createBlock(c,{key:0,class:t.normalizeClass(["s-button",e.$attrs.class]),style:t.normalizeStyle(e.styleOjb),disabled:e.disabled,loading:e.loadingLeft,onClick:e.getHandleClick,btnCode:e.btnCode},{default:t.withCtx(()=>[e.icon&&!e.iconRight?(t.openBlock(),t.createElementBlock("i",it,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,ot)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(t.openBlock(),t.createElementBlock("i",rt,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,nt)])):t.createCommentVNode("",!0),e.loading?(t.openBlock(),t.createBlock(a,{key:2,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["color"])):t.createCommentVNode("",!0)]),_:3},8,["class","style","disabled","loading","onClick","btnCode"]))}const $=tt(et,[["render",ct],["__scopeId","data-v-57ec66a1"]]);function _(e,i={}){_.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-57ec66a1]{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-57ec66a1]{margin-left:15px}.s-button span[data-v-57ec66a1]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-57ec66a1]{vertical-align:middle}.link[data-v-57ec66a1]{align-items:center;display:inline-block;text-align:center}.link[data-v-57ec66a1]:hover{cursor:pointer;color:red}.plain[data-v-57ec66a1]{background:#fff}.plain-icon[data-v-57ec66a1]{margin-right:4px}.loading[data-v-57ec66a1]{opacity:.8}.s-icon[data-v-57ec66a1]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden;vertical-align:middle}.s-icon img[data-v-57ec66a1]{float:left;width:25px;height:25px}.padding-icon[data-v-57ec66a1]{padding-right:5px}.padding-icon-right[data-v-57ec66a1]{padding-left:3px}
|