k-vtable 1.0.17 → 1.0.19
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 +2 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +4 -0
- package/cjs/PivotChart.js +30 -18
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +2 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +4 -4
- package/cjs/core/BaseTable.js +21 -21
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/record-helper.js +12 -4
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +1 -0
- package/cjs/data/DataSource.js +6 -9
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.js +1 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/event.js +17 -8
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +20 -17
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/self-event-listener/list-table/checkbox.js +4 -2
- package/cjs/event/self-event-listener/list-table/checkbox.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +4 -4
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.js +73 -28
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +19 -9
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +3 -3
- package/cjs/layout/pivot-header-layout.js +23 -12
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +1 -0
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
- package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.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 +3 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +13 -6
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +2 -2
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js +24 -21
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/resize/update-resize-column.js +1 -1
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/select/update-position.d.ts +1 -1
- package/cjs/state/select/update-position.js +7 -7
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +2 -1
- package/cjs/state/state.js +5 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +387 -129
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +2 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +4 -0
- package/es/PivotChart.js +30 -18
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +2 -1
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +4 -4
- package/es/core/BaseTable.js +21 -21
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/record-helper.js +12 -4
- package/es/core/record-helper.js.map +1 -1
- package/es/data/DataSource.d.ts +1 -0
- package/es/data/DataSource.js +6 -9
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.js +1 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/event.js +17 -8
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +20 -17
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/self-event-listener/list-table/checkbox.js +4 -2
- package/es/event/self-event-listener/list-table/checkbox.js.map +1 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +3 -3
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.js +73 -28
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +19 -9
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +3 -3
- package/es/layout/pivot-header-layout.js +23 -12
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +1 -0
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +4 -1
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
- package/es/scenegraph/graphic/contributions/vchart-graphic-picker.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 +3 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +13 -6
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +2 -2
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js +24 -21
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/resize/update-resize-column.js +1 -1
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/select/update-position.d.ts +1 -1
- package/es/state/select/update-position.js +7 -7
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +2 -1
- package/es/state/state.js +5 -4
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -281,14 +281,14 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
281
281
|
getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): ColumnInfo | null;
|
|
282
282
|
getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): RowInfo | null;
|
|
283
283
|
clearSelected(): void;
|
|
284
|
-
selectCell(col: number, row: number,
|
|
284
|
+
selectCell(col: number, row: number, enableShiftSelectMode?: boolean, enableCtrlSelectMode?: boolean, makeSelectCellVisible?: boolean, skipBodyMerge?: boolean): void;
|
|
285
285
|
selectCells(cellRanges: CellRange[]): void;
|
|
286
286
|
selectRow(rowIndex: number, isCtrl?: boolean, isShift?: boolean): void;
|
|
287
287
|
selectCol(colIndex: number, isCtrl?: boolean, isShift?: boolean): void;
|
|
288
|
-
startDragSelectCol(colIndex: number,
|
|
289
|
-
dragSelectCol(colIndex: number,
|
|
288
|
+
startDragSelectCol(colIndex: number, enableCtrlSelectMode?: boolean, enableShiftSelectMode?: boolean): void;
|
|
289
|
+
dragSelectCol(colIndex: number, enableCtrlSelectMode?: boolean): void;
|
|
290
290
|
endDragSelect(): void;
|
|
291
|
-
startDragSelectRow(rowIndex: number,
|
|
291
|
+
startDragSelectRow(rowIndex: number, enableCtrlSelectMode?: boolean, isShift?: boolean): void;
|
|
292
292
|
dragSelectRow(rowIndex: number, isCtrl?: boolean): void;
|
|
293
293
|
abstract isListTable(): boolean;
|
|
294
294
|
abstract isPivotTable(): boolean;
|
package/es/core/BaseTable.js
CHANGED
|
@@ -90,7 +90,7 @@ export class BaseTable extends EventTarget {
|
|
|
90
90
|
}
|
|
91
91
|
constructor(container, options = {}) {
|
|
92
92
|
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;
|
|
93
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.0.
|
|
93
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.0.19", this.id = `VTable${Date.now()}`,
|
|
94
94
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
95
95
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
96
96
|
container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
@@ -162,8 +162,8 @@ export class BaseTable extends EventTarget {
|
|
|
162
162
|
if (internalProps.calcWidthContext = {
|
|
163
163
|
_: internalProps,
|
|
164
164
|
get full() {
|
|
165
|
-
var _a;
|
|
166
|
-
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
165
|
+
var _a, _b;
|
|
166
|
+
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
|
|
167
167
|
}
|
|
168
168
|
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT),
|
|
169
169
|
internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
|
|
@@ -480,12 +480,12 @@ export class BaseTable extends EventTarget {
|
|
|
480
480
|
var _a;
|
|
481
481
|
if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
|
|
482
482
|
this.internalProps.pixelRatio = pixelRatio;
|
|
483
|
-
const canvasWidth = this.canvasWidth;
|
|
483
|
+
const that = this, canvasWidth = this.canvasWidth;
|
|
484
484
|
this.internalProps.calcWidthContext = {
|
|
485
485
|
_: this.internalProps,
|
|
486
486
|
get full() {
|
|
487
|
-
var _a;
|
|
488
|
-
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
487
|
+
var _a, _b;
|
|
488
|
+
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
|
|
489
489
|
}
|
|
490
490
|
}, this.scenegraph.setPixelRatio(pixelRatio);
|
|
491
491
|
}
|
|
@@ -968,7 +968,7 @@ export class BaseTable extends EventTarget {
|
|
|
968
968
|
this.release();
|
|
969
969
|
}
|
|
970
970
|
release() {
|
|
971
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
971
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
972
972
|
const internalProps = this.internalProps;
|
|
973
973
|
if (this.isReleased) return;
|
|
974
974
|
null === (_b = null === (_a = internalProps.tooltipHandler) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
|
|
@@ -985,10 +985,10 @@ export class BaseTable extends EventTarget {
|
|
|
985
985
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
986
986
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
|
|
987
987
|
internalProps.focusControl.release();
|
|
988
|
-
const
|
|
988
|
+
const parentElement = null === (_o = internalProps.element) || void 0 === _o ? void 0 : _o.parentElement;
|
|
989
989
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
990
|
-
null === (
|
|
991
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
990
|
+
null === (_r = null === (_q = null === (_p = this.editorManager) || void 0 === _p ? void 0 : _p.editingEditor) || void 0 === _q ? void 0 : _q.onEnd) || void 0 === _r || _r.call(_q),
|
|
991
|
+
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_s = this.reactCustomLayout) || void 0 === _s || _s.clearCache(),
|
|
992
992
|
clearChartRenderQueue();
|
|
993
993
|
}
|
|
994
994
|
fireListeners(type, event) {
|
|
@@ -1191,10 +1191,10 @@ export class BaseTable extends EventTarget {
|
|
|
1191
1191
|
clearSelected() {
|
|
1192
1192
|
this.stateManager.updateSelectPos(-1, -1);
|
|
1193
1193
|
}
|
|
1194
|
-
selectCell(col, row,
|
|
1194
|
+
selectCell(col, row, enableShiftSelectMode, enableCtrlSelectMode, makeSelectCellVisible, skipBodyMerge = !1) {
|
|
1195
1195
|
var _a, _b, _c;
|
|
1196
1196
|
const isHasSelected = !!(null === (_a = this.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
1197
|
-
this.stateManager.updateSelectPos(col, row,
|
|
1197
|
+
this.stateManager.updateSelectPos(col, row, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_c = null != makeSelectCellVisible ? makeSelectCellVisible : null === (_b = this.options.select) || void 0 === _b ? void 0 : _b.makeSelectCellVisible) || void 0 === _c || _c, skipBodyMerge),
|
|
1198
1198
|
this.stateManager.endSelectCells(!0, isHasSelected);
|
|
1199
1199
|
}
|
|
1200
1200
|
selectCells(cellRanges) {
|
|
@@ -1257,25 +1257,25 @@ export class BaseTable extends EventTarget {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
} ]);
|
|
1259
1259
|
}
|
|
1260
|
-
startDragSelectCol(colIndex,
|
|
1260
|
+
startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
|
|
1261
1261
|
var _a, _b, _c, _d, _e, _f;
|
|
1262
|
-
const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startCol =
|
|
1263
|
-
this.stateManager.updateSelectPos(startCol, 0,
|
|
1264
|
-
this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow,
|
|
1262
|
+
const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex, endCol = colIndex, endRow = this.rowCount - 1;
|
|
1263
|
+
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
|
|
1264
|
+
this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
1265
1265
|
}
|
|
1266
|
-
dragSelectCol(colIndex,
|
|
1266
|
+
dragSelectCol(colIndex, enableCtrlSelectMode) {
|
|
1267
1267
|
var _a, _b;
|
|
1268
1268
|
const currentSelectRanges = this.stateManager.select.ranges, lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
1269
|
-
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1,
|
|
1269
|
+
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
|
|
1270
1270
|
}
|
|
1271
1271
|
endDragSelect() {
|
|
1272
1272
|
this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
|
|
1273
1273
|
}
|
|
1274
|
-
startDragSelectRow(rowIndex,
|
|
1274
|
+
startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
|
|
1275
1275
|
var _a, _b, _c, _d, _e, _f;
|
|
1276
1276
|
const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex, endCol = this.colCount - 1, endRow = rowIndex;
|
|
1277
|
-
this.stateManager.updateSelectPos(0, startRow, isShift,
|
|
1278
|
-
this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift,
|
|
1277
|
+
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
|
|
1278
|
+
this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
1279
1279
|
}
|
|
1280
1280
|
dragSelectRow(rowIndex, isCtrl) {
|
|
1281
1281
|
var _a, _b;
|