@visactor/vtable 0.19.1 → 0.19.2-alpha.0
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/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +15 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +2 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +2 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +2 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +53 -24
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +15 -15
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +2 -2
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +2 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -35240,9 +35240,8 @@
|
|
|
35240
35240
|
dx: hierarchyOffset,
|
|
35241
35241
|
x
|
|
35242
35242
|
};
|
|
35243
|
-
const oldText = textMark.attribute.text;
|
|
35244
35243
|
textMark.setAttributes(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
35245
|
-
if (
|
|
35244
|
+
if (textMark.attribute.text) {
|
|
35246
35245
|
const textBaseline = cellTheme.text.textBaseline;
|
|
35247
35246
|
const height = cellHeight - (padding[0] + padding[2]);
|
|
35248
35247
|
let y = 0;
|
|
@@ -37215,7 +37214,9 @@
|
|
|
37215
37214
|
let height = 0;
|
|
37216
37215
|
let renderDefault = false;
|
|
37217
37216
|
let enableCellPadding = false;
|
|
37218
|
-
if (table.isHeader(col, row) ||
|
|
37217
|
+
if (table.isHeader(col, row) ||
|
|
37218
|
+
table.getBodyColumnDefine(col, row)?.mergeCell ||
|
|
37219
|
+
table.hasCustomMerge()) {
|
|
37219
37220
|
const cellRange = table.getCellRange(col, row);
|
|
37220
37221
|
spanRow = cellRange.end.row - cellRange.start.row + 1;
|
|
37221
37222
|
}
|
|
@@ -37301,7 +37302,9 @@
|
|
|
37301
37302
|
}
|
|
37302
37303
|
let spanRow = 1;
|
|
37303
37304
|
let endCol = col;
|
|
37304
|
-
if (table.isHeader(col, row) ||
|
|
37305
|
+
if (table.isHeader(col, row) ||
|
|
37306
|
+
table.getBodyColumnDefine(col, row)?.mergeCell ||
|
|
37307
|
+
table.hasCustomMerge()) {
|
|
37305
37308
|
const cellRange = table.getCellRange(col, row);
|
|
37306
37309
|
spanRow = cellRange.end.row - cellRange.start.row + 1;
|
|
37307
37310
|
col = cellRange.start.col;
|
|
@@ -40327,7 +40330,9 @@
|
|
|
40327
40330
|
let width = 0;
|
|
40328
40331
|
let renderDefault = false;
|
|
40329
40332
|
let enableCellPadding = false;
|
|
40330
|
-
if (table.isHeader(col, row) ||
|
|
40333
|
+
if (table.isHeader(col, row) ||
|
|
40334
|
+
table.getBodyColumnDefine(col, row)?.mergeCell ||
|
|
40335
|
+
table.hasCustomMerge()) {
|
|
40331
40336
|
const cellRange = table.getCellRange(col, row);
|
|
40332
40337
|
spanCol = cellRange.end.col - cellRange.start.col + 1;
|
|
40333
40338
|
}
|
|
@@ -40396,7 +40401,9 @@
|
|
|
40396
40401
|
});
|
|
40397
40402
|
}
|
|
40398
40403
|
let spanCol = 1;
|
|
40399
|
-
if (table.isHeader(col, row) ||
|
|
40404
|
+
if (table.isHeader(col, row) ||
|
|
40405
|
+
table.getBodyColumnDefine(col, row)?.mergeCell ||
|
|
40406
|
+
table.hasCustomMerge()) {
|
|
40400
40407
|
const cellRange = table.getCellRange(col, row);
|
|
40401
40408
|
spanCol = cellRange.end.col - cellRange.start.col + 1;
|
|
40402
40409
|
}
|
|
@@ -51714,7 +51721,7 @@
|
|
|
51714
51721
|
return TABLE_EVENT_TYPE;
|
|
51715
51722
|
}
|
|
51716
51723
|
options;
|
|
51717
|
-
version = "0.19.
|
|
51724
|
+
version = "0.19.2-alpha.0";
|
|
51718
51725
|
pagination;
|
|
51719
51726
|
id = `VTable${Date.now()}`;
|
|
51720
51727
|
headerStyleCache;
|
|
@@ -52139,6 +52146,9 @@
|
|
|
52139
52146
|
return 'grid';
|
|
52140
52147
|
}
|
|
52141
52148
|
getColsWidth(startCol, endCol) {
|
|
52149
|
+
if (startCol > endCol) {
|
|
52150
|
+
return 0;
|
|
52151
|
+
}
|
|
52142
52152
|
startCol = Math.max(startCol, 0);
|
|
52143
52153
|
endCol = Math.min(endCol, (this.colCount ?? Infinity) - 1);
|
|
52144
52154
|
const cachedColWidth = this._colRangeWidthsMap.get(`$${startCol}$${endCol}`);
|
|
@@ -52193,6 +52203,9 @@
|
|
|
52193
52203
|
}
|
|
52194
52204
|
}
|
|
52195
52205
|
getRowsHeight(startRow, endRow) {
|
|
52206
|
+
if (startRow > endRow) {
|
|
52207
|
+
return 0;
|
|
52208
|
+
}
|
|
52196
52209
|
startRow = Math.max(startRow, 0);
|
|
52197
52210
|
endRow = Math.min(endRow, (this.rowCount ?? Infinity) - 1);
|
|
52198
52211
|
let h = 0;
|
|
@@ -52445,27 +52458,40 @@
|
|
|
52445
52458
|
return rect;
|
|
52446
52459
|
}
|
|
52447
52460
|
getCellsRect(startCol, startRow, endCol, endRow) {
|
|
52448
|
-
const isFrozenStartCell = this.isFrozenCell(startCol, startRow);
|
|
52449
|
-
const isFrozenEndCell = this.isFrozenCell(endCol, endRow);
|
|
52450
52461
|
let absoluteLeft = this.getColsWidth(0, startCol - 1) || 0;
|
|
52451
52462
|
let width = this.getColsWidth(startCol, endCol);
|
|
52452
|
-
|
|
52453
|
-
|
|
52454
|
-
|
|
52455
|
-
if (!isFrozenEndCell?.col) {
|
|
52456
|
-
width -= scrollLeft;
|
|
52457
|
-
width = Math.max(width, this.getColsWidth(startCol, this.frozenColCount - 1));
|
|
52458
|
-
}
|
|
52463
|
+
const scrollLeft = this.scrollLeft;
|
|
52464
|
+
if (this.isLeftFrozenColumn(startCol) && this.isRightFrozenColumn(endCol)) {
|
|
52465
|
+
width = this.tableNoFrameWidth - (this.getColsWidth(startCol + 1, this.colCount - 1) ?? 0) - absoluteLeft;
|
|
52459
52466
|
}
|
|
52460
|
-
|
|
52467
|
+
else if (this.isLeftFrozenColumn(startCol) && !this.isLeftFrozenColumn(endCol)) {
|
|
52468
|
+
width = Math.max(width - scrollLeft, this.getColsWidth(startCol, this.frozenColCount - 1));
|
|
52469
|
+
}
|
|
52470
|
+
else if (!this.isRightFrozenColumn(startCol) && this.isRightFrozenColumn(endCol)) {
|
|
52471
|
+
absoluteLeft = Math.min(absoluteLeft - scrollLeft, this.tableNoFrameWidth - this.getRightFrozenColsWidth());
|
|
52472
|
+
width = this.tableNoFrameWidth - (this.getColsWidth(startCol + 1, this.colCount - 1) ?? 0) - absoluteLeft;
|
|
52473
|
+
}
|
|
52474
|
+
else if (this.isRightFrozenColumn(startCol)) {
|
|
52475
|
+
absoluteLeft = this.tableNoFrameWidth - (this.getColsWidth(startCol, this.colCount - 1) ?? 0);
|
|
52476
|
+
}
|
|
52477
|
+
else ;
|
|
52478
|
+
let absoluteTop = this.getRowsHeight(0, startRow - 1);
|
|
52461
52479
|
let height = this.getRowsHeight(startRow, endRow);
|
|
52462
|
-
|
|
52463
|
-
|
|
52464
|
-
|
|
52465
|
-
height -= scrollTop;
|
|
52466
|
-
height = Math.max(height, this.getRowsHeight(startRow, this.frozenRowCount - 1));
|
|
52467
|
-
}
|
|
52480
|
+
const scrollTop = this.scrollTop;
|
|
52481
|
+
if (this.isTopFrozenRow(startRow) && this.isBottomFrozenRow(endRow)) {
|
|
52482
|
+
height = this.tableNoFrameHeight - (this.getRowsHeight(startRow + 1, this.rowCount - 1) ?? 0) - absoluteTop;
|
|
52468
52483
|
}
|
|
52484
|
+
else if (this.isTopFrozenRow(startRow) && !this.isTopFrozenRow(endRow)) {
|
|
52485
|
+
height = Math.max(height - scrollTop, this.getRowsHeight(startRow, this.frozenRowCount - 1));
|
|
52486
|
+
}
|
|
52487
|
+
else if (!this.isBottomFrozenRow(startRow) && this.isBottomFrozenRow(endRow)) {
|
|
52488
|
+
absoluteTop = Math.min(absoluteTop - scrollTop, this.tableNoFrameHeight - this.getBottomFrozenRowsHeight());
|
|
52489
|
+
height = this.tableNoFrameHeight - (this.getRowsHeight(startRow + 1, this.rowCount - 1) ?? 0) - absoluteTop;
|
|
52490
|
+
}
|
|
52491
|
+
else if (this.isBottomFrozenRow(startRow)) {
|
|
52492
|
+
absoluteTop = this.tableNoFrameHeight - (this.getRowsHeight(startRow, this.rowCount - 1) ?? 0);
|
|
52493
|
+
}
|
|
52494
|
+
else ;
|
|
52469
52495
|
return new Rect$1(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
|
|
52470
52496
|
}
|
|
52471
52497
|
getCellsRectWidth(startCol, startRow, endCol, endRow) {
|
|
@@ -53244,6 +53270,9 @@
|
|
|
53244
53270
|
}
|
|
53245
53271
|
return this.internalProps.layoutMap.getCellRange(col, row);
|
|
53246
53272
|
}
|
|
53273
|
+
hasCustomMerge() {
|
|
53274
|
+
return !!this.internalProps.customMergeCell;
|
|
53275
|
+
}
|
|
53247
53276
|
getCustomMerge(col, row) {
|
|
53248
53277
|
if (this.internalProps.customMergeCell) {
|
|
53249
53278
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
@@ -63114,7 +63143,7 @@
|
|
|
63114
63143
|
}
|
|
63115
63144
|
|
|
63116
63145
|
registerForVrender();
|
|
63117
|
-
const version = "0.19.
|
|
63146
|
+
const version = "0.19.2-alpha.0";
|
|
63118
63147
|
function getIcons() {
|
|
63119
63148
|
return get$1();
|
|
63120
63149
|
}
|