evui 3.4.89 → 3.4.91

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.89",
3
+ "version": "3.4.91",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -855,14 +855,24 @@ const modules = {
855
855
  if (ldata !== null && ldata !== undefined) {
856
856
  const g = isHorizontal ? data.o || data.x : data.o || data.y;
857
857
 
858
- if (series.stackIndex) {
858
+ if (series.stackIndex != null) {
859
859
  acc += !isNaN(data.o) ? data.o : 0;
860
860
  useStack = true;
861
861
  } else {
862
862
  acc += data.y;
863
863
  }
864
864
 
865
- if (maxValue === null || maxValue <= g) {
865
+
866
+ if (maxType === 'bar' && useStack) {
867
+ if (item.hit) {
868
+ maxValue = g;
869
+ maxSeriesID = seriesID;
870
+ maxIndex = index;
871
+ maxLabel = ldata;
872
+ maxValuePos = lp;
873
+ maxType = series.type;
874
+ }
875
+ } else if (maxValue === null || maxValue <= g) {
866
876
  maxValue = g;
867
877
  maxSeriesID = seriesID;
868
878
  maxLabel = ldata;
@@ -114,18 +114,16 @@ const modules = {
114
114
  const selectItem = this.options.selectItem;
115
115
  const args = { e };
116
116
 
117
- if (selectItem.use) {
118
- const offset = this.getMousePosition(e);
119
- const hitInfo = this.getItemByPosition(offset, selectItem.useApproximateValue);
120
-
117
+ const offset = this.getMousePosition(e);
118
+ const hitInfo = this.getItemByPosition(offset, selectItem.useApproximateValue);
121
119
 
122
- if (hitInfo.label !== null) {
123
- this.render(hitInfo);
124
- }
125
120
 
126
- ({ label: args.label, value: args.value, sId: args.seriesId, acc: args.acc } = hitInfo);
121
+ if (hitInfo.label !== null) {
122
+ this.render(hitInfo);
127
123
  }
128
124
 
125
+ ({ label: args.label, value: args.value, sId: args.seriesId, acc: args.acc } = hitInfo);
126
+
129
127
  if (typeof this.listeners['dbl-click'] === 'function') {
130
128
  this.listeners['dbl-click'](args);
131
129
  }
@@ -177,6 +175,7 @@ const modules = {
177
175
  };
178
176
 
179
177
  const setSelectedLabelInfo = (targetAxis) => {
178
+ const itemHitInfo = this.getItemByPosition(offset, false);
180
179
  const {
181
180
  labelIndex: clickedLabelIndex,
182
181
  } = this.getLabelInfoByPosition(offset, targetAxis);
@@ -195,10 +194,14 @@ const modules = {
195
194
  eventTarget: 'label',
196
195
  ...cloneDeep(this.defaultSelectInfo),
197
196
  };
197
+ args.label = itemHitInfo.label;
198
+ args.dataIndex = itemHitInfo.maxIndex;
198
199
  };
199
200
 
200
201
  const setSelectedSeriesInfo = () => {
202
+ const itemHitInfo = this.getItemByPosition(offset, false);
201
203
  const hitInfo = this.getSeriesInfoByPosition(offset);
204
+
202
205
  if (hitInfo.sId !== null) {
203
206
  const allSelectedList = this.updateSelectedSeriesInfo(hitInfo.sId);
204
207
  this.defaultSelectInfo.seriesId = allSelectedList.seriesId;
@@ -207,6 +210,8 @@ const modules = {
207
210
  eventTarget: 'series',
208
211
  ...cloneDeep(this.defaultSelectInfo),
209
212
  };
213
+ args.label = itemHitInfo.label;
214
+ args.dataIndex = itemHitInfo.maxIndex;
210
215
  }
211
216
  };
212
217
 
@@ -770,16 +775,23 @@ const modules = {
770
775
  }
771
776
 
772
777
  if (gdata !== null && gdata !== undefined) {
773
- const sName = series.name;
774
- const sw = ctx ? ctx.measureText(sName).width : 1;
778
+ const formattedSeriesName = this.getFormattedTooltipLabel({
779
+ dataId: series.id,
780
+ seriesId: sId,
781
+ seriesName: series.name,
782
+ itemData: item.data,
783
+ });
784
+ const sw = ctx ? ctx.measureText(formattedSeriesName).width : 1;
775
785
 
776
- item.name = sName;
786
+ item.id = series.id;
787
+ item.name = formattedSeriesName;
777
788
  item.axis = { x: series.xAxisIndex, y: series.yAxisIndex };
778
789
  items[sId] = item;
779
790
 
780
791
  const formattedTxt = this.getFormattedTooltipValue({
792
+ dataId: series.id,
781
793
  seriesId: sId,
782
- seriesName: sName,
794
+ seriesName: formattedSeriesName,
783
795
  value: gdata,
784
796
  itemData: item.data,
785
797
  });
@@ -787,7 +799,7 @@ const modules = {
787
799
  item.data.formatted = formattedTxt;
788
800
 
789
801
  if (maxsw < sw) {
790
- maxs = sName;
802
+ maxs = formattedSeriesName;
791
803
  maxsw = sw;
792
804
  }
793
805
 
@@ -814,15 +826,42 @@ const modules = {
814
826
  return { items, hitId, maxTip: [maxs, maxv], maxHighlight };
815
827
  },
816
828
 
829
+ /**
830
+ * get formatted label for tooltip
831
+ * @param dataId
832
+ * @param seriesId
833
+ * @param seriesName
834
+ * @param itemData
835
+ * @returns {string}
836
+ */
837
+ getFormattedTooltipLabel({ dataId, seriesId, seriesName, itemData }) {
838
+ const opt = this.options;
839
+ const tooltipOpt = opt.tooltip;
840
+ const tooltipLabelFormatter = tooltipOpt?.formatter?.label;
841
+
842
+ let formattedLabel = seriesName;
843
+ if (tooltipLabelFormatter) {
844
+ formattedLabel = tooltipLabelFormatter({
845
+ dataId,
846
+ seriesId,
847
+ seriesName,
848
+ itemData,
849
+ });
850
+ }
851
+
852
+ return formattedLabel;
853
+ },
854
+
817
855
  /**
818
856
  * get formatted value for tooltip
857
+ * @param dataId
819
858
  * @param seriesId
820
859
  * @param seriesName
821
860
  * @param value
822
861
  * @param itemData
823
862
  * @returns {string}
824
863
  */
825
- getFormattedTooltipValue({ seriesId, seriesName, value, itemData }) {
864
+ getFormattedTooltipValue({ dataId, seriesId, seriesName, value, itemData }) {
826
865
  const opt = this.options;
827
866
  const isHorizontal = !!opt.horizontal;
828
867
  const tooltipOpt = opt.tooltip;
@@ -838,6 +877,7 @@ const modules = {
838
877
  name: seriesName,
839
878
  percentage: itemData?.percentage,
840
879
  seriesId,
880
+ dataId,
841
881
  });
842
882
  } else if (opt.type === 'heatMap') {
843
883
  formattedTxt = tooltipValueFormatter({
@@ -845,6 +885,7 @@ const modules = {
845
885
  y: itemData?.y,
846
886
  value: value > -1 ? value : 'error',
847
887
  seriesId,
888
+ dataId,
848
889
  });
849
890
  } else {
850
891
  formattedTxt = tooltipValueFormatter({
@@ -852,6 +893,7 @@ const modules = {
852
893
  y: isHorizontal ? itemData?.y : value,
853
894
  name: seriesName,
854
895
  seriesId,
896
+ dataId,
855
897
  });
856
898
  }
857
899
  }
@@ -893,9 +935,17 @@ const modules = {
893
935
  ),
894
936
  );
895
937
 
896
- const formattedValue = this.getFormattedTooltipValue({
938
+ const formattedSeriesName = this.getFormattedTooltipLabel({
939
+ dataId: series.id,
897
940
  seriesId: sId,
898
941
  seriesName: series.name,
942
+ itemData: hasData,
943
+ });
944
+
945
+ const formattedValue = this.getFormattedTooltipValue({
946
+ dataId: series.id,
947
+ seriesId: sId,
948
+ seriesName: formattedSeriesName,
899
949
  value: hasData?.o,
900
950
  itemData: hasData,
901
951
  });
@@ -904,7 +954,7 @@ const modules = {
904
954
  const item = {};
905
955
  item.color = series.color;
906
956
  item.hit = false;
907
- item.name = series.name;
957
+ item.name = formattedSeriesName;
908
958
  item.axis = { x: series.xAxisIndex, y: series.yAxisIndex };
909
959
  item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
910
960
  item.data = hasData;
@@ -914,9 +964,9 @@ const modules = {
914
964
  }
915
965
 
916
966
  const maxSeriesNameWidth = ctx ? ctx.measureText(maxSeriesName).width : 1;
917
- const seriesNameWidth = ctx ? ctx.measureText(series.name).width : 1;
967
+ const seriesNameWidth = ctx ? ctx.measureText(formattedSeriesName).width : 1;
918
968
  if (maxSeriesNameWidth < seriesNameWidth) {
919
- maxSeriesName = series.name;
969
+ maxSeriesName = formattedSeriesName;
920
970
  }
921
971
 
922
972
  const maxValueWidth = ctx ? ctx.measureText(maxValueTxt).width : 1;
@@ -293,9 +293,11 @@ const modules = {
293
293
  const seriesList = [];
294
294
  seriesKeys.forEach((seriesName) => {
295
295
  seriesList.push({
296
+ id: seriesName,
296
297
  data: items[seriesName].data,
297
298
  color: items[seriesName].color,
298
299
  name: items[seriesName].name,
300
+ dataId: items[seriesName].id,
299
301
  });
300
302
  });
301
303
 
@@ -342,11 +344,18 @@ const modules = {
342
344
  ctx.fillStyle = color;
343
345
  }
344
346
 
347
+ const curTooltipInfo = {
348
+ id: seriesList[ix].id,
349
+ name: seriesList[ix].name,
350
+ value: valueText,
351
+ dataId: seriesList[ix].dataId,
352
+ };
353
+
345
354
  // 1. Draw series color
346
355
  this.drawSeriesColorShape(ctx, opt.colorShape, { x: itemX, y: itemY });
347
356
 
348
357
  // 2. Draw series name
349
- ctx.fillStyle = opt.fontColor?.label ?? opt.fontColor;
358
+ ctx.fillStyle = typeof opt.fontColor.label === 'function' ? opt.fontColor.label(curTooltipInfo) : opt.fontColor.label ?? opt.fontColor;
350
359
  ctx.textBaseline = 'Bottom';
351
360
  const seriesNameSpaceWidth = opt.maxWidth - Math.round(ctx.measureText(maxValue).width)
352
361
  - boxPadding.l - boxPadding.r - seriesColorMarginRight - VALUE_MARGIN;
@@ -381,7 +390,7 @@ const modules = {
381
390
  ctx.save();
382
391
 
383
392
  // 3. Draw value
384
- ctx.fillStyle = opt.fontColor?.value ?? opt.fontColor;
393
+ ctx.fillStyle = typeof opt.fontColor.value === 'function' ? opt.fontColor.value(curTooltipInfo) : opt.fontColor.value ?? opt.fontColor;
385
394
  ctx.textAlign = 'right';
386
395
  ctx.fillText(valueText, this.tooltipDOM.offsetWidth - boxPadding.r, itemY);
387
396
  ctx.restore();
@@ -470,11 +479,18 @@ const modules = {
470
479
  ctx.fillStyle = hitColor;
471
480
  }
472
481
 
482
+ const curTooltipInfo = {
483
+ id: hitInfo.hitId,
484
+ name: hitItem.y,
485
+ value: valueText,
486
+ dataId: items[sId].id,
487
+ };
488
+
473
489
  // 1. Draw value color
474
490
  this.drawSeriesColorShape(ctx, opt.colorShape, { x: itemX, y: itemY });
475
491
 
476
492
  // 2. Draw value y names
477
- ctx.fillStyle = opt.fontColor?.label ?? opt.fontColor;
493
+ ctx.fillStyle = typeof opt.fontColor.label === 'function' ? opt.fontColor.label(curTooltipInfo) : opt.fontColor.label ?? opt.fontColor;
478
494
  ctx.textBaseline = 'Bottom';
479
495
  if (this.axesY.length) {
480
496
  ctx.fillText(
@@ -485,6 +501,7 @@ const modules = {
485
501
 
486
502
  // 3. Draw value
487
503
  ctx.textAlign = 'right';
504
+ ctx.fillStyle = typeof opt.fontColor.value === 'function' ? opt.fontColor.value(curTooltipInfo) : opt.fontColor.value ?? opt.fontColor;
488
505
  ctx.fillText(valueText, this.tooltipDOM.offsetWidth - boxPadding.r, itemY);
489
506
  ctx.closePath();
490
507
  },
@@ -582,11 +599,18 @@ const modules = {
582
599
  ctx.fillStyle = color;
583
600
  }
584
601
 
602
+ const curTooltipInfo = {
603
+ id: hitInfo.hitId,
604
+ name: seriesList[ix].name,
605
+ value: valueText,
606
+ dataId: seriesList[ix].dataId,
607
+ };
608
+
585
609
  // 1. Draw series color
586
610
  this.drawSeriesColorShape(ctx, opt.colorShape, { x: itemX, y: itemY });
587
611
 
588
612
  // 2. Draw series name
589
- ctx.fillStyle = opt.fontColor?.label ?? opt.fontColor;
613
+ ctx.fillStyle = typeof opt.fontColor.label === 'function' ? opt.fontColor.label(curTooltipInfo) : opt.fontColor.label ?? opt.fontColor;
590
614
  ctx.textBaseline = 'Bottom';
591
615
  const seriesNameSpaceWidth = opt.maxWidth - Math.round(ctx.measureText(maxValue).width)
592
616
  - boxPadding.l - boxPadding.r - seriesColorMarginRight - VALUE_MARGIN;
@@ -622,6 +646,7 @@ const modules = {
622
646
 
623
647
  // 3. Draw value
624
648
  ctx.textAlign = 'right';
649
+ ctx.fillStyle = typeof opt.fontColor.value === 'function' ? opt.fontColor.value(curTooltipInfo) : opt.fontColor.value ?? opt.fontColor;
625
650
  ctx.fillText(valueText, this.tooltipDOM.offsetWidth - boxPadding.r, itemY);
626
651
  ctx.restore();
627
652
  ctx.closePath();
@@ -453,11 +453,14 @@ export const checkEvent = (params) => {
453
453
  getPagingData,
454
454
  } = params;
455
455
  const { emit } = getCurrentInstance();
456
+
456
457
  /**
457
458
  * row에 대한 체크 상태를 해제한다.
458
459
  *
459
460
  * @param {array} row - row 데이터
460
461
  */
462
+ const isEachMode = () => checkInfo.useCheckbox.mode === 'each';
463
+
461
464
  const unCheckedRow = (row) => {
462
465
  const index = stores.treeStore.findIndex(
463
466
  item => item.index === row.index);
@@ -467,6 +470,10 @@ export const checkEvent = (params) => {
467
470
  }
468
471
  };
469
472
  const onCheckChildren = (node) => {
473
+ if (isEachMode()) {
474
+ return;
475
+ }
476
+
470
477
  if (node.hasChild) {
471
478
  node.children.forEach((children) => {
472
479
  const childNode = children;
@@ -486,6 +493,10 @@ export const checkEvent = (params) => {
486
493
  }
487
494
  };
488
495
  const onCheckParent = (node) => {
496
+ if (isEachMode()) {
497
+ return;
498
+ }
499
+
489
500
  const parentNode = node.parent;
490
501
  if (parentNode) {
491
502
  const isCheck = parentNode.children.every(n => n.checked);
@@ -574,7 +585,7 @@ export const checkEvent = (params) => {
574
585
  */
575
586
  const onCheckAll = (event) => {
576
587
  const status = checkInfo.isHeaderChecked;
577
- let store = stores.store;
588
+ let store = stores.store?.filter(row => row.isFilter);
578
589
  if (pageInfo.isClientPaging) {
579
590
  store = getPagingData();
580
591
  }