vue2-excel-grid 2.6.0 → 2.6.2
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
|
@@ -993,6 +993,7 @@ const ROW_HEADER_WIDTH = 50
|
|
|
993
993
|
const DEFAULT_COL_WIDTH = 100
|
|
994
994
|
const OUTLINE_GUTTER = 20
|
|
995
995
|
const FIT_COLUMNS_MIN_WIDTH = 40
|
|
996
|
+
const ROW_LIST_EDGE_PAD = 8 // birinchi/oxirgi qator bilan tepa/pastki border orasidagi bo'sh joy (px)
|
|
996
997
|
|
|
997
998
|
// Classifies a col.width spec so resolveColWidth() knows how to turn it into a
|
|
998
999
|
// concrete px number. Plain numbers/px strings resolve instantly with no DOM
|
|
@@ -1873,7 +1874,7 @@ const ExcelGridComponent = {
|
|
|
1873
1874
|
// findVisibleRange() uses binary search against this cached array → O(log n) per scroll.
|
|
1874
1875
|
// Invalidated only when row count, custom heights, or hidden rows change.
|
|
1875
1876
|
cumulativeHeights() {
|
|
1876
|
-
return buildCumulativeHeights(this.totalRows, this._rowH, this.rowHeights, this.hiddenRowSet)
|
|
1877
|
+
return buildCumulativeHeights(this.totalRows, this._rowH, this.rowHeights, this.hiddenRowSet, ROW_LIST_EDGE_PAD, ROW_LIST_EDGE_PAD)
|
|
1877
1878
|
},
|
|
1878
1879
|
|
|
1879
1880
|
// height prop omitted → fit header + filter row + all (visible) rows + footer exactly.
|
|
@@ -3449,7 +3450,7 @@ const ExcelGridComponent = {
|
|
|
3449
3450
|
},
|
|
3450
3451
|
|
|
3451
3452
|
getRowGroupBtnStyle(group) {
|
|
3452
|
-
const top = getRowTop(group.startIndex, this._rowH, this.rowHeights) - this.scrollTop
|
|
3453
|
+
const top = getRowTop(group.startIndex, this._rowH, this.rowHeights, ROW_LIST_EDGE_PAD) - this.scrollTop
|
|
3453
3454
|
return {
|
|
3454
3455
|
position: 'absolute',
|
|
3455
3456
|
top: top + 'px',
|
|
@@ -4088,7 +4089,7 @@ const ExcelGridComponent = {
|
|
|
4088
4089
|
scrollToCell(ri, ci) {
|
|
4089
4090
|
const scrollBody = this.$refs.scrollBody
|
|
4090
4091
|
if (!scrollBody) return
|
|
4091
|
-
const rowTop = getRowTop(ri, this._rowH, this.rowHeights)
|
|
4092
|
+
const rowTop = getRowTop(ri, this._rowH, this.rowHeights, ROW_LIST_EDGE_PAD)
|
|
4092
4093
|
const rowBottom = rowTop + this.getRowH(ri)
|
|
4093
4094
|
|
|
4094
4095
|
if (rowTop < scrollBody.scrollTop) scrollBody.scrollTop = rowTop
|
|
@@ -5135,6 +5136,7 @@ const ExcelGridComponent = {
|
|
|
5135
5136
|
|
|
5136
5137
|
this.fillDrag.currentRow = row
|
|
5137
5138
|
this.fillDrag.currentCol = col
|
|
5139
|
+
this.scrollToCell(row, col)
|
|
5138
5140
|
},
|
|
5139
5141
|
|
|
5140
5142
|
async commitFillDrag() {
|
|
@@ -8370,17 +8372,6 @@ export default ExcelGridComponent
|
|
|
8370
8372
|
.eg-size-small .eg-sort-menu {
|
|
8371
8373
|
min-width: 90px;
|
|
8372
8374
|
}
|
|
8373
|
-
.eg-size-small .eg-toolbar {
|
|
8374
|
-
height: 28px;
|
|
8375
|
-
}
|
|
8376
|
-
.eg-size-small .eg-toolbar-btn {
|
|
8377
|
-
width: 22px;
|
|
8378
|
-
height: 22px;
|
|
8379
|
-
}
|
|
8380
|
-
.eg-size-small .eg-toolbar-icon {
|
|
8381
|
-
width: 13px;
|
|
8382
|
-
height: 13px;
|
|
8383
|
-
}
|
|
8384
8375
|
.eg-size-small .eg-lock-flash-icon {
|
|
8385
8376
|
width: 72px;
|
|
8386
8377
|
height: 72px;
|
|
@@ -8421,17 +8412,6 @@ export default ExcelGridComponent
|
|
|
8421
8412
|
.eg-size-large .eg-sort-menu {
|
|
8422
8413
|
min-width: 130px;
|
|
8423
8414
|
}
|
|
8424
|
-
.eg-size-large .eg-toolbar {
|
|
8425
|
-
height: 40px;
|
|
8426
|
-
}
|
|
8427
|
-
.eg-size-large .eg-toolbar-btn {
|
|
8428
|
-
width: 32px;
|
|
8429
|
-
height: 32px;
|
|
8430
|
-
}
|
|
8431
|
-
.eg-size-large .eg-toolbar-icon {
|
|
8432
|
-
width: 18px;
|
|
8433
|
-
height: 18px;
|
|
8434
|
-
}
|
|
8435
8415
|
.eg-size-large .eg-lock-flash-icon {
|
|
8436
8416
|
width: 120px;
|
|
8437
8417
|
height: 120px;
|
|
@@ -75,15 +75,18 @@ export function calcVisibleRows(scrollTop, containerHeight, totalRows, rowHeight
|
|
|
75
75
|
* @param {number} defaultHeight
|
|
76
76
|
* @param {Object} rowHeightsMap - sparse { index: px } overrides
|
|
77
77
|
* @param {Set} hiddenSet - Set of hidden row indices (height = 0)
|
|
78
|
+
* @param {number} padTop - extra px baked into cum[0] (and every entry after it)
|
|
79
|
+
* @param {number} padBottom - extra px baked into the final (total-height) entry only
|
|
78
80
|
* @returns {number[]} length = totalRows + 1
|
|
79
81
|
*/
|
|
80
|
-
export function buildCumulativeHeights(totalRows, defaultHeight, rowHeightsMap = {}, hiddenSet = new Set()) {
|
|
82
|
+
export function buildCumulativeHeights(totalRows, defaultHeight, rowHeightsMap = {}, hiddenSet = new Set(), padTop = 0, padBottom = 0) {
|
|
81
83
|
const cum = new Array(totalRows + 1)
|
|
82
|
-
cum[0] =
|
|
84
|
+
cum[0] = padTop
|
|
83
85
|
for (let i = 0; i < totalRows; i++) {
|
|
84
86
|
const h = hiddenSet.has(i) ? 0 : (rowHeightsMap[i] !== undefined ? rowHeightsMap[i] : defaultHeight)
|
|
85
87
|
cum[i + 1] = cum[i] + h
|
|
86
88
|
}
|
|
89
|
+
cum[totalRows] += padBottom
|
|
87
90
|
return cum
|
|
88
91
|
}
|
|
89
92
|
|
|
@@ -131,9 +134,10 @@ export function findVisibleRange(scrollTop, containerHeight, totalRows, cumulati
|
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
136
|
* Get the top offset of a row
|
|
137
|
+
* @param {number} padTop - extra px offset added on top (see buildCumulativeHeights)
|
|
134
138
|
*/
|
|
135
|
-
export function getRowTop(rowIndex, rowHeight, rowHeights = []) {
|
|
136
|
-
let top =
|
|
139
|
+
export function getRowTop(rowIndex, rowHeight, rowHeights = [], padTop = 0) {
|
|
140
|
+
let top = padTop
|
|
137
141
|
for (let i = 0; i < rowIndex; i++) {
|
|
138
142
|
top += rowHeights[i] !== undefined ? rowHeights[i] : rowHeight
|
|
139
143
|
}
|