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.
@@ -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 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 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 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
- }, A = /* @__PURE__ */ u(
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
- ), 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(), c("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__ */ 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 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 = g(i, o, r)), t = t >> 1, t !== 0; )
42
+ o = g(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 = 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 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
+ }), 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
- width: "176px",
218
- height: "46px",
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: 600
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
- width: "190px",
247
- height: "46px ",
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
- width: this.width,
273
- height: this.height,
274
- borderRadius: this.circle
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(e, t) {
348
+ setup(t, e) {
296
349
  return {
297
- handleClick: (o) => {
298
- let r = N.generate(), n = `${e.btnCode}_${r}`;
350
+ debouncedClick: N((o) => {
351
+ let l = T.generate(), s = `${t.btnCode}_${l}`;
299
352
  console.log(
300
353
  "按钮组件点击事件获取到事件对象及事件唯一标识符",
301
354
  o,
302
- n
303
- ), e.btnCode ? t.emit("handleClick", n) : t.emit("handleClick", "");
304
- }
355
+ s
356
+ ), t.btnCode ? e.emit("handleClick", s) : e.emit("handleClick", "");
357
+ }, 3e3)
305
358
  };
306
359
  }
307
360
  });
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 = {
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 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, [
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: 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
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
- e.icon ? (a(), c("i", V, [
382
+ t.icon ? (h(), c("i", V, [
330
383
  u("img", {
331
- src: e.geturl,
384
+ src: t.geturl,
332
385
  alt: "",
333
- style: f(e.styleObject)
386
+ style: f(t.styleObject)
334
387
  }, null, 12, j)
335
- ])) : m("", !0),
388
+ ])) : S("", !0),
336
389
  u("span", {
337
- style: f({ color: e.color })
390
+ style: f({ color: t.color })
338
391
  }, [
339
- $(e.$slots, "default", {}, void 0, !0)
392
+ $(t.$slots, "default", {}, void 0, !0)
340
393
  ], 4),
341
- e.loading ? (a(), k(s, {
394
+ t.loading ? (h(), w(n, {
342
395
  key: 1,
343
396
  class: "is-loading",
344
- color: e.loadingColor
397
+ color: t.loadingColor
345
398
  }, {
346
399
  default: C(() => [
347
- y(l)
400
+ y(s)
348
401
  ]),
349
402
  _: 1
350
- }, 8, ["color"])) : m("", !0)
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 _ = /* @__PURE__ */ T(M, [["render", E], ["__scopeId", "data-v-c7c15d8f"]]);
357
- function p(e, t = {}) {
358
- p.installed || (p.installed = !0, e.component("common-button", _));
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
- _.install = p;
413
+ z.install = b;
361
414
  export {
362
- _ as default
415
+ z as default
363
416
  };
@@ -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"},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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinosoft-common-button",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
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-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}