sinosoft-common-button 1.2.6 → 1.2.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 +182 -129
- 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 c, createElementVNode as u, defineComponent as _, resolveComponent as a, createVNode as y, normalizeClass as v, normalizeStyle as f, withCtx as C, createCommentVNode as S, renderSlot as $, createBlock as w } 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 W = (t, e) => {
|
|
4
|
+
let r = t.__vccOpts || t;
|
|
5
|
+
for (let [i, o] of e)
|
|
6
|
+
r[i] = o;
|
|
7
|
+
return r;
|
|
8
|
+
}, k = {
|
|
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__ */ u(
|
|
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(), c("svg", x, A);
|
|
27
27
|
}
|
|
28
|
-
var L = /* @__PURE__ */
|
|
29
|
-
function g(
|
|
30
|
-
for (var
|
|
31
|
-
var
|
|
32
|
-
|
|
28
|
+
var L = /* @__PURE__ */ W(k, [["render", B], ["__file", "loading.vue"]]);
|
|
29
|
+
function g(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, d = s < e.length ? e[s] : 0, p = l + n + d;
|
|
32
|
+
i.push(p % r), l = Math.floor(p / 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 = g(i, o, r)), t = t >> 1, t !== 0; )
|
|
42
|
+
o = g(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 = g(
|
|
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
|
-
}), M =
|
|
101
|
+
}), M = _({
|
|
94
102
|
components: {
|
|
95
103
|
Loading: L
|
|
96
104
|
},
|
|
@@ -133,6 +141,14 @@ const N = new R({
|
|
|
133
141
|
type: Boolean,
|
|
134
142
|
default: !1
|
|
135
143
|
},
|
|
144
|
+
text: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: !1
|
|
147
|
+
},
|
|
148
|
+
fontSize: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: ""
|
|
151
|
+
},
|
|
136
152
|
btnCode: {
|
|
137
153
|
type: String,
|
|
138
154
|
default: ""
|
|
@@ -180,98 +196,135 @@ const N = new R({
|
|
|
180
196
|
size: {
|
|
181
197
|
type: [Number, String],
|
|
182
198
|
default: "auto"
|
|
199
|
+
},
|
|
200
|
+
fontWeight: {
|
|
201
|
+
type: Number,
|
|
202
|
+
default: 500
|
|
203
|
+
},
|
|
204
|
+
lineHeight: {
|
|
205
|
+
type: String,
|
|
206
|
+
default: ""
|
|
183
207
|
}
|
|
184
208
|
},
|
|
185
209
|
computed: {
|
|
186
210
|
styleOjb() {
|
|
187
211
|
return this.plain ? {
|
|
188
|
-
background: "#fff",
|
|
212
|
+
background: this.bgColor || "#fff",
|
|
189
213
|
borderWidth: "1px",
|
|
190
214
|
borderStyle: `${this.borderStyle}`,
|
|
191
215
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
192
216
|
color: this.color || "#99004A",
|
|
193
217
|
width: this.width,
|
|
194
218
|
height: this.height,
|
|
195
|
-
borderRadius: this.circle
|
|
219
|
+
borderRadius: this.circle,
|
|
220
|
+
fontSize: this.fontSize || "16px",
|
|
221
|
+
fontWeight: this.fontWeight || 500,
|
|
222
|
+
size: this.size
|
|
196
223
|
} : this.primary ? {
|
|
197
|
-
background: "#99004A",
|
|
224
|
+
background: this.bgColor || "#99004A",
|
|
198
225
|
borderWidth: "1px",
|
|
199
226
|
borderStyle: `${this.borderStyle}`,
|
|
200
227
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
201
228
|
color: this.color || "#ffffff",
|
|
202
229
|
width: this.width,
|
|
203
230
|
height: this.height,
|
|
204
|
-
borderRadius: this.circle
|
|
231
|
+
borderRadius: this.circle,
|
|
232
|
+
fontWeight: this.fontWeight || 500,
|
|
233
|
+
size: this.size
|
|
205
234
|
} : this.primaryOrdinary ? {
|
|
206
|
-
background: "#99004A",
|
|
235
|
+
background: this.bgColor || "#99004A",
|
|
207
236
|
borderWidth: "1px",
|
|
208
237
|
borderStyle: `${this.borderStyle}`,
|
|
209
238
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
210
239
|
color: this.color || "#ffffff",
|
|
211
|
-
width: "190px"
|
|
212
|
-
height: "52px"
|
|
240
|
+
width: `${this.width || "190px"}`,
|
|
241
|
+
height: `${this.height || "52px"}`,
|
|
213
242
|
borderRadius: this.circle,
|
|
214
|
-
fontSize: "16px",
|
|
215
|
-
fontWeight: 600
|
|
243
|
+
fontSize: this.fontSize || "16px",
|
|
244
|
+
fontWeight: this.fontWeight || 600,
|
|
245
|
+
size: this.size
|
|
216
246
|
} : this.primaryDialog ? {
|
|
217
|
-
|
|
218
|
-
height: "
|
|
247
|
+
minWidth: `${this.width || "250px"}`,
|
|
248
|
+
height: `${this.height || "60px"}`,
|
|
219
249
|
background: "#99004A",
|
|
220
250
|
borderWidth: "1px",
|
|
221
251
|
borderStyle: `${this.borderStyle}`,
|
|
222
252
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
223
253
|
color: this.color || "#ffffff",
|
|
224
|
-
borderRadius: "8px",
|
|
225
|
-
fontSize: "16px",
|
|
226
|
-
fontWeight:
|
|
254
|
+
borderRadius: this.circle || "8px",
|
|
255
|
+
fontSize: this.fontSize || "16px",
|
|
256
|
+
fontWeight: this.fontWeight || 560,
|
|
257
|
+
size: this.size
|
|
227
258
|
} : this.default ? {
|
|
228
|
-
background: "#ffffff",
|
|
259
|
+
background: this.bgColor || "#ffffff",
|
|
229
260
|
borderWidth: "1px",
|
|
230
261
|
borderStyle: `${this.borderStyle}`,
|
|
231
262
|
borderColor: `${this.borderColor || this.color || "#DDE2E6"}`,
|
|
232
263
|
color: this.color || "#99004A",
|
|
233
264
|
width: this.width,
|
|
234
265
|
height: this.height,
|
|
235
|
-
borderRadius: this.circle
|
|
266
|
+
borderRadius: this.circle,
|
|
267
|
+
fontWeight: this.fontWeight || 500,
|
|
268
|
+
size: this.size
|
|
236
269
|
} : this.info ? {
|
|
237
|
-
background: "#C4C4C4",
|
|
270
|
+
background: this.bgColor || "#C4C4C4",
|
|
238
271
|
borderWidth: "1px",
|
|
239
272
|
borderStyle: `${this.borderStyle}`,
|
|
240
273
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
241
274
|
color: this.color || "#FFFFFF",
|
|
242
275
|
width: this.width,
|
|
243
276
|
height: this.height,
|
|
244
|
-
borderRadius: this.circle
|
|
277
|
+
borderRadius: this.circle,
|
|
278
|
+
fontWeight: this.fontWeight || 500,
|
|
279
|
+
size: this.size
|
|
245
280
|
} : this.infoDialog ? {
|
|
246
|
-
|
|
247
|
-
height:
|
|
248
|
-
background: "#C4C4C4",
|
|
281
|
+
minWidth: `${this.width || "250px"}`,
|
|
282
|
+
height: `${this.height || "60px"}`,
|
|
283
|
+
background: this.bgColor || "#C4C4C4",
|
|
249
284
|
borderWidth: "1px",
|
|
250
285
|
borderStyle: `${this.borderStyle}`,
|
|
251
286
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
252
287
|
color: this.color || "#FFFFFF",
|
|
253
|
-
borderRadius: "8px",
|
|
254
|
-
fontSize: "16px",
|
|
255
|
-
fontWeight: 600
|
|
288
|
+
borderRadius: this.circle || "8px",
|
|
289
|
+
fontSize: this.fontSize || "16px",
|
|
290
|
+
fontWeight: this.fontWeight || 600,
|
|
291
|
+
size: this.size
|
|
256
292
|
} : this.infoOrdinary ? {
|
|
257
|
-
width: "176px"
|
|
258
|
-
height: "52px"
|
|
259
|
-
background: "#C4C4C4",
|
|
293
|
+
width: `${this.width || "176px"}`,
|
|
294
|
+
height: `${this.height || "52px"}`,
|
|
295
|
+
background: this.bgColor || "#C4C4C4",
|
|
260
296
|
borderWidth: "1px",
|
|
261
297
|
borderStyle: `${this.borderStyle}`,
|
|
262
298
|
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
263
299
|
color: this.color || "#FFFFFF",
|
|
264
|
-
borderRadius: "8px",
|
|
265
|
-
fontSize: "16px",
|
|
266
|
-
fontWeight: 600
|
|
300
|
+
borderRadius: this.circle || "8px",
|
|
301
|
+
fontSize: this.fontSize || "16px",
|
|
302
|
+
fontWeight: this.fontWeight || 600,
|
|
303
|
+
size: this.size
|
|
304
|
+
} : this.text ? {
|
|
305
|
+
width: `${this.width || "41px"}`,
|
|
306
|
+
height: `${this.height || "24px"}`,
|
|
307
|
+
background: this.bgColor || "#ffffff",
|
|
308
|
+
borderWidth: "0px",
|
|
309
|
+
borderStyle: `${this.borderStyle}`,
|
|
310
|
+
borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
|
|
311
|
+
color: this.color || "#E2A650",
|
|
312
|
+
borderRadius: this.circle || "8px",
|
|
313
|
+
fontSize: this.fontSize || "14px",
|
|
314
|
+
fontWeight: this.fontWeight || 500,
|
|
315
|
+
size: this.size,
|
|
316
|
+
lineHeight: this.lineHeight || "24px"
|
|
267
317
|
} : {
|
|
318
|
+
width: this.width,
|
|
319
|
+
height: this.height,
|
|
268
320
|
color: this.color || "#ffffff",
|
|
269
321
|
background: this.bgColor || "#99004A",
|
|
270
322
|
borderStyle: `${this.borderStyle}`,
|
|
271
323
|
borderColor: `${this.borderColor || this.color || "#99004A"}`,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
324
|
+
borderRadius: this.circle || "8px",
|
|
325
|
+
fontSize: this.fontSize || "16px",
|
|
326
|
+
fontWeight: this.fontWeight || 500,
|
|
327
|
+
size: this.size || "20"
|
|
275
328
|
};
|
|
276
329
|
},
|
|
277
330
|
geturl() {
|
|
@@ -292,72 +345,72 @@ const N = new R({
|
|
|
292
345
|
}
|
|
293
346
|
},
|
|
294
347
|
emits: ["handleClick"],
|
|
295
|
-
setup(
|
|
348
|
+
setup(t, e) {
|
|
296
349
|
return {
|
|
297
|
-
|
|
298
|
-
let
|
|
350
|
+
debouncedClick: N((o) => {
|
|
351
|
+
let l = T.generate(), s = `${t.btnCode}_${l}`;
|
|
299
352
|
console.log(
|
|
300
353
|
"按钮组件点击事件获取到事件对象及事件唯一标识符",
|
|
301
354
|
o,
|
|
302
|
-
|
|
303
|
-
),
|
|
304
|
-
}
|
|
355
|
+
s
|
|
356
|
+
), t.btnCode ? e.emit("handleClick", s) : e.emit("handleClick", "");
|
|
357
|
+
}, 3e3)
|
|
305
358
|
};
|
|
306
359
|
}
|
|
307
360
|
});
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
for (const [
|
|
311
|
-
i
|
|
312
|
-
return
|
|
313
|
-
}, V = {
|
|
361
|
+
const E = (t, e) => {
|
|
362
|
+
const r = t.__vccOpts || t;
|
|
363
|
+
for (const [i, o] of e)
|
|
364
|
+
r[i] = o;
|
|
365
|
+
return r;
|
|
366
|
+
}, H = { class: "common-button" }, V = {
|
|
314
367
|
key: 0,
|
|
315
368
|
class: "s-icon"
|
|
316
369
|
}, j = ["src"];
|
|
317
|
-
function
|
|
318
|
-
const
|
|
319
|
-
return
|
|
370
|
+
function I(t, e, r, i, o, l) {
|
|
371
|
+
const s = a("Loading"), n = a("el-icon"), d = a("el-button");
|
|
372
|
+
return h(), c("div", H, [
|
|
320
373
|
y(d, {
|
|
321
|
-
class:
|
|
322
|
-
disabled:
|
|
323
|
-
loading:
|
|
324
|
-
style: f(
|
|
325
|
-
onClick:
|
|
326
|
-
btnCode:
|
|
374
|
+
class: v(["s-button", { plain: t.plain, btnhover: !t.plain, loading: t.loading }]),
|
|
375
|
+
disabled: t.disabled,
|
|
376
|
+
loading: t.loading,
|
|
377
|
+
style: f(t.styleOjb),
|
|
378
|
+
onClick: t.debouncedClick,
|
|
379
|
+
btnCode: t.btnCode
|
|
327
380
|
}, {
|
|
328
381
|
default: C(() => [
|
|
329
|
-
|
|
382
|
+
t.icon ? (h(), c("i", V, [
|
|
330
383
|
u("img", {
|
|
331
|
-
src:
|
|
384
|
+
src: t.geturl,
|
|
332
385
|
alt: "",
|
|
333
|
-
style: f(
|
|
386
|
+
style: f(t.styleObject)
|
|
334
387
|
}, null, 12, j)
|
|
335
|
-
])) :
|
|
388
|
+
])) : S("", !0),
|
|
336
389
|
u("span", {
|
|
337
|
-
style: f({ color:
|
|
390
|
+
style: f({ color: t.color })
|
|
338
391
|
}, [
|
|
339
|
-
$(
|
|
392
|
+
$(t.$slots, "default", {}, void 0, !0)
|
|
340
393
|
], 4),
|
|
341
|
-
|
|
394
|
+
t.loading ? (h(), w(n, {
|
|
342
395
|
key: 1,
|
|
343
396
|
class: "is-loading",
|
|
344
|
-
color:
|
|
397
|
+
color: t.loadingColor
|
|
345
398
|
}, {
|
|
346
399
|
default: C(() => [
|
|
347
|
-
y(
|
|
400
|
+
y(s)
|
|
348
401
|
]),
|
|
349
402
|
_: 1
|
|
350
|
-
}, 8, ["color"])) :
|
|
403
|
+
}, 8, ["color"])) : S("", !0)
|
|
351
404
|
]),
|
|
352
405
|
_: 3
|
|
353
406
|
}, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"])
|
|
354
407
|
]);
|
|
355
408
|
}
|
|
356
|
-
const
|
|
357
|
-
function
|
|
358
|
-
|
|
409
|
+
const z = /* @__PURE__ */ E(M, [["render", I], ["__scopeId", "data-v-bcd0a5e0"]]);
|
|
410
|
+
function b(t, e = {}) {
|
|
411
|
+
b.installed || (b.installed = !0, t.component("common-button", z));
|
|
359
412
|
}
|
|
360
|
-
|
|
413
|
+
z.install = b;
|
|
361
414
|
export {
|
|
362
|
-
|
|
415
|
+
z as default
|
|
363
416
|
};
|
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"},y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},C=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=[C];function S(t,i,l,o,r,n){return e.openBlock(),e.createElementBlock("svg",y,m)}var z=d(b,[["render",S],["__file","loading.vue"]]);function a(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,g=s<i.length?i[s]:0,p=n+h+g;o.push(p%l),n=Math.floor(p/l),s++}return o}function u(t,i,l){if(t<0)return null;if(t==0)return[];for(var o=[],r=i;t&1&&(o=a(o,r,l)),t=t>>1,t!==0;)r=a(r,r,l);return o}function _(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=_(t,i);if(o===null)return null;for(var r=[],n=[1],s=0;s<o.length;s++)o[s]&&(r=a(r,u(o[s],n,l),l)),n=u(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 k{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 k({mid:42,offset:(2019-1970)*31536e3*1e3}),v=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},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"}:{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)}}}),q="",B=(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"},N=["src"];function L(t,i,l,o,r,n){const s=e.resolveComponent("Loading"),h=e.resolveComponent("el-icon"),g=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",F,[e.createVNode(g,{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,N)])):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 f=B(v,[["render",L],["__scopeId","data-v-bcd0a5e0"]]);function c(t,i={}){c.installed||(c.installed=!0,t.component("common-button",f))}return f.install=c,f});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.s-button[data-v-
|
|
1
|
+
.s-button[data-v-bcd0a5e0]{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-bcd0a5e0]{margin-left:15px}.s-button span[data-v-bcd0a5e0]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-bcd0a5e0]{vertical-align:middle}.plain[data-v-bcd0a5e0]{background:#fff}.plain-icon[data-v-bcd0a5e0]{margin-right:4px}.loading[data-v-bcd0a5e0]{opacity:.8}.s-icon[data-v-bcd0a5e0]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-bcd0a5e0]{float:left;width:25px;height:25px}
|