@visactor/vtable 0.9.3-alpha.2 → 0.9.3-alpha.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/cjs/components/menu/dom/MenuHandler.js +1 -1
- package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuContainer.js +3 -1
- package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +11 -7
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.js +1 -1
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +2 -11
- package/cjs/core/BaseTable.js +14 -25
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.d.ts +1 -1
- package/cjs/event/event.js +2 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +28 -21
- package/cjs/event/listener/table-group.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 +4 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +7 -6
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +9 -8
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/state.d.ts +2 -1
- package/cjs/state/state.js +8 -6
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +2 -2
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/dist/vtable.js +120 -88
- package/dist/vtable.min.js +2 -2
- package/es/components/menu/dom/MenuHandler.js +1 -1
- package/es/components/menu/dom/MenuHandler.js.map +1 -1
- package/es/components/menu/dom/logic/MenuContainer.js +3 -1
- package/es/components/menu/dom/logic/MenuContainer.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +11 -7
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.js +1 -1
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/core/BaseTable.d.ts +2 -11
- package/es/core/BaseTable.js +14 -25
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.d.ts +1 -1
- package/es/event/event.js +2 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +28 -21
- package/es/event/listener/table-group.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 +4 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +7 -6
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +9 -8
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/state.d.ts +2 -1
- package/es/state/state.js +8 -6
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +2 -2
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/package.json +1 -1
package/dist/vtable.js
CHANGED
|
@@ -4237,7 +4237,7 @@
|
|
|
4237
4237
|
if (!superTheme.rightFrozenStyle || !obj.rightFrozenStyle) {
|
|
4238
4238
|
return this._rightFrozen;
|
|
4239
4239
|
}
|
|
4240
|
-
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.rightFrozenStyle, obj.rightFrozenStyle);
|
|
4240
|
+
const header = ingoreNoneValueMerge({}, this.defaultStyle, this.rowHeaderStyle, superTheme.rightFrozenStyle, obj.rightFrozenStyle);
|
|
4241
4241
|
this._rightFrozen = this.getStyle(header);
|
|
4242
4242
|
}
|
|
4243
4243
|
return this._rightFrozen;
|
|
@@ -4248,7 +4248,7 @@
|
|
|
4248
4248
|
if (!superTheme.bottomFrozenStyle || !obj.bottomFrozenStyle) {
|
|
4249
4249
|
return this._bottomFrozen;
|
|
4250
4250
|
}
|
|
4251
|
-
const header = ingoreNoneValueMerge({}, this.defaultStyle, superTheme.bottomFrozenStyle, obj.bottomFrozenStyle);
|
|
4251
|
+
const header = ingoreNoneValueMerge({}, this.defaultStyle, this.headerStyle, superTheme.bottomFrozenStyle, obj.bottomFrozenStyle);
|
|
4252
4252
|
this._bottomFrozen = this.getStyle(header);
|
|
4253
4253
|
}
|
|
4254
4254
|
return this._bottomFrozen;
|
|
@@ -39557,7 +39557,6 @@
|
|
|
39557
39557
|
const absoluteLeftIcons = [];
|
|
39558
39558
|
const absoluteRightIcons = [];
|
|
39559
39559
|
let contentWidth;
|
|
39560
|
-
let contentHeight;
|
|
39561
39560
|
let leftIconWidth = 0;
|
|
39562
39561
|
let leftIconHeight = 0;
|
|
39563
39562
|
let rightIconWidth = 0;
|
|
@@ -39582,7 +39581,7 @@
|
|
|
39582
39581
|
wrapText.name = 'text';
|
|
39583
39582
|
cellGroup.appendChild(wrapText);
|
|
39584
39583
|
contentWidth = wrapText.AABBBounds.width();
|
|
39585
|
-
|
|
39584
|
+
wrapText.AABBBounds.height();
|
|
39586
39585
|
}
|
|
39587
39586
|
}
|
|
39588
39587
|
else {
|
|
@@ -39721,7 +39720,7 @@
|
|
|
39721
39720
|
cellGroup.appendChild(cellContent);
|
|
39722
39721
|
cellContent.layout();
|
|
39723
39722
|
contentWidth = cellContent.AABBBounds.width();
|
|
39724
|
-
|
|
39723
|
+
cellContent.AABBBounds.height();
|
|
39725
39724
|
}
|
|
39726
39725
|
else {
|
|
39727
39726
|
if (cellGroup.firstChild) {
|
|
@@ -39731,15 +39730,13 @@
|
|
|
39731
39730
|
cellGroup.appendChild(textMark);
|
|
39732
39731
|
}
|
|
39733
39732
|
contentWidth = textMark.AABBBounds.width();
|
|
39734
|
-
|
|
39733
|
+
textMark.AABBBounds.height();
|
|
39735
39734
|
}
|
|
39736
39735
|
}
|
|
39737
39736
|
const width = autoColWidth
|
|
39738
39737
|
? leftIconWidth + contentWidth + rightIconWidth
|
|
39739
39738
|
: cellWidth - (padding[1] + padding[3]);
|
|
39740
|
-
const height =
|
|
39741
|
-
? Math.max(leftIconHeight, contentHeight, rightIconHeight)
|
|
39742
|
-
: cellHeight - (padding[0] + padding[2]);
|
|
39739
|
+
const height = cellHeight - (padding[0] + padding[2]);
|
|
39743
39740
|
cellGroup.forEachChildren((child) => {
|
|
39744
39741
|
if (child.role === 'icon-left') {
|
|
39745
39742
|
child.setAttribute('x', child.attribute.x + padding[3]);
|
|
@@ -42444,16 +42441,17 @@
|
|
|
42444
42441
|
}
|
|
42445
42442
|
if (table.widthMode === 'adaptive') {
|
|
42446
42443
|
table._clearColRangeWidthsMap();
|
|
42447
|
-
const totalDrawWidth = table.tableNoFrameWidth;
|
|
42444
|
+
const totalDrawWidth = table.tableNoFrameWidth - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
|
|
42448
42445
|
let actualWidth = 0;
|
|
42449
|
-
for (let col =
|
|
42446
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
42450
42447
|
actualWidth += table.getColWidth(col);
|
|
42451
42448
|
}
|
|
42452
42449
|
const factor = totalDrawWidth / actualWidth;
|
|
42453
|
-
for (let col =
|
|
42450
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
42454
42451
|
let colWidth;
|
|
42455
|
-
if (col === table.colCount - 1) {
|
|
42456
|
-
colWidth =
|
|
42452
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
42453
|
+
colWidth =
|
|
42454
|
+
totalDrawWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2);
|
|
42457
42455
|
}
|
|
42458
42456
|
else {
|
|
42459
42457
|
colWidth = Math.round(table.getColWidth(col) * factor);
|
|
@@ -42468,14 +42466,14 @@
|
|
|
42468
42466
|
let actualHeaderWidth = 0;
|
|
42469
42467
|
for (let col = 0; col < table.colCount; col++) {
|
|
42470
42468
|
const colWidth = table.getColWidth(col);
|
|
42471
|
-
if (col < table.frozenColCount) {
|
|
42469
|
+
if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {
|
|
42472
42470
|
actualHeaderWidth += colWidth;
|
|
42473
42471
|
}
|
|
42474
42472
|
actualWidth += colWidth;
|
|
42475
42473
|
}
|
|
42476
42474
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
42477
42475
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
42478
|
-
for (let col = table.frozenColCount; col < table.colCount; col++) {
|
|
42476
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
42479
42477
|
table.setColWidth(col, table.getColWidth(col) * factor, false, true);
|
|
42480
42478
|
}
|
|
42481
42479
|
}
|
|
@@ -42999,6 +42997,7 @@
|
|
|
42999
42997
|
if (cellTheme?.text?.textBaseline) {
|
|
43000
42998
|
textBaseline = cellTheme?.text?.textBaseline;
|
|
43001
42999
|
}
|
|
43000
|
+
const autoRowHeight = table.heightMode === 'autoHeight';
|
|
43002
43001
|
const autoColWidth = colWidth === 'auto';
|
|
43003
43002
|
const autoWrapText = headerStyle.autoWrapText ?? table.internalProps.autoWrapText;
|
|
43004
43003
|
const lineClamp = headerStyle.lineClamp;
|
|
@@ -43029,7 +43028,7 @@
|
|
|
43029
43028
|
if (mayHaveIcon) {
|
|
43030
43029
|
icons = table.getCellIcons(col, row);
|
|
43031
43030
|
}
|
|
43032
|
-
createCellContent(cellGroup, icons, textStr, padding, autoColWidth,
|
|
43031
|
+
createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, typeof lineClamp === 'number' ? lineClamp : undefined, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme);
|
|
43033
43032
|
if (cellTheme?._vtable?.marked) {
|
|
43034
43033
|
const mark = createArc({
|
|
43035
43034
|
x: cellGroup.attribute.width,
|
|
@@ -43250,7 +43249,12 @@
|
|
|
43250
43249
|
const dataValue = table.getCellOriginValue(col, row);
|
|
43251
43250
|
cellGroup = createCellGroup(table, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, null, true, cellTheme);
|
|
43252
43251
|
const progressBarGroup = createProgressBarCell(define, style, colWidth, value, dataValue, col, row, padding, table);
|
|
43253
|
-
|
|
43252
|
+
if (cellGroup.firstChild) {
|
|
43253
|
+
cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);
|
|
43254
|
+
}
|
|
43255
|
+
else {
|
|
43256
|
+
cellGroup.appendChild(progressBarGroup);
|
|
43257
|
+
}
|
|
43254
43258
|
}
|
|
43255
43259
|
else if (type === 'sparkline') {
|
|
43256
43260
|
cellGroup = createSparkLineCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme);
|
|
@@ -43259,6 +43263,9 @@
|
|
|
43259
43263
|
}
|
|
43260
43264
|
function updateCell$1(col, row, table, addNew) {
|
|
43261
43265
|
const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
|
|
43266
|
+
if (!addNew && oldCellGroup.role === 'empty') {
|
|
43267
|
+
return undefined;
|
|
43268
|
+
}
|
|
43262
43269
|
const type = table.isHeader(col, row)
|
|
43263
43270
|
? table._getHeaderLayoutMap(col, row).headerType
|
|
43264
43271
|
: table.getBodyColumnType(col, row);
|
|
@@ -45787,10 +45794,15 @@
|
|
|
45787
45794
|
return;
|
|
45788
45795
|
}
|
|
45789
45796
|
this.updateColWidth(col, width - oldWidth);
|
|
45797
|
+
this.table._clearColRangeWidthsMap(col);
|
|
45790
45798
|
}
|
|
45791
45799
|
setRowHeight(row, height) {
|
|
45792
45800
|
const oldHeight = this.table.getRowHeight(row);
|
|
45801
|
+
if (oldHeight === height) {
|
|
45802
|
+
return;
|
|
45803
|
+
}
|
|
45793
45804
|
this.updateRowHeight(row, height - oldHeight);
|
|
45805
|
+
this.table._clearRowRangeHeightsMap(row);
|
|
45794
45806
|
}
|
|
45795
45807
|
setX(x) {
|
|
45796
45808
|
this.table.scenegraph.proxy.setX(-x);
|
|
@@ -45833,16 +45845,17 @@
|
|
|
45833
45845
|
dealWidthMode() {
|
|
45834
45846
|
const table = this.table;
|
|
45835
45847
|
if (table.widthMode === 'adaptive') {
|
|
45836
|
-
const totalDrawWidth = table.tableNoFrameWidth;
|
|
45848
|
+
const totalDrawWidth = table.tableNoFrameWidth - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
|
|
45837
45849
|
let actualWidth = 0;
|
|
45838
|
-
for (let col =
|
|
45850
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
45839
45851
|
actualWidth += table.getColWidth(col);
|
|
45840
45852
|
}
|
|
45841
45853
|
const factor = totalDrawWidth / actualWidth;
|
|
45842
|
-
for (let col =
|
|
45854
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
45843
45855
|
let colWidth;
|
|
45844
|
-
if (col === table.colCount - 1) {
|
|
45845
|
-
colWidth =
|
|
45856
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
45857
|
+
colWidth =
|
|
45858
|
+
totalDrawWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2);
|
|
45846
45859
|
}
|
|
45847
45860
|
else {
|
|
45848
45861
|
colWidth = Math.round(table.getColWidth(col) * factor);
|
|
@@ -45856,14 +45869,14 @@
|
|
|
45856
45869
|
let actualHeaderWidth = 0;
|
|
45857
45870
|
for (let col = 0; col < table.colCount; col++) {
|
|
45858
45871
|
const colWidth = table.getColWidth(col);
|
|
45859
|
-
if (col < table.frozenColCount) {
|
|
45872
|
+
if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {
|
|
45860
45873
|
actualHeaderWidth += colWidth;
|
|
45861
45874
|
}
|
|
45862
45875
|
actualWidth += colWidth;
|
|
45863
45876
|
}
|
|
45864
45877
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
45865
45878
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
45866
|
-
for (let col = table.frozenColCount; col < table.colCount; col++) {
|
|
45879
|
+
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
45867
45880
|
this.setColWidth(col, table.getColWidth(col) * factor);
|
|
45868
45881
|
}
|
|
45869
45882
|
}
|
|
@@ -46943,13 +46956,16 @@
|
|
|
46943
46956
|
constructor(table) {
|
|
46944
46957
|
this.table = table;
|
|
46945
46958
|
this.initState();
|
|
46946
|
-
this.setHoverState();
|
|
46947
|
-
this.setSelectState();
|
|
46948
|
-
this.setFrozenState();
|
|
46949
46959
|
this.updateVerticalScrollBar = this.updateVerticalScrollBar.bind(this);
|
|
46950
46960
|
this.updateHorizontalScrollBar = this.updateHorizontalScrollBar.bind(this);
|
|
46951
46961
|
}
|
|
46952
46962
|
initState() {
|
|
46963
|
+
this._initState();
|
|
46964
|
+
this.setHoverState();
|
|
46965
|
+
this.setSelectState();
|
|
46966
|
+
this.setFrozenState();
|
|
46967
|
+
}
|
|
46968
|
+
_initState() {
|
|
46953
46969
|
this.interactionState = InteractionState.default;
|
|
46954
46970
|
this.select = {
|
|
46955
46971
|
highlightScope: HighlightScope.single,
|
|
@@ -47194,10 +47210,10 @@
|
|
|
47194
47210
|
this.table.stateManeger.updateSelectPos(-1, -1);
|
|
47195
47211
|
this.table.scenegraph.updateNextFrame();
|
|
47196
47212
|
}
|
|
47197
|
-
updateResizeCol(
|
|
47198
|
-
|
|
47199
|
-
|
|
47200
|
-
let detaX =
|
|
47213
|
+
updateResizeCol(xInTable, yInTable) {
|
|
47214
|
+
xInTable = Math.ceil(xInTable);
|
|
47215
|
+
yInTable = Math.ceil(yInTable);
|
|
47216
|
+
let detaX = xInTable - this.columnResize.x;
|
|
47201
47217
|
if (Math.abs(detaX) < 1) {
|
|
47202
47218
|
return;
|
|
47203
47219
|
}
|
|
@@ -47228,8 +47244,8 @@
|
|
|
47228
47244
|
if (this.table.widthMode === 'adaptive' && this.columnResize.col < this.table.colCount - 1) {
|
|
47229
47245
|
this.table.scenegraph.updateColWidth(this.columnResize.col + 1, -detaX);
|
|
47230
47246
|
}
|
|
47231
|
-
this.columnResize.x =
|
|
47232
|
-
this.table.scenegraph.component.updateResizeCol(this.columnResize.col,
|
|
47247
|
+
this.columnResize.x = xInTable;
|
|
47248
|
+
this.table.scenegraph.component.updateResizeCol(this.columnResize.col, yInTable);
|
|
47233
47249
|
if (this.columnResize.col < this.table.frozenColCount &&
|
|
47234
47250
|
!this.table.isPivotTable() &&
|
|
47235
47251
|
!this.table.transpose) {
|
|
@@ -47744,25 +47760,38 @@
|
|
|
47744
47760
|
function bindTableGroupListener(eventManeger) {
|
|
47745
47761
|
const table = eventManeger.table;
|
|
47746
47762
|
const stateManeger = table.stateManeger;
|
|
47747
|
-
|
|
47763
|
+
document.body.addEventListener('pointermove', (e) => {
|
|
47748
47764
|
if (eventManeger.touchSetTimeout) {
|
|
47749
47765
|
clearTimeout(eventManeger.touchSetTimeout);
|
|
47750
47766
|
eventManeger.touchSetTimeout = undefined;
|
|
47751
47767
|
}
|
|
47752
|
-
const
|
|
47768
|
+
const { x, y } = table._getMouseAbstractPoint(e, false);
|
|
47753
47769
|
if (stateManeger.interactionState === InteractionState.scrolling) {
|
|
47754
47770
|
return;
|
|
47755
47771
|
}
|
|
47756
47772
|
if (stateManeger.interactionState === InteractionState.grabing) {
|
|
47757
47773
|
if (stateManeger.isResizeCol()) {
|
|
47758
|
-
eventManeger.dealColumnResize(
|
|
47759
|
-
if (
|
|
47774
|
+
eventManeger.dealColumnResize(x, y);
|
|
47775
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN)) {
|
|
47760
47776
|
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
|
|
47761
47777
|
col: table.stateManeger.columnResize.col,
|
|
47762
47778
|
colWidth: table.getColWidth(table.stateManeger.columnResize.col)
|
|
47763
47779
|
});
|
|
47764
47780
|
}
|
|
47765
47781
|
}
|
|
47782
|
+
}
|
|
47783
|
+
});
|
|
47784
|
+
table.scenegraph.tableGroup.addEventListener('pointermove', (e) => {
|
|
47785
|
+
if (eventManeger.touchSetTimeout) {
|
|
47786
|
+
clearTimeout(eventManeger.touchSetTimeout);
|
|
47787
|
+
eventManeger.touchSetTimeout = undefined;
|
|
47788
|
+
}
|
|
47789
|
+
const eventArgsSet = getCellEventArgsSet(e);
|
|
47790
|
+
if (stateManeger.interactionState === InteractionState.scrolling) {
|
|
47791
|
+
return;
|
|
47792
|
+
}
|
|
47793
|
+
if (stateManeger.interactionState === InteractionState.grabing) {
|
|
47794
|
+
if (stateManeger.isResizeCol()) ;
|
|
47766
47795
|
else if (stateManeger.isMoveCol()) {
|
|
47767
47796
|
eventManeger.dealColumnMover(eventArgsSet);
|
|
47768
47797
|
}
|
|
@@ -47771,7 +47800,7 @@
|
|
|
47771
47800
|
}
|
|
47772
47801
|
return;
|
|
47773
47802
|
}
|
|
47774
|
-
if (eventManeger.checkColumnResize(eventArgsSet)) {
|
|
47803
|
+
if (stateManeger.isResizeCol() || eventManeger.checkColumnResize(eventArgsSet)) {
|
|
47775
47804
|
stateManeger.updateCursor('col-resize');
|
|
47776
47805
|
}
|
|
47777
47806
|
else {
|
|
@@ -47875,9 +47904,11 @@
|
|
|
47875
47904
|
}
|
|
47876
47905
|
});
|
|
47877
47906
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
47878
|
-
stateManeger.
|
|
47907
|
+
if (!stateManeger.isResizeCol()) {
|
|
47908
|
+
stateManeger.updateInteractionState(InteractionState.default);
|
|
47909
|
+
stateManeger.updateCursor();
|
|
47910
|
+
}
|
|
47879
47911
|
eventManeger.dealTableHover();
|
|
47880
|
-
stateManeger.updateCursor();
|
|
47881
47912
|
const target = e.target;
|
|
47882
47913
|
if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
47883
47914
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
|
|
@@ -47889,6 +47920,9 @@
|
|
|
47889
47920
|
});
|
|
47890
47921
|
table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e) => {
|
|
47891
47922
|
console.log('pointerupoutside');
|
|
47923
|
+
if (stateManeger.isResizeCol()) {
|
|
47924
|
+
endResizeCol(table);
|
|
47925
|
+
}
|
|
47892
47926
|
stateManeger.updateInteractionState(InteractionState.default);
|
|
47893
47927
|
eventManeger.dealTableHover();
|
|
47894
47928
|
eventManeger.dealTableSelect();
|
|
@@ -47964,17 +47998,7 @@
|
|
|
47964
47998
|
if (stateManeger.interactionState === 'grabing') {
|
|
47965
47999
|
stateManeger.updateInteractionState(InteractionState.default);
|
|
47966
48000
|
if (stateManeger.isResizeCol()) {
|
|
47967
|
-
|
|
47968
|
-
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
|
|
47969
|
-
const columns = [];
|
|
47970
|
-
for (let col = 0; col < table.colCount; col++) {
|
|
47971
|
-
columns.push(table.getColWidth(col));
|
|
47972
|
-
}
|
|
47973
|
-
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
47974
|
-
col: table.stateManeger.columnResize.col,
|
|
47975
|
-
columns
|
|
47976
|
-
});
|
|
47977
|
-
}
|
|
48001
|
+
endResizeCol(table);
|
|
47978
48002
|
}
|
|
47979
48003
|
else if (stateManeger.isMoveCol()) {
|
|
47980
48004
|
table.stateManeger.endMoveCol();
|
|
@@ -48141,6 +48165,19 @@
|
|
|
48141
48165
|
}
|
|
48142
48166
|
});
|
|
48143
48167
|
}
|
|
48168
|
+
function endResizeCol(table) {
|
|
48169
|
+
table.stateManeger.endResizeCol();
|
|
48170
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
|
|
48171
|
+
const columns = [];
|
|
48172
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
48173
|
+
columns.push(table.getColWidth(col));
|
|
48174
|
+
}
|
|
48175
|
+
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
48176
|
+
col: table.stateManeger.columnResize.col,
|
|
48177
|
+
columns
|
|
48178
|
+
});
|
|
48179
|
+
}
|
|
48180
|
+
}
|
|
48144
48181
|
|
|
48145
48182
|
function bindScrollBarListener(eventManeger) {
|
|
48146
48183
|
const table = eventManeger.table;
|
|
@@ -48671,8 +48708,8 @@
|
|
|
48671
48708
|
}
|
|
48672
48709
|
return false;
|
|
48673
48710
|
}
|
|
48674
|
-
dealColumnResize(
|
|
48675
|
-
this.table.stateManeger.updateResizeCol(
|
|
48711
|
+
dealColumnResize(xInTable, yInTable) {
|
|
48712
|
+
this.table.stateManeger.updateResizeCol(xInTable, xInTable);
|
|
48676
48713
|
}
|
|
48677
48714
|
chechColumnMover(eventArgsSet) {
|
|
48678
48715
|
const { eventArgs } = eventArgsSet;
|
|
@@ -49179,6 +49216,9 @@
|
|
|
49179
49216
|
this._secondElement = createMenuDomElement$1();
|
|
49180
49217
|
this._secondElement.sub = true;
|
|
49181
49218
|
this._showChildrenIndex = -1;
|
|
49219
|
+
this._rootElement.addEventListener('wheel', e => {
|
|
49220
|
+
e.stopPropagation();
|
|
49221
|
+
});
|
|
49182
49222
|
this._rootElement?.addEventListener('mousedown', e => {
|
|
49183
49223
|
e.stopPropagation();
|
|
49184
49224
|
e.preventDefault();
|
|
@@ -49292,6 +49332,9 @@
|
|
|
49292
49332
|
}, 300);
|
|
49293
49333
|
}
|
|
49294
49334
|
});
|
|
49335
|
+
this._secondElement?.addEventListener('wheel', e => {
|
|
49336
|
+
e.stopPropagation();
|
|
49337
|
+
});
|
|
49295
49338
|
this._secondElement?.addEventListener('mousemove', e => {
|
|
49296
49339
|
if (this._rootElement.classList.contains(HIDDEN_CLASSNAME$1)) {
|
|
49297
49340
|
return;
|
|
@@ -50442,7 +50485,7 @@
|
|
|
50442
50485
|
const { event } = e;
|
|
50443
50486
|
const { left, right, top, bottom } = position.rect;
|
|
50444
50487
|
const abstractPos = table._getMouseAbstractPoint(event, false);
|
|
50445
|
-
if (!(abstractPos &&
|
|
50488
|
+
if (!(abstractPos.inTable &&
|
|
50446
50489
|
abstractPos.x >= left - 5 &&
|
|
50447
50490
|
abstractPos.x <= right + 5 &&
|
|
50448
50491
|
abstractPos.y >= top - 5 &&
|
|
@@ -50541,6 +50584,9 @@
|
|
|
50541
50584
|
constructor(table) {
|
|
50542
50585
|
this._handler = new EventHandler();
|
|
50543
50586
|
this._rootElement = createMenuDomElement();
|
|
50587
|
+
this._rootElement.addEventListener('wheel', e => {
|
|
50588
|
+
e.stopPropagation();
|
|
50589
|
+
});
|
|
50544
50590
|
this._rootElement?.addEventListener('mousedown', e => {
|
|
50545
50591
|
e.stopPropagation();
|
|
50546
50592
|
e.preventDefault();
|
|
@@ -50852,10 +50898,10 @@
|
|
|
50852
50898
|
if (table.internalProps.menu?.renderMode === 'html') {
|
|
50853
50899
|
const abstractPos = table._getMouseAbstractPoint(e.event, false);
|
|
50854
50900
|
let menu = null;
|
|
50855
|
-
if (abstractPos && typeof table.internalProps.menu?.contextMenuItems === 'function') {
|
|
50901
|
+
if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {
|
|
50856
50902
|
menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row), e.row);
|
|
50857
50903
|
}
|
|
50858
|
-
else if (abstractPos && Array.isArray(table.internalProps.menu?.contextMenuItems)) {
|
|
50904
|
+
else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {
|
|
50859
50905
|
menu = table.internalProps.menu?.contextMenuItems;
|
|
50860
50906
|
}
|
|
50861
50907
|
this._bindToCell(e.col, e.row, 'context-menu', {
|
|
@@ -51314,7 +51360,7 @@
|
|
|
51314
51360
|
return TABLE_EVENT_TYPE;
|
|
51315
51361
|
}
|
|
51316
51362
|
options;
|
|
51317
|
-
version = "0.9.3-alpha.
|
|
51363
|
+
version = "0.9.3-alpha.3";
|
|
51318
51364
|
pagerConf;
|
|
51319
51365
|
id = `VTable${Date.now()}`;
|
|
51320
51366
|
headerStyleCache;
|
|
@@ -51861,7 +51907,8 @@
|
|
|
51861
51907
|
if (this.heightMode === 'standard' &&
|
|
51862
51908
|
this.internalProps.layoutMap &&
|
|
51863
51909
|
endRow >= this.columnHeaderLevelCount &&
|
|
51864
|
-
!this.bottomFrozenRowCount
|
|
51910
|
+
!this.bottomFrozenRowCount &&
|
|
51911
|
+
!this.hasAutoImageColumn()) {
|
|
51865
51912
|
for (let i = startRow; i < this.columnHeaderLevelCount; i++) {
|
|
51866
51913
|
h += this.getRowHeight(i);
|
|
51867
51914
|
}
|
|
@@ -52437,7 +52484,7 @@
|
|
|
52437
52484
|
const table = this;
|
|
52438
52485
|
let e;
|
|
52439
52486
|
if (!evt) {
|
|
52440
|
-
return
|
|
52487
|
+
return { inTable: false, x: undefined, y: undefined };
|
|
52441
52488
|
}
|
|
52442
52489
|
if (isTouchEvent(evt)) {
|
|
52443
52490
|
e = evt.changedTouches[0];
|
|
@@ -52448,11 +52495,12 @@
|
|
|
52448
52495
|
const clientX = e.clientX || e.pageX + window.scrollX;
|
|
52449
52496
|
const clientY = e.clientY || e.pageY + window.scrollY;
|
|
52450
52497
|
const rect = table.internalProps.canvas.getBoundingClientRect();
|
|
52498
|
+
let inTable = true;
|
|
52451
52499
|
if (rect.right <= clientX) {
|
|
52452
|
-
|
|
52500
|
+
inTable = false;
|
|
52453
52501
|
}
|
|
52454
52502
|
if (rect.bottom <= clientY) {
|
|
52455
|
-
|
|
52503
|
+
inTable = false;
|
|
52456
52504
|
}
|
|
52457
52505
|
const currentWidth = rect.width;
|
|
52458
52506
|
const originWidth = this.canvas.offsetWidth || currentWidth;
|
|
@@ -52462,31 +52510,7 @@
|
|
|
52462
52510
|
const heightRatio = currentHeight / originHeight;
|
|
52463
52511
|
const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0) - table.tableX;
|
|
52464
52512
|
const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0) - table.tableY;
|
|
52465
|
-
return { x, y };
|
|
52466
|
-
}
|
|
52467
|
-
_getCellEventArgsSet(e) {
|
|
52468
|
-
const abstractPos = this._getMouseAbstractPoint(e);
|
|
52469
|
-
if (!abstractPos) {
|
|
52470
|
-
return {};
|
|
52471
|
-
}
|
|
52472
|
-
const cell = this.getCellAt(abstractPos.x, abstractPos.y);
|
|
52473
|
-
if (cell.col < 0 || cell.row < 0) {
|
|
52474
|
-
return {
|
|
52475
|
-
abstractPos,
|
|
52476
|
-
cell
|
|
52477
|
-
};
|
|
52478
|
-
}
|
|
52479
|
-
const eventArgs = {
|
|
52480
|
-
col: cell.col,
|
|
52481
|
-
row: cell.row,
|
|
52482
|
-
event: e,
|
|
52483
|
-
rect: cell.rect
|
|
52484
|
-
};
|
|
52485
|
-
return {
|
|
52486
|
-
abstractPos,
|
|
52487
|
-
cell,
|
|
52488
|
-
eventArgs
|
|
52489
|
-
};
|
|
52513
|
+
return { x, y, inTable };
|
|
52490
52514
|
}
|
|
52491
52515
|
getTheme() {
|
|
52492
52516
|
return this.internalProps.theme;
|
|
@@ -53336,6 +53360,14 @@
|
|
|
53336
53360
|
}
|
|
53337
53361
|
return customLayout;
|
|
53338
53362
|
}
|
|
53363
|
+
hasAutoImageColumn() {
|
|
53364
|
+
return this.internalProps.layoutMap.columnObjects.find((column) => {
|
|
53365
|
+
if (column.columnType === 'image' && column.define.imageAutoSizing) {
|
|
53366
|
+
return true;
|
|
53367
|
+
}
|
|
53368
|
+
return false;
|
|
53369
|
+
});
|
|
53370
|
+
}
|
|
53339
53371
|
}
|
|
53340
53372
|
|
|
53341
53373
|
var core = /*#__PURE__*/Object.freeze({
|
|
@@ -60654,7 +60686,7 @@
|
|
|
60654
60686
|
percentCalc: percentCalc
|
|
60655
60687
|
});
|
|
60656
60688
|
|
|
60657
|
-
const version = "0.9.3-alpha.
|
|
60689
|
+
const version = "0.9.3-alpha.3";
|
|
60658
60690
|
function getIcons() {
|
|
60659
60691
|
return get$1();
|
|
60660
60692
|
}
|