@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/cjs/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/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.25.
|
|
48
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.25.8-alpha.0", 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, rowResizeMode: rowResizeMode = "none", 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, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
@@ -1632,7 +1632,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1632
1632
|
exportImg() {
|
|
1633
1633
|
return this.scenegraph.stage.toCanvas().toDataURL();
|
|
1634
1634
|
}
|
|
1635
|
-
exportCellImg(col, row) {
|
|
1635
|
+
exportCellImg(col, row, options) {
|
|
1636
1636
|
var _a, _b, _c, _d;
|
|
1637
1637
|
const isInView = this.cellIsInVisualView(col, row), {scrollTop: scrollTop, scrollLeft: scrollLeft} = this;
|
|
1638
1638
|
isInView || this.scrollToCell({
|
|
@@ -1643,13 +1643,31 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1643
1643
|
(null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0 && (0,
|
|
1644
1644
|
update_select_border_1.hideCellSelectBorder)(this.scenegraph);
|
|
1645
1645
|
const {col: hoverCol, row: hoverRow} = this.stateManager.hover.cellPos;
|
|
1646
|
-
|
|
1647
|
-
this.
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1646
|
+
let oldFill, oldStroke;
|
|
1647
|
+
if (this.stateManager.updateHoverPos(-1, -1), this.scenegraph.component.hideVerticalScrollBar(),
|
|
1648
|
+
this.scenegraph.component.hideHorizontalScrollBar(), this.scenegraph.tableGroup.border.setAttribute("visible", !1),
|
|
1649
|
+
null == options ? void 0 : options.disableBackground) {
|
|
1650
|
+
const cellGroup = this.scenegraph.getCell(col, row);
|
|
1651
|
+
oldFill = cellGroup.attribute.fill, cellGroup.setAttribute("fill", "transparent");
|
|
1652
|
+
}
|
|
1653
|
+
if (null == options ? void 0 : options.disableBorder) {
|
|
1654
|
+
const cellGroup = this.scenegraph.getCell(col, row);
|
|
1655
|
+
oldStroke = cellGroup.attribute.stroke, cellGroup.setAttribute("stroke", !1);
|
|
1656
|
+
}
|
|
1657
|
+
this.scenegraph.renderSceneGraph();
|
|
1658
|
+
let sizeOffset = 0;
|
|
1659
|
+
"bottom-right" === this.theme.cellBorderClipDirection && (sizeOffset = 1);
|
|
1660
|
+
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 - sizeOffset, cellRect.bottom + this.tableY - sizeOffset));
|
|
1661
|
+
if (isInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1662
|
+
this.scenegraph.tableGroup.border.setAttribute("visible", !0), oldFill) {
|
|
1663
|
+
this.scenegraph.getCell(col, row).setAttribute("fill", oldFill);
|
|
1664
|
+
}
|
|
1665
|
+
if (oldStroke) {
|
|
1666
|
+
this.scenegraph.getCell(col, row).setAttribute("stroke", oldStroke);
|
|
1667
|
+
}
|
|
1668
|
+
return (null === (_d = null === (_c = this.stateManager.select) || void 0 === _c ? void 0 : _c.ranges) || void 0 === _d ? void 0 : _d.length) > 0 && (0,
|
|
1651
1669
|
update_select_border_1.restoreCellSelectBorder)(this.scenegraph), this.stateManager.updateHoverPos(hoverCol, hoverRow),
|
|
1652
|
-
c.toDataURL();
|
|
1670
|
+
this.scenegraph.updateNextFrame(), c.toDataURL();
|
|
1653
1671
|
}
|
|
1654
1672
|
exportCellRangeImg(cellRange) {
|
|
1655
1673
|
var _a, _b, _c, _d;
|