evui 3.4.2 → 3.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -136,3 +136,17 @@ export function getPrecision(v) {
136
136
  export function checkNullAndUndefined(value) {
137
137
  return value === null || value === undefined;
138
138
  }
139
+
140
+ /**
141
+ * Check if the device is mobile
142
+ * @returns {boolean}
143
+ */
144
+ export function mobileCheck() {
145
+ return (
146
+ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
147
+ navigator.userAgent,
148
+ )
149
+ || 'ontouchstart' in window
150
+ || navigator.maxTouchPoints
151
+ );
152
+ }
@@ -1,4 +1,5 @@
1
1
  import throttle from '@/common/utils.throttle';
2
+ import { mobileCheck } from '@/common/utils';
2
3
  import Model from './model';
3
4
  import TimeScale from './scale/scale.time';
4
5
  import LinearScale from './scale/scale.linear';
@@ -40,6 +41,7 @@ class EvChart {
40
41
  Object.assign(this, GradientLegend);
41
42
  }
42
43
 
44
+ this.isMobile = mobileCheck();
43
45
  this.brushSeries = brushSeries;
44
46
  this.target = target;
45
47
  this.data = data;
@@ -939,6 +941,7 @@ class EvChart {
939
941
  this.overlayCanvas.removeEventListener('click', this.onClick);
940
942
  this.overlayCanvas.removeEventListener('mousedown', this.onMouseDown);
941
943
  this.overlayCanvas.removeEventListener('wheel', this.onWheel);
944
+ window.removeEventListener('click', this.dragTouchSelectionEvent);
942
945
  }
943
946
 
944
947
  if (this.options.tooltip.use) {
@@ -127,11 +127,6 @@ export const AXIS_OPTION = {
127
127
  },
128
128
  };
129
129
 
130
- export const PLOT_LINE_OPTION = {
131
- color: '#FF0000',
132
- lineWidth: 1,
133
- };
134
-
135
130
  export const PLOT_LINE_LABEL_OPTION = {
136
131
  show: false,
137
132
  fontSize: 12,
@@ -147,6 +142,12 @@ export const PLOT_LINE_LABEL_OPTION = {
147
142
  maxWidth: null,
148
143
  };
149
144
 
145
+ export const PLOT_LINE_OPTION = {
146
+ color: '#FF0000',
147
+ lineWidth: 1,
148
+ label: PLOT_LINE_LABEL_OPTION,
149
+ };
150
+
150
151
  export const PLOT_BAND_OPTION = {
151
152
  color: '#FAE59D',
152
153
  };
@@ -15,7 +15,7 @@ const modules = {
15
15
  * @returns {undefined}
16
16
  */
17
17
  this.onMouseMove = (e) => {
18
- if (this.dragInfo?.isMove) {
18
+ if (this.dragInfo?.isMove || this.isMobile) {
19
19
  return;
20
20
  }
21
21
 
@@ -265,11 +265,53 @@ const modules = {
265
265
  break;
266
266
  }
267
267
 
268
- case 'pie':
268
+ case 'pie': {
269
+ if (useSelectItem) {
270
+ setSelectedItemInfo();
271
+ }
272
+
273
+ break;
274
+ }
275
+
269
276
  case 'scatter': {
270
277
  if (useSelectItem) {
271
278
  setSelectedItemInfo();
272
279
  }
280
+
281
+ // 모바일용 dragSelection
282
+ if (this.options.dragSelection?.use && this.isMobile) {
283
+ let touchInfo = this.setTouchInfo(e);
284
+ this.overlayClear();
285
+
286
+ if (this.options.dragSelection.keepDisplay
287
+ && (e.layerX < touchInfo.range.x1
288
+ || e.layerY < touchInfo.range.y1
289
+ || e.layerX > touchInfo.range.x2
290
+ || e.layerY > touchInfo.range.y2)) {
291
+ this.isTouchOverlay = false;
292
+ } else {
293
+ touchInfo = this.setTouchBoxDimensions(touchInfo);
294
+ this.isTouchOverlay = true;
295
+ this.drawSelectionArea(touchInfo);
296
+ }
297
+
298
+ if (!this.options.dragSelection.keepDisplay) {
299
+ setTimeout(() => {
300
+ this.isTouchOverlay = false;
301
+ this.overlayClear();
302
+ }, 100);
303
+ }
304
+
305
+ args.e = e;
306
+ args.touchInfo = touchInfo;
307
+ args.data = this.findSelectedItems(touchInfo);
308
+ args.range = this.getSelectionRange(touchInfo);
309
+
310
+ if (typeof this.listeners['drag-select'] === 'function') {
311
+ this.listeners['drag-select'](args);
312
+ }
313
+ }
314
+
273
315
  break;
274
316
  }
275
317
  }
@@ -313,6 +355,9 @@ const modules = {
313
355
  this.overlayCanvas.addEventListener('dblclick', this.onDblClick);
314
356
  this.overlayCanvas.addEventListener('click', this.onClick);
315
357
  this.overlayCanvas.addEventListener('mousedown', this.onMouseDown);
358
+
359
+ this.dragTouchSelectionEvent = e => this.dragTouchSelectionDestroy(e);
360
+ window.addEventListener('click', this.dragTouchSelectionEvent);
316
361
  },
317
362
 
318
363
  /**
@@ -551,6 +596,99 @@ const modules = {
551
596
  return curMouseTargetVal;
552
597
  },
553
598
 
599
+ /**
600
+ * Processes touch event to determine touch position within the chart.
601
+ *
602
+ * @param {TouchEvent} event - the touch event to process
603
+ * @returns {object} - the processed touch information
604
+ */
605
+ setTouchInfo(event) {
606
+ let [offsetX, offsetY] = this.getMousePosition(event);
607
+ const chartRect = this.chartRect;
608
+ const labelOffset = this.labelOffset;
609
+ const range = {
610
+ x1: chartRect.x1 + labelOffset.left,
611
+ x2: chartRect.x2 - labelOffset.right,
612
+ y1: chartRect.y1 + labelOffset.top,
613
+ y2: chartRect.y2 - labelOffset.bottom,
614
+ };
615
+
616
+ offsetX = Math.max(range.x1, Math.min(offsetX, range.x2));
617
+ offsetY = Math.max(range.y1, Math.min(offsetY, range.y2));
618
+
619
+ return {
620
+ xcp: offsetX,
621
+ ycp: offsetY,
622
+ range,
623
+ };
624
+ },
625
+
626
+ /**
627
+ * Adjusts the touch box dimensions based on the provided touch information.
628
+ *
629
+ * @param {object} touchInfo - The touch information including touch position and plotting range
630
+ * @returns {object} - The adjusted touch information
631
+ */
632
+ setTouchBoxDimensions(touchInfo) {
633
+ const boxSize = this.options.dragSelection?.size || 50;
634
+ const halfBoxSize = boxSize / 2;
635
+ const { xcp, ycp, range } = touchInfo;
636
+ let xsp = xcp - halfBoxSize;
637
+ let ysp = ycp - halfBoxSize;
638
+ let width = boxSize;
639
+ let height = boxSize;
640
+
641
+ this.boxOverflow = {
642
+ x1: false,
643
+ x2: false,
644
+ y1: false,
645
+ y2: false,
646
+ };
647
+
648
+ if (xcp < range.x1 + halfBoxSize) {
649
+ xsp = range.x1;
650
+ width = halfBoxSize - (range.x1 - xcp);
651
+ this.boxOverflow.x1 = true;
652
+ }
653
+ if (xcp > range.x2 - halfBoxSize) {
654
+ width = halfBoxSize - (xcp - range.x2);
655
+ this.boxOverflow.x2 = true;
656
+ }
657
+ if (ycp < range.y1 + halfBoxSize) {
658
+ ysp = range.y1;
659
+ height = halfBoxSize - (range.y1 - ycp);
660
+ this.boxOverflow.y1 = true;
661
+ }
662
+ if (ycp > range.y2 - halfBoxSize) {
663
+ height = halfBoxSize - (ycp - range.y2);
664
+ this.boxOverflow.y2 = true;
665
+ }
666
+
667
+ touchInfo.xsp = xsp;
668
+ touchInfo.ysp = ysp;
669
+ touchInfo.width = width;
670
+ touchInfo.height = height;
671
+
672
+ return touchInfo;
673
+ },
674
+
675
+ /**
676
+ * Remove a touch selection.
677
+ *
678
+ * @param {TouchEvent} e - the touch event to process
679
+ * @returns {undefined}
680
+ */
681
+ dragTouchSelectionDestroy(e) {
682
+ if (
683
+ this.options.dragSelection?.use
684
+ && e.target !== this.overlayCanvas
685
+ && this.isTouchOverlay
686
+ ) {
687
+ this.isTouchOverlay = false;
688
+ this.overlayClear();
689
+ }
690
+ },
691
+
554
692
  /**
555
693
  * Find graph item on mouse position
556
694
  * @param {array} offset return value from getMousePosition()
@@ -952,16 +1090,24 @@ const modules = {
952
1090
  const yMinRatio = this.getRatioInRange(range.y1, range.y2, yep);
953
1091
  const yMaxRatio = this.getRatioInRange(range.y1, range.y2, ysp);
954
1092
 
955
- const xMin = dataRangeX.graphMin + graphWidth * xMinRatio;
956
- const xMax = dataRangeX.graphMin + graphWidth * xMaxRatio;
957
- const yMin = dataRangeY.graphMin + graphHeight * (1 - yMinRatio);
958
- const yMax = dataRangeY.graphMin + graphHeight * (1 - yMaxRatio);
1093
+ const xMin = this.isMobile && this.boxOverflow?.x1
1094
+ ? Math.min(this.minMax.x[0].min, dataRangeX.graphMin)
1095
+ : Math.max(dataRangeX.graphMin + graphWidth * xMinRatio, dataRangeX.graphMin);
1096
+ const xMax = this.isMobile && this.boxOverflow?.x2
1097
+ ? Math.max(this.minMax.x[0].max, dataRangeX.graphMax)
1098
+ : Math.min(dataRangeX.graphMin + graphWidth * xMaxRatio, dataRangeX.graphMax);
1099
+ const yMin = this.isMobile && this.boxOverflow?.y2
1100
+ ? Math.min(this.minMax.y[0].min, dataRangeY.graphMin)
1101
+ : Math.max(dataRangeY.graphMin + graphHeight * (1 - yMinRatio), dataRangeY.graphMin);
1102
+ const yMax = this.isMobile && this.boxOverflow?.y1
1103
+ ? Math.max(this.minMax.y[0].max, dataRangeY.graphMax)
1104
+ : Math.min(dataRangeY.graphMin + graphHeight * (1 - yMaxRatio), dataRangeY.graphMax);
959
1105
 
960
1106
  return {
961
- xMin: Math.max(+parseFloat(xMin).toFixed(3), dataRangeX.graphMin),
962
- xMax: Math.min(+parseFloat(xMax).toFixed(3), dataRangeX.graphMax),
963
- yMin: Math.max(+parseFloat(yMin).toFixed(3), dataRangeY.graphMin),
964
- yMax: Math.min(+parseFloat(yMax).toFixed(3), dataRangeY.graphMax),
1107
+ xMin: +xMin.toFixed(3),
1108
+ xMax: +xMax.toFixed(3),
1109
+ yMin: +yMin.toFixed(3),
1110
+ yMax: +yMax.toFixed(3),
965
1111
  };
966
1112
  },
967
1113
 
@@ -527,7 +527,7 @@ class Scale {
527
527
 
528
528
  /**
529
529
  * Draw X Plot line
530
- * @param {object} dataX Data's X Position
530
+ * @param {number} dataX Data's X Position
531
531
  * @param {number} minX Min X Position
532
532
  * @param {number} maxX Max X Position
533
533
  * @param {number} minY Min Y Position
@@ -544,8 +544,11 @@ class Scale {
544
544
  return;
545
545
  }
546
546
 
547
- ctx.moveTo(dataX, maxY);
548
- ctx.lineTo(dataX, minY);
547
+ let dataXPos = dataX;
548
+ dataXPos += Util.aliasPixel(ctx.lineWidth);
549
+
550
+ ctx.moveTo(dataXPos, maxY);
551
+ ctx.lineTo(dataXPos, minY);
549
552
 
550
553
  ctx.stroke();
551
554
  ctx.restore();
@@ -554,7 +557,7 @@ class Scale {
554
557
 
555
558
  /**
556
559
  * Draw Y Plot line
557
- * @param {object} dataY Data's Y Position
560
+ * @param {number} dataY Data's Y Position
558
561
  * @param {number} minX Min X Position
559
562
  * @param {number} maxX Max X Position
560
563
  * @param {number} minY Min Y Position
@@ -571,8 +574,11 @@ class Scale {
571
574
  return;
572
575
  }
573
576
 
574
- ctx.moveTo(minX, dataY);
575
- ctx.lineTo(maxX, dataY);
577
+ let dataYPos = dataY;
578
+ dataYPos += Util.aliasPixel(ctx.lineWidth);
579
+
580
+ ctx.moveTo(minX, dataYPos);
581
+ ctx.lineTo(maxX, dataYPos);
576
582
 
577
583
  ctx.stroke();
578
584
  ctx.restore();
@@ -181,6 +181,7 @@ const DEFAULT_OPTIONS = {
181
181
  dragSelection: {
182
182
  use: false,
183
183
  keepDisplay: true,
184
+ size: 50,
184
185
  fillColor: '#38ACEC',
185
186
  opacity: 0.65,
186
187
  },
@@ -66,7 +66,10 @@
66
66
  'column': true,
67
67
  'non-border': !!borderStyle,
68
68
  }"
69
- :style="`width: ${minWidth}px;`"
69
+ :style="{
70
+ width: `${minWidth}px`,
71
+ 'border-right': '1px solid #CFCFCF'
72
+ }"
70
73
  >
71
74
  <ev-checkbox
72
75
  v-if="useCheckbox.use && useCheckbox.headerCheck && useCheckbox.mode !== 'single'"
@@ -91,8 +94,9 @@
91
94
  :style="{
92
95
  width: `${column.width}px`,
93
96
  'min-width': `${isRenderer(column) ? rendererMinWidth : minWidth}px`,
94
- 'margin-right': orderedColumns.length - 1 === index
95
- && (hasVerticalScrollBar || hasHorizontalScrollBar) ? `${scrollWidth}px` : '0px',
97
+ 'margin-right': orderedColumns.length - 1 === index && (hasVerticalScrollBar
98
+ || hasHorizontalScrollBar) ? `${scrollWidth}px` : '0px',
99
+ 'border-right': orderedColumns.length - 1 === index ? 'none' : '1px solid #CFCFCF',
96
100
  }"
97
101
  >
98
102
  <!-- Column Name -->
@@ -173,10 +177,8 @@
173
177
  'non-border': !!borderStyle,
174
178
  }"
175
179
  :style="{
176
- position: 'sticky',
177
- right: 0,
178
- width: '40px',
179
- 'min-width': '40px',
180
+ width: '30px',
181
+ 'min-width': '30px',
180
182
  'margin-right': (hasVerticalScrollBar || hasHorizontalScrollBar)
181
183
  ? `${scrollWidth}px` : '0px',
182
184
  }"
@@ -226,7 +228,11 @@
226
228
  'row-checkbox': true,
227
229
  'non-border': !!borderStyle,
228
230
  }"
229
- :style="`width: ${minWidth}px; height: ${rowHeight}px;`"
231
+ :style="{
232
+ width: `${minWidth}px`,
233
+ height: `${rowHeight}px`,
234
+ 'border-right': '1px solid #CFCFCF',
235
+ }"
230
236
  >
231
237
  <ev-checkbox
232
238
  v-model="row[1]"
@@ -256,6 +262,8 @@
256
262
  height: `${rowHeight}px`,
257
263
  'line-height': `${rowHeight}px`,
258
264
  'min-width': `${isRenderer(column) ? rendererMinWidth : minWidth}px`,
265
+ 'border-right': orderedColumns.length - 1 === column.index
266
+ ? 'none' : '1px solid #CFCFCF',
259
267
  }"
260
268
  >
261
269
  <!-- Cell Renderer -->
@@ -277,23 +285,35 @@
277
285
  <td
278
286
  v-if="$props.option.customContextMenu?.length"
279
287
  :class="{
280
- cell: true,
288
+ 'row-contextmenu': true,
281
289
  'non-border': !!borderStyle,
282
290
  }"
283
291
  :style="{
284
292
  position: 'sticky',
285
293
  right: 0,
286
- width: '40px',
294
+ width: '30px',
287
295
  height: `${rowHeight}px`,
288
- 'min-width': '40px',
296
+ 'min-width': '30px',
289
297
  'line-height': `${rowHeight}px`,
290
298
  }"
291
299
  >
292
- <grid-option-button
293
- class="row-contextmenu__btn"
294
- @click="onContextMenu($event)"
295
- @click.prevent="menu.show"
296
- />
300
+ <template v-if="$slots.contextmenuIcon">
301
+ <span
302
+ class="row-contextmenu__btn"
303
+ @click="onContextMenu($event)"
304
+ @click.prevent="menu.show"
305
+ >
306
+ <slot name="contextmenuIcon"></slot>
307
+ </span>
308
+ </template>
309
+ <template v-else>
310
+ <ev-icon
311
+ icon="ev-icon-warning2"
312
+ class="row-contextmenu__btn"
313
+ @click="onContextMenu($event)"
314
+ @click.prevent="menu.show"
315
+ />
316
+ </template>
297
317
  </td>
298
318
  </tr>
299
319
  <tr v-if="!viewStore.length">
@@ -502,6 +522,7 @@ export default {
502
522
  hasHorizontalScrollBar: false,
503
523
  });
504
524
  const selectInfo = reactive({
525
+ contextmenuInfo: props.contextmenuInfo,
505
526
  selectedRow: props.selected,
506
527
  useSelect: computed(() => props.option?.useSelection?.use ?? true),
507
528
  multiple: computed(() => props.option?.useSelection?.multiple ?? false),
@@ -627,6 +648,7 @@ export default {
627
648
  isRenderer,
628
649
  updateVScroll,
629
650
  updateHScroll,
651
+ contextInfo,
630
652
  });
631
653
 
632
654
  const {
@@ -32,6 +32,11 @@
32
32
  border-bottom: 2px solid #7F7F7F !important;
33
33
  }
34
34
  }
35
+ .row-contextmenu__btn {
36
+ display: none;
37
+ vertical-align: middle;
38
+ cursor: pointer;
39
+ }
35
40
  }
36
41
 
37
42
  .column-list {
@@ -54,16 +59,16 @@
54
59
  vertical-align: top;
55
60
  user-select: none;
56
61
 
57
- @include evThemify() {
58
- border-right: 1px solid evThemed('grid-bottom-border');
59
- background: evThemed('background-base');
60
- }
61
- &:nth-last-child(1) {
62
- border-right: 0;
63
- }
62
+ //@include evThemify() {
63
+ // border-right: 1px solid evThemed('grid-bottom-border');
64
+ //}
65
+ //&:nth-last-child(1) {
66
+ // border-right: 0;
67
+ //}
64
68
  .column-sort__icon {
65
69
  position: absolute;
66
70
  top: 50%;
71
+ right: 0;
67
72
  width: 24px;
68
73
  height: 24px;
69
74
  background-size: contain;
@@ -141,7 +146,6 @@
141
146
  white-space: nowrap;
142
147
 
143
148
  @include evThemify() {
144
- background: evThemed('background-base');
145
149
  border-bottom: 1px solid evThemed('grid-bottom-border');
146
150
  }
147
151
  &.selected {
@@ -157,7 +161,7 @@
157
161
  }
158
162
  &:hover {
159
163
  .row-contextmenu__btn {
160
- visibility: visible;
164
+ display: grid;
161
165
  }
162
166
  }
163
167
  }
@@ -165,25 +169,19 @@
165
169
  .cell {
166
170
  display: inline-block;
167
171
  padding: 0 10px;
168
- background: inherit;
169
172
  text-align: center;
170
173
  max-width: 100%;
171
174
  white-space: nowrap;
172
175
  text-overflow: ellipsis;
173
176
 
174
- @include evThemify() {
175
- border-right: 1px solid evThemed('grid-bottom-border');
176
- }
177
+ //@include evThemify() {
178
+ // border-right: 1px solid evThemed('grid-bottom-border');
179
+ //}
177
180
  div {
178
181
  white-space: nowrap;
179
182
  overflow: hidden;
180
183
  text-overflow: ellipsis;
181
184
  }
182
- .row-contextmenu__btn {
183
- visibility: hidden;
184
- vertical-align: middle;
185
- cursor: pointer;
186
- }
187
185
  &.row-checkbox {
188
186
  display: inline-flex;
189
187
  justify-content: center;
@@ -215,9 +213,9 @@
215
213
  justify-content: flex-end;
216
214
  }
217
215
  }
218
- &:last-child {
219
- border-right: 0;
220
- }
216
+ //&:last-child {
217
+ // border-right: 0;
218
+ //}
221
219
  }
222
220
  }
223
221
 
@@ -165,6 +165,7 @@ export const resizeEvent = (params) => {
165
165
  isRenderer,
166
166
  updateVScroll,
167
167
  updateHScroll,
168
+ contextInfo,
168
169
  } = params;
169
170
  /**
170
171
  * 고정 너비, 스크롤 유무 등에 따른 컬럼 너비를 계산한다.
@@ -183,9 +184,6 @@ export const resizeEvent = (params) => {
183
184
  if (cur.hide) {
184
185
  return acc;
185
186
  }
186
- if (cur.field === 'db-icon' || cur.field === 'user-icon') {
187
- cur.width = resizeInfo.iconWidth;
188
- }
189
187
  if (cur.width) {
190
188
  acc.totalWidth += cur.width;
191
189
  } else {
@@ -193,7 +191,7 @@ export const resizeEvent = (params) => {
193
191
  }
194
192
 
195
193
  return acc;
196
- }, { totalWidth: 0, emptyCount: 0 });
194
+ }, { totalWidth: contextInfo.customContextMenu.length ? 30 : 0, emptyCount: 0 });
197
195
 
198
196
  if (rowHeight * props.rows.length > elHeight) {
199
197
  elWidth -= scrollWidth;
@@ -359,11 +357,11 @@ export const clickEvent = (params) => {
359
357
  let lastIndex = -1;
360
358
  const onRowClick = (event, row) => {
361
359
  if (event.target.parentElement.classList?.contains('row-checkbox-input')
362
- || event.target.classList?.contains('row-contextmenu__btn')) {
360
+ || event.target.closest('td')?.classList?.contains('row-contextmenu')) {
363
361
  return false;
364
362
  }
365
363
  const onMultiSelectByKey = (keyType, selected, selectedRow) => {
366
- if (keyType === 'shift') { // shift
364
+ if (keyType === 'shift') {
367
365
  const rowIndex = row[ROW_INDEX];
368
366
  if (lastIndex > -1) {
369
367
  for (
@@ -379,16 +377,19 @@ export const clickEvent = (params) => {
379
377
  } else {
380
378
  stores.originStore[i][ROW_SELECT_INDEX] = false;
381
379
  const deselectedIndex = selectInfo.selectedRow
382
- .findIndex(
383
- sr => sr === stores.originStore[i][ROW_DATA_INDEX]);
384
- selectInfo.selectedRow.splice(deselectedIndex, 1);
380
+ .indexOf(stores.originStore[i][ROW_DATA_INDEX]);
381
+ if (deselectedIndex > -1) {
382
+ selectInfo.selectedRow.splice(deselectedIndex, 1);
383
+ }
385
384
  }
386
385
  }
387
386
  }
388
- } else if (selected) {
389
- selectInfo.selectedRow.splice(selectInfo.selectedRow.indexOf(row[ROW_DATA_INDEX]), 1);
390
- } else {
391
- selectInfo.selectedRow.push(selectedRow);
387
+ } else if (keyType === 'ctrl') {
388
+ if (!selected) {
389
+ selectInfo.selectedRow.push(selectedRow);
390
+ } else {
391
+ selectInfo.selectedRow.splice(selectInfo.selectedRow.indexOf(row[ROW_DATA_INDEX]), 1);
392
+ }
392
393
  }
393
394
  };
394
395
 
@@ -405,7 +406,7 @@ export const clickEvent = (params) => {
405
406
  keyType = 'ctrl';
406
407
  }
407
408
 
408
- if (selectInfo.multiple) { // multi select
409
+ if (selectInfo.multiple && keyType) { // multi select
409
410
  onMultiSelectByKey(keyType, selected, rowData);
410
411
  } else if (selected) { // single select
411
412
  selectInfo.selectedRow = [];
@@ -690,7 +691,6 @@ export const filterEvent = (params) => {
690
691
  };
691
692
 
692
693
  export const contextMenuEvent = (params) => {
693
- const { emit } = getCurrentInstance();
694
694
  const {
695
695
  contextInfo,
696
696
  stores,
@@ -717,6 +717,7 @@ export const contextMenuEvent = (params) => {
717
717
  }
718
718
 
719
719
  menuItem.selectedRow = row ?? [];
720
+ menuItem.contextmenuInfo = [selectInfo.contextmenuInfo];
720
721
 
721
722
  return menuItem;
722
723
  });
@@ -759,23 +760,13 @@ export const contextMenuEvent = (params) => {
759
760
  const onContextMenu = (event) => {
760
761
  const target = event.target;
761
762
  const rowIndex = target.closest('.row')?.dataset?.index;
762
- if (target.classList.contains('row-contextmenu__btn')) {
763
- setContextMenu();
764
- return;
765
- }
766
- let clickedRow;
763
+ let clickedRow = null;
767
764
  if (rowIndex) {
768
765
  clickedRow = stores.viewStore.find(row => row[ROW_INDEX] === +rowIndex)?.[ROW_DATA_INDEX];
769
766
  }
770
-
771
767
  if (clickedRow) {
772
- selectInfo.selectedRow = clickedRow;
768
+ selectInfo.contextmenuInfo = clickedRow;
773
769
  setContextMenu();
774
- emit('update:selected', [clickedRow]);
775
- } else {
776
- selectInfo.selectedRow = [];
777
- setContextMenu(false);
778
- emit('update:selected', []);
779
770
  }
780
771
  };
781
772
  return {