vue2-excel-grid 2.8.7 → 2.8.9
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/vue2-excel-grid.esm.js +439 -335
- package/dist/vue2-excel-grid.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/ExcelGrid.vue +44 -5
package/package.json
CHANGED
|
@@ -254,6 +254,8 @@
|
|
|
254
254
|
@mousedown="onColHeaderMouseDown($event, cell)"
|
|
255
255
|
@dblclick="onColHeaderDblClick($event, cell)"
|
|
256
256
|
@contextmenu.prevent="onColHeaderContextMenu($event, cell)"
|
|
257
|
+
@mouseenter="cell.column && cell.column.overflowTitle === 'truncate' ? _showTooltip(cell.column.title, $event.currentTarget) : null"
|
|
258
|
+
@mouseleave="_hideTooltip"
|
|
257
259
|
>
|
|
258
260
|
<span class="eg-header-title">
|
|
259
261
|
<slot v-if="!cell.isGroup" :name="'header-' + cell.column.key" :column="cell.column">
|
|
@@ -350,6 +352,8 @@
|
|
|
350
352
|
@mousedown="onColHeaderMouseDown($event, cell)"
|
|
351
353
|
@dblclick="onColHeaderDblClick($event, cell)"
|
|
352
354
|
@contextmenu.prevent="onColHeaderContextMenu($event, cell)"
|
|
355
|
+
@mouseenter="cell.column && cell.column.overflowTitle === 'truncate' ? _showTooltip(cell.column.title, $event.currentTarget) : null"
|
|
356
|
+
@mouseleave="_hideTooltip"
|
|
353
357
|
>
|
|
354
358
|
<span class="eg-header-title">
|
|
355
359
|
<slot v-if="!cell.isGroup" :name="'header-' + cell.column.key" :column="cell.column">
|
|
@@ -443,6 +447,8 @@
|
|
|
443
447
|
@mousedown="onColHeaderMouseDown($event, cell)"
|
|
444
448
|
@dblclick="onColHeaderDblClick($event, cell)"
|
|
445
449
|
@contextmenu.prevent="onColHeaderContextMenu($event, cell)"
|
|
450
|
+
@mouseenter="cell.column && cell.column.overflowTitle === 'truncate' ? _showTooltip(cell.column.title, $event.currentTarget) : null"
|
|
451
|
+
@mouseleave="_hideTooltip"
|
|
446
452
|
>
|
|
447
453
|
<span class="eg-header-title">
|
|
448
454
|
<slot v-if="!cell.isGroup" :name="'header-' + cell.column.key" :column="cell.column">
|
|
@@ -527,6 +533,7 @@
|
|
|
527
533
|
v-if="!isRowHidden(ri)"
|
|
528
534
|
:key="'srh-' + ri"
|
|
529
535
|
class="eg-row-header-cell"
|
|
536
|
+
:class="{ 'eg-row--active': activeCell && activeCell.row === ri }"
|
|
530
537
|
:style="getRowHeaderStyle(ri)"
|
|
531
538
|
:data-row="ri"
|
|
532
539
|
@mousedown="onRowHeaderMouseDown($event, ri)"
|
|
@@ -569,7 +576,7 @@
|
|
|
569
576
|
<div :style="{ height: totalVirtualHeight + 'px', position: 'relative' }">
|
|
570
577
|
<div :style="{ transform: 'translateY(' + virtualOffsetTop + 'px)', willChange: 'transform', contain: 'layout style' }">
|
|
571
578
|
<template v-for="ri in visibleRowRange">
|
|
572
|
-
<div v-if="!isRowHidden(ri)" :key="'fc-row-' + ri" class="eg-row" :class="{ 'eg-row--even': ri % 2 === 0 }" :style="getRowStyle(ri)" :data-row="ri">
|
|
579
|
+
<div v-if="!isRowHidden(ri)" :key="'fc-row-' + ri" class="eg-row" :class="{ 'eg-row--even': ri % 2 === 0, 'eg-row--active': activeCell && activeCell.row === ri }" :style="getRowStyle(ri)" :data-row="ri">
|
|
573
580
|
<template v-for="(col, ci) in leafCols">
|
|
574
581
|
<template v-if="isColumnPinnedLeft(ci) && !isColHidden(ci)">
|
|
575
582
|
<div
|
|
@@ -625,7 +632,7 @@
|
|
|
625
632
|
v-if="!isRowHidden(ri)"
|
|
626
633
|
:key="'row-' + ri"
|
|
627
634
|
class="eg-row"
|
|
628
|
-
:class="{ 'eg-row--even': ri % 2 === 0 }"
|
|
635
|
+
:class="{ 'eg-row--even': ri % 2 === 0, 'eg-row--active': activeCell && activeCell.row === ri }"
|
|
629
636
|
:style="getRowStyle(ri)"
|
|
630
637
|
:data-row="ri"
|
|
631
638
|
>
|
|
@@ -688,7 +695,7 @@
|
|
|
688
695
|
<div :style="{ height: totalVirtualHeight + 'px', position: 'relative' }">
|
|
689
696
|
<div :style="{ transform: 'translateY(' + virtualOffsetTop + 'px)', willChange: 'transform', contain: 'layout style' }">
|
|
690
697
|
<template v-for="ri in visibleRowRange">
|
|
691
|
-
<div v-if="!isRowHidden(ri)" :key="'pr-row-' + ri" class="eg-row" :class="{ 'eg-row--even': ri % 2 === 0 }" :style="getRowStyle(ri)" :data-row="ri">
|
|
698
|
+
<div v-if="!isRowHidden(ri)" :key="'pr-row-' + ri" class="eg-row" :class="{ 'eg-row--even': ri % 2 === 0, 'eg-row--active': activeCell && activeCell.row === ri }" :style="getRowStyle(ri)" :data-row="ri">
|
|
692
699
|
<template v-for="col in pinnedRightCols">
|
|
693
700
|
<div
|
|
694
701
|
:key="'pr-cell-' + ri + '-' + col._flatIndex"
|
|
@@ -966,6 +973,7 @@
|
|
|
966
973
|
>{{ colDrag.ghostLabel }}</div>
|
|
967
974
|
|
|
968
975
|
</div>
|
|
976
|
+
<div v-if="hoverTooltip" class="eg-option-tooltip" :style="hoverTooltipStyle">{{ hoverTooltip.text }}</div>
|
|
969
977
|
</div>
|
|
970
978
|
</template>
|
|
971
979
|
|
|
@@ -1615,6 +1623,8 @@ const ExcelGridComponent = {
|
|
|
1615
1623
|
data() {
|
|
1616
1624
|
return {
|
|
1617
1625
|
calculatedHeaderHeight: null,
|
|
1626
|
+
hoverTooltip: null,
|
|
1627
|
+
_tooltipTimer: null,
|
|
1618
1628
|
// Selection
|
|
1619
1629
|
activeCell: { row: 0, col: 0 },
|
|
1620
1630
|
selectionRanges: [], // [{ startRow, startCol, endRow, endCol }]
|
|
@@ -1812,6 +1822,15 @@ const ExcelGridComponent = {
|
|
|
1812
1822
|
},
|
|
1813
1823
|
|
|
1814
1824
|
computed: {
|
|
1825
|
+
hoverTooltipStyle() {
|
|
1826
|
+
if (!this.hoverTooltip) return {}
|
|
1827
|
+
const { rect, text } = this.hoverTooltip
|
|
1828
|
+
const estH = 20 + Math.ceil(text.length / 40) * 16
|
|
1829
|
+
const spaceBelow = window.innerHeight - rect.bottom
|
|
1830
|
+
const top = spaceBelow >= estH + 8 ? rect.bottom + 6 : rect.top - estH - 6
|
|
1831
|
+
const left = Math.min(rect.left, window.innerWidth - 280 - 8)
|
|
1832
|
+
return { position: 'fixed', top: top + 'px', left: Math.max(8, left) + 'px', zIndex: 10000 }
|
|
1833
|
+
},
|
|
1815
1834
|
t() { return getMessages(this.locale) },
|
|
1816
1835
|
|
|
1817
1836
|
// localSyncKey feature — the actual IndexedDB storage key. idbStore.js
|
|
@@ -2803,6 +2822,24 @@ const ExcelGridComponent = {
|
|
|
2803
2822
|
},
|
|
2804
2823
|
|
|
2805
2824
|
methods: {
|
|
2825
|
+
_showTooltip(text, el) {
|
|
2826
|
+
this._clearTooltipTimer()
|
|
2827
|
+
if (!text) return
|
|
2828
|
+
const rect = el.getBoundingClientRect()
|
|
2829
|
+
this._tooltipTimer = setTimeout(() => {
|
|
2830
|
+
this.hoverTooltip = { text, rect }
|
|
2831
|
+
}, 400)
|
|
2832
|
+
},
|
|
2833
|
+
_hideTooltip() {
|
|
2834
|
+
this._clearTooltipTimer()
|
|
2835
|
+
this.hoverTooltip = null
|
|
2836
|
+
},
|
|
2837
|
+
_clearTooltipTimer() {
|
|
2838
|
+
if (this._tooltipTimer) {
|
|
2839
|
+
clearTimeout(this._tooltipTimer)
|
|
2840
|
+
this._tooltipTimer = null
|
|
2841
|
+
}
|
|
2842
|
+
},
|
|
2806
2843
|
_calcHeaderHeight() {
|
|
2807
2844
|
if (!this.leafCols) return
|
|
2808
2845
|
const wrapCols = this.leafCols.filter(c => c.overflowTitle === 'wrap')
|
|
@@ -8635,11 +8672,13 @@ export default ExcelGridComponent
|
|
|
8635
8672
|
background: var(--eg-color-row-stripe, var(--eg-color-row-stripe-default));
|
|
8636
8673
|
}
|
|
8637
8674
|
.eg-row:hover .eg-cell:not(.eg-cell-selected):not(.eg-cell-active):not(.eg-cell-fill-preview),
|
|
8638
|
-
.eg-row.eg-row--hover .eg-cell:not(.eg-cell-selected):not(.eg-cell-active):not(.eg-cell-fill-preview)
|
|
8675
|
+
.eg-row.eg-row--hover .eg-cell:not(.eg-cell-selected):not(.eg-cell-active):not(.eg-cell-fill-preview),
|
|
8676
|
+
.eg-row.eg-row--active .eg-cell:not(.eg-cell-selected):not(.eg-cell-active):not(.eg-cell-fill-preview) {
|
|
8639
8677
|
background: var(--eg-color-row-hover, var(--eg-color-row-hover-default)) !important;
|
|
8640
8678
|
}
|
|
8641
8679
|
.eg-row-header-cell:hover,
|
|
8642
|
-
.eg-row-header-cell.eg-row--hover
|
|
8680
|
+
.eg-row-header-cell.eg-row--hover,
|
|
8681
|
+
.eg-row-header-cell.eg-row--active {
|
|
8643
8682
|
background: var(--eg-color-row-hover, var(--eg-color-row-hover-default)) !important;
|
|
8644
8683
|
}
|
|
8645
8684
|
|