@evercam/ui 0.0.55-beta.2 → 0.0.55-beta.3

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/dist/index.mjs CHANGED
@@ -21961,17 +21961,13 @@ const Ah = {
21961
21961
  },
21962
21962
  dotSize: {
21963
21963
  type: Number,
21964
- default: 6
21964
+ default: 8
21965
21965
  },
21966
21966
  lineWidth: {
21967
21967
  type: Number,
21968
21968
  default: 2
21969
21969
  },
21970
21970
  lineHeight: {
21971
- type: Number,
21972
- default: 16
21973
- },
21974
- hoveredLineHeight: {
21975
21971
  type: Number,
21976
21972
  default: 28
21977
21973
  }
@@ -21981,14 +21977,10 @@ const Ah = {
21981
21977
  milestoneClasses: Ye,
21982
21978
  timeouts: [],
21983
21979
  isInitialRender: !0,
21984
- isHoveringDot: !1,
21985
21980
  isMouseOver: !1
21986
21981
  };
21987
21982
  },
21988
21983
  computed: {
21989
- computedLineHeight() {
21990
- return this.isHoveringDot ? this.hoveredLineHeight : this.lineHeight;
21991
- },
21992
21984
  transitionStyles() {
21993
21985
  return this.isInitialRender ? {} : {
21994
21986
  transition: `transform ${this.transitionDuration}ms, width ${this.transitionDuration}ms, height ${this.transitionDuration}ms, padding ${this.transitionDuration}ms, border-radius ${this.transitionDuration}ms`
@@ -22001,9 +21993,9 @@ const Ah = {
22001
21993
  };
22002
21994
  },
22003
21995
  positionStyles() {
22004
- return this.dot ? {
22005
- transform: `translateY(calc(-100% - ${this.computedLineHeight}px))`
22006
- } : {};
21996
+ return !this.dot || !this.isMouseOver ? {} : {
21997
+ transform: `translateY(calc(-100% - ${this.lineHeight}px))`
21998
+ };
22007
21999
  },
22008
22000
  styles() {
22009
22001
  return {
@@ -22029,25 +22021,25 @@ const Ah = {
22029
22021
  },
22030
22022
  dotContainerStyles() {
22031
22023
  return {
22032
- top: `calc(100% - ${this.borderWidth}px)`,
22033
- height: `calc(${this.computedLineHeight}px + ${this.dotSize}px)`,
22024
+ top: this.isMouseOver ? `calc(100% - ${this.borderWidth}px)` : `calc(50% + ${this.dotSize / 2}px)`,
22025
+ height: `calc(${this.lineHeight}px + ${this.dotSize}px)`,
22034
22026
  left: `calc(50% - ${this.lineWidth}px / 2)`,
22035
22027
  transition: `${this.computedTransitionDuration}ms`
22036
22028
  };
22037
22029
  },
22038
22030
  lineStyles() {
22039
22031
  return {
22040
- top: `${this.borderWidth}px`,
22032
+ bottom: `${this.dotSize / 2}px`,
22041
22033
  left: `calc(50% - ${this.lineWidth}px / 2)`,
22042
22034
  width: `${this.lineWidth}px`,
22043
- height: `calc(${this.computedLineHeight}px)`,
22035
+ height: this.isMouseOver ? `${this.lineHeight}px` : "0",
22044
22036
  backgroundColor: this.borderColor,
22045
22037
  transition: `${this.computedTransitionDuration}ms`
22046
22038
  };
22047
22039
  },
22048
22040
  dotStyles() {
22049
22041
  return {
22050
- top: `calc(${this.computedLineHeight}px + 1px)`,
22042
+ top: `${this.lineHeight}px`,
22051
22043
  left: `calc(50% - ${this.dotSize}px / 2)`,
22052
22044
  width: `${this.dotSize}px`,
22053
22045
  height: `${this.dotSize}px`,
@@ -22064,7 +22056,7 @@ const Ah = {
22064
22056
  methods: {
22065
22057
  onMilestoneMouseOver(s, e) {
22066
22058
  if (this.dot) {
22067
- this.isHoveringDot = !0;
22059
+ this.isMouseOver = !0;
22068
22060
  return;
22069
22061
  }
22070
22062
  const t = s.target;
@@ -22080,14 +22072,14 @@ const Ah = {
22080
22072
  a && (clearTimeout(Number(a)), t.dataset.timeoutId = ""), t.dataset.initialWidth || (t.dataset.initialWidth = t.style.width), t.dataset.initialHeight || (t.dataset.initialHeight = t.style.height), t.dataset.initialContentWidth || (t.dataset.initialContentWidth = String(n.width)), t.dataset.initialContentHeight || (t.dataset.initialContentHeight = String(n.height)), t.dataset.transitionStart = String(Date.now()), t.style.width = t.dataset.initialContentWidth + "px", t.style.height = t.dataset.initialContentHeight + "px", t.style.borderRadius = "0.5em", t.classList.add(Ye.milestoneHovered), i.style.opacity = "1", i.style.width = t.dataset.initialContentWidth + "px", i.style.height = t.dataset.initialContentHeight + "px";
22081
22073
  },
22082
22074
  onMilestoneMouseMove() {
22083
- this.isMouseOver = !0;
22075
+ this.timeouts.forEach((s) => clearTimeout(s)), this.isMouseOver = !0;
22084
22076
  },
22085
22077
  onMilestoneMouseLeave(s, e) {
22086
22078
  if (this.dot) {
22087
22079
  this.timeouts.push(
22088
22080
  setTimeout(() => {
22089
- this.isHoveringDot = !this.isMouseOver;
22090
- }, 600)
22081
+ this.isMouseOver = !1;
22082
+ }, this.transitionDuration + 100)
22091
22083
  );
22092
22084
  return;
22093
22085
  }
@@ -22115,8 +22107,8 @@ var Ch = function() {
22115
22107
  [e.milestoneClasses.milestone]: !0,
22116
22108
  [e.milestoneClasses.milestoneDot]: e.dot,
22117
22109
  [e.milestoneClasses.milestoneBullet]: !e.dot,
22118
- [e.milestoneClasses.milestoneDotHovered]: e.isHoveringDot
22119
- }, style: e.styles, attrs: { tabindex: "0" }, on: { mouseover: (i) => e.onMilestoneMouseOver(i, e.milestone), mousemove: (i) => e.onMilestoneMouseMove(i, e.milestone), mouseleave: (i) => e.onMilestoneMouseLeave(i, e.milestone), click: (i) => e.onMilestoneClick(i, e.milestone) } }, [t("div", { class: e.milestoneClasses.milestoneContent, style: e.contentStyles }, [e._t("content", function() {
22110
+ [e.milestoneClasses.milestoneDotHovered]: e.isMouseOver
22111
+ }, style: e.styles, attrs: { tabindex: "0" }, on: { mouseover: (i) => e.onMilestoneMouseOver(i, e.milestone), mousemove: e.onMilestoneMouseMove, mouseleave: (i) => e.onMilestoneMouseLeave(i, e.milestone), click: (i) => e.onMilestoneClick(i, e.milestone) } }, [t("div", { class: e.milestoneClasses.milestoneContent, style: e.contentStyles }, [e._t("content", function() {
22120
22112
  return [t("span", [e._v(" " + e._s(e.milestone.text) + " ")])];
22121
22113
  })], 2), e.dot ? t("div", { class: e.milestoneClasses.milestoneDotContainer, style: e.dotContainerStyles }, [t("div", { class: e.milestoneClasses.milestoneDotLine, style: e.lineStyles }), t("div", { class: e.milestoneClasses.milestoneDotDot, style: e.dotStyles })]) : t("div", { class: e.milestoneClasses.milestoneLabel, style: e.labelStyles }, [e._t("label")], 2)]);
22122
22114
  }, Dh = [], _h = /* @__PURE__ */ Ne(
@@ -22436,9 +22428,8 @@ const Ih = _h.exports, G = {
22436
22428
  return Object.fromEntries(s);
22437
22429
  },
22438
22430
  allEventsSorted() {
22439
- return Object.values(this.filteredEventsGroups).map((e) => e.events).flat().sort(
22440
- (e, t) => new Date(e.timestamp || e.startDate) > new Date(t.timestamp || t.startDate) ? 1 : -1
22441
- );
22431
+ const s = Object.values(this.filteredEventsGroups).map((e) => e.events).flat();
22432
+ return this.getSortedEvents(s);
22442
22433
  },
22443
22434
  oldestEvent() {
22444
22435
  let s;
@@ -22982,13 +22973,17 @@ const Ih = _h.exports, G = {
22982
22973
  r,
22983
22974
  s
22984
22975
  );
22985
- t.type === "drag" && a && e.attr("style", `left: ${n}px`), t.type === "end" && a && (this.markersPositions = {
22986
- ...this.markersPositions,
22987
- [s.id || s.timestamp]: {
22988
- ...this.markersPositions[s.id || s.timestamp],
22989
- position: n
22990
- }
22991
- }, e.classed(G.markerDragged, !1)), t.type !== "start" && this.$emit(`marker-drag-${t.type}`, {
22976
+ if (t.type === "drag" && a && e.attr("style", `left: ${n}px`), t.type === "end" && a) {
22977
+ const o = s.id || s.timestamp;
22978
+ this.markersPositions = {
22979
+ ...this.markersPositions,
22980
+ [o]: {
22981
+ ...this.markersPositions[o],
22982
+ position: n
22983
+ }
22984
+ }, e.classed(G.markerDragged, !1);
22985
+ }
22986
+ t.type !== "start" && this.$emit(`marker-drag-${t.type}`, {
22992
22987
  marker: s,
22993
22988
  newTimestamp: r.toISOString()
22994
22989
  });
@@ -23220,7 +23215,7 @@ const Ih = _h.exports, G = {
23220
23215
  Object.entries(this.milestonesGroups).forEach(([s, e]) => {
23221
23216
  const t = this.getMilestoneGroupYPosition(s), i = this.svg.select(
23222
23217
  `g.${G.eventGroup}-${s}`
23223
- ), r = 2, n = e.height || this.barChartHeight, a = e.dots ? n : n / 2, o = t + a - r / 2;
23218
+ ), r = 2, a = (e.height || this.barChartHeight) / 2, o = t + a - r / 2;
23224
23219
  i.attr("x1", 0).attr("x2", this.timeline.offsetWidth).select(`.${Ye.milestoneLine}`).attr("y1", o).attr("y2", o);
23225
23220
  const l = w.select(
23226
23221
  `.${Ye.milestonesContainer}-${s}`
@@ -23228,7 +23223,7 @@ const Ih = _h.exports, G = {
23228
23223
  l.style("top", `${t}px`).style("height", `${e.height || this.barChartHeight}px`);
23229
23224
  const c = l.selectAll(
23230
23225
  `.${Ye.milestone}`
23231
- ).data(e.events);
23226
+ ).data(this.getSortedEvents(e.events));
23232
23227
  c.exit().remove(), c.enter().append("div").merge(c).style(
23233
23228
  "left",
23234
23229
  (u) => `${this.timeScale(this.tzStringToDate(u.timestamp))}px`
@@ -23350,11 +23345,6 @@ const Ih = _h.exports, G = {
23350
23345
  }, o = s.append("g").attr("class", `${G.labelGroup} ${G.labelGroup}-${r}`).style("cursor", "pointer").on("click", () => this.toggleGroupVisibility(r));
23351
23346
  o.append("rect").attr("class", G.labelBg).attr("data-color", t).attr("x", a.x).attr("y", a.y).attr("width", a.w).attr("height", a.h).attr("rx", a.radius).attr("ry", a.radius).style("fill", this.dark ? "#131a29" : "white"), o.append("rect").attr("class", G.labelBgFill).attr("data-color", t).attr("x", a.x).attr("y", a.y).attr("width", a.w).attr("height", a.h).attr("rx", a.radius).attr("ry", a.radius).style("fill", this.getLabelBackgroundColor(t)).style("stroke", this.getTextFillColor(t)).style("stroke-width", 0.25), o.append("text").attr("class", G.labelText).attr("data-color", t).attr("x", 5).attr("y", e + (n || this.barChartHeight) / 2).attr("dy", "0.35em").style("text-anchor", "start").style("font-size", "12px").style("font-weight", 500).style("stroke-linejoin", "round").style("paint-order", "stroke").style("fill", this.getTextFillColor(t)).text(i);
23352
23347
  },
23353
- getSortedEvents(s) {
23354
- return [...s].sort(
23355
- (e, t) => new Date(e.timestamp || e.startDate) > new Date(t.timestamp || t.startDate) ? 1 : -1
23356
- );
23357
- },
23358
23348
  getTextFillColor(s, e = 0) {
23359
23349
  var t, i;
23360
23350
  return (this.dark ? (t = w.color(s)) == null ? void 0 : t.brighter(1.5 + e) : (i = w.color(s)) == null ? void 0 : i.darker(2 + e)).toString();
@@ -23462,6 +23452,11 @@ const Ih = _h.exports, G = {
23462
23452
  },
23463
23453
  onMilestoneClick(s, e) {
23464
23454
  this.panOnDateClick && this.panToTimestamp(s.timestamp), this.selectedMilestoneId = s.id || s.timestamp, this.$emit("milestone-click", { milestone: s, milestoneType: e });
23455
+ },
23456
+ getSortedEvents(s) {
23457
+ return [...s].sort(
23458
+ (e, t) => new Date(e.timestamp || e.startDate) > new Date(t.timestamp || t.startDate) ? 1 : -1
23459
+ );
23465
23460
  }
23466
23461
  }
23467
23462
  });
@@ -23475,12 +23470,12 @@ var kh = function() {
23475
23470
  }, { marker: i })], 2)]), t("div", { staticClass: "marker-line e-absolute e-pointer-events-none", style: e.getMarkerLineStyle(i) })]);
23476
23471
  }), e.autoResize ? t("div", { directives: [{ name: "resize-observer", rawName: "v-resize-observer", value: e.onResize, expression: "onResize" }], ref: "timelineContainer", staticClass: "e-timeline__svg-container e-relative e-h-13 e-rounded e-select-none e-overflow-x-hidden" }) : t("div", { ref: "timelineContainer", staticClass: "e-timeline__svg-container e-relative e-h-13 e-rounded e-select-none e-overflow-x-hidden" }), e._l(e.milestonesGroups, function(i, r) {
23477
23472
  return t("div", { key: `${r}`, staticClass: "e-timeline-milestones" }, [t("div", { class: `e-tl-milestones e-tl-milestones-${r}` }, e._l(e.getSortedEvents(i.events), function(n, a) {
23478
- return t("ETimelineMilestone", { key: `${n.milestoneType}-${a}`, class: e.getMilestoneClass(n), attrs: { milestone: n, dot: i.dots, size: n.size || e.milestoneBulletSize, "transition-duration": i.milestonesTransitionDuration, "line-height": i.milestonesLineHeight, "hovered-line-height": i.milestonesHoveredLineHeight, "dot-size": i.milestonesDotSize, "background-color": e.getMilestoneColors(n.color, i.color).background, "border-color": e.getMilestoneColors(n.color, i.color).border }, on: { "milestone-click": function(o) {
23473
+ return t("ETimelineMilestone", { key: `${n.milestoneType}-${a}`, class: e.getMilestoneClass(n), attrs: { "data-timestamp": n.timestamp, milestone: n, dot: i.dots, size: n.size || e.milestoneBulletSize, "transition-duration": i.milestonesTransitionDuration, "line-height": i.milestonesLineHeight, "dot-size": i.milestonesDotSize, "background-color": e.getMilestoneColors(n.color, i.color).background, "border-color": e.getMilestoneColors(n.color, i.color).border }, on: { "milestone-click": function(o) {
23479
23474
  return e.onMilestoneClick(n, r);
23480
23475
  } }, scopedSlots: e._u([{ key: "content", fn: function() {
23481
23476
  return [e._t(`milestoneContent.${n.milestoneType}`, function() {
23482
- return [t("span", [e._v(" " + e._s(n.text) + " ")])];
23483
- }, { milestone: n })];
23477
+ return [t("span", { staticClass: "e-px-2" }, [e._v(" " + e._s(n.text) + " ")])];
23478
+ }, { milestone: n, index: a })];
23484
23479
  }, proxy: !0 }, { key: "label", fn: function() {
23485
23480
  return [e._t(`milestoneLabel.${n.milestoneType}`, null, { milestone: n })];
23486
23481
  }, proxy: !0 }], null, !0) });