@visactor/vtable 1.19.6 → 1.19.8
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/ListTable.js +11 -8
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +2 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +4 -4
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +6 -4
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/menu/dom/MenuHandler.js +42 -4
- package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +1 -0
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -1
- package/cjs/core/BaseTable.js +37 -7
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/data/CachedDataSource.js +1 -1
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/event/event.js +2 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +31 -20
- 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/layout/pivot-header-layout.js +5 -5
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +1 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +2 -2
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +10 -8
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +17 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/resize/update-resize-column.js +1 -1
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/resize/update-resize-row.js +1 -1
- package/cjs/state/resize/update-resize-row.js.map +1 -1
- package/cjs/themes/theme-define.js +4 -0
- package/cjs/themes/theme-define.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +2 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +235 -99
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +11 -8
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +2 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +4 -4
- package/es/PivotTable.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +6 -4
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/menu/dom/MenuHandler.js +42 -4
- package/es/components/menu/dom/MenuHandler.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +1 -0
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -1
- package/es/core/BaseTable.js +37 -7
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/es/core/TABLE_EVENT_TYPE.js +1 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/data/CachedDataSource.js +1 -1
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/event/event.js +1 -3
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +30 -19
- 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/layout/pivot-header-layout.js +5 -5
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +1 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +2 -2
- package/es/layout/tree-helper.js.map +1 -1
- package/es/scenegraph/component/table-component.js +10 -8
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +21 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/resize/update-resize-column.js +1 -1
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/resize/update-resize-row.js +1 -1
- package/es/state/resize/update-resize-row.js.map +1 -1
- package/es/themes/theme-define.js +4 -0
- package/es/themes/theme-define.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +2 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +2 -2
- package/cjs/event/self-event-listener/base-table/right-button-click.d.ts +0 -2
- package/cjs/event/self-event-listener/base-table/right-button-click.js +0 -25
- package/cjs/event/self-event-listener/base-table/right-button-click.js.map +0 -1
- package/es/event/self-event-listener/base-table/right-button-click.d.ts +0 -2
- package/es/event/self-event-listener/base-table/right-button-click.js +0 -17
- package/es/event/self-event-listener/base-table/right-button-click.js.map +0 -1
package/dist/vtable.js
CHANGED
|
@@ -34905,6 +34905,7 @@
|
|
|
34905
34905
|
MOUSEENTER_CELL: 'mouseenter_cell',
|
|
34906
34906
|
MOUSELEAVE_CELL: 'mouseleave_cell',
|
|
34907
34907
|
CONTEXTMENU_CELL: 'contextmenu_cell',
|
|
34908
|
+
CONTEXTMENU_CANVAS: 'contextmenu_canvas',
|
|
34908
34909
|
RESIZE_COLUMN: 'resize_column',
|
|
34909
34910
|
RESIZE_COLUMN_END: 'resize_column_end',
|
|
34910
34911
|
RESIZE_ROW: 'resize_row',
|
|
@@ -36402,6 +36403,9 @@
|
|
|
36402
36403
|
},
|
|
36403
36404
|
get verticalPadding() {
|
|
36404
36405
|
return scroll.verticalPadding ?? 0;
|
|
36406
|
+
},
|
|
36407
|
+
get ignoreFrozenCols() {
|
|
36408
|
+
return scroll.ignoreFrozenCols ?? false;
|
|
36405
36409
|
}
|
|
36406
36410
|
};
|
|
36407
36411
|
}
|
|
@@ -39769,8 +39773,8 @@
|
|
|
39769
39773
|
if (isValid$3(newRecord)) {
|
|
39770
39774
|
newRecord.hierarchyState = oldSource[i].hierarchyState;
|
|
39771
39775
|
}
|
|
39772
|
-
if (isArray$7(oldRecord
|
|
39773
|
-
isArray$7(newRecord
|
|
39776
|
+
if (isArray$7(oldRecord?.children) &&
|
|
39777
|
+
isArray$7(newRecord?.children) &&
|
|
39774
39778
|
oldRecord.map.size !== 0 &&
|
|
39775
39779
|
newRecord.map.size !== 0) {
|
|
39776
39780
|
syncGroupCollapseState(oldRecord.children, newRecord.children, oldRecord.map, newRecord.map);
|
|
@@ -46422,19 +46426,19 @@
|
|
|
46422
46426
|
const visible1 = theme.scrollStyle?.visible;
|
|
46423
46427
|
const horizontalVisible = theme.scrollStyle?.horizontalVisible ?? visible1;
|
|
46424
46428
|
const verticalVisible = theme.scrollStyle?.verticalVisible ?? visible1;
|
|
46425
|
-
const tableWidth = Math.ceil(this.table.
|
|
46426
|
-
const tableHeight = Math.ceil(this.table.
|
|
46429
|
+
const tableWidth = Math.ceil(this.table.tableNoFrameWidth);
|
|
46430
|
+
const tableHeight = Math.ceil(this.table.tableNoFrameHeight);
|
|
46427
46431
|
const totalHeight = this.table.getAllRowsHeight();
|
|
46428
46432
|
const totalWidth = this.table.getAllColsWidth();
|
|
46429
46433
|
const frozenRowsHeight = this.table.getFrozenRowsHeight();
|
|
46430
46434
|
const frozenColsWidth = this.table.getFrozenColsWidth();
|
|
46431
46435
|
const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();
|
|
46432
46436
|
const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();
|
|
46437
|
+
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
46433
46438
|
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
46434
46439
|
if (totalWidth > tableWidth + sizeTolerance) {
|
|
46435
46440
|
const y = Math.min(tableHeight, totalHeight);
|
|
46436
46441
|
const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));
|
|
46437
|
-
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
46438
46442
|
let attrY = 0;
|
|
46439
46443
|
if (this.table.theme.scrollStyle.barToSide) {
|
|
46440
46444
|
attrY =
|
|
@@ -46445,10 +46449,21 @@
|
|
|
46445
46449
|
else {
|
|
46446
46450
|
attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
46447
46451
|
}
|
|
46452
|
+
let hScrollBarx = frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
|
|
46453
|
+
let hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
46454
|
+
const ignoreFrozenCols = this.table.theme.scrollStyle?.ignoreFrozenCols ?? false;
|
|
46455
|
+
if (ignoreFrozenCols) {
|
|
46456
|
+
hScrollBarx = !hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0;
|
|
46457
|
+
hScrollBarWidth = tableWidth;
|
|
46458
|
+
}
|
|
46459
|
+
else {
|
|
46460
|
+
hScrollBarx = frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
|
|
46461
|
+
hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
46462
|
+
}
|
|
46448
46463
|
this.hScrollBar.setAttributes({
|
|
46449
|
-
x:
|
|
46464
|
+
x: hScrollBarx,
|
|
46450
46465
|
y: attrY,
|
|
46451
|
-
width:
|
|
46466
|
+
width: hScrollBarWidth,
|
|
46452
46467
|
range: [0, rangeEnd],
|
|
46453
46468
|
visible: horizontalVisible === 'always'
|
|
46454
46469
|
});
|
|
@@ -46473,7 +46488,6 @@
|
|
|
46473
46488
|
const x = Math.min(tableWidth, totalWidth);
|
|
46474
46489
|
const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));
|
|
46475
46490
|
let attrX = 0;
|
|
46476
|
-
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
46477
46491
|
if (this.table.theme.scrollStyle.barToSide) {
|
|
46478
46492
|
attrX =
|
|
46479
46493
|
this.table.tableNoFrameWidth -
|
|
@@ -49783,6 +49797,9 @@
|
|
|
49783
49797
|
else if (columnGroup.colHeight) {
|
|
49784
49798
|
y = columnGroup.colHeight;
|
|
49785
49799
|
}
|
|
49800
|
+
else if (rowStart >= table.columnHeaderLevelCount && rowStart < table.rowCount - table.bottomFrozenRowCount) {
|
|
49801
|
+
y = table.getRowsHeight(table.columnHeaderLevelCount, rowStart - 1);
|
|
49802
|
+
}
|
|
49786
49803
|
for (let j = rowStart; j <= rowEnd; j++) {
|
|
49787
49804
|
const row = j;
|
|
49788
49805
|
let cellLocation = table.getCellLocation(col, row);
|
|
@@ -54789,6 +54806,22 @@
|
|
|
54789
54806
|
this.isPivot = this.table.isPivotTable();
|
|
54790
54807
|
initSceneGraph(this);
|
|
54791
54808
|
}
|
|
54809
|
+
canvasShowMenu() {
|
|
54810
|
+
this.stage.addEventListener('rightdown', (e) => {
|
|
54811
|
+
const eventArgsSet = getCellEventArgsSet(e);
|
|
54812
|
+
if (!eventArgsSet.eventArgs) {
|
|
54813
|
+
this.table.stateManager.triggerContextMenu(-1, -1, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
54814
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, {
|
|
54815
|
+
event: e,
|
|
54816
|
+
x: eventArgsSet.abstractPos.x,
|
|
54817
|
+
y: eventArgsSet.abstractPos.y,
|
|
54818
|
+
col: -1,
|
|
54819
|
+
row: -1,
|
|
54820
|
+
target: undefined
|
|
54821
|
+
});
|
|
54822
|
+
}
|
|
54823
|
+
});
|
|
54824
|
+
}
|
|
54792
54825
|
clearCells() {
|
|
54793
54826
|
this.table.animationManager.clear();
|
|
54794
54827
|
if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
|
|
@@ -55635,6 +55668,9 @@
|
|
|
55635
55668
|
if (this.table.options.animationAppear) {
|
|
55636
55669
|
dealWithAnimationAppear(this.table);
|
|
55637
55670
|
}
|
|
55671
|
+
if (this.table.options.menu?.contextMenuWorkOnlyCell === false) {
|
|
55672
|
+
this.canvasShowMenu();
|
|
55673
|
+
}
|
|
55638
55674
|
this.updateNextFrame();
|
|
55639
55675
|
}
|
|
55640
55676
|
dealWidthMode() {
|
|
@@ -57485,6 +57521,7 @@
|
|
|
57485
57521
|
}
|
|
57486
57522
|
state.columnResize.x = xInTable;
|
|
57487
57523
|
state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen);
|
|
57524
|
+
state.table._updateSize();
|
|
57488
57525
|
if (state.columnResize.col < state.table.frozenColCount &&
|
|
57489
57526
|
!state.table.isPivotTable() &&
|
|
57490
57527
|
!state.table.transpose) {
|
|
@@ -58143,6 +58180,7 @@
|
|
|
58143
58180
|
}
|
|
58144
58181
|
state.rowResize.y = yInTable;
|
|
58145
58182
|
state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen);
|
|
58183
|
+
state.table._updateSize();
|
|
58146
58184
|
state.table.scenegraph.updateNextFrame();
|
|
58147
58185
|
}
|
|
58148
58186
|
function updateResizeColForRow(detaY, state) {
|
|
@@ -60295,40 +60333,63 @@
|
|
|
60295
60333
|
if (eventArgsSet.eventArgs) {
|
|
60296
60334
|
stateManager.triggerContextMenu(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
60297
60335
|
const { col, row } = eventArgsSet.eventArgs;
|
|
60298
|
-
if (
|
|
60299
|
-
const
|
|
60300
|
-
let
|
|
60301
|
-
|
|
60302
|
-
|
|
60303
|
-
|
|
60304
|
-
|
|
60305
|
-
|
|
60306
|
-
|
|
60336
|
+
if (col >= 0 && row >= 0) {
|
|
60337
|
+
const ranges = table.getSelectedCellRanges();
|
|
60338
|
+
let cellInRange = false;
|
|
60339
|
+
if (ranges.length > 0) {
|
|
60340
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
60341
|
+
const range = ranges[i];
|
|
60342
|
+
const startCol = range.start.col;
|
|
60343
|
+
const endCol = range.end.col;
|
|
60344
|
+
const startRow = range.start.row;
|
|
60345
|
+
const endRow = range.end.row;
|
|
60346
|
+
if ((col >= startCol && col <= endCol && row >= startRow && row <= endRow) ||
|
|
60347
|
+
(col >= endCol && col <= startCol && row >= endRow && row <= startRow) ||
|
|
60348
|
+
(col >= startCol && col <= endCol && row >= endRow && row <= startRow) ||
|
|
60349
|
+
(col >= endCol && col <= startCol && row >= startRow && row <= endRow)) {
|
|
60350
|
+
cellInRange = true;
|
|
60351
|
+
break;
|
|
60352
|
+
}
|
|
60307
60353
|
}
|
|
60308
60354
|
}
|
|
60309
|
-
|
|
60310
|
-
|
|
60311
|
-
|
|
60312
|
-
|
|
60313
|
-
|
|
60314
|
-
|
|
60315
|
-
|
|
60316
|
-
|
|
60317
|
-
|
|
60355
|
+
if (!cellInRange) {
|
|
60356
|
+
table.selectCell(col, row);
|
|
60357
|
+
}
|
|
60358
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
|
|
60359
|
+
const cellInfo = table.getCellInfo(col, row);
|
|
60360
|
+
let icon;
|
|
60361
|
+
let position;
|
|
60362
|
+
if (eventArgsSet.eventArgs?.target) {
|
|
60363
|
+
const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);
|
|
60364
|
+
if (iconInfo) {
|
|
60365
|
+
icon = iconInfo.icon;
|
|
60366
|
+
position = iconInfo.position;
|
|
60318
60367
|
}
|
|
60319
|
-
: undefined,
|
|
60320
|
-
target: eventArgsSet?.eventArgs?.target,
|
|
60321
|
-
mergeCellInfo: eventArgsSet.eventArgs?.mergeInfo
|
|
60322
|
-
};
|
|
60323
|
-
if (table.options.eventOptions?.contextmenuReturnAllSelectedCells ?? true) {
|
|
60324
|
-
if (cellInRanges(table.stateManager.select.ranges, col, row)) {
|
|
60325
|
-
cellsEvent.cells = table.getSelectedCellInfos();
|
|
60326
60368
|
}
|
|
60327
|
-
|
|
60328
|
-
|
|
60369
|
+
const cellsEvent = {
|
|
60370
|
+
...cellInfo,
|
|
60371
|
+
event: e.nativeEvent,
|
|
60372
|
+
cells: [],
|
|
60373
|
+
targetIcon: icon
|
|
60374
|
+
? {
|
|
60375
|
+
name: icon.name,
|
|
60376
|
+
position: position,
|
|
60377
|
+
funcType: icon.attribute.funcType
|
|
60378
|
+
}
|
|
60379
|
+
: undefined,
|
|
60380
|
+
target: eventArgsSet?.eventArgs?.target,
|
|
60381
|
+
mergeCellInfo: eventArgsSet.eventArgs?.mergeInfo
|
|
60382
|
+
};
|
|
60383
|
+
if (table.options.eventOptions?.contextmenuReturnAllSelectedCells ?? true) {
|
|
60384
|
+
if (cellInRanges(table.stateManager.select.ranges, col, row)) {
|
|
60385
|
+
cellsEvent.cells = table.getSelectedCellInfos();
|
|
60386
|
+
}
|
|
60387
|
+
else {
|
|
60388
|
+
cellsEvent.cells = [[cellInfo]];
|
|
60389
|
+
}
|
|
60329
60390
|
}
|
|
60391
|
+
table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);
|
|
60330
60392
|
}
|
|
60331
|
-
table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);
|
|
60332
60393
|
}
|
|
60333
60394
|
}
|
|
60334
60395
|
});
|
|
@@ -62153,33 +62214,6 @@
|
|
|
62153
62214
|
});
|
|
62154
62215
|
}
|
|
62155
62216
|
|
|
62156
|
-
function rightButtonClickEvent(table) {
|
|
62157
|
-
table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, e => {
|
|
62158
|
-
const { col, row } = e;
|
|
62159
|
-
const ranges = table.getSelectedCellRanges();
|
|
62160
|
-
let cellInRange = false;
|
|
62161
|
-
if (ranges.length > 0) {
|
|
62162
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
62163
|
-
const range = ranges[i];
|
|
62164
|
-
const startCol = range.start.col;
|
|
62165
|
-
const endCol = range.end.col;
|
|
62166
|
-
const startRow = range.start.row;
|
|
62167
|
-
const endRow = range.end.row;
|
|
62168
|
-
if ((col >= startCol && col <= endCol && row >= startRow && row <= endRow) ||
|
|
62169
|
-
(col >= endCol && col <= startCol && row >= endRow && row <= startRow) ||
|
|
62170
|
-
(col >= startCol && col <= endCol && row >= endRow && row <= startRow) ||
|
|
62171
|
-
(col >= endCol && col <= startCol && row >= startRow && row <= endRow)) {
|
|
62172
|
-
cellInRange = true;
|
|
62173
|
-
break;
|
|
62174
|
-
}
|
|
62175
|
-
}
|
|
62176
|
-
}
|
|
62177
|
-
if (!cellInRange) {
|
|
62178
|
-
table.selectCell(col, row);
|
|
62179
|
-
}
|
|
62180
|
-
});
|
|
62181
|
-
}
|
|
62182
|
-
|
|
62183
62217
|
class EventManager {
|
|
62184
62218
|
table;
|
|
62185
62219
|
isTouchdown;
|
|
@@ -62264,7 +62298,6 @@
|
|
|
62264
62298
|
bindGroupCheckboxTreeChange(this.table);
|
|
62265
62299
|
bindHeaderCheckboxChange(this.table);
|
|
62266
62300
|
bindButtonClickEvent(this.table);
|
|
62267
|
-
rightButtonClickEvent(this.table);
|
|
62268
62301
|
}
|
|
62269
62302
|
dealTableHover(eventArgsSet) {
|
|
62270
62303
|
if (!eventArgsSet) {
|
|
@@ -63337,6 +63370,9 @@
|
|
|
63337
63370
|
const rect = table.getCellRangeRelativeRect({ col, row });
|
|
63338
63371
|
const element = table.internalProps.menu.parentElement ?? table.getElement();
|
|
63339
63372
|
const { top, bottom, left, right } = rect;
|
|
63373
|
+
if (col === -1 && row === -1) {
|
|
63374
|
+
return true;
|
|
63375
|
+
}
|
|
63340
63376
|
if (table.isFrozenCell(col, row)) {
|
|
63341
63377
|
return true;
|
|
63342
63378
|
}
|
|
@@ -64928,22 +64964,24 @@
|
|
|
64928
64964
|
}
|
|
64929
64965
|
}
|
|
64930
64966
|
function generateLayoutTree(tree, children) {
|
|
64931
|
-
|
|
64932
|
-
|
|
64933
|
-
|
|
64934
|
-
|
|
64935
|
-
|
|
64936
|
-
|
|
64937
|
-
|
|
64938
|
-
|
|
64939
|
-
|
|
64940
|
-
|
|
64941
|
-
|
|
64942
|
-
|
|
64943
|
-
|
|
64944
|
-
|
|
64945
|
-
|
|
64946
|
-
|
|
64967
|
+
if (Array.isArray(children)) {
|
|
64968
|
+
children?.forEach((node) => {
|
|
64969
|
+
const diemnsonNode = {
|
|
64970
|
+
dimensionKey: node.dimensionKey,
|
|
64971
|
+
indicatorKey: node.indicatorKey,
|
|
64972
|
+
value: node.value,
|
|
64973
|
+
hierarchyState: node.hierarchyState,
|
|
64974
|
+
children: undefined,
|
|
64975
|
+
virtual: node.virtual ?? false,
|
|
64976
|
+
levelSpan: node.levelSpan ?? 1
|
|
64977
|
+
};
|
|
64978
|
+
tree.push(diemnsonNode);
|
|
64979
|
+
if (node.children) {
|
|
64980
|
+
diemnsonNode.children = [];
|
|
64981
|
+
generateLayoutTree(diemnsonNode.children, node.children);
|
|
64982
|
+
}
|
|
64983
|
+
});
|
|
64984
|
+
}
|
|
64947
64985
|
}
|
|
64948
64986
|
function countLayoutTree(children, countParentNode) {
|
|
64949
64987
|
let count = 0;
|
|
@@ -67226,7 +67264,7 @@
|
|
|
67226
67264
|
return TABLE_EVENT_TYPE;
|
|
67227
67265
|
}
|
|
67228
67266
|
options;
|
|
67229
|
-
version = "1.19.
|
|
67267
|
+
version = "1.19.8";
|
|
67230
67268
|
pagination;
|
|
67231
67269
|
id = `VTable${Date.now()}`;
|
|
67232
67270
|
headerStyleCache;
|
|
@@ -67918,8 +67956,17 @@
|
|
|
67918
67956
|
widthP = this.canvasWidth - 1;
|
|
67919
67957
|
heightP = this.canvasHeight - 1;
|
|
67920
67958
|
}
|
|
67921
|
-
const
|
|
67922
|
-
|
|
67959
|
+
const scrollStyle = this.getTheme().scrollStyle;
|
|
67960
|
+
let vScrollBarWidth = 0;
|
|
67961
|
+
let hScrollBarWidth = 0;
|
|
67962
|
+
vScrollBarWidth = this.shouldVScrollBarWidthShow(widthP, heightP, scrollStyle)
|
|
67963
|
+
? getVerticalScrollBarSize(scrollStyle)
|
|
67964
|
+
: 0;
|
|
67965
|
+
hScrollBarWidth = this.shouldHScrollBarWidthShow(widthP, heightP, scrollStyle)
|
|
67966
|
+
? getHorizontalScrollBarSize(scrollStyle)
|
|
67967
|
+
: 0;
|
|
67968
|
+
const width = Math.floor(widthP - vScrollBarWidth);
|
|
67969
|
+
const height = Math.floor(heightP - hScrollBarWidth);
|
|
67923
67970
|
if (this.internalProps.theme?.frameStyle) {
|
|
67924
67971
|
const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
67925
67972
|
const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
|
|
@@ -67932,15 +67979,67 @@
|
|
|
67932
67979
|
else {
|
|
67933
67980
|
this.tableX = (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
|
|
67934
67981
|
this.tableY = (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
|
|
67982
|
+
const rightBorder = (lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0);
|
|
67935
67983
|
this.tableNoFrameWidth =
|
|
67936
|
-
width -
|
|
67984
|
+
width -
|
|
67985
|
+
(rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) -
|
|
67986
|
+
((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
|
|
67987
|
+
const bottomBorder = (lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0);
|
|
67937
67988
|
this.tableNoFrameHeight =
|
|
67938
|
-
height -
|
|
67989
|
+
height -
|
|
67990
|
+
(bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) -
|
|
67991
|
+
((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0));
|
|
67939
67992
|
}
|
|
67940
67993
|
}
|
|
67941
67994
|
this._clearColRangeWidthsMap();
|
|
67942
67995
|
this._clearRowRangeHeightsMap();
|
|
67943
67996
|
}
|
|
67997
|
+
shouldVScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
|
|
67998
|
+
if (scrollStyle.hoverOn || scrollStyle.visible === 'none') {
|
|
67999
|
+
return false;
|
|
68000
|
+
}
|
|
68001
|
+
const totalHeight = this.getAllRowsHeight();
|
|
68002
|
+
const sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
|
|
68003
|
+
const isHScrollBarDecideVScrollBar = totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight;
|
|
68004
|
+
if (isHScrollBarDecideVScrollBar) {
|
|
68005
|
+
const totalWidth = this.getAllColsWidth();
|
|
68006
|
+
const sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
|
|
68007
|
+
const isVScrollBarDecideHScrollBar = totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth;
|
|
68008
|
+
if (isVScrollBarDecideHScrollBar) {
|
|
68009
|
+
return false;
|
|
68010
|
+
}
|
|
68011
|
+
if (totalWidth > tableWidth) {
|
|
68012
|
+
return true;
|
|
68013
|
+
}
|
|
68014
|
+
if (totalWidth <= tableWidth - sizeTolerance) {
|
|
68015
|
+
return false;
|
|
68016
|
+
}
|
|
68017
|
+
}
|
|
68018
|
+
return !(totalHeight <= tableHeight - sizeTolerance);
|
|
68019
|
+
}
|
|
68020
|
+
shouldHScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
|
|
68021
|
+
if (scrollStyle.hoverOn || scrollStyle.visible === 'none') {
|
|
68022
|
+
return false;
|
|
68023
|
+
}
|
|
68024
|
+
const totalWidth = this.getAllColsWidth();
|
|
68025
|
+
const sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
|
|
68026
|
+
const isVScrollBarDecideHScrollBar = totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth;
|
|
68027
|
+
if (isVScrollBarDecideHScrollBar) {
|
|
68028
|
+
const totalHeight = this.getAllRowsHeight();
|
|
68029
|
+
const sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
|
|
68030
|
+
const isHScrollBarDecideVScrollBar = totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight;
|
|
68031
|
+
if (isHScrollBarDecideVScrollBar) {
|
|
68032
|
+
return false;
|
|
68033
|
+
}
|
|
68034
|
+
if (totalHeight > tableHeight) {
|
|
68035
|
+
return true;
|
|
68036
|
+
}
|
|
68037
|
+
if (totalHeight <= tableHeight - sizeTolerance) {
|
|
68038
|
+
return false;
|
|
68039
|
+
}
|
|
68040
|
+
}
|
|
68041
|
+
return !(totalWidth <= tableWidth - sizeTolerance);
|
|
68042
|
+
}
|
|
67944
68043
|
updateViewBox(newViewBox) {
|
|
67945
68044
|
const oldWidth = (this.options?.viewBox?.x2 ?? 0) - (this.options?.viewBox?.x1 ?? 0);
|
|
67946
68045
|
const oldHeight = (this.options?.viewBox?.y2 ?? 0) - (this.options?.viewBox?.y1 ?? 0);
|
|
@@ -73075,7 +73174,7 @@
|
|
|
73075
73174
|
}
|
|
73076
73175
|
const expand = !hd.hierarchyState || hd.hierarchyState === HierarchyState.expand;
|
|
73077
73176
|
if (!!hd.columns && !!expand) {
|
|
73078
|
-
const isAllHided = hd.columns.every((c) => c.hide);
|
|
73177
|
+
const isAllHided = hd.columns.every((c) => c.hide) || hd.hide;
|
|
73079
73178
|
!isAllHided &&
|
|
73080
73179
|
this._addHeaders(maxRow + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader, hd.levelSpan).forEach(c => results.push(c));
|
|
73081
73180
|
}
|
|
@@ -74649,7 +74748,6 @@
|
|
|
74649
74748
|
if (options.title) {
|
|
74650
74749
|
const Title = Factory.getComponent('title');
|
|
74651
74750
|
internalProps.title = new Title(options.title, this);
|
|
74652
|
-
this.scenegraph.resize();
|
|
74653
74751
|
}
|
|
74654
74752
|
if (this.options.emptyTip) {
|
|
74655
74753
|
if (this.internalProps.emptyTip) {
|
|
@@ -74666,6 +74764,7 @@
|
|
|
74666
74764
|
this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
|
|
74667
74765
|
}
|
|
74668
74766
|
setTimeout(() => {
|
|
74767
|
+
this.resize();
|
|
74669
74768
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
74670
74769
|
}, 0);
|
|
74671
74770
|
}
|
|
@@ -74724,6 +74823,7 @@
|
|
|
74724
74823
|
this.headerStyleCache = new Map();
|
|
74725
74824
|
this.bodyStyleCache = new Map();
|
|
74726
74825
|
this.bodyBottomStyleCache = new Map();
|
|
74826
|
+
this._updateSize();
|
|
74727
74827
|
this.scenegraph.createSceneGraph();
|
|
74728
74828
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
74729
74829
|
this.renderAsync();
|
|
@@ -75055,6 +75155,9 @@
|
|
|
75055
75155
|
table.colCount = layoutMap.colCount ?? 0;
|
|
75056
75156
|
table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
|
|
75057
75157
|
this.internalProps.frozenColCount = this.options.frozenColCount ?? 0;
|
|
75158
|
+
if (this.options.frozenColCount >= this.colCount) {
|
|
75159
|
+
this.internalProps.frozenColCount = 0;
|
|
75160
|
+
}
|
|
75058
75161
|
table.frozenRowCount = Math.max(layoutMap.headerLevelCount, this.options.frozenRowCount ?? 0);
|
|
75059
75162
|
if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
|
|
75060
75163
|
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
@@ -75385,6 +75488,7 @@
|
|
|
75385
75488
|
this.refreshRowColCount();
|
|
75386
75489
|
this.stateManager.initCheckedState(this.records);
|
|
75387
75490
|
this.scenegraph.createSceneGraph();
|
|
75491
|
+
this.resize();
|
|
75388
75492
|
}
|
|
75389
75493
|
getCheckboxState(field) {
|
|
75390
75494
|
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount) {
|
|
@@ -75499,11 +75603,11 @@
|
|
|
75499
75603
|
this.clearCellStyleCache();
|
|
75500
75604
|
this.scenegraph.createSceneGraph();
|
|
75501
75605
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
75606
|
+
this._updateSize();
|
|
75502
75607
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
75503
|
-
this._updateSize();
|
|
75504
75608
|
this.internalProps.title.resize();
|
|
75505
|
-
this.scenegraph.resize();
|
|
75506
75609
|
}
|
|
75610
|
+
this.scenegraph.resize();
|
|
75507
75611
|
if (this.options.emptyTip) {
|
|
75508
75612
|
if (this.internalProps.emptyTip) {
|
|
75509
75613
|
this.internalProps.emptyTip?.resetVisible();
|
|
@@ -77802,10 +77906,11 @@
|
|
|
77802
77906
|
if (!this.legendComponent || this.visible === false) {
|
|
77803
77907
|
return;
|
|
77804
77908
|
}
|
|
77805
|
-
this.
|
|
77806
|
-
|
|
77807
|
-
|
|
77909
|
+
const attrs = this.getLegendAttributes({
|
|
77910
|
+
width: this.table.tableNoFrameWidth,
|
|
77911
|
+
height: this.table.tableNoFrameHeight
|
|
77808
77912
|
});
|
|
77913
|
+
this.legendComponent.setAttributes(attrs);
|
|
77809
77914
|
this.adjustTableSize(this.legendComponent.attribute);
|
|
77810
77915
|
}
|
|
77811
77916
|
adjustTableSize(attrs) {
|
|
@@ -78495,6 +78600,19 @@
|
|
|
78495
78600
|
}
|
|
78496
78601
|
};
|
|
78497
78602
|
function getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions) {
|
|
78603
|
+
if (col === -1 && row === -1 && type === 'context-menu') {
|
|
78604
|
+
if (dropDownMenuOptions?.content) {
|
|
78605
|
+
return {
|
|
78606
|
+
type,
|
|
78607
|
+
position: dropDownMenuOptions.position,
|
|
78608
|
+
referencePosition: dropDownMenuOptions.referencePosition ?? {
|
|
78609
|
+
rect: { left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0 }
|
|
78610
|
+
},
|
|
78611
|
+
content: dropDownMenuOptions.content
|
|
78612
|
+
};
|
|
78613
|
+
}
|
|
78614
|
+
return null;
|
|
78615
|
+
}
|
|
78498
78616
|
const { lineHeight, textBaseline, textStick } = table._getCellStyle(col, row);
|
|
78499
78617
|
let rect = table.getCellRangeRelativeRect(table.getCellRange(col, row));
|
|
78500
78618
|
if (textStick) {
|
|
@@ -78577,7 +78695,9 @@
|
|
|
78577
78695
|
const { instance, info: menuInstanceInfo } = instanceInfo;
|
|
78578
78696
|
const attach = instance && instance.bindMenuElement(col, row, menuInstanceInfo);
|
|
78579
78697
|
if (attach) {
|
|
78580
|
-
const range =
|
|
78698
|
+
const range = col === -1 && row === -1
|
|
78699
|
+
? { start: { col: -1, row: -1 }, end: { col: -1, row: -1 } }
|
|
78700
|
+
: this._table.getCellRange(col, row);
|
|
78581
78701
|
this._attachInfo = { range, instance };
|
|
78582
78702
|
}
|
|
78583
78703
|
}
|
|
@@ -78638,6 +78758,22 @@
|
|
|
78638
78758
|
});
|
|
78639
78759
|
}
|
|
78640
78760
|
});
|
|
78761
|
+
table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, e => {
|
|
78762
|
+
if (table.internalProps.menu?.renderMode === 'html') {
|
|
78763
|
+
const abstractPos = table._getMouseAbstractPoint(e.event);
|
|
78764
|
+
let menu = null;
|
|
78765
|
+
if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {
|
|
78766
|
+
menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row), e.row, e.col, table);
|
|
78767
|
+
}
|
|
78768
|
+
else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {
|
|
78769
|
+
menu = table.internalProps.menu?.contextMenuItems;
|
|
78770
|
+
}
|
|
78771
|
+
this._bindToCell(-1, -1, 'context-menu', {
|
|
78772
|
+
content: menu,
|
|
78773
|
+
position: { x: abstractPos.x, y: abstractPos.y }
|
|
78774
|
+
});
|
|
78775
|
+
}
|
|
78776
|
+
});
|
|
78641
78777
|
}
|
|
78642
78778
|
_getMenuInstanceInfo(col, row, type, dropDownMenuOptions) {
|
|
78643
78779
|
const table = this._table;
|
|
@@ -84737,10 +84873,10 @@
|
|
|
84737
84873
|
needLowestLevel_colPaths = true;
|
|
84738
84874
|
needLowestLevel_rowPaths = true;
|
|
84739
84875
|
}
|
|
84740
|
-
if (colHeaderPaths.length >= this._getColumnHeaderTreeExpandedMaxLevelCount()) {
|
|
84876
|
+
if ((colHeaderPaths?.length ?? 0) && colHeaderPaths.length >= this._getColumnHeaderTreeExpandedMaxLevelCount()) {
|
|
84741
84877
|
needLowestLevel_colPaths = true;
|
|
84742
84878
|
}
|
|
84743
|
-
if (rowHeaderPaths.length >= this._getRowHeaderTreeExpandedMaxLevelCount()) {
|
|
84879
|
+
if ((rowHeaderPaths?.length ?? 0) && rowHeaderPaths.length >= this._getRowHeaderTreeExpandedMaxLevelCount()) {
|
|
84744
84880
|
needLowestLevel_rowPaths = true;
|
|
84745
84881
|
}
|
|
84746
84882
|
let col;
|
|
@@ -87789,7 +87925,6 @@
|
|
|
87789
87925
|
if (options.title) {
|
|
87790
87926
|
const Title = Factory.getComponent('title');
|
|
87791
87927
|
this.internalProps.title = new Title(options.title, this);
|
|
87792
|
-
this.scenegraph.resize();
|
|
87793
87928
|
}
|
|
87794
87929
|
if (this.options.emptyTip) {
|
|
87795
87930
|
if (this.internalProps.emptyTip) {
|
|
@@ -87802,6 +87937,7 @@
|
|
|
87802
87937
|
}
|
|
87803
87938
|
}
|
|
87804
87939
|
setTimeout(() => {
|
|
87940
|
+
this.resize();
|
|
87805
87941
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
87806
87942
|
}, 0);
|
|
87807
87943
|
}
|
|
@@ -88040,7 +88176,7 @@
|
|
|
88040
88176
|
if (sourceNode.value === targetNode.value && sourceNode.dimensionKey === targetNode.dimensionKey) {
|
|
88041
88177
|
targetNode.hierarchyState =
|
|
88042
88178
|
targetNode.hierarchyState ?? (targetNode?.children ? sourceNode.hierarchyState : undefined);
|
|
88043
|
-
targetNode?.children?.forEach((targetChildNode, index) => {
|
|
88179
|
+
targetNode?.children?.forEach?.((targetChildNode, index) => {
|
|
88044
88180
|
if (sourceNode?.children?.[index] && targetChildNode) {
|
|
88045
88181
|
const beforeRowDimension = sourceNode.children.find((item) => item.dimensionKey === targetChildNode.dimensionKey && item.value === targetChildNode.value);
|
|
88046
88182
|
if (beforeRowDimension) {
|
|
@@ -89479,7 +89615,6 @@
|
|
|
89479
89615
|
if (options.title) {
|
|
89480
89616
|
const Title = Factory.getComponent('title');
|
|
89481
89617
|
this.internalProps.title = new Title(options.title, this);
|
|
89482
|
-
this.scenegraph.resize();
|
|
89483
89618
|
}
|
|
89484
89619
|
if (this.options.emptyTip) {
|
|
89485
89620
|
if (this.internalProps.emptyTip) {
|
|
@@ -89492,6 +89627,7 @@
|
|
|
89492
89627
|
}
|
|
89493
89628
|
}
|
|
89494
89629
|
setTimeout(() => {
|
|
89630
|
+
this.resize();
|
|
89495
89631
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
89496
89632
|
}, 0);
|
|
89497
89633
|
}
|
|
@@ -91050,7 +91186,7 @@
|
|
|
91050
91186
|
}
|
|
91051
91187
|
|
|
91052
91188
|
registerForVrender();
|
|
91053
|
-
const version = "1.19.
|
|
91189
|
+
const version = "1.19.8";
|
|
91054
91190
|
function getIcons() {
|
|
91055
91191
|
return get$2();
|
|
91056
91192
|
}
|