@visactor/vtable-sheet 1.22.12-alpha.4 → 1.22.12
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-sheet.js +48 -31
- package/dist/vtable-sheet.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/cjs/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
|
|
|
2
2
|
import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
|
|
3
3
|
import * as TYPES from './ts-types';
|
|
4
4
|
import * as VTable from './vtable';
|
|
5
|
-
export declare const version = "1.22.12
|
|
5
|
+
export declare const version = "1.22.12";
|
|
6
6
|
export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.12\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
|
package/dist/vtable-sheet.js
CHANGED
|
@@ -24239,14 +24239,20 @@
|
|
|
24239
24239
|
x: x,
|
|
24240
24240
|
y: y
|
|
24241
24241
|
} = this.stage.eventPointTransform(e);
|
|
24242
|
-
let
|
|
24243
|
-
|
|
24242
|
+
let currentPos,
|
|
24243
|
+
currentScrollValue = 0,
|
|
24244
24244
|
delta = 0;
|
|
24245
24245
|
const {
|
|
24246
|
-
|
|
24247
|
-
|
|
24248
|
-
|
|
24249
|
-
|
|
24246
|
+
width: width,
|
|
24247
|
+
height: height
|
|
24248
|
+
} = this.getSliderRenderBounds(),
|
|
24249
|
+
track = "vertical" === direction ? height : width,
|
|
24250
|
+
travel = Math.max(track - this._sliderSize, 0),
|
|
24251
|
+
{
|
|
24252
|
+
range: range
|
|
24253
|
+
} = this.attribute,
|
|
24254
|
+
ratio = clamp$1(range[1] - range[0], 0, 1);
|
|
24255
|
+
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos) : (currentPos = x, delta = currentPos - this._prePos), currentScrollValue = travel > 0 && ratio < 1 ? delta / travel * (1 - ratio) : 0, [currentPos, currentScrollValue];
|
|
24250
24256
|
}, this._onSliderPointerMove = e => {
|
|
24251
24257
|
const {
|
|
24252
24258
|
stopSliderMovePropagation = !0
|
|
@@ -24390,15 +24396,24 @@
|
|
|
24390
24396
|
}
|
|
24391
24397
|
_getSliderPos(range) {
|
|
24392
24398
|
const {
|
|
24393
|
-
direction: direction
|
|
24399
|
+
direction: direction,
|
|
24400
|
+
minSliderSize = 0
|
|
24394
24401
|
} = this.attribute,
|
|
24395
24402
|
{
|
|
24396
24403
|
width: width,
|
|
24397
24404
|
height: height,
|
|
24398
24405
|
x1: x1,
|
|
24399
24406
|
y1: y1
|
|
24400
|
-
} = this.getSliderRenderBounds()
|
|
24401
|
-
|
|
24407
|
+
} = this.getSliderRenderBounds(),
|
|
24408
|
+
track = "horizontal" === direction ? width : height,
|
|
24409
|
+
origin = "horizontal" === direction ? x1 : y1,
|
|
24410
|
+
start = clamp$1(range[0], 0, 1),
|
|
24411
|
+
end = clamp$1(range[1], 0, 1),
|
|
24412
|
+
ratio = clamp$1(end - start, 0, 1),
|
|
24413
|
+
L = Math.max(ratio * track, minSliderSize),
|
|
24414
|
+
T = Math.max(track - L, 0),
|
|
24415
|
+
pStart = origin + start / Math.max(1 - ratio, 1e-12) * T;
|
|
24416
|
+
return [pStart, pStart + L];
|
|
24402
24417
|
}
|
|
24403
24418
|
_getScrollRange() {
|
|
24404
24419
|
if (this._sliderLimitRange) return this._sliderLimitRange;
|
|
@@ -24438,6 +24453,7 @@
|
|
|
24438
24453
|
direction: "horizontal",
|
|
24439
24454
|
round: !0,
|
|
24440
24455
|
sliderSize: 20,
|
|
24456
|
+
minSliderSize: 0,
|
|
24441
24457
|
sliderStyle: {
|
|
24442
24458
|
fill: "rgba(0, 0, 0, .5)"
|
|
24443
24459
|
},
|
|
@@ -48846,25 +48862,25 @@
|
|
|
48846
48862
|
releaseRowChartInstance = !0,
|
|
48847
48863
|
releaseAllChartInstance = !1
|
|
48848
48864
|
} = {}) {
|
|
48849
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
48865
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48850
48866
|
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
|
|
48851
|
-
!this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (
|
|
48867
|
+
!this.activeChartInstance || !forceRelease && getBrushingChartInstance(table.scenegraph) && getBrushingChartInstance(table.scenegraph) === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
48852
48868
|
x1: -1e3,
|
|
48853
48869
|
x2: -800,
|
|
48854
48870
|
y1: -1e3,
|
|
48855
48871
|
y2: -800
|
|
48856
|
-
}, !1, !1), null === (
|
|
48872
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
|
|
48857
48873
|
const {
|
|
48858
48874
|
col: col,
|
|
48859
48875
|
row: row
|
|
48860
48876
|
} = this.parent;
|
|
48861
|
-
table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (
|
|
48877
|
+
table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_d = null === (_c = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _c ? void 0 : _c.hideLabelHoverOnAxis) || void 0 === _d || _d.call(_c)), table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_f = null === (_e = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _e ? void 0 : _e.hideLabelHoverOnAxis) || void 0 === _f || _f.call(_e));
|
|
48862
48878
|
} else {
|
|
48863
48879
|
const {
|
|
48864
48880
|
col: col,
|
|
48865
48881
|
row: row
|
|
48866
48882
|
} = this.parent;
|
|
48867
|
-
releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (
|
|
48883
|
+
releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = null === (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _g ? void 0 : _g.hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = null === (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _j ? void 0 : _j.hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
|
|
48868
48884
|
}
|
|
48869
48885
|
releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
|
|
48870
48886
|
}
|
|
@@ -50273,7 +50289,7 @@
|
|
|
50273
50289
|
dimensions = item.dimensions,
|
|
50274
50290
|
width = item.width,
|
|
50275
50291
|
cell = table.getCellAddressByHeaderPaths(dimensions);
|
|
50276
|
-
cell && cell.col < table.rowHeaderLevelCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
|
|
50292
|
+
cell && cell.col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && (table.internalProps._widthResizedColMap.has(cell.col) || (table._setColWidth(cell.col, width), table.internalProps._widthResizedColMap.add(cell.col)));
|
|
50277
50293
|
}
|
|
50278
50294
|
}
|
|
50279
50295
|
|
|
@@ -60316,7 +60332,7 @@
|
|
|
60316
60332
|
}
|
|
60317
60333
|
constructor(container, options = {}) {
|
|
60318
60334
|
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;
|
|
60319
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.12
|
|
60335
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.12", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
60320
60336
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60321
60337
|
options: options,
|
|
60322
60338
|
container: container
|
|
@@ -61524,36 +61540,34 @@
|
|
|
61524
61540
|
}
|
|
61525
61541
|
}]);
|
|
61526
61542
|
}
|
|
61527
|
-
startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
|
|
61528
|
-
var _a, _b
|
|
61543
|
+
startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode, makeSelectCellVisible) {
|
|
61544
|
+
var _a, _b;
|
|
61529
61545
|
const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
|
|
61530
61546
|
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,
|
|
61531
61547
|
endCol = colIndex,
|
|
61532
61548
|
endRow = this.rowCount - 1;
|
|
61533
|
-
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1,
|
|
61549
|
+
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
|
|
61534
61550
|
}
|
|
61535
|
-
dragSelectCol(colIndex, enableCtrlSelectMode) {
|
|
61536
|
-
var _a, _b;
|
|
61551
|
+
dragSelectCol(colIndex, enableCtrlSelectMode, makeSelectCellVisible) {
|
|
61537
61552
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
61538
61553
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
61539
|
-
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1,
|
|
61554
|
+
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
|
|
61540
61555
|
}
|
|
61541
61556
|
endDragSelect() {
|
|
61542
61557
|
this.stateManager.updateInteractionState(InteractionState.default);
|
|
61543
61558
|
}
|
|
61544
|
-
startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
|
|
61545
|
-
var _a, _b
|
|
61559
|
+
startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift, makeSelectCellVisible) {
|
|
61560
|
+
var _a, _b;
|
|
61546
61561
|
const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1],
|
|
61547
61562
|
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,
|
|
61548
61563
|
endCol = this.colCount - 1,
|
|
61549
61564
|
endRow = rowIndex;
|
|
61550
|
-
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1,
|
|
61565
|
+
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
|
|
61551
61566
|
}
|
|
61552
|
-
dragSelectRow(rowIndex, isCtrl) {
|
|
61553
|
-
var _a, _b;
|
|
61567
|
+
dragSelectRow(rowIndex, isCtrl, makeSelectCellVisible) {
|
|
61554
61568
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
61555
61569
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
61556
|
-
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1,
|
|
61570
|
+
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
|
|
61557
61571
|
}
|
|
61558
61572
|
get recordsCount() {
|
|
61559
61573
|
var _a;
|
|
@@ -65403,6 +65417,9 @@
|
|
|
65403
65417
|
completeEditCell() {
|
|
65404
65418
|
this.editorManager.completeEdit();
|
|
65405
65419
|
}
|
|
65420
|
+
cancelEditCell() {
|
|
65421
|
+
this.editorManager.cancelEdit();
|
|
65422
|
+
}
|
|
65406
65423
|
getEditor(col, row) {
|
|
65407
65424
|
var _a, _b;
|
|
65408
65425
|
const lastSelectedCellEditor = this.editorManager.cacheLastSelectedCellEditor[`${col}-${row}`];
|
|
@@ -71096,11 +71113,11 @@
|
|
|
71096
71113
|
if (isRow) {
|
|
71097
71114
|
this.table.stateManager.setSelectInline("row");
|
|
71098
71115
|
const rowIndex = seriesNumberCell.id;
|
|
71099
|
-
isDragSelect ? this.table.dragSelectRow(rowIndex, enableCtrlSelectMode) : this.table.startDragSelectRow(rowIndex, enableCtrlSelectMode, enableShiftSelectMode);
|
|
71116
|
+
isDragSelect ? this.table.dragSelectRow(rowIndex, enableCtrlSelectMode, !1) : this.table.startDragSelectRow(rowIndex, enableCtrlSelectMode, enableShiftSelectMode, !1);
|
|
71100
71117
|
} else if (isCol) {
|
|
71101
71118
|
this.table.stateManager.setSelectInline("col");
|
|
71102
71119
|
const colIndex = seriesNumberCell.id;
|
|
71103
|
-
isDragSelect ? this.table.dragSelectCol(colIndex, enableCtrlSelectMode) : this.table.startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode);
|
|
71120
|
+
isDragSelect ? this.table.dragSelectCol(colIndex, enableCtrlSelectMode, !1) : this.table.startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode, !1);
|
|
71104
71121
|
} else this.table.eventManager.deelTableSelectAll();
|
|
71105
71122
|
}, this.handleSeriesNumberCellClickUp = e => {
|
|
71106
71123
|
this.table.stateManager.setSelectInline(!1), this.table.endDragSelect();
|
|
@@ -91411,7 +91428,7 @@
|
|
|
91411
91428
|
importStyle();
|
|
91412
91429
|
}
|
|
91413
91430
|
|
|
91414
|
-
const version = "1.22.12
|
|
91431
|
+
const version = "1.22.12";
|
|
91415
91432
|
importStyles();
|
|
91416
91433
|
|
|
91417
91434
|
exports.TYPES = index;
|