evui 3.4.142 → 3.4.144

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.142",
3
+ "version": "3.4.144",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -246,7 +246,9 @@
246
246
  }, { deep: true, flush: 'post' });
247
247
 
248
248
  watch(() => props.selectedSeries, (newValue) => {
249
- if (newValue.seriesId) {
249
+ if (!normalizedOptions.selectSeries?.use) {
250
+ console.warn('[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working');
251
+ } else if (newValue.seriesId) {
250
252
  evChart.selectSeriesByData(newValue.seriesId);
251
253
  }
252
254
  }, { deep: true, flush: 'post' });
@@ -187,7 +187,7 @@ const modules = {
187
187
  const hitItem = hitInfo.items[hitItemId];
188
188
 
189
189
  if (hitItem) {
190
- args.label = hitItem.data?.x || hitItem.data?.y;
190
+ args.label = hitItem.label;
191
191
  args.value = hitItem.data?.o;
192
192
  args.seriesId = hitItemId;
193
193
  args.dataIndex = hitItem.index;
@@ -211,7 +211,7 @@ const modules = {
211
211
  this.defaultSelectInfo = this.getSelectedLabelInfoWithLabelData(dataIndexList, targetAxis);
212
212
 
213
213
  if (hitItem) {
214
- args.label = hitItem.data?.x || hitItem.data?.y;
214
+ args.label = hitItem.label;
215
215
  args.seriesId = hitItemId;
216
216
  args.value = hitItem.data?.o;
217
217
  args.acc = hitItem.data?.acc;
@@ -228,7 +228,7 @@ const modules = {
228
228
  const allSelectedList = this.updateSelectedSeriesInfo(hitItemId, true);
229
229
 
230
230
  if (hitItem) {
231
- args.label = hitItem.data?.x || hitItem.data?.y;
231
+ args.label = hitItem.label;
232
232
  args.value = hitItem.data?.o;
233
233
  args.seriesId = allSelectedList.seriesId?.at(0);
234
234
  args.acc = hitItem.data?.acc;
@@ -350,7 +350,7 @@ const modules = {
350
350
  ...cloneDeep(this.defaultSelectInfo),
351
351
  };
352
352
  args.label = hitItem.label;
353
- args.dataIndex = hitItem.maxIndex;
353
+ args.dataIndex = hitItem.index;
354
354
  }
355
355
  };
356
356
 
@@ -886,9 +886,23 @@ const modules = {
886
886
 
887
887
  /**
888
888
  * Find graph item on mouse position
889
- * @param {array} offset return value from getMousePosition()
889
+ * @param {number[]} offset return value from getMousePosition()
890
890
  *
891
- * @returns {object} hit item information
891
+ * @returns {{
892
+ * items: Record<string, {
893
+ * data: any,
894
+ * hit: boolean,
895
+ * color: string,
896
+ * name: string,
897
+ * id: string,
898
+ * index: number,
899
+ * label: string | import('dayjs').Dayjs,
900
+ * axis: { x: number, y: number },
901
+ * }>,
902
+ * hitId: string | null,
903
+ * maxTip: [string, string],
904
+ * maxHighlight: [string, number] | null,
905
+ * }} hit item information
892
906
  */
893
907
  findHitItem(offset) {
894
908
  const sIds = Object.keys(this.seriesList);
@@ -945,6 +959,7 @@ const modules = {
945
959
  item.id = series.id;
946
960
  item.name = formattedSeriesName;
947
961
  item.axis = { x: series.xAxisIndex, y: series.yAxisIndex };
962
+ item.label = isHorizontal ? item.data?.y : item.data?.x;
948
963
  items[sId] = item;
949
964
 
950
965
  const formattedTxt = this.getFormattedTooltipValue({
@@ -1289,7 +1304,7 @@ const modules = {
1289
1304
  * Select Series
1290
1305
  * set backup data that selected series information list
1291
1306
  * render chart
1292
- * @param seriesIdList {number[]} '
1307
+ * @param seriesIdList {number[]}
1293
1308
  * @returns {boolean}
1294
1309
  */
1295
1310
  selectSeriesByData(seriesIdList) {
@@ -931,8 +931,13 @@ const modules = {
931
931
  }
932
932
  this.setLegendColumnHeader();
933
933
  } else if (this.options.legend.virtualScroll) {
934
- this.updateVisibleRowCount();
935
- this.renderVisibleLegends();
934
+ const isHidden = this.legendDOM?.style?.display === 'none';
935
+ if (isHidden) {
936
+ this.legendNeedsUpdate = true;
937
+ } else {
938
+ this.updateVisibleRowCount();
939
+ this.renderVisibleLegends();
940
+ }
936
941
  } else {
937
942
  while (legendBoxDOM.hasChildNodes()) {
938
943
  legendBoxDOM.removeChild(legendBoxDOM.firstChild);
@@ -1487,6 +1492,12 @@ const modules = {
1487
1492
  if (this.legendDOM) {
1488
1493
  this.legendDOM.style.display = 'block';
1489
1494
  }
1495
+
1496
+ if (this.legendNeedsUpdate && this.options.legend.virtualScroll && !this.useTable) {
1497
+ this.legendNeedsUpdate = false;
1498
+ this.updateVisibleRowCount();
1499
+ this.renderVisibleLegends();
1500
+ }
1490
1501
  },
1491
1502
 
1492
1503
  /**
@@ -117,12 +117,12 @@ export default {
117
117
  const timeRegexExp = /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;
118
118
  if (Array.isArray(time) && (!timeRegexExp.test(time[0]) || !timeRegexExp.test(time[1]))) {
119
119
  // range mode
120
- console.warn('Please check the time format in the Timepicker.');
120
+ console.warn('[EVUI][TimePicker] Please check the time format in the Timepicker.');
121
121
  return false;
122
122
  }
123
123
  if (!Array.isArray(time) && !timeRegexExp.test(time)) {
124
124
  // single mode
125
- console.warn('Please check the time format in the Timepicker.');
125
+ console.warn('[EVUI][TimePicker] Please check the time format in the Timepicker.');
126
126
  return false;
127
127
  }
128
128
  return true;
@@ -132,7 +132,7 @@ export default {
132
132
 
133
133
  // check 'value' property and add nodeKey if same value already exists
134
134
  if ('value' in node && valueArr.includes(node.value)) {
135
- console.warn('The \'value\' of data should be unique.');
135
+ console.warn('[EVUI][Tree] The \'value\' of data should be unique.');
136
136
  node.value += node.nodeKey;
137
137
  } else if (!('value' in node)) {
138
138
  node.value = node.title + node.nodeKey;
@@ -97,7 +97,7 @@ const useModel = () => {
97
97
  const convertedWidth = removeUnit(props.width, 'horizontal');
98
98
  const convertedMinWidth = removeUnit(props.minWidth, 'horizontal');
99
99
  if (convertedWidth < convertedMinWidth) {
100
- console.warn('Since width is less than min-width, it is replaced by min-width.');
100
+ console.warn('[EVUI][Window] Since width is less than min-width, it is replaced by min-width.');
101
101
  basePosition.width = numberToUnit(props.minWidth);
102
102
  } else {
103
103
  basePosition.width = numberToUnit(props.width);
@@ -106,7 +106,7 @@ const useModel = () => {
106
106
  const convertedHeight = removeUnit(props.height, 'vertical');
107
107
  const convertedMinHeight = removeUnit(props.minHeight, 'vertical');
108
108
  if (convertedHeight < convertedMinHeight) {
109
- console.warn('Since height is less than min-height, it is replaced by min-height.');
109
+ console.warn('[EVUI][Window] Since height is less than min-height, it is replaced by min-height.');
110
110
  basePosition.height = numberToUnit(props.minHeight);
111
111
  } else {
112
112
  basePosition.height = numberToUnit(props.height);