@visactor/vtable 0.10.3-alpha.3 → 0.11.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/ListTable.js +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +1 -3
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +10 -4
- package/cjs/core/BaseTable.js +53 -14
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.js +1 -0
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +6 -8
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +5 -5
- package/cjs/event/media-click.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/layout/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +3 -0
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/pivot-layout.d.ts +1 -0
- package/cjs/layout/pivot-layout.js +1 -0
- package/cjs/layout/pivot-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +3 -0
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.js +4 -6
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +6 -6
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +13 -0
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +12 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +7 -9
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/sort/index.js +2 -1
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/spark-line/index.d.ts +1 -1
- package/cjs/state/spark-line/index.js +2 -1
- package/cjs/state/spark-line/index.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +8 -6
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +6 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/Composite-define.d.ts +21 -0
- package/cjs/ts-types/list-table/define/Composite-define.js +6 -0
- package/cjs/ts-types/list-table/define/Composite-define.js.map +1 -0
- package/cjs/ts-types/list-table/define/index.d.ts +3 -1
- package/cjs/ts-types/list-table/define/index.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/composite-indicator.d.ts +21 -0
- package/cjs/ts-types/pivot-table/indicator/composite-indicator.js +6 -0
- package/cjs/ts-types/pivot-table/indicator/composite-indicator.js.map +1 -0
- package/cjs/ts-types/pivot-table/indicator/index.d.ts +2 -1
- package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/dist/vtable.js +706 -397
- package/dist/vtable.min.js +3 -3
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +1 -3
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.d.ts +10 -4
- package/es/core/BaseTable.js +53 -12
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.js +1 -0
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +6 -8
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +5 -5
- package/es/event/media-click.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/layout/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +3 -0
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/pivot-layout.d.ts +1 -0
- package/es/layout/pivot-layout.js +1 -0
- package/es/layout/pivot-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +3 -0
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/chart.js +4 -6
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +3 -3
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +13 -0
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/scenegraph.js +12 -0
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +7 -9
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +2 -2
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/sort/index.js +2 -1
- package/es/state/sort/index.js.map +1 -1
- package/es/state/spark-line/index.d.ts +1 -1
- package/es/state/spark-line/index.js +2 -1
- package/es/state/spark-line/index.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +8 -6
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +6 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/Composite-define.d.ts +21 -0
- package/es/ts-types/list-table/define/Composite-define.js +2 -0
- package/es/ts-types/list-table/define/Composite-define.js.map +1 -0
- package/es/ts-types/list-table/define/index.d.ts +3 -1
- package/es/ts-types/list-table/define/index.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/composite-indicator.d.ts +21 -0
- package/es/ts-types/pivot-table/indicator/composite-indicator.js +2 -0
- package/es/ts-types/pivot-table/indicator/composite-indicator.js.map +1 -0
- package/es/ts-types/pivot-table/indicator/index.d.ts +2 -1
- package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/package.json +6 -6
- package/cjs/scenegraph/layout/update-cell.d.ts +0 -3
- package/cjs/scenegraph/layout/update-cell.js +0 -56
- package/cjs/scenegraph/layout/update-cell.js.map +0 -1
- package/cjs/tools/text-width.d.ts +0 -1
- package/cjs/tools/text-width.js +0 -17
- package/cjs/tools/text-width.js.map +0 -1
- package/es/scenegraph/layout/update-cell.d.ts +0 -3
- package/es/scenegraph/layout/update-cell.js +0 -57
- package/es/scenegraph/layout/update-cell.js.map +0 -1
- package/es/tools/text-width.d.ts +0 -1
- package/es/tools/text-width.js +0 -9
- package/es/tools/text-width.js.map +0 -1
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CellAddress, type CellRange, type TableEventHandlersEventArgumentMap, type TableEventHandlersReturnMap, type TableKeyboardOptions, type DropDownMenuHighlightInfo, type MenuListItem, type WidthModeDef, type ICustomRender, type ICellHeaderPaths, type HeaderData, type FullExtendStyle, type FieldDef, type ColumnTypeOption, type SortState, type IPagination, type ICustomLayout, type CellInfo, type CellStyle, type DropDownMenuOptions, type FieldFormat, type FieldData, type MaybePromiseOrUndefined, type MousePointerCellEvent, type DropDownMenuEventInfo, type HierarchyState, type FieldKeyDef, type CellLocation, type LayoutObjectId, type HeightModeDef, type ITableThemeDefine } from '../ts-types';
|
|
2
2
|
import type { ColumnIconOption } from '../ts-types';
|
|
3
3
|
import { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';
|
|
4
4
|
import { EventTarget } from '../event/EventTarget';
|
|
@@ -32,6 +32,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
32
32
|
_widthMode: WidthModeDef;
|
|
33
33
|
_heightMode: HeightModeDef;
|
|
34
34
|
_autoFillWidth: boolean;
|
|
35
|
+
_autoFillHeight: boolean;
|
|
35
36
|
customRender?: ICustomRender;
|
|
36
37
|
canvasWidth?: number;
|
|
37
38
|
canvasHeight?: number;
|
|
@@ -48,6 +49,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
48
49
|
headerStyleCache: any;
|
|
49
50
|
bodyStyleCache: any;
|
|
50
51
|
container: HTMLElement;
|
|
52
|
+
isReleased: boolean;
|
|
51
53
|
constructor(container: HTMLElement, options?: BaseTableConstructorOptions);
|
|
52
54
|
throttleInvalidate: (this: any, ...args: any[]) => void;
|
|
53
55
|
getContainer(): HTMLElement;
|
|
@@ -107,9 +109,11 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
107
109
|
set heightMode(heightMode: HeightModeDef);
|
|
108
110
|
get autoFillWidth(): boolean;
|
|
109
111
|
set autoFillWidth(autoFillWidth: boolean);
|
|
110
|
-
|
|
112
|
+
get autoFillHeight(): boolean;
|
|
113
|
+
set autoFillHeight(autoFillHeight: boolean);
|
|
114
|
+
_colWidthDefineToPxWidth(width: string | number): number;
|
|
111
115
|
private _getColWidthLimits;
|
|
112
|
-
|
|
116
|
+
_adjustColWidth(col: number, orgWidth: number): number;
|
|
113
117
|
setPixelRatio(pixelRatio: number): void;
|
|
114
118
|
_updateSize(): void;
|
|
115
119
|
get rowHierarchyType(): 'grid' | 'tree';
|
|
@@ -209,6 +213,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
209
213
|
private computeTargetColByX;
|
|
210
214
|
clearSelected(): void;
|
|
211
215
|
selectCell(col: number, row: number): void;
|
|
216
|
+
selectCells(cellRanges: CellRange[]): void;
|
|
212
217
|
abstract isListTable(): boolean;
|
|
213
218
|
abstract isPivotTable(): boolean;
|
|
214
219
|
abstract isPivotChart(): boolean;
|
|
@@ -237,7 +242,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
237
242
|
updateAutoWrapText(autoWrapText: boolean): void;
|
|
238
243
|
get theme(): TableTheme;
|
|
239
244
|
set theme(theme: TableTheme);
|
|
240
|
-
updateTheme(theme:
|
|
245
|
+
updateTheme(theme: ITableThemeDefine): void;
|
|
241
246
|
getBodyField(col: number, row: number): FieldDef | undefined;
|
|
242
247
|
getBodyColumnDefine(col: number, row: number): ColumnDefine;
|
|
243
248
|
getBodyColumnType(col: number, row: number): ColumnTypeOption;
|
|
@@ -301,4 +306,5 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
301
306
|
cellIsInVisualView(col: number, row: number): boolean;
|
|
302
307
|
exportImg(): string;
|
|
303
308
|
exportCellImg(col: number, row: number): string;
|
|
309
|
+
exportCellRangeImg(cellRange: CellRange): string;
|
|
304
310
|
}
|
package/es/core/BaseTable.js
CHANGED
|
@@ -8,6 +8,8 @@ import * as style from "../tools/style";
|
|
|
8
8
|
|
|
9
9
|
import { AABBBounds } from "@visactor/vutils";
|
|
10
10
|
|
|
11
|
+
import { InteractionState } from "../ts-types";
|
|
12
|
+
|
|
11
13
|
import { event, style as utilStyle } from "../tools/helper";
|
|
12
14
|
|
|
13
15
|
import { TABLE_EVENT_TYPE } from "./TABLE_EVENT_TYPE";
|
|
@@ -74,13 +76,13 @@ export class BaseTable extends EventTarget {
|
|
|
74
76
|
}
|
|
75
77
|
constructor(container, options = {}) {
|
|
76
78
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
77
|
-
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.
|
|
78
|
-
this.id = `VTable${Date.now()}`, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
79
|
+
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.11.0",
|
|
80
|
+
this.id = `VTable${Date.now()}`, this.isReleased = !1, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
79
81
|
!container) throw new Error("vtable's container is undefined");
|
|
80
|
-
const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, keyboardOptions: keyboardOptions, 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} = options;
|
|
82
|
+
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, 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} = options;
|
|
81
83
|
this.container = container, this.options = options, this.options.container = container,
|
|
82
84
|
this._widthMode = widthMode, this._heightMode = heightMode, this._autoFillWidth = autoFillWidth,
|
|
83
|
-
this.customRender = customRender, this.padding = {
|
|
85
|
+
this._autoFillHeight = autoFillHeight, this.customRender = customRender, this.padding = {
|
|
84
86
|
top: 0,
|
|
85
87
|
right: 0,
|
|
86
88
|
left: 0,
|
|
@@ -287,6 +289,12 @@ export class BaseTable extends EventTarget {
|
|
|
287
289
|
set autoFillWidth(autoFillWidth) {
|
|
288
290
|
autoFillWidth !== this._autoFillWidth && (this._autoFillWidth = autoFillWidth);
|
|
289
291
|
}
|
|
292
|
+
get autoFillHeight() {
|
|
293
|
+
return this._autoFillHeight;
|
|
294
|
+
}
|
|
295
|
+
set autoFillHeight(autoFillHeight) {
|
|
296
|
+
autoFillHeight !== this._autoFillHeight && (this._autoFillHeight = autoFillHeight);
|
|
297
|
+
}
|
|
290
298
|
_colWidthDefineToPxWidth(width) {
|
|
291
299
|
return "auto" === width ? 0 : _toPxWidth(this, width);
|
|
292
300
|
}
|
|
@@ -655,7 +663,7 @@ export class BaseTable extends EventTarget {
|
|
|
655
663
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
656
664
|
})), internalProps.releaseList = null), this.scenegraph.stage.release();
|
|
657
665
|
const {parentElement: parentElement} = internalProps.element;
|
|
658
|
-
parentElement && parentElement.removeChild(internalProps.element);
|
|
666
|
+
parentElement && parentElement.removeChild(internalProps.element), this.isReleased = !0;
|
|
659
667
|
}
|
|
660
668
|
fireListeners(type, event) {
|
|
661
669
|
return super.fireListeners(type, event);
|
|
@@ -663,7 +671,7 @@ export class BaseTable extends EventTarget {
|
|
|
663
671
|
updateOption(options) {
|
|
664
672
|
var _a, _b, _c, _d, _e;
|
|
665
673
|
this.options = options;
|
|
666
|
-
const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth = 80, keyboardOptions: keyboardOptions, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, pixelRatio: pixelRatio, widthMode: widthMode, heightMode: heightMode, autoFillWidth: autoFillWidth, customRender: customRender, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount} = options;
|
|
674
|
+
const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth = 80, keyboardOptions: keyboardOptions, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, pixelRatio: pixelRatio, widthMode: widthMode, heightMode: heightMode, autoFillWidth: autoFillWidth, autoFillHeight: autoFillHeight, customRender: customRender, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount} = options;
|
|
667
675
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio),
|
|
668
676
|
padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding,
|
|
669
677
|
this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
|
|
@@ -671,7 +679,8 @@ export class BaseTable extends EventTarget {
|
|
|
671
679
|
padding.right && (this.padding.right = padding.right))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon,
|
|
672
680
|
"number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
673
681
|
this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard",
|
|
674
|
-
this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.
|
|
682
|
+
this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight,
|
|
683
|
+
this.customRender = customRender;
|
|
675
684
|
const internalProps = this.internalProps;
|
|
676
685
|
"node" !== Env.mode && updateRootElementPadding(internalProps.element, this.padding),
|
|
677
686
|
internalProps.frozenColCount = frozenColCount, internalProps.defaultRowHeight = defaultRowHeight,
|
|
@@ -862,6 +871,14 @@ export class BaseTable extends EventTarget {
|
|
|
862
871
|
selectCell(col, row) {
|
|
863
872
|
this.stateManeger.updateSelectPos(col, row), this.stateManeger.endSelectCells();
|
|
864
873
|
}
|
|
874
|
+
selectCells(cellRanges) {
|
|
875
|
+
const {scrollLeft: scrollLeft, scrollTop: scrollTop} = this;
|
|
876
|
+
cellRanges.forEach(((cellRange, index) => {
|
|
877
|
+
this.stateManeger.updateSelectPos(cellRange.start.col, cellRange.start.row, !1, index >= 1),
|
|
878
|
+
this.stateManeger.updateInteractionState(InteractionState.grabing), this.stateManeger.updateSelectPos(cellRange.end.col, cellRange.end.row, !1, index >= 1),
|
|
879
|
+
this.stateManeger.endSelectCells(!1), this.stateManeger.updateInteractionState(InteractionState.default);
|
|
880
|
+
})), this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft);
|
|
881
|
+
}
|
|
865
882
|
get allowFrozenColCount() {
|
|
866
883
|
return this.internalProps.allowFrozenColCount;
|
|
867
884
|
}
|
|
@@ -911,7 +928,10 @@ export class BaseTable extends EventTarget {
|
|
|
911
928
|
return null == body ? void 0 : body.define;
|
|
912
929
|
}
|
|
913
930
|
getBodyColumnType(col, row) {
|
|
914
|
-
|
|
931
|
+
const cellType = this.internalProps.layoutMap.getBody(col, row).cellType;
|
|
932
|
+
return getProp("cellType", {
|
|
933
|
+
cellType: cellType
|
|
934
|
+
}, col, row, this);
|
|
915
935
|
}
|
|
916
936
|
getHeaderField(col, row) {
|
|
917
937
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -1347,7 +1367,7 @@ export class BaseTable extends EventTarget {
|
|
|
1347
1367
|
return customLayout;
|
|
1348
1368
|
}
|
|
1349
1369
|
hasAutoImageColumn() {
|
|
1350
|
-
return this.internalProps.layoutMap.columnObjects.find((column => !("image" !== column.cellType || !column.define.imageAutoSizing)));
|
|
1370
|
+
return this.internalProps.layoutMap.columnObjects.find((column => !("image" !== column.cellType && "function" != typeof column.cellType || !column.define.imageAutoSizing)));
|
|
1351
1371
|
}
|
|
1352
1372
|
_getActiveChartInstance() {
|
|
1353
1373
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -1362,12 +1382,33 @@ export class BaseTable extends EventTarget {
|
|
|
1362
1382
|
return this.scenegraph.stage.toCanvas().toDataURL();
|
|
1363
1383
|
}
|
|
1364
1384
|
exportCellImg(col, row) {
|
|
1365
|
-
this.cellIsInVisualView(col, row)
|
|
1385
|
+
const isInView = this.cellIsInVisualView(col, row), {scrollTop: scrollTop, scrollLeft: scrollLeft} = this;
|
|
1386
|
+
isInView || this.scrollToCell({
|
|
1366
1387
|
col: col,
|
|
1367
1388
|
row: row
|
|
1368
1389
|
});
|
|
1369
|
-
const cellRect = this.getCellRelativeRect(col, row);
|
|
1370
|
-
return
|
|
1390
|
+
const cellRect = this.getCellRelativeRect(col, row), 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));
|
|
1391
|
+
return isInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1392
|
+
c.toDataURL();
|
|
1393
|
+
}
|
|
1394
|
+
exportCellRangeImg(cellRange) {
|
|
1395
|
+
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);
|
|
1396
|
+
isInView && isMaxCellInView || this.scrollToCell({
|
|
1397
|
+
col: minCol,
|
|
1398
|
+
row: minRow
|
|
1399
|
+
});
|
|
1400
|
+
const cellRect = this.getCellRangeRelativeRect({
|
|
1401
|
+
start: {
|
|
1402
|
+
col: minCol,
|
|
1403
|
+
row: minRow
|
|
1404
|
+
},
|
|
1405
|
+
end: {
|
|
1406
|
+
col: maxCol,
|
|
1407
|
+
row: maxRow
|
|
1408
|
+
}
|
|
1409
|
+
}), 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();
|
|
1410
|
+
return isInView && isMaxCellInView || (this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft)),
|
|
1411
|
+
base64Image;
|
|
1371
1412
|
}
|
|
1372
1413
|
}
|
|
1373
1414
|
//# sourceMappingURL=BaseTable.js.map
|