sinosoft-common-button 1.2.6 → 1.2.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 +215 -137
- package/common-button.umd.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/common-button.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { openBlock as
|
|
1
|
+
import { openBlock as h, createElementBlock as f, createElementVNode as g, defineComponent as v, resolveComponent as u, createBlock as C, normalizeClass as w, normalizeStyle as a, withCtx as y, createCommentVNode as S, renderSlot as z, createVNode as _ } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.1.0 */
|
|
3
|
-
var
|
|
4
|
-
let
|
|
5
|
-
for (let [
|
|
6
|
-
i
|
|
7
|
-
return
|
|
8
|
-
},
|
|
3
|
+
var k = (t, e) => {
|
|
4
|
+
let r = t.__vccOpts || t;
|
|
5
|
+
for (let [i, o] of e)
|
|
6
|
+
r[i] = o;
|
|
7
|
+
return r;
|
|
8
|
+
}, W = {
|
|
9
9
|
name: "Loading"
|
|
10
10
|
}, x = {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
viewBox: "0 0 1024 1024"
|
|
13
|
-
},
|
|
13
|
+
}, F = /* @__PURE__ */ g(
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
16
16
|
fill: "currentColor",
|
|
@@ -19,78 +19,86 @@ var z = (e, t) => {
|
|
|
19
19
|
null,
|
|
20
20
|
-1
|
|
21
21
|
/* HOISTED */
|
|
22
|
-
),
|
|
23
|
-
|
|
22
|
+
), A = [
|
|
23
|
+
F
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function B(t, e, r, i, o, l) {
|
|
26
|
+
return h(), f("svg", x, A);
|
|
27
27
|
}
|
|
28
|
-
var L = /* @__PURE__ */
|
|
29
|
-
function
|
|
30
|
-
for (var
|
|
31
|
-
var
|
|
32
|
-
|
|
28
|
+
var L = /* @__PURE__ */ k(W, [["render", B], ["__file", "loading.vue"]]);
|
|
29
|
+
function b(t, e, r) {
|
|
30
|
+
for (var i = [], o = Math.max(t.length, e.length), l = 0, s = 0; s < o || l; ) {
|
|
31
|
+
var n = s < t.length ? t[s] : 0, c = s < e.length ? e[s] : 0, d = l + n + c;
|
|
32
|
+
i.push(d % r), l = Math.floor(d / r), s++;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return i;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
36
|
+
function m(t, e, r) {
|
|
37
|
+
if (t < 0)
|
|
38
38
|
return null;
|
|
39
|
-
if (
|
|
39
|
+
if (t == 0)
|
|
40
40
|
return [];
|
|
41
|
-
for (var
|
|
42
|
-
|
|
43
|
-
return
|
|
41
|
+
for (var i = [], o = e; t & 1 && (i = b(i, o, r)), t = t >> 1, t !== 0; )
|
|
42
|
+
o = b(o, o, r);
|
|
43
|
+
return i;
|
|
44
44
|
}
|
|
45
|
-
function O(
|
|
46
|
-
for (var
|
|
47
|
-
var
|
|
48
|
-
if (isNaN(
|
|
45
|
+
function O(t, e) {
|
|
46
|
+
for (var r = t.split(""), i = [], o = r.length - 1; o >= 0; o--) {
|
|
47
|
+
var l = parseInt(r[o], e);
|
|
48
|
+
if (isNaN(l))
|
|
49
49
|
return null;
|
|
50
|
-
|
|
50
|
+
i.push(l);
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return i;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
var
|
|
56
|
-
if (
|
|
54
|
+
function R(t, e, r) {
|
|
55
|
+
var i = O(t, e);
|
|
56
|
+
if (i === null)
|
|
57
57
|
return null;
|
|
58
|
-
for (var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)),
|
|
64
|
-
for (var
|
|
65
|
-
|
|
66
|
-
return
|
|
58
|
+
for (var o = [], l = [1], s = 0; s < i.length; s++)
|
|
59
|
+
i[s] && (o = b(
|
|
60
|
+
o,
|
|
61
|
+
m(i[s], l, r),
|
|
62
|
+
r
|
|
63
|
+
)), l = m(e, l, r);
|
|
64
|
+
for (var n = "", s = o.length - 1; s >= 0; s--)
|
|
65
|
+
n += o[s].toString(r);
|
|
66
|
+
return n;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function q(t) {
|
|
69
|
+
return t.substring(0, 2) === "0x" && (t = t.substring(2)), t = t.toLowerCase(), R(t, 16, 10);
|
|
70
70
|
}
|
|
71
|
-
class
|
|
72
|
-
constructor(
|
|
73
|
-
|
|
71
|
+
class D {
|
|
72
|
+
constructor(e) {
|
|
73
|
+
e = e || {}, this.seq = 0, this.mid = (e.mid || 1) % 1023, this.offset = e.offset || 0, this.lastTime = 0;
|
|
74
74
|
}
|
|
75
75
|
generate() {
|
|
76
|
-
const
|
|
77
|
-
this.lastTime ==
|
|
78
|
-
let
|
|
79
|
-
for (;
|
|
76
|
+
const e = Date.now(), r = (e - this.offset).toString(2);
|
|
77
|
+
this.lastTime == e ? (this.seq++, this.seq > 4095 && (this.seq = 0)) : this.seq = 0, this.lastTime = e;
|
|
78
|
+
let i = this.seq.toString(2), o = this.mid.toString(2);
|
|
79
|
+
for (; i.length < 12; )
|
|
80
|
+
i = "0" + i;
|
|
81
|
+
for (; o.length < 10; )
|
|
80
82
|
o = "0" + o;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
l = parseInt(n.substring(s - 4, s), 2).toString(16) + l;
|
|
87
|
-
return D(l);
|
|
83
|
+
const l = r + o + i;
|
|
84
|
+
let s = "";
|
|
85
|
+
for (let n = l.length; n > 0; n -= 4)
|
|
86
|
+
s = parseInt(l.substring(n - 4, n), 2).toString(16) + s;
|
|
87
|
+
return q(s);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
function N(t, e) {
|
|
91
|
+
let r;
|
|
92
|
+
return (...i) => {
|
|
93
|
+
clearTimeout(r), r = setTimeout(() => {
|
|
94
|
+
t(...i);
|
|
95
|
+
}, e);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const T = new D({
|
|
91
99
|
mid: 42,
|
|
92
100
|
offset: (2019 - 1970) * 31536e3 * 1e3
|
|
93
|
-
}),
|
|
101
|
+
}), H = v({
|
|
94
102
|
components: {
|
|
95
103
|
Loading: L
|
|
96
104
|
},
|
|
@@ -133,6 +141,18 @@ const N = new R({
|
|
|
133
141
|
type: Boolean,
|
|
134
142
|
default: !1
|
|
135
143
|
},
|
|
144
|
+
text: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: !1
|
|
147
|
+
},
|
|
148
|
+
link: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
default: !1
|
|
151
|
+
},
|
|
152
|
+
fontSize: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: ""
|
|
155
|
+
},
|
|
136
156
|
btnCode: {
|
|
137
157
|
type: String,
|
|
138
158
|
default: ""
|
|
@@ -180,98 +200,147 @@ const N = new R({
|
|
|
180
200
|
size: {
|
|
181
201
|
type: [Number, String],
|
|
182
202
|
default: "auto"
|
|
203
|
+
},
|
|
204
|
+
fontWeight: {
|
|
205
|
+
type: Number,
|
|
206
|
+
default: 500
|
|
207
|
+
},
|
|
208
|
+
lineHeight: {
|
|
209
|
+
type: String,
|
|
210
|
+
default: ""
|
|
183
211
|
}
|
|
184
212
|
},
|
|
185
213
|
computed: {
|
|
186
214
|
styleOjb() {
|
|
187
215
|
return this.plain ? {
|
|
188
|
-
background: "#fff",
|
|
216
|
+
background: this.bgColor || "#fff",
|
|
189
217
|
borderWidth: "1px",
|
|
190
218
|
borderStyle: `${this.borderStyle}`,
|
|
191
219
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
192
220
|
color: this.color || "#99004A",
|
|
193
221
|
width: this.width,
|
|
194
222
|
height: this.height,
|
|
195
|
-
borderRadius: this.circle
|
|
223
|
+
borderRadius: this.circle,
|
|
224
|
+
fontSize: this.fontSize || "16px",
|
|
225
|
+
fontWeight: this.fontWeight || 500,
|
|
226
|
+
size: this.size
|
|
196
227
|
} : this.primary ? {
|
|
197
|
-
background: "#99004A",
|
|
228
|
+
background: this.bgColor || "#99004A",
|
|
198
229
|
borderWidth: "1px",
|
|
199
230
|
borderStyle: `${this.borderStyle}`,
|
|
200
231
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
201
232
|
color: this.color || "#ffffff",
|
|
202
233
|
width: this.width,
|
|
203
234
|
height: this.height,
|
|
204
|
-
borderRadius: this.circle
|
|
235
|
+
borderRadius: this.circle,
|
|
236
|
+
fontWeight: this.fontWeight || 500,
|
|
237
|
+
size: this.size
|
|
205
238
|
} : this.primaryOrdinary ? {
|
|
206
|
-
background: "#99004A",
|
|
239
|
+
background: this.bgColor || "#99004A",
|
|
207
240
|
borderWidth: "1px",
|
|
208
241
|
borderStyle: `${this.borderStyle}`,
|
|
209
242
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
210
243
|
color: this.color || "#ffffff",
|
|
211
|
-
width: "190px"
|
|
212
|
-
height: "52px"
|
|
244
|
+
width: `${this.width || "190px"}`,
|
|
245
|
+
height: `${this.height || "52px"}`,
|
|
213
246
|
borderRadius: this.circle,
|
|
214
|
-
fontSize: "16px",
|
|
215
|
-
fontWeight: 600
|
|
247
|
+
fontSize: this.fontSize || "16px",
|
|
248
|
+
fontWeight: this.fontWeight || 600,
|
|
249
|
+
size: this.size
|
|
216
250
|
} : this.primaryDialog ? {
|
|
217
|
-
|
|
218
|
-
height: "
|
|
251
|
+
minWidth: `${this.width || "250px"}`,
|
|
252
|
+
height: `${this.height || "60px"}`,
|
|
219
253
|
background: "#99004A",
|
|
220
254
|
borderWidth: "1px",
|
|
221
255
|
borderStyle: `${this.borderStyle}`,
|
|
222
256
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
223
257
|
color: this.color || "#ffffff",
|
|
224
|
-
borderRadius: "8px",
|
|
225
|
-
fontSize: "16px",
|
|
226
|
-
fontWeight:
|
|
258
|
+
borderRadius: this.circle || "8px",
|
|
259
|
+
fontSize: this.fontSize || "16px",
|
|
260
|
+
fontWeight: this.fontWeight || 560,
|
|
261
|
+
size: this.size
|
|
227
262
|
} : this.default ? {
|
|
228
|
-
background: "#ffffff",
|
|
263
|
+
background: this.bgColor || "#ffffff",
|
|
229
264
|
borderWidth: "1px",
|
|
230
265
|
borderStyle: `${this.borderStyle}`,
|
|
231
266
|
borderColor: `${this.borderColor || this.color || "#DDE2E6"}`,
|
|
232
267
|
color: this.color || "#99004A",
|
|
233
268
|
width: this.width,
|
|
234
269
|
height: this.height,
|
|
235
|
-
borderRadius: this.circle
|
|
270
|
+
borderRadius: this.circle,
|
|
271
|
+
fontWeight: this.fontWeight || 500,
|
|
272
|
+
size: this.size
|
|
236
273
|
} : this.info ? {
|
|
237
|
-
background: "#C4C4C4",
|
|
274
|
+
background: this.bgColor || "#C4C4C4",
|
|
238
275
|
borderWidth: "1px",
|
|
239
276
|
borderStyle: `${this.borderStyle}`,
|
|
240
277
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
241
278
|
color: this.color || "#FFFFFF",
|
|
242
279
|
width: this.width,
|
|
243
280
|
height: this.height,
|
|
244
|
-
borderRadius: this.circle
|
|
281
|
+
borderRadius: this.circle,
|
|
282
|
+
fontWeight: this.fontWeight || 500,
|
|
283
|
+
size: this.size
|
|
245
284
|
} : this.infoDialog ? {
|
|
246
|
-
|
|
247
|
-
height:
|
|
248
|
-
background: "#C4C4C4",
|
|
285
|
+
minWidth: `${this.width || "250px"}`,
|
|
286
|
+
height: `${this.height || "60px"}`,
|
|
287
|
+
background: this.bgColor || "#C4C4C4",
|
|
249
288
|
borderWidth: "1px",
|
|
250
289
|
borderStyle: `${this.borderStyle}`,
|
|
251
290
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
252
291
|
color: this.color || "#FFFFFF",
|
|
253
|
-
borderRadius: "8px",
|
|
254
|
-
fontSize: "16px",
|
|
255
|
-
fontWeight: 600
|
|
292
|
+
borderRadius: this.circle || "8px",
|
|
293
|
+
fontSize: this.fontSize || "16px",
|
|
294
|
+
fontWeight: this.fontWeight || 600,
|
|
295
|
+
size: this.size
|
|
256
296
|
} : this.infoOrdinary ? {
|
|
257
|
-
width: "176px"
|
|
258
|
-
height: "52px"
|
|
259
|
-
background: "#C4C4C4",
|
|
297
|
+
width: `${this.width || "176px"}`,
|
|
298
|
+
height: `${this.height || "52px"}`,
|
|
299
|
+
background: this.bgColor || "#C4C4C4",
|
|
260
300
|
borderWidth: "1px",
|
|
261
301
|
borderStyle: `${this.borderStyle}`,
|
|
262
302
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
263
303
|
color: this.color || "#FFFFFF",
|
|
264
|
-
borderRadius: "8px",
|
|
265
|
-
fontSize: "16px",
|
|
266
|
-
fontWeight: 600
|
|
304
|
+
borderRadius: this.circle || "8px",
|
|
305
|
+
fontSize: this.fontSize || "16px",
|
|
306
|
+
fontWeight: this.fontWeight || 600,
|
|
307
|
+
size: this.size
|
|
308
|
+
} : this.text ? {
|
|
309
|
+
width: `${this.width || "41px"}`,
|
|
310
|
+
height: `${this.height || "24px"}`,
|
|
311
|
+
background: this.bgColor || "#ffffff",
|
|
312
|
+
borderWidth: "0px",
|
|
313
|
+
borderStyle: `${this.borderStyle}`,
|
|
314
|
+
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
315
|
+
color: this.color || "#E2A650",
|
|
316
|
+
borderRadius: this.circle || "8px",
|
|
317
|
+
fontSize: this.fontSize || "14px",
|
|
318
|
+
fontWeight: this.fontWeight || 500,
|
|
319
|
+
size: this.size,
|
|
320
|
+
lineHeight: this.lineHeight || "24px"
|
|
321
|
+
} : this.link ? {
|
|
322
|
+
width: this.width,
|
|
323
|
+
height: this.height,
|
|
324
|
+
borderWidth: "0px",
|
|
325
|
+
borderStyle: `${this.borderStyle}`,
|
|
326
|
+
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
327
|
+
color: this.color || "#E2A650",
|
|
328
|
+
borderRadius: this.circle || "8px",
|
|
329
|
+
fontSize: this.fontSize || "14px",
|
|
330
|
+
fontWeight: this.fontWeight || 500,
|
|
331
|
+
size: this.size,
|
|
332
|
+
lineHeight: this.lineHeight || "24px"
|
|
267
333
|
} : {
|
|
334
|
+
width: this.width,
|
|
335
|
+
height: this.height,
|
|
268
336
|
color: this.color || "#ffffff",
|
|
269
337
|
background: this.bgColor || "#99004A",
|
|
270
338
|
borderStyle: `${this.borderStyle}`,
|
|
271
339
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
340
|
+
borderRadius: this.circle || "8px",
|
|
341
|
+
fontSize: this.fontSize || "16px",
|
|
342
|
+
fontWeight: this.fontWeight || 500,
|
|
343
|
+
size: this.size || "20"
|
|
275
344
|
};
|
|
276
345
|
},
|
|
277
346
|
geturl() {
|
|
@@ -292,72 +361,81 @@ const N = new R({
|
|
|
292
361
|
}
|
|
293
362
|
},
|
|
294
363
|
emits: ["handleClick"],
|
|
295
|
-
setup(
|
|
364
|
+
setup(t, e) {
|
|
296
365
|
return {
|
|
297
|
-
|
|
298
|
-
let
|
|
366
|
+
debouncedClick: N((o) => {
|
|
367
|
+
let l = T.generate(), s = `${t.btnCode}_${l}`;
|
|
299
368
|
console.log(
|
|
300
369
|
"按钮组件点击事件获取到事件对象及事件唯一标识符",
|
|
301
370
|
o,
|
|
302
|
-
|
|
303
|
-
),
|
|
304
|
-
}
|
|
371
|
+
s
|
|
372
|
+
), t.btnCode ? e.emit("handleClick", s) : e.emit("handleClick", "");
|
|
373
|
+
}, 3e3)
|
|
305
374
|
};
|
|
306
375
|
}
|
|
307
376
|
});
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
for (const [
|
|
311
|
-
i
|
|
312
|
-
return
|
|
313
|
-
},
|
|
377
|
+
const E = (t, e) => {
|
|
378
|
+
const r = t.__vccOpts || t;
|
|
379
|
+
for (const [i, o] of e)
|
|
380
|
+
r[i] = o;
|
|
381
|
+
return r;
|
|
382
|
+
}, M = { class: "common-button" }, j = {
|
|
314
383
|
key: 0,
|
|
315
384
|
class: "s-icon"
|
|
316
|
-
},
|
|
317
|
-
function
|
|
318
|
-
const
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
onClick: e.
|
|
326
|
-
|
|
385
|
+
}, V = ["src"], I = ["btnCode"];
|
|
386
|
+
function G(t, e, r, i, o, l) {
|
|
387
|
+
const s = u("Loading"), n = u("el-icon"), c = u("el-button");
|
|
388
|
+
return h(), f("div", M, [
|
|
389
|
+
t.link ? (h(), f("span", {
|
|
390
|
+
key: 1,
|
|
391
|
+
class: "link",
|
|
392
|
+
style: a(t.styleOjb),
|
|
393
|
+
btnCode: t.btnCode,
|
|
394
|
+
onClick: e[0] || (e[0] = (...d) => t.debouncedClick && t.debouncedClick(...d))
|
|
395
|
+
}, [
|
|
396
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
397
|
+
], 12, I)) : (h(), C(c, {
|
|
398
|
+
key: 0,
|
|
399
|
+
class: w(["s-button", { plain: t.plain, btnhover: !t.plain, loading: t.loading }]),
|
|
400
|
+
disabled: t.disabled,
|
|
401
|
+
loading: t.loading,
|
|
402
|
+
style: a(t.styleOjb),
|
|
403
|
+
onClick: t.debouncedClick,
|
|
404
|
+
btnCode: t.btnCode
|
|
327
405
|
}, {
|
|
328
|
-
default:
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
src:
|
|
406
|
+
default: y(() => [
|
|
407
|
+
t.icon ? (h(), f("i", j, [
|
|
408
|
+
g("img", {
|
|
409
|
+
src: t.geturl,
|
|
332
410
|
alt: "",
|
|
333
|
-
style:
|
|
334
|
-
}, null, 12,
|
|
335
|
-
])) :
|
|
336
|
-
|
|
337
|
-
style:
|
|
411
|
+
style: a(t.styleObject)
|
|
412
|
+
}, null, 12, V)
|
|
413
|
+
])) : S("", !0),
|
|
414
|
+
g("span", {
|
|
415
|
+
style: a({ color: t.color })
|
|
338
416
|
}, [
|
|
339
|
-
|
|
417
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
340
418
|
], 4),
|
|
341
|
-
|
|
419
|
+
t.loading ? (h(), C(n, {
|
|
342
420
|
key: 1,
|
|
343
421
|
class: "is-loading",
|
|
344
|
-
color:
|
|
422
|
+
color: t.loadingColor
|
|
345
423
|
}, {
|
|
346
|
-
default:
|
|
347
|
-
|
|
424
|
+
default: y(() => [
|
|
425
|
+
_(s)
|
|
348
426
|
]),
|
|
349
427
|
_: 1
|
|
350
|
-
}, 8, ["color"])) :
|
|
428
|
+
}, 8, ["color"])) : S("", !0)
|
|
351
429
|
]),
|
|
352
430
|
_: 3
|
|
353
|
-
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"])
|
|
431
|
+
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"]))
|
|
354
432
|
]);
|
|
355
433
|
}
|
|
356
|
-
const
|
|
357
|
-
function p(
|
|
358
|
-
p.installed || (p.installed = !0,
|
|
434
|
+
const $ = /* @__PURE__ */ E(H, [["render", G], ["__scopeId", "data-v-4118ea46"]]);
|
|
435
|
+
function p(t, e = {}) {
|
|
436
|
+
p.installed || (p.installed = !0, t.component("common-button", $));
|
|
359
437
|
}
|
|
360
|
-
|
|
438
|
+
$.install = p;
|
|
361
439
|
export {
|
|
362
|
-
|
|
440
|
+
$ as default
|
|
363
441
|
};
|
package/common-button.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(e=typeof globalThis<"u"?globalThis:e||self,e.button=d(e.Vue))})(this,function(e){"use strict";/*! Element Plus Icons Vue v2.1.0 */var d=(t,i)=>{let l=t.__vccOpts||t;for(let[o,r]of i)l[o]=r;return l},b={name:"Loading"},C={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},y=e.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),m=[y];function S(t,i,l,o,r,n){return e.openBlock(),e.createElementBlock("svg",C,m)}var z=d(b,[["render",S],["__file","loading.vue"]]);function f(t,i,l){for(var o=[],r=Math.max(t.length,i.length),n=0,s=0;s<r||n;){var h=s<t.length?t[s]:0,u=s<i.length?i[s]:0,a=n+h+u;o.push(a%l),n=Math.floor(a/l),s++}return o}function p(t,i,l){if(t<0)return null;if(t==0)return[];for(var o=[],r=i;t&1&&(o=f(o,r,l)),t=t>>1,t!==0;)r=f(r,r,l);return o}function k(t,i){for(var l=t.split(""),o=[],r=l.length-1;r>=0;r--){var n=parseInt(l[r],i);if(isNaN(n))return null;o.push(n)}return o}function $(t,i,l){var o=k(t,i);if(o===null)return null;for(var r=[],n=[1],s=0;s<o.length;s++)o[s]&&(r=f(r,p(o[s],n,l),l)),n=p(i,n,l);for(var h="",s=r.length-1;s>=0;s--)h+=r[s].toString(l);return h}function w(t){return t.substring(0,2)==="0x"&&(t=t.substring(2)),t=t.toLowerCase(),$(t,16,10)}class _{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(),l=(i-this.offset).toString(2);this.lastTime==i?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=i;let o=this.seq.toString(2),r=this.mid.toString(2);for(;o.length<12;)o="0"+o;for(;r.length<10;)r="0"+r;const n=l+r+o;let s="";for(let h=n.length;h>0;h-=4)s=parseInt(n.substring(h-4,h),2).toString(16)+s;return w(s)}}function W(t,i){let l;return(...o)=>{clearTimeout(l),l=setTimeout(()=>{t(...o)},i)}}const x=new _({mid:42,offset:(2019-1970)*31536e3*1e3}),B=e.defineComponent({components:{Loading:z},props:{disabled:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},primaryDialog:{type:Boolean,default:!1},primaryOrdinary:{type:Boolean,default:!1},info:{type:Boolean,default:!1},infoDialog:{type:Boolean,default:!1},infoOrdinary:{type:Boolean,default:!1},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:""}},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:"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.primaryOrdinary?{background:this.bgColor||"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:`${this.width||"190px"}`,height:`${this.height||"52px"}`,borderRadius:this.circle,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.primaryDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||560,size:this.size}:this.default?{background:this.bgColor||"#ffffff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.info?{background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.infoDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.infoOrdinary?{width:`${this.width||"176px"}`,height:`${this.height||"52px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.text?{width:`${this.width||"41px"}`,height:`${this.height||"24px"}`,background:this.bgColor||"#ffffff",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:"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||"16px",fontWeight:this.fontWeight||500,size:this.size||"20"}},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(t,i){return{debouncedClick:W(r=>{let n=x.generate(),s=`${t.btnCode}_${n}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",r,s),t.btnCode?i.emit("handleClick",s):i.emit("handleClick","")},3e3)}}}),O="",v=(t,i)=>{const l=t.__vccOpts||t;for(const[o,r]of i)l[o]=r;return l},F={class:"common-button"},A={key:0,class:"s-icon"},E=["src"],L=["btnCode"];function N(t,i,l,o,r,n){const s=e.resolveComponent("Loading"),h=e.resolveComponent("el-icon"),u=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",F,[t.link?(e.openBlock(),e.createElementBlock("span",{key:1,class:"link",style:e.normalizeStyle(t.styleOjb),btnCode:t.btnCode,onClick:i[0]||(i[0]=(...a)=>t.debouncedClick&&t.debouncedClick(...a))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],12,L)):(e.openBlock(),e.createBlock(u,{key:0,class:e.normalizeClass(["s-button",{plain:t.plain,btnhover:!t.plain,loading:t.loading}]),disabled:t.disabled,loading:t.loading,style:e.normalizeStyle(t.styleOjb),onClick:t.debouncedClick,btnCode:t.btnCode},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createElementBlock("i",A,[e.createElementVNode("img",{src:t.geturl,alt:"",style:e.normalizeStyle(t.styleObject)},null,12,E)])):e.createCommentVNode("",!0),e.createElementVNode("span",{style:e.normalizeStyle({color:t.color})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4),t.loading?(e.openBlock(),e.createBlock(h,{key:1,class:"is-loading",color:t.loadingColor},{default:e.withCtx(()=>[e.createVNode(s)]),_:1},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"]))])}const c=v(B,[["render",N],["__scopeId","data-v-4118ea46"]]);function g(t,i={}){g.installed||(g.installed=!0,t.component("common-button",c))}return c.install=g,c});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.s-button[data-v-
|
|
1
|
+
.s-button[data-v-4118ea46]{display:inline-block;height:36px;line-height:1;border:none;background:#99004A;padding:0 19px;border-radius:7px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .5s ease-in-out;user-select:none}.s-button+.s-button[data-v-4118ea46]{margin-left:15px}.s-button span[data-v-4118ea46]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-4118ea46]{vertical-align:middle}.link[data-v-4118ea46]:hover{cursor:pointer;color:red}.plain[data-v-4118ea46]{background:#fff}.plain-icon[data-v-4118ea46]{margin-right:4px}.loading[data-v-4118ea46]{opacity:.8}.s-icon[data-v-4118ea46]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-4118ea46]{float:left;width:25px;height:25px}
|