dfish-widget 1.0.119 → 1.0.121

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/lib/index.esm.js CHANGED
@@ -3567,7 +3567,8 @@ const O = {},
3567
3567
  animateState: null,
3568
3568
  isDeactivated: false,
3569
3569
  _pos: null,
3570
- snapStyle: null
3570
+ snapStyle: null,
3571
+ unique: false,
3571
3572
  }
3572
3573
  },
3573
3574
  activated() {
@@ -3714,10 +3715,11 @@ const O = {},
3714
3715
  setListenHide(a) {
3715
3716
  let d = this.x.hoverShowDrop;
3716
3717
  let n = a ? 'addEventListener' : 'removeEventListener';
3717
- let evs = $$1.br.mobile ? ['touchend'] : ['mousedown', $$1.br.firefox ? 'DOMMouseScroll' : 'mousewheel'];
3718
+ let wl = $$1.br.firefox ? 'DOMMouseScroll' : 'mousewheel';
3719
+ let evs = $$1.br.mobile ? ['touchend'] : ['mousedown', wl];
3718
3720
  evs.forEach(v => document[n](v, this.bind('listenHideClose', (e) => {
3719
3721
  let c;
3720
- if (this.x.visible !== false && (e.target.classList.contains('w-dialog-cover') || !(this.hasBubble(e.target) || (!this.x.independent && ((c = this.getCommander()).isWidget ? c.hasBubble(e.target) : c.contains(e.target)))))) {
3722
+ if (this.x.visible !== false && (e.target.classList.contains('w-dialog-cover') || e.type === wl || !(this.hasBubble(e.target) || (!this.x.independent && ((c = this.getCommander()).isWidget ? c.hasBubble(e.target) : c.contains(e.target)))))) {
3721
3723
  if (e.target.id == this.id + 'cvr') e.stopPropagation();
3722
3724
  this.close();
3723
3725
  }
@@ -4358,7 +4360,8 @@ script$16.__file = "src/template/TemplateTip.vue";
4358
4360
 
4359
4361
  let inst$1 = null;
4360
4362
  let tipCache = {
4361
- time: new Date().getTime()
4363
+ time: new Date().getTime(),
4364
+ list: []
4362
4365
  };
4363
4366
 
4364
4367
  var script$15 = {
@@ -4381,7 +4384,17 @@ let inst$1 = null;
4381
4384
  },
4382
4385
  html_slots_default() {
4383
4386
  return h(script$16, {text: this.x.text, escape: this.x.escape}, this.$slots)
4384
- }
4387
+ },
4388
+ // implement
4389
+ setVisibleSub(a) {
4390
+ if (a) {
4391
+ for (let uid of tipCache.list) {
4392
+ if (uid != this.uid) {
4393
+ $$1.close(uid);
4394
+ }
4395
+ }
4396
+ }
4397
+ },
4385
4398
  },
4386
4399
  computed: {
4387
4400
  slotTarget() {
@@ -4399,9 +4412,14 @@ let inst$1 = null;
4399
4412
  tipCache.time = new Date().getTime();
4400
4413
  inst$1 && $$1.close(inst$1);
4401
4414
  inst$1 = this.uid;
4415
+ tipCache.list.push(this.uid);
4402
4416
  },
4403
4417
  unmounted() {
4404
4418
  inst$1 = null;
4419
+ let i = tipCache.list.indexOf(this.uid);
4420
+ if (i > -1) {
4421
+ tipCache.list.splice(i, 1);
4422
+ }
4405
4423
  }
4406
4424
  };
4407
4425
 
@@ -9357,93 +9375,96 @@ var script$r = {
9357
9375
  methods: {
9358
9376
  indent() {
9359
9377
  let len = this.$refs.wrap.querySelectorAll(':scope>.w-timeline-half>.w-timeline-item').length;
9360
- if (len <= 1) return
9361
- let vt = this.x.vertical;
9362
- let size = vt ? 'width' : 'height';
9363
- let prevWidth = 0;
9364
- let nextWidth = 0;
9365
- for (let i = 0; i < len; i++) {
9366
- let prev = this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i}"]`);
9367
- let next = i < len - 1 && this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i+1}"]`);
9368
- let prevBcr = $$1.bcr(prev.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9369
- if (prev.parentNode == this.$refs.prev) {
9370
- prevWidth = Math.max(prevWidth, prevBcr[size]);
9371
- } else {
9372
- nextWidth = Math.max(nextWidth, prevBcr[size]);
9373
- }
9374
- if (next && prev.parentNode != next.parentNode) {
9375
- let nextBcr = $$1.bcr(next.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9376
- if (vt && prevBcr.bottom + 25 > nextBcr.top) {
9377
- $$1.q(next).css({
9378
- marginTop: prevBcr.bottom + 25 - nextBcr.top
9379
- });
9380
- } else if (!vt && prevBcr.right + 50 > nextBcr.left) {
9381
- $$1.q(next).css({
9382
- marginLeft: prevBcr.right + 50 - nextBcr.left
9383
- });
9378
+ if (len > 0) {
9379
+ let vt = this.x.vertical;
9380
+ let size = vt ? 'width' : 'height';
9381
+ let prevWidth = 0;
9382
+ let nextWidth = 0;
9383
+ for (let i = 0; i < len; i++) {
9384
+ let prev = this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i}"]`);
9385
+ let next = i < len - 1 && this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i+1}"]`);
9386
+ let prevBcr = $$1.bcr(prev.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9387
+ if (prev.parentNode == this.$refs.prev) {
9388
+ prevWidth = Math.max(prevWidth, prevBcr[size]);
9389
+ } else {
9390
+ nextWidth = Math.max(nextWidth, prevBcr[size]);
9391
+ }
9392
+ if (next && prev.parentNode != next.parentNode) {
9393
+ let nextBcr = $$1.bcr(next.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9394
+ if (vt && prevBcr.bottom + 25 > nextBcr.top) {
9395
+ $$1.q(next).css({
9396
+ marginTop: prevBcr.bottom + 25 - nextBcr.top
9397
+ });
9398
+ } else if (!vt && prevBcr.right + 50 > nextBcr.left) {
9399
+ $$1.q(next).css({
9400
+ marginLeft: prevBcr.right + 50 - nextBcr.left
9401
+ });
9402
+ }
9384
9403
  }
9385
9404
  }
9386
- }
9387
- let prevItems = $$1.q('>.w-timeline-item', this.$refs.prev);
9388
- prevItems.each((i, v) => {
9389
- let icon = $$1.q('>.w-timeline-item-icon', v);
9390
- let bcr = $$1.bcr(icon[0]);
9391
- icon.css({
9392
- [vt ? 'marginRight' : 'marginBottom']: (prevWidth - bcr[size]) / 2
9405
+ let prevItems = $$1.q('>.w-timeline-item', this.$refs.prev);
9406
+ prevItems.each((i, v) => {
9407
+ let icon = $$1.q('>.w-timeline-item-icon', v);
9408
+ let bcr = $$1.bcr(icon[0]);
9409
+ icon.css({
9410
+ [vt ? 'marginRight' : 'marginBottom']: (prevWidth - bcr[size]) / 2
9411
+ });
9393
9412
  });
9394
- });
9395
- $$1.q('>.w-timeline-item', this.$refs.next).each((i, v) => {
9396
- let icon = $$1.q('>.w-timeline-item-icon', v);
9397
- let bcr = $$1.bcr(icon[0]);
9398
- icon.css({
9399
- [vt ? 'marginLeft' : 'marginTop']: (nextWidth - bcr[size]) / 2
9413
+ $$1.q('>.w-timeline-item', this.$refs.next).each((i, v) => {
9414
+ let icon = $$1.q('>.w-timeline-item-icon', v);
9415
+ let bcr = $$1.bcr(icon[0]);
9416
+ icon.css({
9417
+ [vt ? 'marginLeft' : 'marginTop']: (nextWidth - bcr[size]) / 2
9418
+ });
9400
9419
  });
9401
- });
9402
- prevItems.length && $$1.q(this.$refs.next).css({
9403
- [vt ? 'marginLeft' : 'marginTop']: `-${nextWidth/2 + prevWidth/2}px`
9404
- });
9405
-
9406
- const wrapBcr = $$1.bcr(this.$refs.wrap);
9407
- const center = [];
9408
- let bg = [];
9409
- let linePos = 0;
9410
- let lineColor = '#ddd';
9411
- for (let i = 0; i < len; i++) {
9412
- let el = $$1.q(`>.w-timeline-half>.w-timeline-item[w-index="${i}"]`, this.$refs.wrap);
9413
- let b = $$1.bcr(el.find('>.w-timeline-item-icon>.w-timeline-item-icon-img')[0]);
9414
- let c = {x: b.left + (b.width / 2), y: b.top + (b.height / 2), color: el.attr('w-line-color')};
9415
- center.push(c);
9416
- }
9417
- center.sort((n, m) => this.x.vertical ? (n.y < m.y ? -1 : 0) : (n.x < m.x ? -1 : 0));
9418
- for (let i = 0; i < len; i++) {
9419
- const c = center[i];
9420
- if (i > 0) {
9421
- const prev = center[0];
9422
- linePos = this.x.vertical ? c.y - prev.y : c.x - prev.x;
9423
- bg.push(`${lineColor} ${linePos}px`);
9424
- }
9425
- if (c.color) lineColor = c.color;
9426
- if (i > 0) {
9427
- bg.push(`${lineColor} ${linePos}px`);
9428
- }
9429
- }
9430
- if (this.x.vertical) {
9431
- $$1.q(this.$refs.line).css({
9432
- width: 2,
9433
- height: center[len-1].y - center[0].y,
9434
- top: center[0].y - wrapBcr.top,
9435
- left: center[0].x - wrapBcr.left - 1,
9420
+ prevItems.length && $$1.q(this.$refs.next).css({
9421
+ [vt ? 'marginLeft' : 'marginTop']: `-${nextWidth/2 + prevWidth/2}px`
9436
9422
  });
9423
+ }
9424
+ if (len == 0) {
9425
+ $$1.q(this.$refs.line).css({width: 0, height: 0});
9437
9426
  } else {
9438
- $$1.q(this.$refs.line).css({
9439
- width: center[len-1].x - center[0].x,
9440
- height: 2,
9441
- top: center[0].y - wrapBcr.top - 1,
9442
- left: center[0].x - wrapBcr.left,
9443
- background: `linear-gradient(to right, ${bg.join()})`
9444
- });
9427
+ const wrapBcr = $$1.bcr(this.$refs.wrap);
9428
+ const center = [];
9429
+ let bg = [];
9430
+ let linePos = 0;
9431
+ let lineColor = '#ddd';
9432
+ for (let i = 0; i < len; i++) {
9433
+ let el = $$1.q(`>.w-timeline-half>.w-timeline-item[w-index="${i}"]`, this.$refs.wrap);
9434
+ let b = $$1.bcr(el.find('>.w-timeline-item-icon>.w-timeline-item-icon-img')[0]);
9435
+ let c = {x: b.left + (b.width / 2), y: b.top + (b.height / 2), color: el.attr('w-line-color')};
9436
+ center.push(c);
9437
+ }
9438
+ center.sort((n, m) => this.x.vertical ? (n.y < m.y ? -1 : 0) : (n.x < m.x ? -1 : 0));
9439
+ for (let i = 0; i < len; i++) {
9440
+ const c = center[i];
9441
+ if (i > 0) {
9442
+ const prev = center[0];
9443
+ linePos = this.x.vertical ? c.y - prev.y : c.x - prev.x;
9444
+ bg.push(`${lineColor} ${linePos}px`);
9445
+ }
9446
+ if (c.color) lineColor = c.color;
9447
+ if (i > 0) {
9448
+ bg.push(`${lineColor} ${linePos}px`);
9449
+ }
9450
+ }
9451
+ if (this.x.vertical) {
9452
+ $$1.q(this.$refs.line).css({
9453
+ width: 2,
9454
+ height: center[len-1].y - center[0].y,
9455
+ top: center[0].y - wrapBcr.top,
9456
+ left: center[0].x - wrapBcr.left - 1,
9457
+ });
9458
+ } else {
9459
+ $$1.q(this.$refs.line).css({
9460
+ width: center[len-1].x - center[0].x,
9461
+ height: 2,
9462
+ top: center[0].y - wrapBcr.top - 1,
9463
+ left: center[0].x - wrapBcr.left,
9464
+ background: `linear-gradient(to right, ${bg.join()})`
9465
+ });
9466
+ }
9445
9467
  }
9446
-
9447
9468
  },
9448
9469
  html_slots() {
9449
9470
  let prevSlots = [];