sinosoft-common-button 1.4.5 → 1.4.7
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 +318 -244
- package/common-button.umd.cjs +1 -0
- package/package.json +27 -4
- package/style.css +1 -1
- package/common-button.umd.js +0 -1
package/common-button.es.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let i
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, oe = {
|
|
1
|
+
import { openBlock as g, createElementBlock as C, createElementVNode as y, defineComponent as ze, onUnmounted as Oe, resolveComponent as $, createBlock as R, normalizeStyle as p, normalizeClass as te, withCtx as I, createCommentVNode as S, renderSlot as re, createVNode as ie } from "vue";
|
|
2
|
+
var qe = (e, t) => {
|
|
3
|
+
let r = e.__vccOpts || e;
|
|
4
|
+
for (let [i, o] of t)
|
|
5
|
+
r[i] = o;
|
|
6
|
+
return r;
|
|
7
|
+
}, We = {
|
|
9
8
|
name: "Loading"
|
|
10
|
-
},
|
|
9
|
+
}, $e = {
|
|
11
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
11
|
viewBox: "0 0 1024 1024"
|
|
13
|
-
},
|
|
12
|
+
}, Re = /* @__PURE__ */ y(
|
|
14
13
|
"path",
|
|
15
14
|
{
|
|
16
15
|
fill: "currentColor",
|
|
@@ -19,203 +18,284 @@ var re = (e, t) => {
|
|
|
19
18
|
null,
|
|
20
19
|
-1
|
|
21
20
|
/* HOISTED */
|
|
22
|
-
),
|
|
23
|
-
|
|
21
|
+
), Ie = [
|
|
22
|
+
Re
|
|
24
23
|
];
|
|
25
|
-
function
|
|
26
|
-
return
|
|
24
|
+
function Le(e, t, r, i, o, l) {
|
|
25
|
+
return g(), C("svg", $e, Ie);
|
|
27
26
|
}
|
|
28
|
-
var
|
|
29
|
-
function
|
|
30
|
-
for (var
|
|
31
|
-
var
|
|
32
|
-
|
|
27
|
+
var Ee = /* @__PURE__ */ qe(We, [["render", Le], ["__file", "loading.vue"]]);
|
|
28
|
+
function X(e, t, r) {
|
|
29
|
+
for (var i = [], o = Math.max(e.length, t.length), l = 0, n = 0; n < o || l; ) {
|
|
30
|
+
var a = n < e.length ? e[n] : 0, u = n < t.length ? t[n] : 0, s = l + a + u;
|
|
31
|
+
i.push(s % r), l = Math.floor(s / r), n++;
|
|
33
32
|
}
|
|
34
|
-
return
|
|
33
|
+
return i;
|
|
35
34
|
}
|
|
36
|
-
function
|
|
37
|
-
if (e < 0)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
o = O(o, o, i);
|
|
43
|
-
return r;
|
|
35
|
+
function oe(e, t, r) {
|
|
36
|
+
if (e < 0) return null;
|
|
37
|
+
if (e == 0) return [];
|
|
38
|
+
for (var i = [], o = t; e & 1 && (i = X(i, o, r)), e = e >> 1, e !== 0; )
|
|
39
|
+
o = X(o, o, r);
|
|
40
|
+
return i;
|
|
44
41
|
}
|
|
45
|
-
function
|
|
46
|
-
for (var
|
|
47
|
-
var
|
|
48
|
-
if (isNaN(
|
|
49
|
-
|
|
50
|
-
r.push(s);
|
|
42
|
+
function Ne(e, t) {
|
|
43
|
+
for (var r = e.split(""), i = [], o = r.length - 1; o >= 0; o--) {
|
|
44
|
+
var l = parseInt(r[o], t);
|
|
45
|
+
if (isNaN(l)) return null;
|
|
46
|
+
i.push(l);
|
|
51
47
|
}
|
|
52
|
-
return
|
|
48
|
+
return i;
|
|
53
49
|
}
|
|
54
|
-
function
|
|
55
|
-
var
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
r[n] && (o = O(
|
|
50
|
+
function Be(e, t, r) {
|
|
51
|
+
var i = Ne(e, t);
|
|
52
|
+
if (i === null) return null;
|
|
53
|
+
for (var o = [], l = [1], n = 0; n < i.length; n++)
|
|
54
|
+
i[n] && (o = X(
|
|
60
55
|
o,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)),
|
|
64
|
-
for (var
|
|
65
|
-
|
|
66
|
-
return
|
|
56
|
+
oe(i[n], l, r),
|
|
57
|
+
r
|
|
58
|
+
)), l = oe(t, l, r);
|
|
59
|
+
for (var a = "", n = o.length - 1; n >= 0; n--)
|
|
60
|
+
a += o[n].toString(r);
|
|
61
|
+
return a;
|
|
67
62
|
}
|
|
68
|
-
function
|
|
69
|
-
return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(),
|
|
63
|
+
function Ae(e) {
|
|
64
|
+
return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(), Be(e, 16, 10);
|
|
70
65
|
}
|
|
71
|
-
class
|
|
66
|
+
class Fe {
|
|
72
67
|
constructor(t) {
|
|
73
68
|
t = t || {}, this.seq = 0, this.mid = (t.mid || 1) % 1023, this.offset = t.offset || 0, this.lastTime = 0;
|
|
74
69
|
}
|
|
75
70
|
generate() {
|
|
76
|
-
const t = Date.now(),
|
|
71
|
+
const t = Date.now(), r = (t - this.offset).toString(2);
|
|
77
72
|
this.lastTime == t ? (this.seq++, this.seq > 4095 && (this.seq = 0)) : this.seq = 0, this.lastTime = t;
|
|
78
|
-
let
|
|
79
|
-
for (;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
o = "0" + o;
|
|
83
|
-
const s = i + o + r;
|
|
73
|
+
let i = this.seq.toString(2), o = this.mid.toString(2);
|
|
74
|
+
for (; i.length < 12; ) i = "0" + i;
|
|
75
|
+
for (; o.length < 10; ) o = "0" + o;
|
|
76
|
+
const l = r + o + i;
|
|
84
77
|
let n = "";
|
|
85
|
-
for (let
|
|
86
|
-
n = parseInt(
|
|
87
|
-
return
|
|
78
|
+
for (let a = l.length; a > 0; a -= 4)
|
|
79
|
+
n = parseInt(l.substring(a - 4, a), 2).toString(16) + n;
|
|
80
|
+
return Ae(n);
|
|
88
81
|
}
|
|
89
82
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
83
|
+
var z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
84
|
+
function He(e) {
|
|
92
85
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
93
86
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
function we(e) {
|
|
102
|
-
for (var t = e.length; t-- && ke.test(e.charAt(t)); )
|
|
103
|
-
;
|
|
104
|
-
return t;
|
|
105
|
-
}
|
|
106
|
-
var Te = we, ze = Te, je = /^\s+/;
|
|
107
|
-
function Oe(e) {
|
|
108
|
-
return e && e.slice(0, ze(e) + 1).replace(je, "");
|
|
109
|
-
}
|
|
110
|
-
var We = Oe, Le = x, Ie = Le.Symbol, X = Ie, M = X, J = Object.prototype, Re = J.hasOwnProperty, Ee = J.toString, v = M ? M.toStringTag : void 0;
|
|
111
|
-
function Be(e) {
|
|
112
|
-
var t = Re.call(e, v), i = e[v];
|
|
113
|
-
try {
|
|
114
|
-
e[v] = void 0;
|
|
115
|
-
var r = !0;
|
|
116
|
-
} catch {
|
|
87
|
+
var L, ne;
|
|
88
|
+
function ve() {
|
|
89
|
+
if (ne) return L;
|
|
90
|
+
ne = 1;
|
|
91
|
+
function e(t) {
|
|
92
|
+
var r = typeof t;
|
|
93
|
+
return t != null && (r == "object" || r == "function");
|
|
117
94
|
}
|
|
118
|
-
|
|
119
|
-
return r && (t ? e[v] = i : delete e[v]), o;
|
|
95
|
+
return L = e, L;
|
|
120
96
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
|
|
97
|
+
var E, se;
|
|
98
|
+
function Ge() {
|
|
99
|
+
if (se) return E;
|
|
100
|
+
se = 1;
|
|
101
|
+
var e = typeof z == "object" && z && z.Object === Object && z;
|
|
102
|
+
return E = e, E;
|
|
124
103
|
}
|
|
125
|
-
var
|
|
126
|
-
function
|
|
127
|
-
|
|
104
|
+
var N, le;
|
|
105
|
+
function Se() {
|
|
106
|
+
if (le) return N;
|
|
107
|
+
le = 1;
|
|
108
|
+
var e = Ge(), t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
|
|
109
|
+
return N = r, N;
|
|
128
110
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
|
|
111
|
+
var B, ae;
|
|
112
|
+
function Me() {
|
|
113
|
+
if (ae) return B;
|
|
114
|
+
ae = 1;
|
|
115
|
+
var e = Se(), t = function() {
|
|
116
|
+
return e.Date.now();
|
|
117
|
+
};
|
|
118
|
+
return B = t, B;
|
|
132
119
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return P;
|
|
143
|
-
if (G(e)) {
|
|
144
|
-
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
145
|
-
e = G(t) ? t + "" : t;
|
|
120
|
+
var A, de;
|
|
121
|
+
function De() {
|
|
122
|
+
if (de) return A;
|
|
123
|
+
de = 1;
|
|
124
|
+
var e = /\s/;
|
|
125
|
+
function t(r) {
|
|
126
|
+
for (var i = r.length; i-- && e.test(r.charAt(i)); )
|
|
127
|
+
;
|
|
128
|
+
return i;
|
|
146
129
|
}
|
|
147
|
-
|
|
148
|
-
return e === 0 ? e : +e;
|
|
149
|
-
e = et(e);
|
|
150
|
-
var i = rt.test(e);
|
|
151
|
-
return i || ot.test(e) ? nt(e.slice(2), i ? 2 : 8) : it.test(e) ? P : +e;
|
|
130
|
+
return A = t, A;
|
|
152
131
|
}
|
|
153
|
-
var
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var c = r, m = o;
|
|
161
|
-
return r = o = void 0, f = a, n = e.apply(m, c), n;
|
|
162
|
-
}
|
|
163
|
-
function Q(a) {
|
|
164
|
-
return f = a, l = setTimeout(C, t), I ? _(a) : n;
|
|
132
|
+
var F, ue;
|
|
133
|
+
function Pe() {
|
|
134
|
+
if (ue) return F;
|
|
135
|
+
ue = 1;
|
|
136
|
+
var e = De(), t = /^\s+/;
|
|
137
|
+
function r(i) {
|
|
138
|
+
return i && i.slice(0, e(i) + 1).replace(t, "");
|
|
165
139
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
140
|
+
return F = r, F;
|
|
141
|
+
}
|
|
142
|
+
var H, fe;
|
|
143
|
+
function Ce() {
|
|
144
|
+
if (fe) return H;
|
|
145
|
+
fe = 1;
|
|
146
|
+
var e = Se(), t = e.Symbol;
|
|
147
|
+
return H = t, H;
|
|
148
|
+
}
|
|
149
|
+
var G, he;
|
|
150
|
+
function Ve() {
|
|
151
|
+
if (he) return G;
|
|
152
|
+
he = 1;
|
|
153
|
+
var e = Ce(), t = Object.prototype, r = t.hasOwnProperty, i = t.toString, o = e ? e.toStringTag : void 0;
|
|
154
|
+
function l(n) {
|
|
155
|
+
var a = r.call(n, o), u = n[o];
|
|
156
|
+
try {
|
|
157
|
+
n[o] = void 0;
|
|
158
|
+
var s = !0;
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
var f = i.call(n);
|
|
162
|
+
return s && (a ? n[o] = u : delete n[o]), f;
|
|
169
163
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
return G = l, G;
|
|
165
|
+
}
|
|
166
|
+
var M, ce;
|
|
167
|
+
function xe() {
|
|
168
|
+
if (ce) return M;
|
|
169
|
+
ce = 1;
|
|
170
|
+
var e = Object.prototype, t = e.toString;
|
|
171
|
+
function r(i) {
|
|
172
|
+
return t.call(i);
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
return M = r, M;
|
|
175
|
+
}
|
|
176
|
+
var D, ge;
|
|
177
|
+
function Ue() {
|
|
178
|
+
if (ge) return D;
|
|
179
|
+
ge = 1;
|
|
180
|
+
var e = Ce(), t = Ve(), r = xe(), i = "[object Null]", o = "[object Undefined]", l = e ? e.toStringTag : void 0;
|
|
181
|
+
function n(a) {
|
|
182
|
+
return a == null ? a === void 0 ? o : i : l && l in Object(a) ? t(a) : r(a);
|
|
179
183
|
}
|
|
180
|
-
|
|
181
|
-
|
|
184
|
+
return D = n, D;
|
|
185
|
+
}
|
|
186
|
+
var P, be;
|
|
187
|
+
function Xe() {
|
|
188
|
+
if (be) return P;
|
|
189
|
+
be = 1;
|
|
190
|
+
function e(t) {
|
|
191
|
+
return t != null && typeof t == "object";
|
|
182
192
|
}
|
|
183
|
-
|
|
184
|
-
|
|
193
|
+
return P = e, P;
|
|
194
|
+
}
|
|
195
|
+
var V, pe;
|
|
196
|
+
function Je() {
|
|
197
|
+
if (pe) return V;
|
|
198
|
+
pe = 1;
|
|
199
|
+
var e = Ue(), t = Xe(), r = "[object Symbol]";
|
|
200
|
+
function i(o) {
|
|
201
|
+
return typeof o == "symbol" || t(o) && e(o) == r;
|
|
185
202
|
}
|
|
186
|
-
|
|
187
|
-
|
|
203
|
+
return V = i, V;
|
|
204
|
+
}
|
|
205
|
+
var x, ye;
|
|
206
|
+
function Ke() {
|
|
207
|
+
if (ye) return x;
|
|
208
|
+
ye = 1;
|
|
209
|
+
var e = Pe(), t = ve(), r = Je(), i = NaN, o = /^[-+]0x[0-9a-f]+$/i, l = /^0b[01]+$/i, n = /^0o[0-7]+$/i, a = parseInt;
|
|
210
|
+
function u(s) {
|
|
211
|
+
if (typeof s == "number")
|
|
212
|
+
return s;
|
|
213
|
+
if (r(s))
|
|
214
|
+
return i;
|
|
215
|
+
if (t(s)) {
|
|
216
|
+
var f = typeof s.valueOf == "function" ? s.valueOf() : s;
|
|
217
|
+
s = t(f) ? f + "" : f;
|
|
218
|
+
}
|
|
219
|
+
if (typeof s != "string")
|
|
220
|
+
return s === 0 ? s : +s;
|
|
221
|
+
s = e(s);
|
|
222
|
+
var c = l.test(s);
|
|
223
|
+
return c || n.test(s) ? a(s.slice(2), c ? 2 : 8) : o.test(s) ? i : +s;
|
|
188
224
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
225
|
+
return x = u, x;
|
|
226
|
+
}
|
|
227
|
+
var U, me;
|
|
228
|
+
function Qe() {
|
|
229
|
+
if (me) return U;
|
|
230
|
+
me = 1;
|
|
231
|
+
var e = ve(), t = Me(), r = Ke(), i = "Expected a function", o = Math.max, l = Math.min;
|
|
232
|
+
function n(a, u, s) {
|
|
233
|
+
var f, c, w, v, h, m, _ = 0, Q = !1, T = !1, O = !0;
|
|
234
|
+
if (typeof a != "function")
|
|
235
|
+
throw new TypeError(i);
|
|
236
|
+
u = r(u) || 0, e(s) && (Q = !!s.leading, T = "maxWait" in s, w = T ? o(r(s.maxWait) || 0, u) : w, O = "trailing" in s ? !!s.trailing : O);
|
|
237
|
+
function q(d) {
|
|
238
|
+
var b = f, k = c;
|
|
239
|
+
return f = c = void 0, _ = d, v = a.apply(k, b), v;
|
|
240
|
+
}
|
|
241
|
+
function Te(d) {
|
|
242
|
+
return _ = d, h = setTimeout(j, u), Q ? q(d) : v;
|
|
243
|
+
}
|
|
244
|
+
function ke(d) {
|
|
245
|
+
var b = d - m, k = d - _, ee = u - b;
|
|
246
|
+
return T ? l(ee, w - k) : ee;
|
|
247
|
+
}
|
|
248
|
+
function Y(d) {
|
|
249
|
+
var b = d - m, k = d - _;
|
|
250
|
+
return m === void 0 || b >= u || b < 0 || T && k >= w;
|
|
251
|
+
}
|
|
252
|
+
function j() {
|
|
253
|
+
var d = t();
|
|
254
|
+
if (Y(d))
|
|
255
|
+
return Z(d);
|
|
256
|
+
h = setTimeout(j, ke(d));
|
|
196
257
|
}
|
|
197
|
-
|
|
258
|
+
function Z(d) {
|
|
259
|
+
return h = void 0, O && f ? q(d) : (f = c = void 0, v);
|
|
260
|
+
}
|
|
261
|
+
function we() {
|
|
262
|
+
h !== void 0 && clearTimeout(h), _ = 0, f = m = c = h = void 0;
|
|
263
|
+
}
|
|
264
|
+
function je() {
|
|
265
|
+
return h === void 0 ? v : Z(t());
|
|
266
|
+
}
|
|
267
|
+
function W() {
|
|
268
|
+
var d = t(), b = Y(d);
|
|
269
|
+
if (f = arguments, c = this, m = d, b) {
|
|
270
|
+
if (h === void 0)
|
|
271
|
+
return Te(m);
|
|
272
|
+
if (T)
|
|
273
|
+
return clearTimeout(h), h = setTimeout(j, u), q(m);
|
|
274
|
+
}
|
|
275
|
+
return h === void 0 && (h = setTimeout(j, u)), v;
|
|
276
|
+
}
|
|
277
|
+
return W.cancel = we, W.flush = je, W;
|
|
198
278
|
}
|
|
199
|
-
return
|
|
279
|
+
return U = n, U;
|
|
200
280
|
}
|
|
201
|
-
var
|
|
202
|
-
const
|
|
203
|
-
var
|
|
281
|
+
var Ye = Qe();
|
|
282
|
+
const Ze = /* @__PURE__ */ He(Ye);
|
|
283
|
+
var J;
|
|
204
284
|
((e) => {
|
|
205
|
-
e.debouncedFun = (t,
|
|
285
|
+
e.debouncedFun = (t, r) => Ze(t, r, {
|
|
206
286
|
leading: !0,
|
|
207
287
|
// 延长开始后调用
|
|
208
288
|
trailing: !1
|
|
209
289
|
// 延长结束前调用
|
|
210
290
|
});
|
|
211
|
-
})(
|
|
212
|
-
const
|
|
291
|
+
})(J || (J = {}));
|
|
292
|
+
const et = new Fe({
|
|
213
293
|
mid: 42,
|
|
214
|
-
offset:
|
|
215
|
-
}),
|
|
294
|
+
offset: 49 * 31536e3 * 1e3
|
|
295
|
+
}), tt = ze({
|
|
216
296
|
// inheritAttrs: false, // 不在组件的根元素上添加非 prop 的 attribute
|
|
217
297
|
components: {
|
|
218
|
-
Loading:
|
|
298
|
+
Loading: Ee
|
|
219
299
|
},
|
|
220
300
|
props: {
|
|
221
301
|
disabled: {
|
|
@@ -311,7 +391,7 @@ const bt = new ue({
|
|
|
311
391
|
},
|
|
312
392
|
size: {
|
|
313
393
|
type: [Number, String],
|
|
314
|
-
default: "
|
|
394
|
+
default: ""
|
|
315
395
|
},
|
|
316
396
|
fontWeight: {
|
|
317
397
|
type: [Number, String],
|
|
@@ -398,8 +478,8 @@ const bt = new ue({
|
|
|
398
478
|
color: this.color || "#E2A650",
|
|
399
479
|
borderRadius: this.circle || "8px",
|
|
400
480
|
fontSize: this.fontSize || "14px",
|
|
401
|
-
fontWeight: this.fontWeight ||
|
|
402
|
-
size: this.size,
|
|
481
|
+
fontWeight: this.fontWeight || 400,
|
|
482
|
+
size: this.link ? 20 : this.size,
|
|
403
483
|
lineHeight: this.lineHeight || "24px"
|
|
404
484
|
} : {
|
|
405
485
|
width: this.width,
|
|
@@ -411,7 +491,7 @@ const bt = new ue({
|
|
|
411
491
|
borderRadius: this.circle || "8px",
|
|
412
492
|
fontSize: this.fontSize || "14px",
|
|
413
493
|
fontWeight: this.fontWeight || 500,
|
|
414
|
-
size: this.size ||
|
|
494
|
+
size: this.size || 24,
|
|
415
495
|
borderWidth: this.borderWidth || "0px"
|
|
416
496
|
};
|
|
417
497
|
},
|
|
@@ -421,8 +501,7 @@ const bt = new ue({
|
|
|
421
501
|
return this.icon;
|
|
422
502
|
if (this.icon.includes("svg"))
|
|
423
503
|
return `${this.icon}`;
|
|
424
|
-
} else
|
|
425
|
-
return "";
|
|
504
|
+
} else return "";
|
|
426
505
|
return `${this.icon}`;
|
|
427
506
|
},
|
|
428
507
|
styleObject: function() {
|
|
@@ -434,134 +513,129 @@ const bt = new ue({
|
|
|
434
513
|
},
|
|
435
514
|
emits: ["handleClick"],
|
|
436
515
|
setup(e, t) {
|
|
437
|
-
const
|
|
438
|
-
let n =
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}, r = W.debouncedFun((s) => {
|
|
445
|
-
i(s);
|
|
446
|
-
}, 3e3), o = (s) => {
|
|
447
|
-
e.debounced ? r(s) : i(s);
|
|
516
|
+
const r = (l) => {
|
|
517
|
+
let n = et.generate(), a = `${e.btnCode}_${n}`;
|
|
518
|
+
e.btnCode ? t.emit("handleClick", a) : t.emit("handleClick", "");
|
|
519
|
+
}, i = J.debouncedFun((l) => {
|
|
520
|
+
r();
|
|
521
|
+
}, 3e3), o = (l) => {
|
|
522
|
+
e.debounced ? (l.preventDefault(), i(l)) : r();
|
|
448
523
|
};
|
|
449
|
-
return
|
|
450
|
-
|
|
524
|
+
return Oe(() => {
|
|
525
|
+
i.cancel();
|
|
451
526
|
}), {
|
|
452
527
|
getHandleClick: o,
|
|
453
|
-
handleClick:
|
|
528
|
+
handleClick: r
|
|
454
529
|
};
|
|
455
530
|
}
|
|
456
|
-
})
|
|
457
|
-
const
|
|
458
|
-
const i
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}, mt = {
|
|
531
|
+
}), rt = (e, t) => {
|
|
532
|
+
const r = e.__vccOpts || e;
|
|
533
|
+
for (const [i, o] of t)
|
|
534
|
+
r[i] = o;
|
|
535
|
+
return r;
|
|
536
|
+
}, it = {
|
|
463
537
|
key: 0,
|
|
464
|
-
class: "s-icon"
|
|
465
|
-
},
|
|
538
|
+
class: "s-icon btn-icon"
|
|
539
|
+
}, ot = ["src"], nt = {
|
|
466
540
|
key: 1,
|
|
467
|
-
class: "s-icon"
|
|
468
|
-
},
|
|
541
|
+
class: "s-icon btn-icon-right"
|
|
542
|
+
}, st = ["src"], lt = ["btnCode"], at = {
|
|
469
543
|
key: 0,
|
|
470
544
|
class: "s-icon padding-icon"
|
|
471
|
-
},
|
|
545
|
+
}, dt = ["src"], ut = {
|
|
472
546
|
key: 1,
|
|
473
547
|
class: "s-icon padding-icon-right"
|
|
474
|
-
},
|
|
475
|
-
function
|
|
476
|
-
const n =
|
|
477
|
-
return e.link ? (
|
|
548
|
+
}, ft = ["src"];
|
|
549
|
+
function ht(e, t, r, i, o, l) {
|
|
550
|
+
const n = $("Loading"), a = $("el-icon"), u = $("el-button");
|
|
551
|
+
return e.link ? (g(), C("span", {
|
|
478
552
|
key: 1,
|
|
479
|
-
class:
|
|
480
|
-
style:
|
|
553
|
+
class: te(["link", e.$attrs.class]),
|
|
554
|
+
style: p(e.styleOjb),
|
|
481
555
|
btnCode: e.btnCode
|
|
482
556
|
}, [
|
|
483
|
-
|
|
484
|
-
onClick: t[0] || (t[0] = (...
|
|
557
|
+
y("span", {
|
|
558
|
+
onClick: t[0] || (t[0] = (...s) => e.getHandleClick && e.getHandleClick(...s)),
|
|
485
559
|
class: "linkPointer"
|
|
486
560
|
}, [
|
|
487
|
-
e.icon && !e.iconRight ? (
|
|
488
|
-
|
|
561
|
+
e.icon && !e.iconRight ? (g(), C("i", at, [
|
|
562
|
+
y("img", {
|
|
489
563
|
src: e.geturl,
|
|
490
564
|
alt: "",
|
|
491
|
-
style:
|
|
492
|
-
}, null, 12,
|
|
493
|
-
])) :
|
|
494
|
-
|
|
495
|
-
style:
|
|
565
|
+
style: p(e.styleObject)
|
|
566
|
+
}, null, 12, dt)
|
|
567
|
+
])) : S("", !0),
|
|
568
|
+
y("span", {
|
|
569
|
+
style: p({ color: e.color })
|
|
496
570
|
}, [
|
|
497
|
-
|
|
571
|
+
re(e.$slots, "default", {}, void 0, !0)
|
|
498
572
|
], 4),
|
|
499
|
-
e.icon && e.iconRight ? (
|
|
500
|
-
|
|
573
|
+
e.icon && e.iconRight ? (g(), C("i", ut, [
|
|
574
|
+
y("img", {
|
|
501
575
|
src: e.geturl,
|
|
502
576
|
alt: "",
|
|
503
|
-
style:
|
|
504
|
-
}, null, 12,
|
|
505
|
-
])) :
|
|
506
|
-
e.loading ? (
|
|
577
|
+
style: p(e.styleObject)
|
|
578
|
+
}, null, 12, ft)
|
|
579
|
+
])) : S("", !0),
|
|
580
|
+
e.loading ? (g(), R(a, {
|
|
507
581
|
key: 2,
|
|
508
582
|
class: "is-loading",
|
|
509
583
|
color: e.loadingColor
|
|
510
584
|
}, {
|
|
511
|
-
default:
|
|
512
|
-
|
|
585
|
+
default: I(() => [
|
|
586
|
+
ie(n)
|
|
513
587
|
]),
|
|
514
588
|
_: 1
|
|
515
|
-
}, 8, ["color"])) :
|
|
589
|
+
}, 8, ["color"])) : S("", !0)
|
|
516
590
|
])
|
|
517
|
-
], 14,
|
|
591
|
+
], 14, lt)) : (g(), R(u, {
|
|
518
592
|
key: 0,
|
|
519
|
-
class:
|
|
520
|
-
style:
|
|
593
|
+
class: te(["s-button", e.$attrs.class]),
|
|
594
|
+
style: p(e.styleOjb),
|
|
521
595
|
disabled: e.disabled,
|
|
522
596
|
loading: e.loadingLeft,
|
|
523
597
|
onClick: e.getHandleClick,
|
|
524
598
|
btnCode: e.btnCode
|
|
525
599
|
}, {
|
|
526
|
-
default:
|
|
527
|
-
e.icon && !e.iconRight ? (
|
|
528
|
-
|
|
600
|
+
default: I(() => [
|
|
601
|
+
e.icon && !e.iconRight ? (g(), C("i", it, [
|
|
602
|
+
y("img", {
|
|
529
603
|
src: e.geturl,
|
|
530
604
|
alt: "",
|
|
531
|
-
style:
|
|
532
|
-
}, null, 12,
|
|
533
|
-
])) :
|
|
534
|
-
|
|
535
|
-
style:
|
|
605
|
+
style: p(e.styleObject)
|
|
606
|
+
}, null, 12, ot)
|
|
607
|
+
])) : S("", !0),
|
|
608
|
+
y("span", {
|
|
609
|
+
style: p({ color: e.color })
|
|
536
610
|
}, [
|
|
537
|
-
|
|
611
|
+
re(e.$slots, "default", {}, void 0, !0)
|
|
538
612
|
], 4),
|
|
539
|
-
e.icon && e.iconRight ? (
|
|
540
|
-
|
|
613
|
+
e.icon && e.iconRight ? (g(), C("i", nt, [
|
|
614
|
+
y("img", {
|
|
541
615
|
src: e.geturl,
|
|
542
616
|
alt: "",
|
|
543
|
-
style:
|
|
544
|
-
}, null, 12,
|
|
545
|
-
])) :
|
|
546
|
-
e.loading ? (
|
|
617
|
+
style: p(e.styleObject)
|
|
618
|
+
}, null, 12, st)
|
|
619
|
+
])) : S("", !0),
|
|
620
|
+
e.loading ? (g(), R(a, {
|
|
547
621
|
key: 2,
|
|
548
622
|
class: "is-loading",
|
|
549
623
|
color: e.loadingColor
|
|
550
624
|
}, {
|
|
551
|
-
default:
|
|
552
|
-
|
|
625
|
+
default: I(() => [
|
|
626
|
+
ie(n)
|
|
553
627
|
]),
|
|
554
628
|
_: 1
|
|
555
|
-
}, 8, ["color"])) :
|
|
629
|
+
}, 8, ["color"])) : S("", !0)
|
|
556
630
|
]),
|
|
557
631
|
_: 3
|
|
558
632
|
}, 8, ["class", "style", "disabled", "loading", "onClick", "btnCode"]));
|
|
559
633
|
}
|
|
560
|
-
const
|
|
561
|
-
function
|
|
562
|
-
|
|
634
|
+
const _e = /* @__PURE__ */ rt(tt, [["render", ht], ["__scopeId", "data-v-05f95f10"]]);
|
|
635
|
+
function K(e, t = {}) {
|
|
636
|
+
K.installed || (K.installed = !0, e.component("common-button", _e));
|
|
563
637
|
}
|
|
564
|
-
|
|
638
|
+
_e.install = K;
|
|
565
639
|
export {
|
|
566
|
-
|
|
640
|
+
_e as default
|
|
567
641
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(r,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("vue")):typeof define=="function"&&define.amd?define(["vue"],y):(r=typeof globalThis<"u"?globalThis:r||self,r.button=y(r.Vue))})(this,(function(r){"use strict";var y=(e,t)=>{let i=e.__vccOpts||e;for(let[o,n]of t)i[o]=n;return i},ge={name:"Loading"},be={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},me=r.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),pe=[me];function ye(e,t,i,o,n,a){return r.openBlock(),r.createElementBlock("svg",be,pe)}var Se=y(ge,[["render",ye],["__file","loading.vue"]]);function w(e,t,i){for(var o=[],n=Math.max(e.length,t.length),a=0,l=0;l<n||a;){var d=l<e.length?e[l]:0,f=l<t.length?t[l]:0,s=a+d+f;o.push(s%i),a=Math.floor(s/i),l++}return o}function x(e,t,i){if(e<0)return null;if(e==0)return[];for(var o=[],n=t;e&1&&(o=w(o,n,i)),e=e>>1,e!==0;)n=w(n,n,i);return o}function Ce(e,t){for(var i=e.split(""),o=[],n=i.length-1;n>=0;n--){var a=parseInt(i[n],t);if(isNaN(a))return null;o.push(a)}return o}function ke(e,t,i){var o=Ce(e,t);if(o===null)return null;for(var n=[],a=[1],l=0;l<o.length;l++)o[l]&&(n=w(n,x(o[l],a,i),i)),a=x(t,a,i);for(var d="",l=n.length-1;l>=0;l--)d+=n[l].toString(i);return d}function _e(e){return e.substring(0,2)==="0x"&&(e=e.substring(2)),e=e.toLowerCase(),ke(e,16,10)}class Te{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(),i=(t-this.offset).toString(2);this.lastTime==t?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=t;let o=this.seq.toString(2),n=this.mid.toString(2);for(;o.length<12;)o="0"+o;for(;n.length<10;)n="0"+n;const a=i+n+o;let l="";for(let d=a.length;d>0;d-=4)l=parseInt(a.substring(d-4,d),2).toString(16)+l;return _e(l)}}var _=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,U;function X(){if(U)return z;U=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return z=e,z}var j,J;function we(){if(J)return j;J=1;var e=typeof _=="object"&&_&&_.Object===Object&&_;return j=e,j}var O,K;function Q(){if(K)return O;K=1;var e=we(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return O=i,O}var q,Y;function ze(){if(Y)return q;Y=1;var e=Q(),t=function(){return e.Date.now()};return q=t,q}var W,Z;function je(){if(Z)return W;Z=1;var e=/\s/;function t(i){for(var o=i.length;o--&&e.test(i.charAt(o)););return o}return W=t,W}var $,ee;function Oe(){if(ee)return $;ee=1;var e=je(),t=/^\s+/;function i(o){return o&&o.slice(0,e(o)+1).replace(t,"")}return $=i,$}var R,te;function re(){if(te)return R;te=1;var e=Q(),t=e.Symbol;return R=t,R}var E,ie;function qe(){if(ie)return E;ie=1;var e=re(),t=Object.prototype,i=t.hasOwnProperty,o=t.toString,n=e?e.toStringTag:void 0;function a(l){var d=i.call(l,n),f=l[n];try{l[n]=void 0;var s=!0}catch{}var h=o.call(l);return s&&(d?l[n]=f:delete l[n]),h}return E=a,E}var N,oe;function We(){if(oe)return N;oe=1;var e=Object.prototype,t=e.toString;function i(o){return t.call(o)}return N=i,N}var B,ne;function $e(){if(ne)return B;ne=1;var e=re(),t=qe(),i=We(),o="[object Null]",n="[object Undefined]",a=e?e.toStringTag:void 0;function l(d){return d==null?d===void 0?n:o:a&&a in Object(d)?t(d):i(d)}return B=l,B}var I,le;function Re(){if(le)return I;le=1;function e(t){return t!=null&&typeof t=="object"}return I=e,I}var L,se;function Ee(){if(se)return L;se=1;var e=$e(),t=Re(),i="[object Symbol]";function o(n){return typeof n=="symbol"||t(n)&&e(n)==i}return L=o,L}var V,ae;function Ne(){if(ae)return V;ae=1;var e=Oe(),t=X(),i=Ee(),o=NaN,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,d=parseInt;function f(s){if(typeof s=="number")return s;if(i(s))return o;if(t(s)){var h=typeof s.valueOf=="function"?s.valueOf():s;s=t(h)?h+"":h}if(typeof s!="string")return s===0?s:+s;s=e(s);var g=a.test(s);return g||l.test(s)?d(s.slice(2),g?2:8):n.test(s)?o:+s}return V=f,V}var A,de;function Be(){if(de)return A;de=1;var e=X(),t=ze(),i=Ne(),o="Expected a function",n=Math.max,a=Math.min;function l(d,f,s){var h,g,T,p,u,m,S=0,ce=!1,C=!1,M=!0;if(typeof d!="function")throw new TypeError(o);f=i(f)||0,e(s)&&(ce=!!s.leading,C="maxWait"in s,T=C?n(i(s.maxWait)||0,f):T,M="trailing"in s?!!s.trailing:M);function D(c){var b=h,k=g;return h=g=void 0,S=c,p=d.apply(k,b),p}function Qe(c){return S=c,u=setTimeout(v,f),ce?D(c):p}function Ye(c){var b=c-m,k=c-S,ue=f-b;return C?a(ue,T-k):ue}function fe(c){var b=c-m,k=c-S;return m===void 0||b>=f||b<0||C&&k>=T}function v(){var c=t();if(fe(c))return he(c);u=setTimeout(v,Ye(c))}function he(c){return u=void 0,M&&h?D(c):(h=g=void 0,p)}function Ze(){u!==void 0&&clearTimeout(u),S=0,h=m=g=u=void 0}function et(){return u===void 0?p:he(t())}function P(){var c=t(),b=fe(c);if(h=arguments,g=this,m=c,b){if(u===void 0)return Qe(m);if(C)return clearTimeout(u),u=setTimeout(v,f),D(m)}return u===void 0&&(u=setTimeout(v,f)),p}return P.cancel=Ze,P.flush=et,P}return A=l,A}var Ie=Be();const Le=ve(Ie);var F;(e=>{e.debouncedFun=(t,i)=>Le(t,i,{leading:!0,trailing:!1})})(F||(F={}));const Ve=new Te({mid:42,offset:49*31536e3*1e3}),Ae=r.defineComponent({components:{Loading:Se},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:""},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||400,size:this.link?20: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||24,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 i=a=>{let l=Ve.generate(),d=`${e.btnCode}_${l}`;e.btnCode?t.emit("handleClick",d):t.emit("handleClick","")},o=F.debouncedFun(a=>{i()},3e3),n=a=>{e.debounced?(a.preventDefault(),o(a)):i()};return r.onUnmounted(()=>{o.cancel()}),{getHandleClick:n,handleClick:i}}}),Fe=(e,t)=>{const i=e.__vccOpts||e;for(const[o,n]of t)i[o]=n;return i},He={key:0,class:"s-icon btn-icon"},Ge=["src"],Me={key:1,class:"s-icon btn-icon-right"},De=["src"],Pe=["btnCode"],xe={key:0,class:"s-icon padding-icon"},Ue=["src"],Xe={key:1,class:"s-icon padding-icon-right"},Je=["src"];function Ke(e,t,i,o,n,a){const l=r.resolveComponent("Loading"),d=r.resolveComponent("el-icon"),f=r.resolveComponent("el-button");return e.link?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["link",e.$attrs.class]),style:r.normalizeStyle(e.styleOjb),btnCode:e.btnCode},[r.createElementVNode("span",{onClick:t[0]||(t[0]=(...s)=>e.getHandleClick&&e.getHandleClick(...s)),class:"linkPointer"},[e.icon&&!e.iconRight?(r.openBlock(),r.createElementBlock("i",xe,[r.createElementVNode("img",{src:e.geturl,alt:"",style:r.normalizeStyle(e.styleObject)},null,12,Ue)])):r.createCommentVNode("",!0),r.createElementVNode("span",{style:r.normalizeStyle({color:e.color})},[r.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(r.openBlock(),r.createElementBlock("i",Xe,[r.createElementVNode("img",{src:e.geturl,alt:"",style:r.normalizeStyle(e.styleObject)},null,12,Je)])):r.createCommentVNode("",!0),e.loading?(r.openBlock(),r.createBlock(d,{key:2,class:"is-loading",color:e.loadingColor},{default:r.withCtx(()=>[r.createVNode(l)]),_:1},8,["color"])):r.createCommentVNode("",!0)])],14,Pe)):(r.openBlock(),r.createBlock(f,{key:0,class:r.normalizeClass(["s-button",e.$attrs.class]),style:r.normalizeStyle(e.styleOjb),disabled:e.disabled,loading:e.loadingLeft,onClick:e.getHandleClick,btnCode:e.btnCode},{default:r.withCtx(()=>[e.icon&&!e.iconRight?(r.openBlock(),r.createElementBlock("i",He,[r.createElementVNode("img",{src:e.geturl,alt:"",style:r.normalizeStyle(e.styleObject)},null,12,Ge)])):r.createCommentVNode("",!0),r.createElementVNode("span",{style:r.normalizeStyle({color:e.color})},[r.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.icon&&e.iconRight?(r.openBlock(),r.createElementBlock("i",Me,[r.createElementVNode("img",{src:e.geturl,alt:"",style:r.normalizeStyle(e.styleObject)},null,12,De)])):r.createCommentVNode("",!0),e.loading?(r.openBlock(),r.createBlock(d,{key:2,class:"is-loading",color:e.loadingColor},{default:r.withCtx(()=>[r.createVNode(l)]),_:1},8,["color"])):r.createCommentVNode("",!0)]),_:3},8,["class","style","disabled","loading","onClick","btnCode"]))}const H=Fe(Ae,[["render",Ke],["__scopeId","data-v-05f95f10"]]);function G(e,t={}){G.installed||(G.installed=!0,e.component("common-button",H))}return H.install=G,H}));
|
package/package.json
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sinosoft-common-button",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./common-button.es.js",
|
|
6
|
+
"module": "./common-button.es.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./common-button.es.js",
|
|
10
|
+
"require": "./common-button.umd.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./style.css": "./style.css",
|
|
13
|
+
"./*": "./*"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"common-button.es.js",
|
|
17
|
+
"common-button.umd.cjs",
|
|
18
|
+
"style.css"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"vue": "^3.2.47",
|
|
22
|
+
"element-plus": "^2.3.6"
|
|
23
|
+
},
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/",
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
4
29
|
"description": "",
|
|
5
|
-
"main": "common-button.es.js",
|
|
6
30
|
"scripts": {
|
|
7
31
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
32
|
},
|
|
9
33
|
"keywords": [],
|
|
10
|
-
"author": ""
|
|
11
|
-
"license": "ISC"
|
|
34
|
+
"author": ""
|
|
12
35
|
}
|
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.s-button[data-v-
|
|
1
|
+
.s-button[data-v-05f95f10]{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;-webkit-user-select:none;user-select:none}.s-button+.s-button[data-v-05f95f10]{margin-left:15px}.s-button span[data-v-05f95f10]{display:inline-block;text-justify:auto;line-height:1}.s-button>*[data-v-05f95f10]{vertical-align:middle}.link[data-v-05f95f10]{align-items:center}.link[data-v-05f95f10]:hover{cursor:default;color:red}.linkPointer[data-v-05f95f10]{cursor:pointer}.linkDisabled[data-v-05f95f10]{pointer-events:none;cursor:not-allowed}.plain[data-v-05f95f10]{background:#fff}.plain-icon[data-v-05f95f10]{margin-right:4px}.loading[data-v-05f95f10]{opacity:.8}.s-icon[data-v-05f95f10]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden;vertical-align:middle}.s-icon img[data-v-05f95f10]{float:left;width:24px;height:24px}.link .s-icon img[data-v-05f95f10]{float:left;width:20px;height:20px}.btn-icon[data-v-05f95f10]{padding-right:4px}.btn-icon-right[data-v-05f95f10]{padding-left:4px}.padding-icon[data-v-05f95f10]{padding-right:8px}.padding-icon-right[data-v-05f95f10]{padding-left:8px}
|
package/common-button.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,Ve="[object Symbol]";function Ie(e){return typeof e=="symbol"||Le(e)&&Ne(e)==Ve}var Re=Ie,Ae=ue,V=v,Fe=Re,I=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 I;if(V(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=V(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)?I:+e}var Pe=Ge,xe=v,S=se,R=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=R(i)||0,xe(o)&&(A=!!o.leading,b="maxWait"in o,s=b?Xe(R(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},[t.createElementVNode("span",{onClick:i[0]||(i[0]=(...f)=>e.getHandleClick&&e.getHandleClick(...f)),class:"linkPointer"},[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-04f59a93"]]);function _(e,i={}){_.installed||(_.installed=!0,e.component("common-button",$))}return $.install=_,$});
|