@visactor/vtable 0.24.2-alpha.2 → 0.24.2-alpha.4
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.js +4 -38
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/drill.js +2 -1
- package/cjs/event/media-click.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/tree-helper.js +1 -1
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +9 -18
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +2 -4
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +0 -1
- package/cjs/scenegraph/scenegraph.js +6 -8
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js +4 -4
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/themes/component.js +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +26 -104
- package/dist/vtable.min.js +1 -1
- package/es/core/BaseTable.js +5 -37
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/drill.js +2 -1
- package/es/event/media-click.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/tree-helper.js +1 -1
- package/es/layout/tree-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +9 -18
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +2 -4
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +0 -1
- package/es/scenegraph/scenegraph.js +6 -8
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js +4 -4
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/themes/component.js +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +2 -2
package/cjs/core/BaseTable.js
CHANGED
|
@@ -45,7 +45,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
45
45
|
}
|
|
46
46
|
constructor(container, options = {}) {
|
|
47
47
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48
|
-
if (super(), this.showFrozenIcon = !0, this.version = "0.24.2-alpha.
|
|
48
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.24.2-alpha.4", this.id = `VTable${Date.now()}`,
|
|
49
49
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
50
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
51
51
|
const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
|
|
@@ -1563,31 +1563,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
cellIsInVisualView(col, row) {
|
|
1565
1565
|
const drawRange = this.getDrawRange(), rect = this.getCellRelativeRect(col, row);
|
|
1566
|
-
|
|
1567
|
-
const colHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1568
|
-
start: {
|
|
1569
|
-
col: 0,
|
|
1570
|
-
row: 0
|
|
1571
|
-
},
|
|
1572
|
-
end: {
|
|
1573
|
-
col: this.colCount - 1,
|
|
1574
|
-
row: this.columnHeaderLevelCount
|
|
1575
|
-
}
|
|
1576
|
-
}), rowHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1577
|
-
start: {
|
|
1578
|
-
col: 0,
|
|
1579
|
-
row: 0
|
|
1580
|
-
},
|
|
1581
|
-
end: {
|
|
1582
|
-
col: this.rowHeaderLevelCount,
|
|
1583
|
-
row: this.rowCount - 1
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
if (rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right) {
|
|
1587
|
-
if (this.isHeader(col, row)) return !0;
|
|
1588
|
-
if (drawRange.top >= colHeaderRangeRect.bottom && drawRange.left >= rowHeaderRangeRect.right) return !0;
|
|
1589
|
-
}
|
|
1590
|
-
return !1;
|
|
1566
|
+
return col < this.frozenColCount && row < this.frozenRowCount || rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right;
|
|
1591
1567
|
}
|
|
1592
1568
|
getCustomMergeValue(col, row) {
|
|
1593
1569
|
if (this.internalProps.customMergeCell) {
|
|
@@ -1612,8 +1588,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1612
1588
|
(null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0 && (0,
|
|
1613
1589
|
update_select_border_1.hideCellSelectBorder)(this.scenegraph);
|
|
1614
1590
|
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1615
|
-
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.
|
|
1616
|
-
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.renderSceneGraph();
|
|
1591
|
+
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.renderSceneGraph();
|
|
1617
1592
|
const c = this.scenegraph.stage.toCanvas(!1, (new vutils_1.AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
1618
1593
|
return isInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1619
1594
|
(null === (_d = null === (_c = this.stateManager.select) || void 0 === _c ? void 0 : _c.ranges) || void 0 === _d ? void 0 : _d.length) > 0 && (0,
|
|
@@ -1621,7 +1596,6 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1621
1596
|
c.toDataURL();
|
|
1622
1597
|
}
|
|
1623
1598
|
exportCellRangeImg(cellRange) {
|
|
1624
|
-
var _a, _b, _c, _d;
|
|
1625
1599
|
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, minCol = Math.min(cellRange.start.col, cellRange.end.col), minRow = Math.min(cellRange.start.row, cellRange.end.row), maxCol = Math.max(cellRange.start.col, cellRange.end.col), maxRow = Math.max(cellRange.start.row, cellRange.end.row), isInView = this.cellIsInVisualView(minCol, minRow), isMaxCellInView = this.cellIsInVisualView(maxCol, maxRow);
|
|
1626
1600
|
isInView && isMaxCellInView || this.scrollToCell({
|
|
1627
1601
|
col: minCol,
|
|
@@ -1636,16 +1610,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1636
1610
|
col: maxCol,
|
|
1637
1611
|
row: maxRow
|
|
1638
1612
|
}
|
|
1639
|
-
});
|
|
1640
|
-
(null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0 && (0,
|
|
1641
|
-
update_select_border_1.hideCellSelectBorder)(this.scenegraph);
|
|
1642
|
-
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1643
|
-
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.component.hideVerticalScrollBar(),
|
|
1644
|
-
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.renderSceneGraph();
|
|
1645
|
-
const base64Image = this.scenegraph.stage.toCanvas(!1, (new vutils_1.AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY)).toDataURL();
|
|
1613
|
+
}), base64Image = this.scenegraph.stage.toCanvas(!1, (new vutils_1.AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY)).toDataURL();
|
|
1646
1614
|
return isInView && isMaxCellInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1647
|
-
(null === (_d = null === (_c = this.stateManager.select) || void 0 === _c ? void 0 : _c.ranges) || void 0 === _d ? void 0 : _d.length) > 0 && (0,
|
|
1648
|
-
update_select_border_1.restoreCellSelectBorder)(this.scenegraph), this.stateManager.updateHoverPos(hoverCol, hoverRow),
|
|
1649
1615
|
base64Image;
|
|
1650
1616
|
}
|
|
1651
1617
|
exportCanvas() {
|