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.
@@ -1,16 +1,16 @@
1
- import { openBlock as a, createElementBlock as c, createElementVNode as u, defineComponent as S, resolveComponent as h, createVNode as y, normalizeClass as w, normalizeStyle as f, withCtx as C, createCommentVNode as m, renderSlot as $, createBlock as k } from "vue";
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 z = (e, t) => {
4
- let i = e.__vccOpts || e;
5
- for (let [o, r] of t)
6
- i[o] = r;
7
- return i;
8
- }, F = {
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
- }, A = /* @__PURE__ */ u(
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
- ), B = [
23
- A
22
+ ), A = [
23
+ F
24
24
  ];
25
- function W(e, t, i, o, r, n) {
26
- return a(), c("svg", x, B);
25
+ function B(t, e, r, i, o, l) {
26
+ return h(), f("svg", x, A);
27
27
  }
28
- var L = /* @__PURE__ */ z(F, [["render", W], ["__file", "loading.vue"]]);
29
- function g(e, t, i) {
30
- for (var o = [], r = Math.max(e.length, t.length), n = 0, l = 0; l < r || n; ) {
31
- var s = l < e.length ? e[l] : 0, d = l < t.length ? t[l] : 0, b = n + s + d;
32
- o.push(b % i), n = Math.floor(b / i), l++;
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 o;
34
+ return i;
35
35
  }
36
- function v(e, t, i) {
37
- if (e < 0)
36
+ function m(t, e, r) {
37
+ if (t < 0)
38
38
  return null;
39
- if (e == 0)
39
+ if (t == 0)
40
40
  return [];
41
- for (var o = [], r = t; e & 1 && (o = g(o, r, i)), e = e >> 1, e !== 0; )
42
- r = g(r, r, i);
43
- return o;
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(e, t) {
46
- for (var i = e.split(""), o = [], r = i.length - 1; r >= 0; r--) {
47
- var n = parseInt(i[r], t);
48
- if (isNaN(n))
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
- o.push(n);
50
+ i.push(l);
51
51
  }
52
- return o;
52
+ return i;
53
53
  }
54
- function q(e, t, i) {
55
- var o = O(e, t);
56
- if (o === null)
54
+ function R(t, e, r) {
55
+ var i = O(t, e);
56
+ if (i === null)
57
57
  return null;
58
- for (var r = [], n = [1], l = 0; l < o.length; l++)
59
- o[l] && (r = g(
60
- r,
61
- v(o[l], n, i),
62
- i
63
- )), n = v(t, n, i);
64
- for (var s = "", l = r.length - 1; l >= 0; l--)
65
- s += r[l].toString(i);
66
- return s;
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 D(e) {
69
- return e.substring(0, 2) === "0x" && (e = e.substring(2)), e = e.toLowerCase(), q(e, 16, 10);
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 R {
72
- constructor(t) {
73
- t = t || {}, this.seq = 0, this.mid = (t.mid || 1) % 1023, this.offset = t.offset || 0, this.lastTime = 0;
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 t = Date.now(), i = (t - this.offset).toString(2);
77
- this.lastTime == t ? (this.seq++, this.seq > 4095 && (this.seq = 0)) : this.seq = 0, this.lastTime = t;
78
- let o = this.seq.toString(2), r = this.mid.toString(2);
79
- for (; o.length < 12; )
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
- for (; r.length < 10; )
82
- r = "0" + r;
83
- const n = i + r + o;
84
- let l = "";
85
- for (let s = n.length; s > 0; s -= 4)
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
- const N = new R({
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 = S({
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
- width: "176px",
218
- height: "46px",
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: 600
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
- width: "190px",
247
- height: "46px ",
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
- width: this.width,
273
- height: this.height,
274
- borderRadius: this.circle
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(e, t) {
364
+ setup(t, e) {
296
365
  return {
297
- handleClick: (o) => {
298
- let r = N.generate(), n = `${e.btnCode}_${r}`;
366
+ debouncedClick: N((o) => {
367
+ let l = T.generate(), s = `${t.btnCode}_${l}`;
299
368
  console.log(
300
369
  "按钮组件点击事件获取到事件对象及事件唯一标识符",
301
370
  o,
302
- n
303
- ), e.btnCode ? t.emit("handleClick", n) : t.emit("handleClick", "");
304
- }
371
+ s
372
+ ), t.btnCode ? e.emit("handleClick", s) : e.emit("handleClick", "");
373
+ }, 3e3)
305
374
  };
306
375
  }
307
376
  });
308
- const T = (e, t) => {
309
- const i = e.__vccOpts || e;
310
- for (const [o, r] of t)
311
- i[o] = r;
312
- return i;
313
- }, V = {
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
- }, j = ["src"];
317
- function E(e, t, i, o, r, n) {
318
- const l = h("Loading"), s = h("el-icon"), d = h("el-button");
319
- return a(), c("div", null, [
320
- y(d, {
321
- class: w(["s-button", { plain: e.plain, btnhover: !e.plain, loading: e.loading }]),
322
- disabled: e.disabled,
323
- loading: e.loading,
324
- style: f(e.styleOjb),
325
- onClick: e.handleClick,
326
- btnCode: e.btnCode
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: C(() => [
329
- e.icon ? (a(), c("i", V, [
330
- u("img", {
331
- src: e.geturl,
406
+ default: y(() => [
407
+ t.icon ? (h(), f("i", j, [
408
+ g("img", {
409
+ src: t.geturl,
332
410
  alt: "",
333
- style: f(e.styleObject)
334
- }, null, 12, j)
335
- ])) : m("", !0),
336
- u("span", {
337
- style: f({ color: e.color })
411
+ style: a(t.styleObject)
412
+ }, null, 12, V)
413
+ ])) : S("", !0),
414
+ g("span", {
415
+ style: a({ color: t.color })
338
416
  }, [
339
- $(e.$slots, "default", {}, void 0, !0)
417
+ z(t.$slots, "default", {}, void 0, !0)
340
418
  ], 4),
341
- e.loading ? (a(), k(s, {
419
+ t.loading ? (h(), C(n, {
342
420
  key: 1,
343
421
  class: "is-loading",
344
- color: e.loadingColor
422
+ color: t.loadingColor
345
423
  }, {
346
- default: C(() => [
347
- y(l)
424
+ default: y(() => [
425
+ _(s)
348
426
  ]),
349
427
  _: 1
350
- }, 8, ["color"])) : m("", !0)
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 _ = /* @__PURE__ */ T(M, [["render", E], ["__scopeId", "data-v-c7c15d8f"]]);
357
- function p(e, t = {}) {
358
- p.installed || (p.installed = !0, e.component("common-button", _));
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
- _.install = p;
438
+ $.install = p;
361
439
  export {
362
- _ as default
440
+ $ as default
363
441
  };
@@ -1 +1 @@
1
- (function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue")):typeof define=="function"&&define.amd?define(["vue"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.button=a(t.Vue))})(this,function(t){"use strict";/*! Element Plus Icons Vue v2.1.0 */var a=(e,o)=>{let l=e.__vccOpts||e;for(let[i,r]of o)l[i]=r;return l},b={name:"Loading"},y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},C=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),m=[C];function _(e,o,l,i,r,s){return t.openBlock(),t.createElementBlock("svg",y,m)}var S=a(b,[["render",_],["__file","loading.vue"]]);function h(e,o,l){for(var i=[],r=Math.max(e.length,o.length),s=0,n=0;n<r||s;){var d=n<e.length?e[n]:0,u=n<o.length?o[n]:0,g=s+d+u;i.push(g%l),s=Math.floor(g/l),n++}return i}function p(e,o,l){if(e<0)return null;if(e==0)return[];for(var i=[],r=o;e&1&&(i=h(i,r,l)),e=e>>1,e!==0;)r=h(r,r,l);return i}function w(e,o){for(var l=e.split(""),i=[],r=l.length-1;r>=0;r--){var s=parseInt(l[r],o);if(isNaN(s))return null;i.push(s)}return i}function k(e,o,l){var i=w(e,o);if(i===null)return null;for(var r=[],s=[1],n=0;n<i.length;n++)i[n]&&(r=h(r,p(i[n],s,l),l)),s=p(o,s,l);for(var d="",n=r.length-1;n>=0;n--)d+=r[n].toString(l);return d}function $(e){return e.substring(0,2)==="0x"&&(e=e.substring(2)),e=e.toLowerCase(),k(e,16,10)}class v{constructor(o){o=o||{},this.seq=0,this.mid=(o.mid||1)%1023,this.offset=o.offset||0,this.lastTime=0}generate(){const o=Date.now(),l=(o-this.offset).toString(2);this.lastTime==o?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=o;let i=this.seq.toString(2),r=this.mid.toString(2);for(;i.length<12;)i="0"+i;for(;r.length<10;)r="0"+r;const s=l+r+i;let n="";for(let d=s.length;d>0;d-=4)n=parseInt(s.substring(d-4,d),2).toString(16)+n;return $(n)}}const z=new v({mid:42,offset:(2019-1970)*31536e3*1e3}),F=t.defineComponent({components:{Loading:S},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},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"}},computed:{styleOjb(){return this.plain?{background:"#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}:this.primary?{background:"#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}:this.primaryOrdinary?{background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:"190px",height:"52px",borderRadius:this.circle,fontSize:"16px",fontWeight:600}:this.primaryDialog?{width:"176px",height:"46px",background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",borderRadius:"8px",fontSize:"16px",fontWeight:600}:this.default?{background:"#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}:this.info?{background:"#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}:this.infoDialog?{width:"190px",height:"46px ",background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:"8px",fontSize:"16px",fontWeight:600}:this.infoOrdinary?{width:"176px",height:"52px",background:"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:"8px",fontSize:"16px",fontWeight:600}:{color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,width:this.width,height:this.height,borderRadius:this.circle}},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,o){return{handleClick:i=>{let r=z.generate(),s=`${e.btnCode}_${r}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",i,s),e.btnCode?o.emit("handleClick",s):o.emit("handleClick","")}}}}),L="",B=(e,o)=>{const l=e.__vccOpts||e;for(const[i,r]of o)l[i]=r;return l},x={key:0,class:"s-icon"},A=["src"];function W(e,o,l,i,r,s){const n=t.resolveComponent("Loading"),d=t.resolveComponent("el-icon"),u=t.resolveComponent("el-button");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(u,{class:t.normalizeClass(["s-button",{plain:e.plain,btnhover:!e.plain,loading:e.loading}]),disabled:e.disabled,loading:e.loading,style:t.normalizeStyle(e.styleOjb),onClick:e.handleClick,btnCode:e.btnCode},{default:t.withCtx(()=>[e.icon?(t.openBlock(),t.createElementBlock("i",x,[t.createElementVNode("img",{src:e.geturl,alt:"",style:t.normalizeStyle(e.styleObject)},null,12,A)])):t.createCommentVNode("",!0),t.createElementVNode("span",{style:t.normalizeStyle({color:e.color})},[t.renderSlot(e.$slots,"default",{},void 0,!0)],4),e.loading?(t.openBlock(),t.createBlock(d,{key:1,class:"is-loading",color:e.loadingColor},{default:t.withCtx(()=>[t.createVNode(n)]),_:1},8,["color"])):t.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"])])}const f=B(F,[["render",W],["__scopeId","data-v-c7c15d8f"]]);function c(e,o={}){c.installed||(c.installed=!0,e.component("common-button",f))}return f.install=c,f});
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinosoft-common-button",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "main": "common-button.es.js",
6
6
  "scripts": {
package/style.css CHANGED
@@ -1 +1 @@
1
- .s-button[data-v-c7c15d8f]{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-c7c15d8f]{margin-left:15px}.s-button span[data-v-c7c15d8f]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-c7c15d8f]{vertical-align:middle}.plain[data-v-c7c15d8f]{background:#fff}.plain-icon[data-v-c7c15d8f]{margin-right:4px}.loading[data-v-c7c15d8f]{opacity:.8}.s-icon[data-v-c7c15d8f]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-c7c15d8f]{float:left;width:25px;height:25px}
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}