@visactor/vtable 0.25.7 → 0.25.8-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 +4 -1
- package/cjs/core/BaseTable.js +26 -8
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.js +2 -1
- package/cjs/core/row-series-number-helper.js +1 -2
- 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 -0
- package/cjs/plugins/themes.js +1 -2
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +24 -18
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +18 -16
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/themes/component.js +1 -1
- package/cjs/ts-types/base-table.d.ts +7 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +46 -7
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +4 -1
- package/es/core/BaseTable.js +27 -8
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.js +2 -1
- package/es/core/row-series-number-helper.js +1 -2
- 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 +2 -1
- package/es/plugins/themes.js +1 -2
- package/es/scenegraph/group-creater/cell-type/image-cell.js +21 -17
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +18 -15
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/themes/component.js +1 -1
- package/es/ts-types/base-table.d.ts +7 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -381,7 +381,10 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
381
381
|
cellIsInVisualView(col: number, row: number): boolean;
|
|
382
382
|
getCustomMergeValue(col: number, row: number): string | undefined;
|
|
383
383
|
exportImg(): string;
|
|
384
|
-
exportCellImg(col: number, row: number
|
|
384
|
+
exportCellImg(col: number, row: number, options?: {
|
|
385
|
+
disableBackground?: boolean;
|
|
386
|
+
disableBorder?: boolean;
|
|
387
|
+
}): string;
|
|
385
388
|
exportCellRangeImg(cellRange: CellRange): string;
|
|
386
389
|
exportCanvas(): HTMLCanvasElement;
|
|
387
390
|
getImageBuffer(type?: string): any;
|
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.25.
|
|
85
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.25.8-alpha.0", 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, rowResizeMode: rowResizeMode = "none", 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, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
@@ -1662,7 +1662,7 @@ export class BaseTable extends EventTarget {
|
|
|
1662
1662
|
exportImg() {
|
|
1663
1663
|
return this.scenegraph.stage.toCanvas().toDataURL();
|
|
1664
1664
|
}
|
|
1665
|
-
exportCellImg(col, row) {
|
|
1665
|
+
exportCellImg(col, row, options) {
|
|
1666
1666
|
var _a, _b, _c, _d;
|
|
1667
1667
|
const isInView = this.cellIsInVisualView(col, row), {scrollTop: scrollTop, scrollLeft: scrollLeft} = this;
|
|
1668
1668
|
isInView || this.scrollToCell({
|
|
@@ -1672,12 +1672,31 @@ export class BaseTable extends EventTarget {
|
|
|
1672
1672
|
const cellRect = this.getCellRelativeRect(col, row);
|
|
1673
1673
|
(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);
|
|
1674
1674
|
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1675
|
-
|
|
1676
|
-
this.
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1675
|
+
let oldFill, oldStroke;
|
|
1676
|
+
if (this.stateManager.updateHoverPos(-1, -1), this.scenegraph.component.hideVerticalScrollBar(),
|
|
1677
|
+
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.tableGroup.border.setAttribute("visible", !1),
|
|
1678
|
+
null == options ? void 0 : options.disableBackground) {
|
|
1679
|
+
const cellGroup = this.scenegraph.getCell(col, row);
|
|
1680
|
+
oldFill = cellGroup.attribute.fill, cellGroup.setAttribute("fill", "transparent");
|
|
1681
|
+
}
|
|
1682
|
+
if (null == options ? void 0 : options.disableBorder) {
|
|
1683
|
+
const cellGroup = this.scenegraph.getCell(col, row);
|
|
1684
|
+
oldStroke = cellGroup.attribute.stroke, cellGroup.setAttribute("stroke", !1);
|
|
1685
|
+
}
|
|
1686
|
+
this.scenegraph.renderSceneGraph();
|
|
1687
|
+
let sizeOffset = 0;
|
|
1688
|
+
"bottom-right" === this.theme.cellBorderClipDirection && (sizeOffset = 1);
|
|
1689
|
+
const c = this.scenegraph.stage.toCanvas(!1, (new AABBBounds).set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX - sizeOffset, cellRect.bottom + this.tableY - sizeOffset));
|
|
1690
|
+
if (isInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1691
|
+
this.scenegraph.tableGroup.border.setAttribute("visible", !0), oldFill) {
|
|
1692
|
+
this.scenegraph.getCell(col, row).setAttribute("fill", oldFill);
|
|
1693
|
+
}
|
|
1694
|
+
if (oldStroke) {
|
|
1695
|
+
this.scenegraph.getCell(col, row).setAttribute("stroke", oldStroke);
|
|
1696
|
+
}
|
|
1697
|
+
return (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),
|
|
1698
|
+
this.stateManager.updateHoverPos(hoverCol, hoverRow), this.scenegraph.updateNextFrame(),
|
|
1699
|
+
c.toDataURL();
|
|
1681
1700
|
}
|
|
1682
1701
|
exportCellRangeImg(cellRange) {
|
|
1683
1702
|
var _a, _b, _c, _d;
|