dfish-widget 1.0.120 → 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
@@ -3715,10 +3715,11 @@ const O = {},
3715
3715
  setListenHide(a) {
3716
3716
  let d = this.x.hoverShowDrop;
3717
3717
  let n = a ? 'addEventListener' : 'removeEventListener';
3718
- 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];
3719
3720
  evs.forEach(v => document[n](v, this.bind('listenHideClose', (e) => {
3720
3721
  let c;
3721
- 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)))))) {
3722
3723
  if (e.target.id == this.id + 'cvr') e.stopPropagation();
3723
3724
  this.close();
3724
3725
  }
@@ -9374,93 +9375,96 @@ var script$r = {
9374
9375
  methods: {
9375
9376
  indent() {
9376
9377
  let len = this.$refs.wrap.querySelectorAll(':scope>.w-timeline-half>.w-timeline-item').length;
9377
- if (len <= 1) return
9378
- let vt = this.x.vertical;
9379
- let size = vt ? 'width' : 'height';
9380
- let prevWidth = 0;
9381
- let nextWidth = 0;
9382
- for (let i = 0; i < len; i++) {
9383
- let prev = this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i}"]`);
9384
- let next = i < len - 1 && this.$refs.wrap.querySelector(`:scope>.w-timeline-half>.w-timeline-item[w-index="${i+1}"]`);
9385
- let prevBcr = $$1.bcr(prev.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9386
- if (prev.parentNode == this.$refs.prev) {
9387
- prevWidth = Math.max(prevWidth, prevBcr[size]);
9388
- } else {
9389
- nextWidth = Math.max(nextWidth, prevBcr[size]);
9390
- }
9391
- if (next && prev.parentNode != next.parentNode) {
9392
- let nextBcr = $$1.bcr(next.querySelector(':scope>.w-timeline-item-icon>.w-timeline-item-icon-img'));
9393
- if (vt && prevBcr.bottom + 25 > nextBcr.top) {
9394
- $$1.q(next).css({
9395
- marginTop: prevBcr.bottom + 25 - nextBcr.top
9396
- });
9397
- } else if (!vt && prevBcr.right + 50 > nextBcr.left) {
9398
- $$1.q(next).css({
9399
- marginLeft: prevBcr.right + 50 - nextBcr.left
9400
- });
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
+ }
9401
9403
  }
9402
9404
  }
9403
- }
9404
- let prevItems = $$1.q('>.w-timeline-item', this.$refs.prev);
9405
- prevItems.each((i, v) => {
9406
- let icon = $$1.q('>.w-timeline-item-icon', v);
9407
- let bcr = $$1.bcr(icon[0]);
9408
- icon.css({
9409
- [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
+ });
9410
9412
  });
9411
- });
9412
- $$1.q('>.w-timeline-item', this.$refs.next).each((i, v) => {
9413
- let icon = $$1.q('>.w-timeline-item-icon', v);
9414
- let bcr = $$1.bcr(icon[0]);
9415
- icon.css({
9416
- [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
+ });
9417
9419
  });
9418
- });
9419
- prevItems.length && $$1.q(this.$refs.next).css({
9420
- [vt ? 'marginLeft' : 'marginTop']: `-${nextWidth/2 + prevWidth/2}px`
9421
- });
9422
-
9423
- const wrapBcr = $$1.bcr(this.$refs.wrap);
9424
- const center = [];
9425
- let bg = [];
9426
- let linePos = 0;
9427
- let lineColor = '#ddd';
9428
- for (let i = 0; i < len; i++) {
9429
- let el = $$1.q(`>.w-timeline-half>.w-timeline-item[w-index="${i}"]`, this.$refs.wrap);
9430
- let b = $$1.bcr(el.find('>.w-timeline-item-icon>.w-timeline-item-icon-img')[0]);
9431
- let c = {x: b.left + (b.width / 2), y: b.top + (b.height / 2), color: el.attr('w-line-color')};
9432
- center.push(c);
9433
- }
9434
- center.sort((n, m) => this.x.vertical ? (n.y < m.y ? -1 : 0) : (n.x < m.x ? -1 : 0));
9435
- for (let i = 0; i < len; i++) {
9436
- const c = center[i];
9437
- if (i > 0) {
9438
- const prev = center[0];
9439
- linePos = this.x.vertical ? c.y - prev.y : c.x - prev.x;
9440
- bg.push(`${lineColor} ${linePos}px`);
9441
- }
9442
- if (c.color) lineColor = c.color;
9443
- if (i > 0) {
9444
- bg.push(`${lineColor} ${linePos}px`);
9445
- }
9446
- }
9447
- if (this.x.vertical) {
9448
- $$1.q(this.$refs.line).css({
9449
- width: 2,
9450
- height: center[len-1].y - center[0].y,
9451
- top: center[0].y - wrapBcr.top,
9452
- 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`
9453
9422
  });
9423
+ }
9424
+ if (len == 0) {
9425
+ $$1.q(this.$refs.line).css({width: 0, height: 0});
9454
9426
  } else {
9455
- $$1.q(this.$refs.line).css({
9456
- width: center[len-1].x - center[0].x,
9457
- height: 2,
9458
- top: center[0].y - wrapBcr.top - 1,
9459
- left: center[0].x - wrapBcr.left,
9460
- background: `linear-gradient(to right, ${bg.join()})`
9461
- });
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
+ }
9462
9467
  }
9463
-
9464
9468
  },
9465
9469
  html_slots() {
9466
9470
  let prevSlots = [];