evui 3.4.133 → 3.4.135

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.4.133",
3
+ "version": "3.4.135",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -358,7 +358,9 @@ class Line {
358
358
  });
359
359
 
360
360
  if (validData.length === 0) {
361
- return item;
361
+ gdata.forEach((point, idx) => {
362
+ validData.push({ ...point, originalIndex: idx });
363
+ });
362
364
  }
363
365
 
364
366
  // 이진 탐색으로 가장 가까운 포인트 찾기
@@ -82,7 +82,6 @@ const modules = {
82
82
  label,
83
83
  mousePosition: [e.clientX, e.clientY],
84
84
  dataLabel: actualLabelValue,
85
- isTooltipBased: true,
86
85
  };
87
86
  }
88
87
  } else if (tooltip.use && this.isInitTooltip) {
@@ -109,7 +108,6 @@ const modules = {
109
108
  horizontal: this.options.horizontal,
110
109
  label,
111
110
  mousePosition: [e.clientX, e.clientY],
112
- isTooltipBased: false,
113
111
  };
114
112
  } else if (!args.hoveredLabel) {
115
113
  args.hoveredLabel = {
@@ -1034,8 +1032,7 @@ const modules = {
1034
1032
  }
1035
1033
  }
1036
1034
 
1037
- let closestDistance = this.seriesList?.[referenceSeries]?.useLinearInterpolation?.()
1038
- ? Infinity : avgInterval;
1035
+ let closestDistance = Infinity;
1039
1036
  let closestIndex = -1;
1040
1037
 
1041
1038
  // 각 라벨에서 가장 가까운 것 찾기
@@ -1068,6 +1065,23 @@ const modules = {
1068
1065
  }
1069
1066
  }
1070
1067
 
1068
+ if (closestDistance >= avgInterval) {
1069
+ const useLinearInterpolation = sIds.some((sId) => {
1070
+ const series = this.seriesList[sId];
1071
+
1072
+ if (series?.show) {
1073
+ const passingValue = series.passingValue;
1074
+ const interpolation = series.interpolation;
1075
+ const hasPassingValueInData = series.hasPassingValueInData;
1076
+
1077
+ return interpolation === 'linear' || (interpolation === 'none' && !!passingValue && hasPassingValueInData);
1078
+ }
1079
+
1080
+ return false;
1081
+ });
1082
+ return useLinearInterpolation ? closestIndex : -1;
1083
+ }
1084
+
1071
1085
  return closestIndex;
1072
1086
  },
1073
1087
 
@@ -858,29 +858,18 @@ const modules = {
858
858
  *
859
859
  * @returns {undefined}
860
860
  */
861
- drawSyncedIndicator({ horizontal, label, mousePosition, dataLabel, isTooltipBased }) {
862
- if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
861
+ drawSyncedIndicator({ horizontal, label, mousePosition, dataLabel }) {
862
+ if (!this._canDrawSyncedIndicator(horizontal, mousePosition)) {
863
863
  return;
864
864
  }
865
865
 
866
- // tooltip 기반 동기화인 경우
867
- if (isTooltipBased) {
866
+ if (dataLabel) {
868
867
  this.drawSyncedIndicatorForTooltip({ dataLabel, mousePosition });
869
868
  return;
870
869
  }
871
870
 
872
- // 기존 시간 기반 동기화
873
- if (
874
- this.options.syncHover === false
875
- || (!horizontal && !this.options.axesX.every(({ type }) => type === 'time'))
876
- || (horizontal && !this.options.axesY.every(({ type }) => type === 'time'))) {
877
- return;
878
- }
879
871
  const fromTime = +this.data.labels?.[0];
880
872
  const toTime = +this.data.labels?.[this.data.labels.length - 1];
881
- if (fromTime == null || toTime == null) {
882
- return;
883
- }
884
873
  const [clientX, clientY] = mousePosition;
885
874
  const { top, bottom, left, right } = this.chartDOM.getBoundingClientRect();
886
875
 
@@ -908,6 +897,30 @@ const modules = {
908
897
  }
909
898
  },
910
899
 
900
+ _canDrawSyncedIndicator(horizontal, mousePosition) {
901
+ if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
902
+ return false;
903
+ }
904
+
905
+ return this._isTimeBasedSyncEnabled(horizontal) && this._hasValidTimeRange();
906
+ },
907
+
908
+ _isTimeBasedSyncEnabled(horizontal) {
909
+ if (this.options.syncHover === false) return false;
910
+ if (!this.data?.labels?.length) return false;
911
+
912
+ const timeAxes = horizontal
913
+ ? this.options.axesY.every(({ type }) => type === 'time')
914
+ : this.options.axesX.every(({ type }) => type === 'time');
915
+
916
+ return timeAxes;
917
+ },
918
+
919
+ _hasValidTimeRange() {
920
+ const fromTime = +this.data.labels?.[0];
921
+ const toTime = +this.data.labels?.[this.data.labels.length - 1];
922
+ return fromTime != null && toTime != null;
923
+ },
911
924
 
912
925
  /**
913
926
  * 제공된 dataLabel과 일치하는 Label이 있다면 indicator를 그림
@@ -9,7 +9,18 @@
9
9
  :items="items"
10
10
  :style="menuStyle"
11
11
  :comp="comp"
12
- />
12
+ >
13
+ <template
14
+ v-for="(_, slotName) in $slots"
15
+ :key="slotName"
16
+ #[slotName]="slotProps"
17
+ >
18
+ <slot
19
+ :name="slotName"
20
+ v-bind="slotProps"
21
+ />
22
+ </template>
23
+ </menu-list>
13
24
  </teleport>
14
25
  </template>
15
26
  </template>
@@ -15,7 +15,18 @@
15
15
  class="ev-menu-li-prefix"
16
16
  :class="item.iconClass"
17
17
  />
18
- {{ item.text }}
18
+ <span class="ev-menu-li-text">
19
+ <slot
20
+ v-if="item.slotKey"
21
+ :name="item.slotKey"
22
+ :item="item"
23
+ >
24
+ {{ item.text }}
25
+ </slot>
26
+ <template v-else>
27
+ {{ item.text }}
28
+ </template>
29
+ </span>
19
30
  <i
20
31
  v-if="item.children || item.isShowMenu"
21
32
  class="ev-menu-li-suffix ev-icon-arrow-right2"
@@ -31,7 +42,18 @@
31
42
  :comp="comp"
32
43
  :items="childrenItems"
33
44
  :style="menuStyle"
34
- />
45
+ >
46
+ <template
47
+ v-for="(_, slotName) in $slots"
48
+ :key="slotName"
49
+ #[slotName]="slotProps"
50
+ >
51
+ <slot
52
+ :name="slotName"
53
+ v-bind="slotProps"
54
+ />
55
+ </template>
56
+ </component>
35
57
  </template>
36
58
  </div>
37
59
  </template>
@@ -152,4 +174,9 @@ export default {
152
174
  position: absolute;
153
175
  left: 3px;
154
176
  }
177
+
178
+ .ev-menu-li-text {
179
+ display: inline-block;
180
+ padding-left: 20px;
181
+ }
155
182
  </style>
@@ -9,7 +9,18 @@
9
9
  :disabled="disabled"
10
10
  :comp="component"
11
11
  @click="clickMenu"
12
- />
12
+ >
13
+ <template
14
+ v-for="(_, slotName) in $slots"
15
+ :key="slotName"
16
+ #[slotName]="slotProps"
17
+ >
18
+ <slot
19
+ :name="slotName"
20
+ v-bind="slotProps"
21
+ />
22
+ </template>
23
+ </menu-item>
13
24
  </ul>
14
25
  </template>
15
26
 
@@ -21,7 +21,18 @@
21
21
  :class="['front-icon', item.iconClass]"
22
22
  />
23
23
  <span class="text">
24
- {{ item.text || item.value }}
24
+ <slot
25
+ v-if="item.slotKey"
26
+ :name="item.slotKey"
27
+ :item="item"
28
+ :depth="depth"
29
+ :selected-item="selectedItem"
30
+ >
31
+ {{ item.text || item.value }}
32
+ </slot>
33
+ <template v-else>
34
+ {{ item.text || item.value }}
35
+ </template>
25
36
  </span>
26
37
  <span
27
38
  v-if="expandable && hasChild"
@@ -84,6 +95,9 @@ export default {
84
95
  } else if (obj.disabled !== undefined && typeof obj.disabled !== 'boolean') {
85
96
  console.warn('[EVUI][Menu] disabled attribute must be \'Boolean\' type.');
86
97
  return false;
98
+ } else if (obj.slotKey !== undefined && typeof obj.slotKey !== 'string') {
99
+ console.warn('[EVUI][Menu] slotKey attribute must be \'String\' type.');
100
+ return false;
87
101
  }
88
102
  return true;
89
103
  },