@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/es/core/BaseTable.js
CHANGED
|
@@ -82,7 +82,7 @@ export class BaseTable extends EventTarget {
|
|
|
82
82
|
}
|
|
83
83
|
constructor(container, options = {}) {
|
|
84
84
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
85
|
-
if (super(), this.showFrozenIcon = !0, this.version = "0.24.2-alpha.
|
|
85
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.24.2-alpha.4", this.id = `VTable${Date.now()}`,
|
|
86
86
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
87
87
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
88
88
|
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 = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
|
|
@@ -1592,31 +1592,7 @@ export class BaseTable extends EventTarget {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
cellIsInVisualView(col, row) {
|
|
1594
1594
|
const drawRange = this.getDrawRange(), rect = this.getCellRelativeRect(col, row);
|
|
1595
|
-
|
|
1596
|
-
const colHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1597
|
-
start: {
|
|
1598
|
-
col: 0,
|
|
1599
|
-
row: 0
|
|
1600
|
-
},
|
|
1601
|
-
end: {
|
|
1602
|
-
col: this.colCount - 1,
|
|
1603
|
-
row: this.columnHeaderLevelCount
|
|
1604
|
-
}
|
|
1605
|
-
}), rowHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1606
|
-
start: {
|
|
1607
|
-
col: 0,
|
|
1608
|
-
row: 0
|
|
1609
|
-
},
|
|
1610
|
-
end: {
|
|
1611
|
-
col: this.rowHeaderLevelCount,
|
|
1612
|
-
row: this.rowCount - 1
|
|
1613
|
-
}
|
|
1614
|
-
});
|
|
1615
|
-
if (rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right) {
|
|
1616
|
-
if (this.isHeader(col, row)) return !0;
|
|
1617
|
-
if (drawRange.top >= colHeaderRangeRect.bottom && drawRange.left >= rowHeaderRangeRect.right) return !0;
|
|
1618
|
-
}
|
|
1619
|
-
return !1;
|
|
1595
|
+
return col < this.frozenColCount && row < this.frozenRowCount || rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right;
|
|
1620
1596
|
}
|
|
1621
1597
|
getCustomMergeValue(col, row) {
|
|
1622
1598
|
if (this.internalProps.customMergeCell) {
|
|
@@ -1640,15 +1616,13 @@ export class BaseTable extends EventTarget {
|
|
|
1640
1616
|
const cellRect = this.getCellRelativeRect(col, row);
|
|
1641
1617
|
(null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0 && hideCellSelectBorder(this.scenegraph);
|
|
1642
1618
|
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1643
|
-
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.
|
|
1644
|
-
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.renderSceneGraph();
|
|
1619
|
+
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.renderSceneGraph();
|
|
1645
1620
|
const c = this.scenegraph.stage.toCanvas(!1, (new AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
1646
1621
|
return isInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1647
1622
|
(null === (_d = null === (_c = this.stateManager.select) || void 0 === _c ? void 0 : _c.ranges) || void 0 === _d ? void 0 : _d.length) > 0 && restoreCellSelectBorder(this.scenegraph),
|
|
1648
1623
|
this.stateManager.updateHoverPos(hoverCol, hoverRow), c.toDataURL();
|
|
1649
1624
|
}
|
|
1650
1625
|
exportCellRangeImg(cellRange) {
|
|
1651
|
-
var _a, _b, _c, _d;
|
|
1652
1626
|
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);
|
|
1653
1627
|
isInView && isMaxCellInView || this.scrollToCell({
|
|
1654
1628
|
col: minCol,
|
|
@@ -1663,15 +1637,9 @@ export class BaseTable extends EventTarget {
|
|
|
1663
1637
|
col: maxCol,
|
|
1664
1638
|
row: maxRow
|
|
1665
1639
|
}
|
|
1666
|
-
});
|
|
1667
|
-
(null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0 && hideCellSelectBorder(this.scenegraph);
|
|
1668
|
-
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1669
|
-
this.stateManager.updateHoverPos(-1, -1), this.scenegraph.component.hideVerticalScrollBar(),
|
|
1670
|
-
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.renderSceneGraph();
|
|
1671
|
-
const base64Image = this.scenegraph.stage.toCanvas(!1, (new AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY)).toDataURL();
|
|
1640
|
+
}), base64Image = this.scenegraph.stage.toCanvas(!1, (new AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY)).toDataURL();
|
|
1672
1641
|
return isInView && isMaxCellInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1673
|
-
|
|
1674
|
-
this.stateManager.updateHoverPos(hoverCol, hoverRow), base64Image;
|
|
1642
|
+
base64Image;
|
|
1675
1643
|
}
|
|
1676
1644
|
exportCanvas() {
|
|
1677
1645
|
return this.scenegraph.stage.toCanvas();
|