@visactor/vtable 1.8.3-alpha.0 → 1.9.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 +7 -4
- package/cjs/ListTable.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +7 -4
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +9 -4
- package/cjs/core/BaseTable.js +31 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/animation.d.ts +20 -0
- package/cjs/core/animation.js +48 -0
- package/cjs/core/animation.js.map +1 -0
- package/cjs/core/tableHelper.d.ts +2 -1
- package/cjs/core/tableHelper.js +9 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +1 -0
- package/cjs/data/DataSource.js +4 -0
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -2
- package/cjs/dataset/dataset.js +1 -0
- package/cjs/event/event.js +2 -2
- 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/listener/table-group.js +43 -19
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.js +1 -1
- package/cjs/event/scroll.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/index.js +1 -2
- package/cjs/layout/layout-helper.js +2 -1
- package/cjs/layout/pivot-header-layout.js +10 -3
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +5 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/custom-cell-style.js +1 -1
- package/cjs/scenegraph/component/custom.js +6 -4
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +32 -9
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +37 -9
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/layout/frozen-react.js +7 -7
- package/cjs/scenegraph/layout/frozen-react.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -2
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +3 -4
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/cell-move/index.js +3 -2
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/select/update-position.js +19 -4
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +2 -1
- package/cjs/state/state.js +11 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +4 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +11 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +3 -0
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +315 -94
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +8 -5
- package/es/ListTable.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +5 -4
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/core/BaseTable.d.ts +9 -4
- package/es/core/BaseTable.js +32 -14
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +2 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/animation.d.ts +20 -0
- package/es/core/animation.js +41 -0
- package/es/core/animation.js.map +1 -0
- package/es/core/tableHelper.d.ts +2 -1
- package/es/core/tableHelper.js +7 -0
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/DataSource.d.ts +1 -0
- package/es/data/DataSource.js +4 -0
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -2
- package/es/dataset/dataset.js +2 -1
- package/es/event/event.js +2 -2
- 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/listener/table-group.js +43 -19
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.js +1 -1
- package/es/event/scroll.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/index.js +1 -2
- package/es/layout/layout-helper.js +2 -1
- package/es/layout/pivot-header-layout.js +10 -3
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +5 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/custom-cell-style.js +1 -1
- package/es/scenegraph/component/custom.js +6 -4
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +28 -7
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +35 -8
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/layout/frozen-react.js +7 -7
- package/es/scenegraph/layout/frozen-react.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -2
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +3 -4
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/cell-move/index.js +3 -2
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/select/update-position.js +19 -4
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +2 -1
- package/es/state/state.js +11 -4
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +4 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +11 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +3 -0
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import type { ITextGraphicAttribute } from './../vrender';
|
|
|
21
21
|
import { ReactCustomLayout } from '../components/react/react-custom-layout';
|
|
22
22
|
import type { ISortedMapItem } from '../data/DataSource';
|
|
23
23
|
import type { EditManeger } from '../edit/edit-manager';
|
|
24
|
+
import type { ITableAnimationOption } from './animation';
|
|
25
|
+
import { TableAnimationManager } from './animation';
|
|
24
26
|
export declare abstract class BaseTable extends EventTarget implements BaseTableAPI {
|
|
25
27
|
internalProps: IBaseTableProtected;
|
|
26
28
|
showFrozenIcon: boolean;
|
|
@@ -49,6 +51,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
49
51
|
stateManager: StateManager;
|
|
50
52
|
eventManager: EventManager;
|
|
51
53
|
editorManager: EditManeger;
|
|
54
|
+
animationManager: TableAnimationManager;
|
|
52
55
|
_pixelRatio: number;
|
|
53
56
|
canvasSizeSeted?: boolean;
|
|
54
57
|
static get EVENT_TYPE(): typeof TABLE_EVENT_TYPE;
|
|
@@ -353,10 +356,6 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
353
356
|
getAllCells(colMaxCount?: number, rowMaxCount?: number): CellInfo[][];
|
|
354
357
|
getAllColumnHeaderCells(): CellInfo[][];
|
|
355
358
|
getAllRowHeaderCells(): CellInfo[][];
|
|
356
|
-
scrollToCell(cellAddr: {
|
|
357
|
-
col?: number;
|
|
358
|
-
row?: number;
|
|
359
|
-
}): void;
|
|
360
359
|
getCopyValue(): string | null;
|
|
361
360
|
getSelectedCellInfos(): CellInfo[][] | null;
|
|
362
361
|
getSelectedCellRanges(): CellRange[];
|
|
@@ -420,4 +419,10 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
420
419
|
disableScroll(): void;
|
|
421
420
|
enableScroll(): void;
|
|
422
421
|
getGroupTitleLevel(col: number, row: number): number | undefined;
|
|
422
|
+
scrollToRow(row: number, animationOption?: ITableAnimationOption | boolean): void;
|
|
423
|
+
scrollToCol(col: number, animationOption?: ITableAnimationOption | boolean): void;
|
|
424
|
+
scrollToCell(cellAddr: {
|
|
425
|
+
col?: number;
|
|
426
|
+
row?: number;
|
|
427
|
+
}, animationOption?: ITableAnimationOption | boolean): void;
|
|
423
428
|
}
|
package/es/core/BaseTable.js
CHANGED
|
@@ -72,6 +72,8 @@ import { createReactContainer } from "../scenegraph/layout/frozen-react";
|
|
|
72
72
|
|
|
73
73
|
import { setIconColor } from "../icons";
|
|
74
74
|
|
|
75
|
+
import { TableAnimationManager } from "./animation";
|
|
76
|
+
|
|
75
77
|
const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
76
78
|
|
|
77
79
|
importStyle();
|
|
@@ -82,7 +84,7 @@ export class BaseTable extends EventTarget {
|
|
|
82
84
|
}
|
|
83
85
|
constructor(container, options = {}) {
|
|
84
86
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
85
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.
|
|
87
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.9.0", this.id = `VTable${Date.now()}`,
|
|
86
88
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
87
89
|
!container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
88
90
|
const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, 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;
|
|
@@ -138,7 +140,8 @@ export class BaseTable extends EventTarget {
|
|
|
138
140
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
139
141
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
140
142
|
this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this),
|
|
141
|
-
this.eventManager = new EventManager(this),
|
|
143
|
+
this.eventManager = new EventManager(this), this.animationManager = new TableAnimationManager(this),
|
|
144
|
+
options.legends) {
|
|
142
145
|
internalProps.legends = [];
|
|
143
146
|
const createLegend = Factory.getFunction("createLegend");
|
|
144
147
|
if (Array.isArray(options.legends)) {
|
|
@@ -1362,18 +1365,6 @@ export class BaseTable extends EventTarget {
|
|
|
1362
1365
|
const start_col = 0, start_row = this.columnHeaderLevelCount, end_col = this.rowHeaderLevelCount - 1, end_row = this.rowCount - 1;
|
|
1363
1366
|
return Array(end_row - start_row + 1).fill(0).map(((_, i) => Array(end_col - start_col + 1).fill(0).map(((_, j) => this.getCellInfo(j + start_col, i + start_row)))));
|
|
1364
1367
|
}
|
|
1365
|
-
scrollToCell(cellAddr) {
|
|
1366
|
-
const drawRange = this.getDrawRange();
|
|
1367
|
-
if (isValid(cellAddr.col) && cellAddr.col >= this.frozenColCount) {
|
|
1368
|
-
const frozenWidth = this.getFrozenColsWidth(), left = this.getColsWidth(0, cellAddr.col - 1);
|
|
1369
|
-
this.scrollLeft = Math.min(left - frozenWidth, this.getAllColsWidth() - drawRange.width);
|
|
1370
|
-
}
|
|
1371
|
-
if (isValid(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
1372
|
-
const frozenHeight = this.getFrozenRowsHeight(), top = this.getRowsHeight(0, cellAddr.row - 1);
|
|
1373
|
-
this.scrollTop = Math.min(top - frozenHeight, this.getAllRowsHeight() - drawRange.height);
|
|
1374
|
-
}
|
|
1375
|
-
this.render();
|
|
1376
|
-
}
|
|
1377
1368
|
getCopyValue() {
|
|
1378
1369
|
var _a, _b, _c;
|
|
1379
1370
|
if ((null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0) {
|
|
@@ -1766,5 +1757,32 @@ export class BaseTable extends EventTarget {
|
|
|
1766
1757
|
this.eventManager.enableScroll();
|
|
1767
1758
|
}
|
|
1768
1759
|
getGroupTitleLevel(col, row) {}
|
|
1760
|
+
scrollToRow(row, animationOption) {
|
|
1761
|
+
animationOption ? this.animationManager.scrollTo({
|
|
1762
|
+
row: row
|
|
1763
|
+
}, animationOption) : this.scrollToCell({
|
|
1764
|
+
row: row
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
scrollToCol(col, animationOption) {
|
|
1768
|
+
animationOption ? this.animationManager.scrollTo({
|
|
1769
|
+
col: col
|
|
1770
|
+
}, animationOption) : this.scrollToCell({
|
|
1771
|
+
col: col
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
scrollToCell(cellAddr, animationOption) {
|
|
1775
|
+
if (animationOption) return void this.animationManager.scrollTo(cellAddr, animationOption);
|
|
1776
|
+
const drawRange = this.getDrawRange();
|
|
1777
|
+
if (isValid(cellAddr.col) && cellAddr.col >= this.frozenColCount) {
|
|
1778
|
+
const frozenWidth = this.getFrozenColsWidth(), left = this.getColsWidth(0, cellAddr.col - 1);
|
|
1779
|
+
this.scrollLeft = Math.min(left - frozenWidth, this.getAllColsWidth() - drawRange.width);
|
|
1780
|
+
}
|
|
1781
|
+
if (isValid(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
1782
|
+
const frozenHeight = this.getFrozenRowsHeight(), top = this.getRowsHeight(0, cellAddr.row - 1);
|
|
1783
|
+
this.scrollTop = Math.min(top - frozenHeight, this.getAllRowsHeight() - drawRange.height);
|
|
1784
|
+
}
|
|
1785
|
+
this.render();
|
|
1786
|
+
}
|
|
1769
1787
|
}
|
|
1770
1788
|
//# sourceMappingURL=BaseTable.js.map
|