@visactor/vtable 0.19.1 → 0.19.2-alpha.1
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/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +4 -0
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +4 -0
- package/cjs/core/BaseTable.js +50 -34
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/util.js +2 -2
- package/cjs/event/util.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/scenegraph/debug-tool/debug-tool.js +4 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +1 -0
- package/cjs/scenegraph/graphic/chart.js +33 -19
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +2 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +2 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/cjs/scenegraph/refresh-node/update-chart.js +9 -2
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +10 -4
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +12 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +524 -351
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +5 -2
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.d.ts +4 -0
- package/es/core/BaseTable.js +49 -33
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.js +2 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/util.js +2 -2
- package/es/event/util.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/scenegraph/debug-tool/debug-tool.js +4 -1
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +1 -0
- package/es/scenegraph/graphic/chart.js +32 -20
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +2 -2
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +2 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/es/scenegraph/refresh-node/update-chart.js +6 -0
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.js +10 -4
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/ts-types/base-table.d.ts +12 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +8 -8
package/cjs/core/BaseTable.js
CHANGED
|
@@ -45,9 +45,9 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
45
45
|
}
|
|
46
46
|
constructor(container, options = {}) {
|
|
47
47
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
48
|
-
if (super(), this.showFrozenIcon = !0, this.version = "0.19.1", this.id = `VTable${Date.now()}`,
|
|
48
|
+
if (super(), this.showFrozenIcon = !0, this.version = "0.19.2-alpha.1", this.id = `VTable${Date.now()}`,
|
|
49
49
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
|
-
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
50
|
+
!container && "node" !== options.mode && !options.canvas) 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, keyboardOptions: keyboardOptions, eventOptions: eventOptions, 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;
|
|
52
52
|
this.container = container, this.options = options, this.options.container = container,
|
|
53
53
|
this._widthMode = widthMode, this._heightMode = heightMode, this._autoFillWidth = autoFillWidth,
|
|
@@ -63,8 +63,10 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
63
63
|
this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight;
|
|
64
64
|
const internalProps = this.internalProps = {};
|
|
65
65
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
66
|
-
|
|
67
|
-
internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
66
|
+
this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
|
|
67
|
+
internalProps.element.style.position = "relative", internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
68
|
+
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== env_1.Env.mode && (internalProps.element = (0,
|
|
69
|
+
tableHelper_1.createRootElement)(this.padding), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
68
70
|
internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas),
|
|
69
71
|
internalProps.context = internalProps.canvas.getContext("2d")), internalProps.handler = new EventHandler_1.EventHandler,
|
|
70
72
|
(0, vutils_1.isNumber)(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
@@ -296,34 +298,44 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
296
298
|
this.internalProps.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
|
|
297
299
|
}
|
|
298
300
|
_updateSize() {
|
|
299
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
300
302
|
const {padding: padding} = this;
|
|
301
303
|
let widthP = 0, heightP = 0;
|
|
302
|
-
if (
|
|
303
|
-
|
|
304
|
+
if (this.tableX = 0, this.tableY = 0, this.options.canvas && this.options.viewBox) widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
|
|
305
|
+
heightP = this.options.viewBox.y2 - this.options.viewBox.y1, (null === (_a = null == this ? void 0 : this.scenegraph) || void 0 === _a ? void 0 : _a.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP)); else if ("browser" === env_1.Env.mode) {
|
|
306
|
+
const element = this.getElement(), width1 = null !== (_c = null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 0, height1 = null !== (_e = null === (_d = element.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 0;
|
|
304
307
|
element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
|
|
305
308
|
element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
|
|
306
309
|
const {canvas: canvas} = this.internalProps;
|
|
307
|
-
widthP = null !== (
|
|
308
|
-
heightP = null !== (
|
|
309
|
-
(null === (
|
|
310
|
+
widthP = null !== (_g = null === (_f = canvas.parentElement) || void 0 === _f ? void 0 : _f.offsetWidth) && void 0 !== _g ? _g : 0,
|
|
311
|
+
heightP = null !== (_j = null === (_h = canvas.parentElement) || void 0 === _h ? void 0 : _h.offsetHeight) && void 0 !== _j ? _j : 0,
|
|
312
|
+
(null === (_k = null == this ? void 0 : this.scenegraph) || void 0 === _k ? void 0 : _k.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
|
|
310
313
|
canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
|
|
311
314
|
canvas.style.height = `${heightP}px`);
|
|
312
315
|
} else "node" === env_1.Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
313
316
|
const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
|
|
314
|
-
if (null === (
|
|
315
|
-
const lineWidths = toBoxArray(null !== (
|
|
316
|
-
this.tableX
|
|
317
|
-
this.tableY
|
|
318
|
-
this.tableNoFrameWidth = width - ((null !== (
|
|
319
|
-
this.tableNoFrameHeight = height - ((null !== (
|
|
320
|
-
}
|
|
317
|
+
if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
|
|
318
|
+
const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [ null ]), shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [ 0 ]);
|
|
319
|
+
this.tableX += (null !== (_r = lineWidths[3]) && void 0 !== _r ? _r : 0) + (null !== (_s = shadowWidths[3]) && void 0 !== _s ? _s : 0),
|
|
320
|
+
this.tableY += (null !== (_t = lineWidths[0]) && void 0 !== _t ? _t : 0) + (null !== (_u = shadowWidths[0]) && void 0 !== _u ? _u : 0),
|
|
321
|
+
this.tableNoFrameWidth = width - ((null !== (_v = lineWidths[1]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[1]) && void 0 !== _w ? _w : 0)) - ((null !== (_x = lineWidths[3]) && void 0 !== _x ? _x : 0) + (null !== (_y = shadowWidths[3]) && void 0 !== _y ? _y : 0)),
|
|
322
|
+
this.tableNoFrameHeight = height - ((null !== (_z = lineWidths[0]) && void 0 !== _z ? _z : 0) + (null !== (_0 = shadowWidths[0]) && void 0 !== _0 ? _0 : 0)) - ((null !== (_1 = lineWidths[2]) && void 0 !== _1 ? _1 : 0) + (null !== (_2 = shadowWidths[2]) && void 0 !== _2 ? _2 : 0));
|
|
323
|
+
} else this.tableX += 0, this.tableY += 0, this.tableNoFrameWidth = width, this.tableNoFrameHeight = height;
|
|
324
|
+
}
|
|
325
|
+
updateViewBox(newViewBox) {
|
|
326
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
327
|
+
const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0, oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0, newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
|
|
328
|
+
this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
|
|
329
|
+
}
|
|
330
|
+
setViewBoxTransform(a, b, c, d, e, f) {
|
|
331
|
+
this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
|
|
321
332
|
}
|
|
322
333
|
get rowHierarchyType() {
|
|
323
334
|
return "grid";
|
|
324
335
|
}
|
|
325
336
|
getColsWidth(startCol, endCol) {
|
|
326
337
|
var _a;
|
|
338
|
+
if (startCol > endCol) return 0;
|
|
327
339
|
startCol = Math.max(startCol, 0), endCol = Math.min(endCol, (null !== (_a = this.colCount) && void 0 !== _a ? _a : 1 / 0) - 1);
|
|
328
340
|
const cachedColWidth = this._colRangeWidthsMap.get(`$${startCol}$${endCol}`);
|
|
329
341
|
if (null != cachedColWidth) return cachedColWidth;
|
|
@@ -352,6 +364,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
352
364
|
}
|
|
353
365
|
getRowsHeight(startRow, endRow) {
|
|
354
366
|
var _a;
|
|
367
|
+
if (startRow > endRow) return 0;
|
|
355
368
|
startRow = Math.max(startRow, 0), endRow = Math.min(endRow, (null !== (_a = this.rowCount) && void 0 !== _a ? _a : 1 / 0) - 1);
|
|
356
369
|
let h = 0;
|
|
357
370
|
if ("standard" === this.heightMode && !this.autoFillHeight && this.internalProps.layoutMap && endRow >= this.columnHeaderLevelCount && !this.bottomFrozenRowCount && !this.hasAutoImageColumn()) {
|
|
@@ -478,21 +491,16 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
478
491
|
return rect.top = targetTop, rect.bottom = targetBottom, rect;
|
|
479
492
|
}
|
|
480
493
|
getCellsRect(startCol, startRow, endCol, endRow) {
|
|
481
|
-
|
|
494
|
+
var _a, _b, _c, _d, _e, _f;
|
|
482
495
|
let absoluteLeft = this.getColsWidth(0, startCol - 1) || 0, width = this.getColsWidth(startCol, endCol);
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
const scrollTop = this.scrollTop;
|
|
492
|
-
(null == isFrozenEndCell ? void 0 : isFrozenEndCell.row) || (height -= scrollTop,
|
|
493
|
-
height = Math.max(height, this.getRowsHeight(startRow, this.frozenRowCount - 1)));
|
|
494
|
-
}
|
|
495
|
-
return new Rect_1.Rect(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
|
|
496
|
+
const scrollLeft = this.scrollLeft;
|
|
497
|
+
this.isLeftFrozenColumn(startCol) && this.isRightFrozenColumn(endCol) ? width = this.tableNoFrameWidth - (null !== (_a = this.getColsWidth(startCol + 1, this.colCount - 1)) && void 0 !== _a ? _a : 0) - absoluteLeft : this.isLeftFrozenColumn(startCol) && !this.isLeftFrozenColumn(endCol) ? width = Math.max(width - scrollLeft, this.getColsWidth(startCol, this.frozenColCount - 1)) : !this.isRightFrozenColumn(startCol) && this.isRightFrozenColumn(endCol) ? (absoluteLeft = Math.min(absoluteLeft - scrollLeft, this.tableNoFrameWidth - this.getRightFrozenColsWidth()),
|
|
498
|
+
width = this.tableNoFrameWidth - (null !== (_b = this.getColsWidth(startCol + 1, this.colCount - 1)) && void 0 !== _b ? _b : 0) - absoluteLeft) : this.isRightFrozenColumn(startCol) && (absoluteLeft = this.tableNoFrameWidth - (null !== (_c = this.getColsWidth(startCol, this.colCount - 1)) && void 0 !== _c ? _c : 0));
|
|
499
|
+
let absoluteTop = this.getRowsHeight(0, startRow - 1), height = this.getRowsHeight(startRow, endRow);
|
|
500
|
+
const scrollTop = this.scrollTop;
|
|
501
|
+
return this.isTopFrozenRow(startRow) && this.isBottomFrozenRow(endRow) ? height = this.tableNoFrameHeight - (null !== (_d = this.getRowsHeight(startRow + 1, this.rowCount - 1)) && void 0 !== _d ? _d : 0) - absoluteTop : this.isTopFrozenRow(startRow) && !this.isTopFrozenRow(endRow) ? height = Math.max(height - scrollTop, this.getRowsHeight(startRow, this.frozenRowCount - 1)) : !this.isBottomFrozenRow(startRow) && this.isBottomFrozenRow(endRow) ? (absoluteTop = Math.min(absoluteTop - scrollTop, this.tableNoFrameHeight - this.getBottomFrozenRowsHeight()),
|
|
502
|
+
height = this.tableNoFrameHeight - (null !== (_e = this.getRowsHeight(startRow + 1, this.rowCount - 1)) && void 0 !== _e ? _e : 0) - absoluteTop) : this.isBottomFrozenRow(startRow) && (absoluteTop = this.tableNoFrameHeight - (null !== (_f = this.getRowsHeight(startRow, this.rowCount - 1)) && void 0 !== _f ? _f : 0)),
|
|
503
|
+
new Rect_1.Rect(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
|
|
496
504
|
}
|
|
497
505
|
getCellsRectWidth(startCol, startRow, endCol, endRow) {
|
|
498
506
|
const isFrozenStartCell = this.isFrozenCell(startCol, startRow), isFrozenEndCell = this.isFrozenCell(endCol, endRow);
|
|
@@ -581,8 +589,11 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
581
589
|
}));
|
|
582
590
|
}
|
|
583
591
|
_toRelativeRect(absoluteRect, relativeX = !0, relativeY = !0) {
|
|
592
|
+
var _a, _b, _c, _d;
|
|
584
593
|
const rect = absoluteRect.copy(), visibleRect = this.getVisibleRect();
|
|
585
594
|
return rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0)), rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0)),
|
|
595
|
+
rect.offsetLeft(null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
596
|
+
rect.offsetTop(null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
586
597
|
rect;
|
|
587
598
|
}
|
|
588
599
|
getVisibleRect() {
|
|
@@ -686,7 +697,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
686
697
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
687
698
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
688
699
|
const {parentElement: parentElement} = internalProps.element;
|
|
689
|
-
parentElement && parentElement.removeChild(internalProps.element),
|
|
700
|
+
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
701
|
+
this.isReleased = !0;
|
|
690
702
|
}
|
|
691
703
|
fireListeners(type, event) {
|
|
692
704
|
return super.fireListeners(type, event);
|
|
@@ -771,6 +783,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
771
783
|
return new Rect_1.Rect(this.tableX, this.tableY, width, height);
|
|
772
784
|
}
|
|
773
785
|
_getMouseAbstractPoint(evt, isAddScroll = !0) {
|
|
786
|
+
var _a, _b, _c, _d;
|
|
774
787
|
let e;
|
|
775
788
|
if (!evt) return {
|
|
776
789
|
inTable: !1,
|
|
@@ -783,8 +796,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
783
796
|
rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
|
|
784
797
|
const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight);
|
|
785
798
|
return {
|
|
786
|
-
x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0),
|
|
787
|
-
y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0),
|
|
799
|
+
x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0) - (null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
800
|
+
y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0) - (null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
788
801
|
inTable: inTable
|
|
789
802
|
};
|
|
790
803
|
}
|
|
@@ -1024,6 +1037,9 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1024
1037
|
}
|
|
1025
1038
|
return this.internalProps.layoutMap.getCellRange(col, row);
|
|
1026
1039
|
}
|
|
1040
|
+
hasCustomMerge() {
|
|
1041
|
+
return !!this.internalProps.customMergeCell;
|
|
1042
|
+
}
|
|
1027
1043
|
getCustomMerge(col, row) {
|
|
1028
1044
|
if (this.internalProps.customMergeCell) {
|
|
1029
1045
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|