@visactor/vtable 0.23.1-alpha.1 → 0.23.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/ListTable.js +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +12 -0
- package/cjs/core/BaseTable.js +38 -10
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +1 -1
- package/cjs/data/DataSource.js +14 -3
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/event.d.ts +4 -0
- package/cjs/event/event.js +6 -5
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +65 -26
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -1
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/listener/touch.js +7 -18
- package/cjs/event/listener/touch.js.map +1 -1
- package/cjs/event/scroll.d.ts +16 -1
- package/cjs/event/scroll.js +38 -5
- 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/simple-header-layout.js +1 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +1 -1
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.js +2 -0
- package/cjs/scenegraph/icon/icon-update.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/layout/update-row.js +2 -3
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +4 -4
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +5 -5
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +2 -2
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/select/update-position.d.ts +1 -1
- package/cjs/state/select/update-position.js +4 -4
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +8 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/diff-cell.d.ts +1 -1
- package/cjs/tools/diff-cell.js +3 -3
- package/cjs/tools/diff-cell.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +12 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +425 -237
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +12 -0
- package/es/core/BaseTable.js +38 -10
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +1 -1
- package/es/data/DataSource.js +13 -4
- package/es/data/DataSource.js.map +1 -1
- package/es/event/event.d.ts +4 -0
- package/es/event/event.js +7 -4
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +66 -25
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +1 -1
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/listener/touch.js +7 -18
- package/es/event/listener/touch.js.map +1 -1
- package/es/event/scroll.d.ts +16 -1
- package/es/event/scroll.js +33 -2
- 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/simple-header-layout.js +1 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/component/table-component.js +1 -1
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/icon/icon-update.js +2 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +3 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +2 -3
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.js +4 -4
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +5 -5
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +2 -2
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/select/update-position.d.ts +1 -1
- package/es/state/select/update-position.js +4 -4
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +8 -4
- package/es/state/state.js.map +1 -1
- package/es/tools/diff-cell.d.ts +1 -1
- package/es/tools/diff-cell.js +3 -3
- package/es/tools/diff-cell.js.map +1 -1
- package/es/ts-types/base-table.d.ts +12 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
package/dist/vtable.js
CHANGED
|
@@ -1461,7 +1461,7 @@
|
|
|
1461
1461
|
function objectKeys(obj) {
|
|
1462
1462
|
return Object.keys(obj);
|
|
1463
1463
|
}
|
|
1464
|
-
function isEqual
|
|
1464
|
+
function isEqual(a, b, options) {
|
|
1465
1465
|
if (a === b) return !0;
|
|
1466
1466
|
if (typeof a != typeof b) return !1;
|
|
1467
1467
|
if (null == a || null == b) return !1;
|
|
@@ -1471,7 +1471,7 @@
|
|
|
1471
1471
|
if ("object" != typeof a) return !1;
|
|
1472
1472
|
if (isArray$3(a)) {
|
|
1473
1473
|
if (a.length !== b.length) return !1;
|
|
1474
|
-
for (let i = a.length - 1; i >= 0; i--) if (!isEqual
|
|
1474
|
+
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
|
|
1475
1475
|
return !0;
|
|
1476
1476
|
}
|
|
1477
1477
|
if (!isPlainObject$1(a)) return !1;
|
|
@@ -1482,7 +1482,7 @@
|
|
|
1482
1482
|
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
1483
1483
|
for (let i = ka.length - 1; i >= 0; i--) {
|
|
1484
1484
|
const key = ka[i];
|
|
1485
|
-
if (!isEqual
|
|
1485
|
+
if (!isEqual(a[key], b[key], options)) return !1;
|
|
1486
1486
|
}
|
|
1487
1487
|
return !0;
|
|
1488
1488
|
}
|
|
@@ -6789,10 +6789,10 @@
|
|
|
6789
6789
|
easing: "cubicOut"
|
|
6790
6790
|
};
|
|
6791
6791
|
|
|
6792
|
-
var Edge;
|
|
6792
|
+
var Edge$1;
|
|
6793
6793
|
!function (Edge) {
|
|
6794
6794
|
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
6795
|
-
}(Edge || (Edge = {}));
|
|
6795
|
+
}(Edge$1 || (Edge$1 = {}));
|
|
6796
6796
|
const _strokeVec4 = [!1, !1, !1, !1];
|
|
6797
6797
|
const parseStroke = stroke => {
|
|
6798
6798
|
var _a;
|
|
@@ -21360,10 +21360,10 @@
|
|
|
21360
21360
|
loadPyramid3dPick || (loadPyramid3dPick = !0, bind(CanvasPyramid3dPicker).to(DefaultCanvasPyramid3dPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasPyramid3dPicker));
|
|
21361
21361
|
});
|
|
21362
21362
|
|
|
21363
|
-
const browser = isBrowserEnv();
|
|
21363
|
+
const browser$1 = isBrowserEnv();
|
|
21364
21364
|
|
|
21365
21365
|
function _registerArc() {
|
|
21366
|
-
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
|
|
21366
|
+
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser$1 ? arcCanvasPickModule : arcMathPickModule));
|
|
21367
21367
|
}
|
|
21368
21368
|
_registerArc.__loaded = !1;
|
|
21369
21369
|
const registerArc = _registerArc;
|
|
@@ -21375,19 +21375,19 @@
|
|
|
21375
21375
|
const registerArc3d = _registerArc3d;
|
|
21376
21376
|
|
|
21377
21377
|
function _registerArea() {
|
|
21378
|
-
_registerArea.__loaded || (_registerArea.__loaded = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
|
|
21378
|
+
_registerArea.__loaded || (_registerArea.__loaded = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser$1 ? areaCanvasPickModule : areaMathPickModule));
|
|
21379
21379
|
}
|
|
21380
21380
|
_registerArea.__loaded = !1;
|
|
21381
21381
|
const registerArea = _registerArea;
|
|
21382
21382
|
|
|
21383
21383
|
function _registerCircle() {
|
|
21384
|
-
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
|
|
21384
|
+
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser$1 ? circleCanvasPickModule : circleMathPickModule));
|
|
21385
21385
|
}
|
|
21386
21386
|
_registerCircle.__loaded = !1;
|
|
21387
21387
|
const registerCircle = _registerCircle;
|
|
21388
21388
|
|
|
21389
21389
|
function _registerGlyph() {
|
|
21390
|
-
_registerGlyph.__loaded || (_registerGlyph.__loaded = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser ? glyphCanvasPickModule : glyphMathPickModule));
|
|
21390
|
+
_registerGlyph.__loaded || (_registerGlyph.__loaded = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser$1 ? glyphCanvasPickModule : glyphMathPickModule));
|
|
21391
21391
|
}
|
|
21392
21392
|
_registerGlyph.__loaded = !1;
|
|
21393
21393
|
const registerGlyph = _registerGlyph;
|
|
@@ -21399,25 +21399,25 @@
|
|
|
21399
21399
|
const registerGroup = _registerGroup;
|
|
21400
21400
|
|
|
21401
21401
|
function _registerImage() {
|
|
21402
|
-
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
|
|
21402
|
+
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser$1 ? imageCanvasPickModule : imageMathPickModule));
|
|
21403
21403
|
}
|
|
21404
21404
|
_registerImage.__loaded = !1;
|
|
21405
21405
|
const registerImage = _registerImage;
|
|
21406
21406
|
|
|
21407
21407
|
function _registerLine() {
|
|
21408
|
-
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
|
|
21408
|
+
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser$1 ? lineCanvasPickModule : lineMathPickModule));
|
|
21409
21409
|
}
|
|
21410
21410
|
_registerLine.__loaded = !1;
|
|
21411
21411
|
const registerLine = _registerLine;
|
|
21412
21412
|
|
|
21413
21413
|
function _registerPath() {
|
|
21414
|
-
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
|
|
21414
|
+
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser$1 ? pathCanvasPickModule : pathMathPickModule));
|
|
21415
21415
|
}
|
|
21416
21416
|
_registerPath.__loaded = !1;
|
|
21417
21417
|
const registerPath = _registerPath;
|
|
21418
21418
|
|
|
21419
21419
|
function _registerPolygon() {
|
|
21420
|
-
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
|
|
21420
|
+
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser$1 ? polygonCanvasPickModule : polygonMathPickModule));
|
|
21421
21421
|
}
|
|
21422
21422
|
_registerPolygon.__loaded = !1;
|
|
21423
21423
|
const registerPolygon = _registerPolygon;
|
|
@@ -21429,7 +21429,7 @@
|
|
|
21429
21429
|
const registerPyramid3d = _registerPyramid3d;
|
|
21430
21430
|
|
|
21431
21431
|
function _registerRect() {
|
|
21432
|
-
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
|
|
21432
|
+
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser$1 ? rectCanvasPickModule : rectMathPickModule));
|
|
21433
21433
|
}
|
|
21434
21434
|
_registerRect.__loaded = !1;
|
|
21435
21435
|
const registerRect = _registerRect;
|
|
@@ -21441,7 +21441,7 @@
|
|
|
21441
21441
|
const registerRect3d = _registerRect3d;
|
|
21442
21442
|
|
|
21443
21443
|
function _registerRichtext() {
|
|
21444
|
-
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
|
|
21444
|
+
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser$1 ? richtextCanvasPickModule : richTextMathPickModule));
|
|
21445
21445
|
}
|
|
21446
21446
|
_registerRichtext.__loaded = !1;
|
|
21447
21447
|
const registerRichtext = _registerRichtext;
|
|
@@ -21453,13 +21453,13 @@
|
|
|
21453
21453
|
const registerShadowRoot = _registerShadowRoot;
|
|
21454
21454
|
|
|
21455
21455
|
function _registerSymbol() {
|
|
21456
|
-
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
|
|
21456
|
+
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser$1 ? symbolCanvasPickModule : symbolMathPickModule));
|
|
21457
21457
|
}
|
|
21458
21458
|
_registerSymbol.__loaded = !1;
|
|
21459
21459
|
const registerSymbol = _registerSymbol;
|
|
21460
21460
|
|
|
21461
21461
|
function _registerText() {
|
|
21462
|
-
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
|
|
21462
|
+
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser$1 ? textCanvasPickModule : textMathPickModule));
|
|
21463
21463
|
}
|
|
21464
21464
|
_registerText.__loaded = !1;
|
|
21465
21465
|
const registerText = _registerText;
|
|
@@ -22869,7 +22869,7 @@
|
|
|
22869
22869
|
Safari: ua.indexOf('safari') > -1 && ua.indexOf('edge') === -1
|
|
22870
22870
|
};
|
|
22871
22871
|
}
|
|
22872
|
-
analyzeUserAgent();
|
|
22872
|
+
const { IE, Chrome, Firefox, Edge, Safari } = analyzeUserAgent();
|
|
22873
22873
|
function isObject$1(obj) {
|
|
22874
22874
|
return obj === Object(obj);
|
|
22875
22875
|
}
|
|
@@ -22998,6 +22998,14 @@
|
|
|
22998
22998
|
}
|
|
22999
22999
|
return false;
|
|
23000
23000
|
}
|
|
23001
|
+
const browser = {
|
|
23002
|
+
IE,
|
|
23003
|
+
Edge,
|
|
23004
|
+
Chrome,
|
|
23005
|
+
Firefox,
|
|
23006
|
+
Safari,
|
|
23007
|
+
heightLimit: Chrome ? 33554431 : Firefox ? 17895588 : 10737433
|
|
23008
|
+
};
|
|
23001
23009
|
const obj = {
|
|
23002
23010
|
isObject: isObject$1
|
|
23003
23011
|
};
|
|
@@ -32904,89 +32912,6 @@
|
|
|
32904
32912
|
}
|
|
32905
32913
|
}
|
|
32906
32914
|
|
|
32907
|
-
function diffCellAddress(col, row, oldCellIds, newCellIds, oldRowHeaderCellPositons, layout) {
|
|
32908
|
-
const columnHeaderStart = layout.columnHeaderLevelCount;
|
|
32909
|
-
const addCellPositions = [];
|
|
32910
|
-
const removeCellPositions = [];
|
|
32911
|
-
for (let i = 0; i < oldCellIds.length; i++) {
|
|
32912
|
-
if (!newCellIds.includes(oldCellIds[i])) {
|
|
32913
|
-
removeCellPositions.push(oldRowHeaderCellPositons[i]);
|
|
32914
|
-
}
|
|
32915
|
-
}
|
|
32916
|
-
for (let i = 0; i < newCellIds.length; i++) {
|
|
32917
|
-
if (!oldCellIds.includes(newCellIds[i])) {
|
|
32918
|
-
const newCellAddr = { col, row: columnHeaderStart + i };
|
|
32919
|
-
addCellPositions.push(newCellAddr);
|
|
32920
|
-
}
|
|
32921
|
-
}
|
|
32922
|
-
let parentId = layout.getParentCellId(col, row);
|
|
32923
|
-
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
32924
|
-
const updateCellPositions = [];
|
|
32925
|
-
parentCellAddress && updateCellPositions.push(parentCellAddress);
|
|
32926
|
-
while (parentId) {
|
|
32927
|
-
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
32928
|
-
if (parentId) {
|
|
32929
|
-
parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
32930
|
-
updateCellPositions.push(parentCellAddress);
|
|
32931
|
-
}
|
|
32932
|
-
}
|
|
32933
|
-
return {
|
|
32934
|
-
addCellPositions,
|
|
32935
|
-
removeCellPositions,
|
|
32936
|
-
updateCellPositions
|
|
32937
|
-
};
|
|
32938
|
-
}
|
|
32939
|
-
function calculateArrayDiff(originalArray, targetArray) {
|
|
32940
|
-
const add = [];
|
|
32941
|
-
const remove = [];
|
|
32942
|
-
const originalMap = new Map();
|
|
32943
|
-
for (let i = 0; i < originalArray.length; i++) {
|
|
32944
|
-
const element = originalArray[i];
|
|
32945
|
-
const key = JSON.stringify(element);
|
|
32946
|
-
if (originalMap.has(key)) {
|
|
32947
|
-
originalMap.get(key).push(i);
|
|
32948
|
-
}
|
|
32949
|
-
else {
|
|
32950
|
-
originalMap.set(key, [i]);
|
|
32951
|
-
}
|
|
32952
|
-
}
|
|
32953
|
-
for (let i = 0; i < targetArray.length; i++) {
|
|
32954
|
-
const element = targetArray[i];
|
|
32955
|
-
const key = JSON.stringify(element);
|
|
32956
|
-
if (!originalMap.has(key)) {
|
|
32957
|
-
add.push(i);
|
|
32958
|
-
}
|
|
32959
|
-
else {
|
|
32960
|
-
const indices = originalMap.get(key);
|
|
32961
|
-
indices.shift();
|
|
32962
|
-
if (indices.length === 0) {
|
|
32963
|
-
originalMap.delete(key);
|
|
32964
|
-
}
|
|
32965
|
-
}
|
|
32966
|
-
}
|
|
32967
|
-
for (let i = 0; i < originalArray.length; i++) {
|
|
32968
|
-
const element = originalArray[i];
|
|
32969
|
-
if (!targetArray.some(item => isEqual(item, element))) {
|
|
32970
|
-
remove.push(i);
|
|
32971
|
-
}
|
|
32972
|
-
}
|
|
32973
|
-
return { add, remove };
|
|
32974
|
-
}
|
|
32975
|
-
function isEqual(arr1, arr2) {
|
|
32976
|
-
if (arr1 === arr2) {
|
|
32977
|
-
return true;
|
|
32978
|
-
}
|
|
32979
|
-
if (arr1.length !== arr2.length) {
|
|
32980
|
-
return false;
|
|
32981
|
-
}
|
|
32982
|
-
for (let i = 0; i < arr1.length; i++) {
|
|
32983
|
-
if (arr1[i] !== arr2[i]) {
|
|
32984
|
-
return false;
|
|
32985
|
-
}
|
|
32986
|
-
}
|
|
32987
|
-
return true;
|
|
32988
|
-
}
|
|
32989
|
-
|
|
32990
32915
|
class Aggregator {
|
|
32991
32916
|
className = 'Aggregator';
|
|
32992
32917
|
isRecord = true;
|
|
@@ -33810,7 +33735,7 @@
|
|
|
33810
33735
|
const record = this.getOriginalRecord(this.currentIndexedData[index]);
|
|
33811
33736
|
return record?.hierarchyState ?? null;
|
|
33812
33737
|
}
|
|
33813
|
-
toggleHierarchyState(index) {
|
|
33738
|
+
toggleHierarchyState(index, bodyStartIndex, bodyEndIndex) {
|
|
33814
33739
|
const oldIndexedData = this.currentIndexedData.slice(0);
|
|
33815
33740
|
const indexed = this.getIndexKey(index);
|
|
33816
33741
|
const state = this.getHierarchyState(index);
|
|
@@ -33841,8 +33766,21 @@
|
|
|
33841
33766
|
data.hierarchyState = HierarchyState.collapse;
|
|
33842
33767
|
}
|
|
33843
33768
|
this.updatePagerData();
|
|
33844
|
-
const
|
|
33845
|
-
|
|
33769
|
+
const add = [];
|
|
33770
|
+
const remove = [];
|
|
33771
|
+
if (state === HierarchyState.collapse) {
|
|
33772
|
+
const addLength = this.currentIndexedData.length - oldIndexedData.length;
|
|
33773
|
+
for (let i = 0; i < addLength; i++) {
|
|
33774
|
+
add.push(index + i + 1);
|
|
33775
|
+
}
|
|
33776
|
+
}
|
|
33777
|
+
else if (state === HierarchyState.expand) {
|
|
33778
|
+
const removeLength = oldIndexedData.length - this.currentIndexedData.length;
|
|
33779
|
+
for (let i = 0; i < removeLength; i++) {
|
|
33780
|
+
remove.push(index + i + 1);
|
|
33781
|
+
}
|
|
33782
|
+
}
|
|
33783
|
+
return { add, remove };
|
|
33846
33784
|
}
|
|
33847
33785
|
pushChildrenNode(indexKey, hierarchyState, nodeData) {
|
|
33848
33786
|
if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {
|
|
@@ -36640,6 +36578,9 @@
|
|
|
36640
36578
|
const barPaddingLeft = Math.max(barPadding[3], Math.ceil(borderWidth[3] / 2));
|
|
36641
36579
|
contentWidth -= barPaddingRight + barPaddingLeft;
|
|
36642
36580
|
contentHeight -= barPaddingBottom + barPaddingTop;
|
|
36581
|
+
if (row === table.rowCount - 1) {
|
|
36582
|
+
contentHeight -= 1;
|
|
36583
|
+
}
|
|
36643
36584
|
const top = barPaddingTop;
|
|
36644
36585
|
const left = barPaddingLeft;
|
|
36645
36586
|
const right = contentWidth;
|
|
@@ -37692,7 +37633,7 @@
|
|
|
37692
37633
|
wordBreak: 'break-word',
|
|
37693
37634
|
heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
|
|
37694
37635
|
pickable: false,
|
|
37695
|
-
dx: hierarchyOffset + _contentOffset,
|
|
37636
|
+
dx: (textAlign === 'left' ? hierarchyOffset : 0) + _contentOffset,
|
|
37696
37637
|
whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
|
|
37697
37638
|
};
|
|
37698
37639
|
const wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
@@ -37794,7 +37735,8 @@
|
|
|
37794
37735
|
lineClamp,
|
|
37795
37736
|
wordBreak: 'break-word',
|
|
37796
37737
|
whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal',
|
|
37797
|
-
dx:
|
|
37738
|
+
dx: (textAlign === 'left' ? (!contentLeftIcons.length && !contentRightIcons.length ? hierarchyOffset : 0) : 0) +
|
|
37739
|
+
_contentOffset
|
|
37798
37740
|
};
|
|
37799
37741
|
const wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
37800
37742
|
wrapText.name = 'text';
|
|
@@ -38011,7 +37953,7 @@
|
|
|
38011
37953
|
let contentHeight;
|
|
38012
37954
|
if (textMark instanceof Text$1) {
|
|
38013
37955
|
oldTextHeight = textMark.AABBBounds.height();
|
|
38014
|
-
textMark.setAttribute('maxLineWidth', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));
|
|
37956
|
+
textMark.setAttribute('maxLineWidth', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]) - (textMark.attribute.dx ?? 0));
|
|
38015
37957
|
contentHeight = textMark.AABBBounds.height();
|
|
38016
37958
|
}
|
|
38017
37959
|
else if (textMark instanceof RichText) {
|
|
@@ -38695,7 +38637,7 @@
|
|
|
38695
38637
|
wordBreak: 'break-word',
|
|
38696
38638
|
heightLimit: cellHeight - (padding[0] + padding[2]),
|
|
38697
38639
|
pickable: false,
|
|
38698
|
-
dx: hierarchyOffset,
|
|
38640
|
+
dx: textAlign === 'left' ? hierarchyOffset : 0,
|
|
38699
38641
|
x
|
|
38700
38642
|
};
|
|
38701
38643
|
textMark.setAttributes(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
@@ -40389,7 +40331,8 @@
|
|
|
40389
40331
|
}
|
|
40390
40332
|
}
|
|
40391
40333
|
else if (autoWrapText) {
|
|
40392
|
-
const
|
|
40334
|
+
const hierarchyOffset = getHierarchyOffset(col, row, table);
|
|
40335
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - hierarchyOffset;
|
|
40393
40336
|
utilTextMark.setAttributes({
|
|
40394
40337
|
maxLineWidth,
|
|
40395
40338
|
text: lines,
|
|
@@ -41785,7 +41728,7 @@
|
|
|
41785
41728
|
this.frozenShadowLine.setAttributes({
|
|
41786
41729
|
visible: true,
|
|
41787
41730
|
x: colX,
|
|
41788
|
-
height: this.table.
|
|
41731
|
+
height: this.table.getDrawRange().height
|
|
41789
41732
|
});
|
|
41790
41733
|
}
|
|
41791
41734
|
}
|
|
@@ -46075,9 +46018,9 @@
|
|
|
46075
46018
|
}
|
|
46076
46019
|
}
|
|
46077
46020
|
function removeRow(row, scene) {
|
|
46078
|
-
removeCellGroup(row, scene);
|
|
46079
46021
|
const proxy = scene.proxy;
|
|
46080
46022
|
if (row >= proxy.rowStart && row <= proxy.rowEnd) {
|
|
46023
|
+
removeCellGroup(row, scene);
|
|
46081
46024
|
proxy.rowEnd--;
|
|
46082
46025
|
proxy.currentRow--;
|
|
46083
46026
|
}
|
|
@@ -47020,7 +46963,7 @@
|
|
|
47020
46963
|
}
|
|
47021
46964
|
newSelectedDataItemsInChart.push(selectedState);
|
|
47022
46965
|
}
|
|
47023
|
-
if (!isEqual
|
|
46966
|
+
if (!isEqual(table._selectedDataItemsInChart, newSelectedDataItemsInChart)) {
|
|
47024
46967
|
table._selectedDataItemsInChart = newSelectedDataItemsInChart;
|
|
47025
46968
|
table.internalProps.layoutMap.updateDataStateToChartInstance();
|
|
47026
46969
|
clearChartCacheImage(scenegraph);
|
|
@@ -47127,6 +47070,10 @@
|
|
|
47127
47070
|
}
|
|
47128
47071
|
updateCellRangeIcon(col, row, (icon) => icon.attribute.visibleTime === 'mouseenter_cell', (icon) => {
|
|
47129
47072
|
icon.setAttribute('opacity', 0);
|
|
47073
|
+
const iconBack = icon.parent.getChildByName('icon-back');
|
|
47074
|
+
if (iconBack) {
|
|
47075
|
+
iconBack.setAttribute('visible', false);
|
|
47076
|
+
}
|
|
47130
47077
|
}, scene);
|
|
47131
47078
|
scene.updateNextFrame();
|
|
47132
47079
|
}
|
|
@@ -48410,17 +48357,17 @@
|
|
|
48410
48357
|
this.cornerHeaderGroup.setDeltaHeight(detaY);
|
|
48411
48358
|
this.rowHeaderGroup.setDeltaY(detaY);
|
|
48412
48359
|
this.bodyGroup.setDeltaY(detaY);
|
|
48413
|
-
this.rightFrozenGroup.setDeltaY(detaY);
|
|
48360
|
+
this.table.rightFrozenColCount && this.rightFrozenGroup.setDeltaY(detaY);
|
|
48414
48361
|
}
|
|
48415
48362
|
else if (row >= this.table.rowCount - this.table.bottomFrozenRowCount) {
|
|
48416
48363
|
this.leftBottomCornerGroup.setDeltaHeight(detaY);
|
|
48417
48364
|
this.bottomFrozenGroup.setDeltaHeight(detaY);
|
|
48418
|
-
this.rightBottomCornerGroup.setDeltaHeight(detaY);
|
|
48365
|
+
this.table.rightFrozenColCount && this.rightBottomCornerGroup.setDeltaHeight(detaY);
|
|
48419
48366
|
}
|
|
48420
48367
|
else {
|
|
48421
48368
|
this.rowHeaderGroup.setDeltaHeight(detaY);
|
|
48422
48369
|
this.bodyGroup.setDeltaHeight(detaY);
|
|
48423
|
-
this.rightFrozenGroup.setDeltaHeight(detaY);
|
|
48370
|
+
this.table.rightFrozenColCount && this.rightFrozenGroup.setDeltaHeight(detaY);
|
|
48424
48371
|
}
|
|
48425
48372
|
}
|
|
48426
48373
|
updateContainerHeight(row, detaY) {
|
|
@@ -48443,7 +48390,8 @@
|
|
|
48443
48390
|
return;
|
|
48444
48391
|
}
|
|
48445
48392
|
if ((row >= this.proxy.rowStart && row <= this.proxy.rowEnd) ||
|
|
48446
|
-
(row >= this.table.rowCount - this.table.bottomFrozenRowCount && row <= this.table.rowCount - 1)
|
|
48393
|
+
(row >= this.table.rowCount - this.table.bottomFrozenRowCount && row <= this.table.rowCount - 1) ||
|
|
48394
|
+
row < this.table.frozenRowCount) {
|
|
48447
48395
|
this.updateRowHeight(row, height - oldHeight);
|
|
48448
48396
|
}
|
|
48449
48397
|
this.table._clearRowRangeHeightsMap(row);
|
|
@@ -49250,7 +49198,7 @@
|
|
|
49250
49198
|
return table._getLayoutCellId(col, row) === table._getLayoutCellId(range1Col, range1Row);
|
|
49251
49199
|
}
|
|
49252
49200
|
|
|
49253
|
-
function updateSelectPosition(state, col, row, isShift, isCtrl, isSelectAll) {
|
|
49201
|
+
function updateSelectPosition(state, col, row, isShift, isCtrl, isSelectAll, isSelectMoving = false) {
|
|
49254
49202
|
const { table, interactionState } = state;
|
|
49255
49203
|
const { scenegraph } = table;
|
|
49256
49204
|
const { highlightScope, disableHeader, cellPos } = state.select;
|
|
@@ -49258,7 +49206,7 @@
|
|
|
49258
49206
|
col = -1;
|
|
49259
49207
|
row = -1;
|
|
49260
49208
|
}
|
|
49261
|
-
if (col !== -1 && row !== -1) {
|
|
49209
|
+
if (col !== -1 && row !== -1 && !isSelectMoving) {
|
|
49262
49210
|
if (interactionState === InteractionState.grabing && state.select.ranges.length > 0) {
|
|
49263
49211
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
49264
49212
|
if (col > currentRange.start.col && col > currentRange.end.col) {
|
|
@@ -49294,7 +49242,9 @@
|
|
|
49294
49242
|
state.select.ranges = [];
|
|
49295
49243
|
scenegraph.deleteAllSelectBorder();
|
|
49296
49244
|
}
|
|
49297
|
-
else if (interactionState === InteractionState.default &&
|
|
49245
|
+
else if (interactionState === InteractionState.default &&
|
|
49246
|
+
!table.eventManager.isDraging &&
|
|
49247
|
+
!table.stateManager.isResizeCol()) {
|
|
49298
49248
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
49299
49249
|
if (isShift && currentRange) {
|
|
49300
49250
|
if (state.select.headerSelectMode !== 'cell' && table.isColumnHeader(col, row)) {
|
|
@@ -49367,7 +49317,8 @@
|
|
|
49367
49317
|
scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row, extendSelectRange);
|
|
49368
49318
|
}
|
|
49369
49319
|
}
|
|
49370
|
-
else if (interactionState === InteractionState.grabing
|
|
49320
|
+
else if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) &&
|
|
49321
|
+
!table.stateManager.isResizeCol()) {
|
|
49371
49322
|
let extendSelectRange = true;
|
|
49372
49323
|
if (cellPos.col === -1) {
|
|
49373
49324
|
cellPos.col = col;
|
|
@@ -49697,7 +49648,7 @@
|
|
|
49697
49648
|
const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
|
|
49698
49649
|
if (cellLocation === 'columnHeader') {
|
|
49699
49650
|
backX = state.columnMove.x;
|
|
49700
|
-
if (state.table.
|
|
49651
|
+
if (state.table.isLeftFrozenColumn(col)) {
|
|
49701
49652
|
lineX =
|
|
49702
49653
|
state.columnMove.colTarget >= state.columnMove.colSource
|
|
49703
49654
|
? state.table.getColsWidth(0, state.columnMove.colTarget)
|
|
@@ -49785,13 +49736,13 @@
|
|
|
49785
49736
|
state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType);
|
|
49786
49737
|
}
|
|
49787
49738
|
if (state.table.internalProps.frozenColDragHeaderMode === 'adjustFrozenCount' && state.table.isListTable()) {
|
|
49788
|
-
if (state.table.
|
|
49789
|
-
!state.table.
|
|
49739
|
+
if (state.table.isLeftFrozenColumn(state.columnMove.colTarget) &&
|
|
49740
|
+
!state.table.isLeftFrozenColumn(state.columnMove.colSource)) {
|
|
49790
49741
|
state.table.frozenColCount +=
|
|
49791
49742
|
sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
49792
49743
|
}
|
|
49793
|
-
else if (state.table.
|
|
49794
|
-
!state.table.
|
|
49744
|
+
else if (state.table.isLeftFrozenColumn(state.columnMove.colSource) &&
|
|
49745
|
+
!state.table.isLeftFrozenColumn(state.columnMove.colTarget)) {
|
|
49795
49746
|
state.table.frozenColCount -=
|
|
49796
49747
|
sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1;
|
|
49797
49748
|
}
|
|
@@ -50281,11 +50232,11 @@
|
|
|
50281
50232
|
updateHoverPos(col, row) {
|
|
50282
50233
|
updateHoverPosition(this, col, row);
|
|
50283
50234
|
}
|
|
50284
|
-
updateSelectPos(col, row, isShift = false, isCtrl = false, isSelectAll = false) {
|
|
50235
|
+
updateSelectPos(col, row, isShift = false, isCtrl = false, isSelectAll = false, isSelectMoving = false) {
|
|
50285
50236
|
if (row !== -1 && row !== -1) {
|
|
50286
50237
|
this.select.selecting = true;
|
|
50287
50238
|
}
|
|
50288
|
-
updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll);
|
|
50239
|
+
updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll, isSelectMoving);
|
|
50289
50240
|
}
|
|
50290
50241
|
checkCellRangeInSelect(cellPosStart, cellPosEnd) {
|
|
50291
50242
|
return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
|
|
@@ -50495,6 +50446,9 @@
|
|
|
50495
50446
|
const totalHeight = this.table.getAllRowsHeight();
|
|
50496
50447
|
const oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
50497
50448
|
this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
|
|
50449
|
+
if (!isValid$3(this.scroll.verticalBarPos) || isNaN(this.scroll.verticalBarPos)) {
|
|
50450
|
+
this.scroll.verticalBarPos = 0;
|
|
50451
|
+
}
|
|
50498
50452
|
this.table.scenegraph.setY(-this.scroll.verticalBarPos, yRatio === 1);
|
|
50499
50453
|
this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY;
|
|
50500
50454
|
this.table.scenegraph.proxy.deltaY = 0;
|
|
@@ -50517,6 +50471,9 @@
|
|
|
50517
50471
|
const totalWidth = this.table.getAllColsWidth();
|
|
50518
50472
|
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
50519
50473
|
this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
|
|
50474
|
+
if (!isValid$3(this.scroll.horizontalBarPos) || isNaN(this.scroll.horizontalBarPos)) {
|
|
50475
|
+
this.scroll.horizontalBarPos = 0;
|
|
50476
|
+
}
|
|
50520
50477
|
this.table.scenegraph.setX(-this.scroll.horizontalBarPos, xRatio === 1);
|
|
50521
50478
|
this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX;
|
|
50522
50479
|
this.table.scenegraph.proxy.deltaX = 0;
|
|
@@ -50544,6 +50501,9 @@
|
|
|
50544
50501
|
}
|
|
50545
50502
|
const oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
50546
50503
|
this.scroll.verticalBarPos = top;
|
|
50504
|
+
if (!isValid$3(this.scroll.verticalBarPos) || isNaN(this.scroll.verticalBarPos)) {
|
|
50505
|
+
this.scroll.verticalBarPos = 0;
|
|
50506
|
+
}
|
|
50547
50507
|
this.table.scenegraph.setY(-top);
|
|
50548
50508
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
50549
50509
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
@@ -50571,6 +50531,9 @@
|
|
|
50571
50531
|
}
|
|
50572
50532
|
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
50573
50533
|
this.scroll.horizontalBarPos = left;
|
|
50534
|
+
if (!isValid$3(this.scroll.horizontalBarPos) || isNaN(this.scroll.horizontalBarPos)) {
|
|
50535
|
+
this.scroll.horizontalBarPos = 0;
|
|
50536
|
+
}
|
|
50574
50537
|
this.table.scenegraph.setX(-left);
|
|
50575
50538
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
50576
50539
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
@@ -51196,9 +51159,6 @@
|
|
|
51196
51159
|
eventManager.touchSetTimeout = undefined;
|
|
51197
51160
|
}
|
|
51198
51161
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
51199
|
-
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
51200
|
-
return;
|
|
51201
|
-
}
|
|
51202
51162
|
if (stateManager.interactionState === InteractionState.grabing) {
|
|
51203
51163
|
if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
|
|
51204
51164
|
if (stateManager.isResizeCol()) ;
|
|
@@ -51214,6 +51174,9 @@
|
|
|
51214
51174
|
}
|
|
51215
51175
|
return;
|
|
51216
51176
|
}
|
|
51177
|
+
else if (table.eventManager.isDraging) {
|
|
51178
|
+
eventManager.dealTableSelect(eventArgsSet, true);
|
|
51179
|
+
}
|
|
51217
51180
|
if (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet)) {
|
|
51218
51181
|
if (table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet)) {
|
|
51219
51182
|
stateManager.updateCursor('crosshair');
|
|
@@ -51870,7 +51833,7 @@
|
|
|
51870
51833
|
});
|
|
51871
51834
|
}
|
|
51872
51835
|
|
|
51873
|
-
function handleWhell(event, state) {
|
|
51836
|
+
function handleWhell(event, state, isWheelEvent = true) {
|
|
51874
51837
|
let { deltaX, deltaY } = event;
|
|
51875
51838
|
if (event.shiftKey && event.deltaY) {
|
|
51876
51839
|
deltaX = deltaY;
|
|
@@ -51890,7 +51853,7 @@
|
|
|
51890
51853
|
state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY);
|
|
51891
51854
|
state.showVerticalScrollBar(true);
|
|
51892
51855
|
}
|
|
51893
|
-
state.resetInteractionState();
|
|
51856
|
+
isWheelEvent && state.resetInteractionState();
|
|
51894
51857
|
if (event.cancelable &&
|
|
51895
51858
|
(state.table.internalProps.overscrollBehavior === 'none' ||
|
|
51896
51859
|
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, state)) ||
|
|
@@ -51935,6 +51898,64 @@
|
|
|
51935
51898
|
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
51936
51899
|
return totalWidth !== 0 && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1;
|
|
51937
51900
|
}
|
|
51901
|
+
class InertiaScroll {
|
|
51902
|
+
friction;
|
|
51903
|
+
lastTime;
|
|
51904
|
+
speedX;
|
|
51905
|
+
speedY;
|
|
51906
|
+
stateManager;
|
|
51907
|
+
runingId;
|
|
51908
|
+
scrollHandle;
|
|
51909
|
+
constructor(stateManager) {
|
|
51910
|
+
this.stateManager = stateManager;
|
|
51911
|
+
}
|
|
51912
|
+
setScrollHandle(scrollHandle) {
|
|
51913
|
+
this.scrollHandle = scrollHandle;
|
|
51914
|
+
}
|
|
51915
|
+
startInertia(speedX, speedY, friction) {
|
|
51916
|
+
this.lastTime = Date.now();
|
|
51917
|
+
this.speedX = speedX;
|
|
51918
|
+
this.speedY = speedY;
|
|
51919
|
+
this.friction = friction;
|
|
51920
|
+
if (!this.runingId) {
|
|
51921
|
+
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
51922
|
+
}
|
|
51923
|
+
}
|
|
51924
|
+
inertia() {
|
|
51925
|
+
const now = Date.now();
|
|
51926
|
+
const dffTime = now - this.lastTime;
|
|
51927
|
+
let stopped = true;
|
|
51928
|
+
const f = Math.pow(this.friction, dffTime / 16);
|
|
51929
|
+
const newSpeedX = f * this.speedX;
|
|
51930
|
+
const newSpeedY = f * this.speedY;
|
|
51931
|
+
let dx = 0;
|
|
51932
|
+
let dy = 0;
|
|
51933
|
+
if (Math.abs(newSpeedX) > 0.05) {
|
|
51934
|
+
stopped = false;
|
|
51935
|
+
dx = ((this.speedX + newSpeedX) / 2) * dffTime;
|
|
51936
|
+
}
|
|
51937
|
+
if (Math.abs(newSpeedY) > 0.05) {
|
|
51938
|
+
stopped = false;
|
|
51939
|
+
dy = ((this.speedY + newSpeedY) / 2) * dffTime;
|
|
51940
|
+
}
|
|
51941
|
+
this.scrollHandle?.(dx, dy);
|
|
51942
|
+
if (stopped) {
|
|
51943
|
+
this.runingId = null;
|
|
51944
|
+
return;
|
|
51945
|
+
}
|
|
51946
|
+
this.lastTime = now;
|
|
51947
|
+
this.speedX = newSpeedX;
|
|
51948
|
+
this.speedY = newSpeedY;
|
|
51949
|
+
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
51950
|
+
}
|
|
51951
|
+
endInertia() {
|
|
51952
|
+
cancelAnimationFrame(this.runingId);
|
|
51953
|
+
this.runingId = null;
|
|
51954
|
+
}
|
|
51955
|
+
isInertiaScrolling() {
|
|
51956
|
+
return !!this.runingId;
|
|
51957
|
+
}
|
|
51958
|
+
}
|
|
51938
51959
|
|
|
51939
51960
|
function bindContainerDomListener(eventManager) {
|
|
51940
51961
|
const table = eventManager.table;
|
|
@@ -52057,51 +52078,61 @@
|
|
|
52057
52078
|
const data = table.getCopyValue();
|
|
52058
52079
|
if (isValid$3(data)) {
|
|
52059
52080
|
e.preventDefault();
|
|
52060
|
-
|
|
52061
|
-
const
|
|
52062
|
-
|
|
52063
|
-
|
|
52064
|
-
|
|
52065
|
-
|
|
52066
|
-
|
|
52067
|
-
|
|
52068
|
-
|
|
52069
|
-
|
|
52070
|
-
|
|
52071
|
-
|
|
52072
|
-
|
|
52073
|
-
|
|
52074
|
-
|
|
52075
|
-
|
|
52076
|
-
|
|
52077
|
-
|
|
52078
|
-
|
|
52079
|
-
|
|
52080
|
-
|
|
52081
|
-
|
|
52082
|
-
|
|
52083
|
-
|
|
52084
|
-
|
|
52085
|
-
|
|
52086
|
-
|
|
52087
|
-
|
|
52088
|
-
|
|
52081
|
+
if (navigator.clipboard?.write) {
|
|
52082
|
+
const setDataToHTML = (data) => {
|
|
52083
|
+
const result = ['<table>'];
|
|
52084
|
+
const META_HEAD = [
|
|
52085
|
+
'<meta name="author" content="Visactor"/>',
|
|
52086
|
+
'<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'
|
|
52087
|
+
].join('');
|
|
52088
|
+
const rows = data.split('\r\n');
|
|
52089
|
+
rows.forEach(function (rowCells, rowIndex) {
|
|
52090
|
+
const cells = rowCells.split('\t');
|
|
52091
|
+
const rowValues = [];
|
|
52092
|
+
if (rowIndex === 0) {
|
|
52093
|
+
result.push('<tbody>');
|
|
52094
|
+
}
|
|
52095
|
+
cells.forEach(function (cell, cellIndex) {
|
|
52096
|
+
const parsedCellData = !cell
|
|
52097
|
+
? ''
|
|
52098
|
+
: cell
|
|
52099
|
+
.toString()
|
|
52100
|
+
.replace(/&/g, '&')
|
|
52101
|
+
.replace(/'/g, ''')
|
|
52102
|
+
.replace(/</g, '<')
|
|
52103
|
+
.replace(/>/g, '>')
|
|
52104
|
+
.replace(/\n/g, '<br>')
|
|
52105
|
+
.replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n')
|
|
52106
|
+
.replace(/\x20{2,}/gi, (substring) => {
|
|
52107
|
+
return `<span style="mso-spacerun: yes">${' '.repeat(substring.length - 1)} </span>`;
|
|
52108
|
+
})
|
|
52109
|
+
.replace(/\t/gi, '	');
|
|
52110
|
+
rowValues.push(`<td>${parsedCellData}</td>`);
|
|
52111
|
+
});
|
|
52112
|
+
result.push('<tr>', ...rowValues, '</tr>');
|
|
52113
|
+
if (rowIndex === rowCells.length - 1) {
|
|
52114
|
+
result.push('</tbody>');
|
|
52115
|
+
}
|
|
52089
52116
|
});
|
|
52090
|
-
result.push('
|
|
52091
|
-
|
|
52092
|
-
|
|
52093
|
-
|
|
52094
|
-
|
|
52095
|
-
|
|
52096
|
-
|
|
52097
|
-
|
|
52098
|
-
|
|
52099
|
-
|
|
52100
|
-
|
|
52101
|
-
|
|
52102
|
-
|
|
52103
|
-
|
|
52104
|
-
|
|
52117
|
+
result.push('</table>');
|
|
52118
|
+
return [META_HEAD, result.join('')].join('');
|
|
52119
|
+
};
|
|
52120
|
+
const dataHTML = setDataToHTML(data);
|
|
52121
|
+
navigator.clipboard.write([
|
|
52122
|
+
new ClipboardItem({
|
|
52123
|
+
'text/html': new Blob([dataHTML], { type: 'text/html' }),
|
|
52124
|
+
'text/plain': new Blob([data], { type: 'text/plain' })
|
|
52125
|
+
})
|
|
52126
|
+
]);
|
|
52127
|
+
}
|
|
52128
|
+
else {
|
|
52129
|
+
if (browser.IE) {
|
|
52130
|
+
window.clipboardData.setData('Text', data);
|
|
52131
|
+
}
|
|
52132
|
+
else {
|
|
52133
|
+
e.clipboardData.setData('text/plain', data);
|
|
52134
|
+
}
|
|
52135
|
+
}
|
|
52105
52136
|
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
52106
52137
|
cellRange: table.stateManager.select.ranges,
|
|
52107
52138
|
copyData: data
|
|
@@ -52115,17 +52146,40 @@
|
|
|
52115
52146
|
return;
|
|
52116
52147
|
}
|
|
52117
52148
|
if (table.stateManager.select.ranges?.length > 0) {
|
|
52118
|
-
navigator.clipboard
|
|
52119
|
-
|
|
52120
|
-
|
|
52121
|
-
|
|
52122
|
-
|
|
52123
|
-
|
|
52124
|
-
|
|
52149
|
+
if (navigator.clipboard?.read) {
|
|
52150
|
+
navigator.clipboard.read().then(clipboardItems => {
|
|
52151
|
+
for (const item of clipboardItems) {
|
|
52152
|
+
if (item.types.includes('text/html')) {
|
|
52153
|
+
pasteHtmlToTable(item);
|
|
52154
|
+
}
|
|
52155
|
+
else if (item.types.length === 1 && item.types[0] === 'text/plain') {
|
|
52156
|
+
pasteTextToTable(item);
|
|
52157
|
+
}
|
|
52158
|
+
else ;
|
|
52125
52159
|
}
|
|
52126
|
-
|
|
52127
|
-
|
|
52128
|
-
|
|
52160
|
+
});
|
|
52161
|
+
}
|
|
52162
|
+
else {
|
|
52163
|
+
const ranges = table.stateManager.select.ranges;
|
|
52164
|
+
const col = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
52165
|
+
const row = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
52166
|
+
const clipboardData = e.clipboardData || window.Clipboard;
|
|
52167
|
+
const pastedData = clipboardData.getData('text');
|
|
52168
|
+
const rows = pastedData.split('\n');
|
|
52169
|
+
const values = [];
|
|
52170
|
+
rows.forEach(function (rowCells, rowIndex) {
|
|
52171
|
+
const cells = rowCells.split('\t');
|
|
52172
|
+
const rowValues = [];
|
|
52173
|
+
values.push(rowValues);
|
|
52174
|
+
cells.forEach(function (cell, cellIndex) {
|
|
52175
|
+
if (cellIndex === cells.length - 1) {
|
|
52176
|
+
cell = cell.trim();
|
|
52177
|
+
}
|
|
52178
|
+
rowValues.push(cell);
|
|
52179
|
+
});
|
|
52180
|
+
});
|
|
52181
|
+
table.changeCellValues(col, row, values);
|
|
52182
|
+
}
|
|
52129
52183
|
}
|
|
52130
52184
|
}
|
|
52131
52185
|
});
|
|
@@ -52286,6 +52340,7 @@
|
|
|
52286
52340
|
table.eventManager.LastBodyPointerXY = null;
|
|
52287
52341
|
table.eventManager.isDown = false;
|
|
52288
52342
|
table.eventManager.isDraging = false;
|
|
52343
|
+
table.eventManager.inertiaScroll.endInertia();
|
|
52289
52344
|
};
|
|
52290
52345
|
eventManager.globalEventListeners.push({
|
|
52291
52346
|
name: 'pointerup',
|
|
@@ -52302,9 +52357,6 @@
|
|
|
52302
52357
|
}
|
|
52303
52358
|
}
|
|
52304
52359
|
const { x, y } = table._getMouseAbstractPoint(e, false);
|
|
52305
|
-
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
52306
|
-
return;
|
|
52307
|
-
}
|
|
52308
52360
|
if (stateManager.interactionState === InteractionState.grabing) {
|
|
52309
52361
|
if (stateManager.isResizeCol()) {
|
|
52310
52362
|
eventManager.dealColumnResize(x, y);
|
|
@@ -52316,6 +52368,95 @@
|
|
|
52316
52368
|
}
|
|
52317
52369
|
}
|
|
52318
52370
|
}
|
|
52371
|
+
const isSelecting = table.stateManager.isSelecting();
|
|
52372
|
+
if (eventManager.isDraging && isSelecting) {
|
|
52373
|
+
const drawRange = table.getDrawRange();
|
|
52374
|
+
const topFrozenRowHeight = table.getFrozenRowsHeight();
|
|
52375
|
+
const bottomFrozenRowHeight = table.getBottomFrozenRowsHeight();
|
|
52376
|
+
const leftFrozenColsWidth = table.getFrozenColsWidth();
|
|
52377
|
+
const rightFrozenColsWidth = table.getRightFrozenColsWidth();
|
|
52378
|
+
const startCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].start;
|
|
52379
|
+
const endCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end;
|
|
52380
|
+
const canScrollY = table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false;
|
|
52381
|
+
const canScrollX = table.isFrozenColumn(startCell.col) === false || table.isFrozenColumn(endCell.col) === false;
|
|
52382
|
+
if (((y > drawRange.bottom - bottomFrozenRowHeight || y < drawRange.top + topFrozenRowHeight) && canScrollY) ||
|
|
52383
|
+
((x > drawRange.right - rightFrozenColsWidth || x < drawRange.left + leftFrozenColsWidth) && canScrollX)) {
|
|
52384
|
+
table.eventManager.scrollXSpeed = 0;
|
|
52385
|
+
table.eventManager.scrollYSpeed = 0;
|
|
52386
|
+
let bottom = false;
|
|
52387
|
+
let top = false;
|
|
52388
|
+
let right = false;
|
|
52389
|
+
let left = false;
|
|
52390
|
+
if (y > drawRange.bottom - bottomFrozenRowHeight &&
|
|
52391
|
+
canScrollY &&
|
|
52392
|
+
table.scrollTop + table.tableNoFrameWidth < table.getAllRowsHeight()) {
|
|
52393
|
+
bottom = true;
|
|
52394
|
+
table.eventManager.scrollYSpeed = -(y - drawRange.bottom + bottomFrozenRowHeight) / 50;
|
|
52395
|
+
}
|
|
52396
|
+
else if (y < drawRange.top + topFrozenRowHeight && canScrollY && table.scrollTop > 0) {
|
|
52397
|
+
top = true;
|
|
52398
|
+
table.eventManager.scrollYSpeed = -(y - drawRange.top - topFrozenRowHeight) / 50;
|
|
52399
|
+
}
|
|
52400
|
+
if (x > drawRange.right - rightFrozenColsWidth &&
|
|
52401
|
+
canScrollX &&
|
|
52402
|
+
table.scrollLeft + table.tableNoFrameWidth < table.getAllColsWidth()) {
|
|
52403
|
+
right = true;
|
|
52404
|
+
table.eventManager.scrollXSpeed = -(x - drawRange.right + rightFrozenColsWidth) / 50;
|
|
52405
|
+
}
|
|
52406
|
+
else if (x < drawRange.left + leftFrozenColsWidth && canScrollX && table.scrollLeft > 0) {
|
|
52407
|
+
left = true;
|
|
52408
|
+
table.eventManager.scrollXSpeed = -(x - drawRange.left - leftFrozenColsWidth) / 50;
|
|
52409
|
+
}
|
|
52410
|
+
table.eventManager.inertiaScroll.startInertia(table.eventManager.scrollXSpeed, table.eventManager.scrollYSpeed, 1);
|
|
52411
|
+
table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
|
|
52412
|
+
handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager, false);
|
|
52413
|
+
let selectX;
|
|
52414
|
+
let selectY;
|
|
52415
|
+
if (bottom) {
|
|
52416
|
+
selectY = table.scrollTop + drawRange.height - bottomFrozenRowHeight - 20;
|
|
52417
|
+
}
|
|
52418
|
+
else if (top) {
|
|
52419
|
+
selectY = table.scrollTop + topFrozenRowHeight + 20;
|
|
52420
|
+
}
|
|
52421
|
+
if (right) {
|
|
52422
|
+
selectX = table.scrollLeft + drawRange.width - rightFrozenColsWidth - 20;
|
|
52423
|
+
}
|
|
52424
|
+
else if (left) {
|
|
52425
|
+
selectX = table.scrollLeft + leftFrozenColsWidth + 20;
|
|
52426
|
+
}
|
|
52427
|
+
let considerFrozenY = false;
|
|
52428
|
+
let considerFrozenX = false;
|
|
52429
|
+
if (!right && !left) {
|
|
52430
|
+
if ((x > table.tableNoFrameWidth - table.getRightFrozenColsWidth() && x < table.tableNoFrameWidth) ||
|
|
52431
|
+
(x > 0 && x < table.getFrozenColsWidth())) {
|
|
52432
|
+
selectX = x;
|
|
52433
|
+
considerFrozenX = true;
|
|
52434
|
+
}
|
|
52435
|
+
else {
|
|
52436
|
+
selectX = table.scrollLeft + x;
|
|
52437
|
+
}
|
|
52438
|
+
}
|
|
52439
|
+
if (!bottom && !top) {
|
|
52440
|
+
if ((y > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() && y < table.tableNoFrameHeight) ||
|
|
52441
|
+
(y > 0 && y < table.getFrozenRowsHeight())) {
|
|
52442
|
+
selectY = y;
|
|
52443
|
+
considerFrozenY = true;
|
|
52444
|
+
}
|
|
52445
|
+
else {
|
|
52446
|
+
selectY = table.scrollTop + y;
|
|
52447
|
+
}
|
|
52448
|
+
}
|
|
52449
|
+
table.stateManager.updateInteractionState(InteractionState.grabing);
|
|
52450
|
+
table.stateManager.updateSelectPos(table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX).col, table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY).row, false, false, false, true);
|
|
52451
|
+
});
|
|
52452
|
+
}
|
|
52453
|
+
else if (table.eventManager.inertiaScroll.isInertiaScrolling()) {
|
|
52454
|
+
table.eventManager.inertiaScroll.endInertia();
|
|
52455
|
+
}
|
|
52456
|
+
else {
|
|
52457
|
+
table.eventManager.scrollYSpeed = 0;
|
|
52458
|
+
}
|
|
52459
|
+
}
|
|
52319
52460
|
};
|
|
52320
52461
|
eventManager.globalEventListeners.push({
|
|
52321
52462
|
name: 'pointermove',
|
|
@@ -52393,7 +52534,10 @@
|
|
|
52393
52534
|
const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
|
|
52394
52535
|
const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52395
52536
|
const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
52396
|
-
startInertia(vX, vY,
|
|
52537
|
+
eventManager.inertiaScroll.startInertia(vX, vY, 0.95);
|
|
52538
|
+
table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
|
|
52539
|
+
handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager);
|
|
52540
|
+
});
|
|
52397
52541
|
}
|
|
52398
52542
|
eventManager.isTouchdown = false;
|
|
52399
52543
|
eventManager.touchMovePoints = [];
|
|
@@ -52423,37 +52567,6 @@
|
|
|
52423
52567
|
function isTouchEvent$1(e) {
|
|
52424
52568
|
return !!e.changedTouches;
|
|
52425
52569
|
}
|
|
52426
|
-
function startInertia(vX, vY, stateManager) {
|
|
52427
|
-
let time = Date.now();
|
|
52428
|
-
const friction = 0.95;
|
|
52429
|
-
const inertia = () => {
|
|
52430
|
-
const now = Date.now();
|
|
52431
|
-
const dffTime = now - time;
|
|
52432
|
-
let stopped = true;
|
|
52433
|
-
const f = Math.pow(friction, dffTime / 16);
|
|
52434
|
-
const newVX = f * vX;
|
|
52435
|
-
const newVY = f * vY;
|
|
52436
|
-
let dx = 0;
|
|
52437
|
-
let dy = 0;
|
|
52438
|
-
if (Math.abs(newVX) > 0.05) {
|
|
52439
|
-
stopped = false;
|
|
52440
|
-
dx = ((vX + newVX) / 2) * dffTime;
|
|
52441
|
-
}
|
|
52442
|
-
if (Math.abs(newVY) > 0.05) {
|
|
52443
|
-
stopped = false;
|
|
52444
|
-
dy = ((vY + newVY) / 2) * dffTime;
|
|
52445
|
-
}
|
|
52446
|
-
handleWhell({ deltaX: -dx, deltaY: -dy }, stateManager);
|
|
52447
|
-
if (stopped) {
|
|
52448
|
-
return;
|
|
52449
|
-
}
|
|
52450
|
-
time = now;
|
|
52451
|
-
vX = newVX;
|
|
52452
|
-
vY = newVY;
|
|
52453
|
-
requestAnimationFrame(inertia);
|
|
52454
|
-
};
|
|
52455
|
-
requestAnimationFrame(inertia);
|
|
52456
|
-
}
|
|
52457
52570
|
|
|
52458
52571
|
function bindAxisClickEvent(table) {
|
|
52459
52572
|
if (!table.isPivotChart()) {
|
|
@@ -52593,9 +52706,13 @@
|
|
|
52593
52706
|
LastBodyPointerXY;
|
|
52594
52707
|
isDown = false;
|
|
52595
52708
|
isDraging = false;
|
|
52709
|
+
scrollYSpeed;
|
|
52710
|
+
scrollXSpeed;
|
|
52596
52711
|
globalEventListeners = [];
|
|
52712
|
+
inertiaScroll;
|
|
52597
52713
|
constructor(table) {
|
|
52598
52714
|
this.table = table;
|
|
52715
|
+
this.inertiaScroll = new InertiaScroll(table.stateManager);
|
|
52599
52716
|
if (Env.mode === 'node') {
|
|
52600
52717
|
return;
|
|
52601
52718
|
}
|
|
@@ -52745,7 +52862,7 @@
|
|
|
52745
52862
|
this.table.stateManager.updateSelectPos(-1, -1);
|
|
52746
52863
|
return false;
|
|
52747
52864
|
}
|
|
52748
|
-
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey);
|
|
52865
|
+
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, false, isSelectMoving);
|
|
52749
52866
|
return true;
|
|
52750
52867
|
}
|
|
52751
52868
|
return false;
|
|
@@ -52793,10 +52910,10 @@
|
|
|
52793
52910
|
updateCol = eventArgs.col;
|
|
52794
52911
|
}
|
|
52795
52912
|
}
|
|
52796
|
-
this.table.stateManager.updateSelectPos(isSelectMoving ? updateCol : currentRange.end.col, isSelectMoving ? updateRow : currentRange.end.row, true, eventArgs.event.ctrlKey || eventArgs.event.metaKey);
|
|
52913
|
+
this.table.stateManager.updateSelectPos(isSelectMoving ? updateCol : currentRange.end.col, isSelectMoving ? updateRow : currentRange.end.row, true, eventArgs.event.ctrlKey || eventArgs.event.metaKey, false, isSelectMoving);
|
|
52797
52914
|
}
|
|
52798
52915
|
else {
|
|
52799
|
-
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey);
|
|
52916
|
+
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, false, isSelectMoving);
|
|
52800
52917
|
}
|
|
52801
52918
|
return true;
|
|
52802
52919
|
}
|
|
@@ -56133,7 +56250,7 @@
|
|
|
56133
56250
|
return TABLE_EVENT_TYPE;
|
|
56134
56251
|
}
|
|
56135
56252
|
options;
|
|
56136
|
-
version = "0.23.1
|
|
56253
|
+
version = "0.23.1";
|
|
56137
56254
|
pagination;
|
|
56138
56255
|
id = `VTable${Date.now()}`;
|
|
56139
56256
|
headerStyleCache;
|
|
@@ -56152,7 +56269,6 @@
|
|
|
56152
56269
|
const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
|
|
56153
56270
|
this.container = container;
|
|
56154
56271
|
this.options = options;
|
|
56155
|
-
this.options.container = container;
|
|
56156
56272
|
this._widthMode = widthMode;
|
|
56157
56273
|
this._heightMode = heightMode;
|
|
56158
56274
|
this._autoFillWidth = autoFillWidth;
|
|
@@ -56948,8 +57064,8 @@
|
|
|
56948
57064
|
return this.getCellsRectWidth(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row);
|
|
56949
57065
|
}
|
|
56950
57066
|
isFrozenCell(col, row) {
|
|
56951
|
-
const isFrozenRow = this.isFrozenRow(row)
|
|
56952
|
-
const isFrozenCol = this.isFrozenColumn(col)
|
|
57067
|
+
const isFrozenRow = this.isFrozenRow(row);
|
|
57068
|
+
const isFrozenCol = this.isFrozenColumn(col);
|
|
56953
57069
|
if (isFrozenRow || isFrozenCol) {
|
|
56954
57070
|
return {
|
|
56955
57071
|
row: isFrozenRow,
|
|
@@ -57496,6 +57612,46 @@
|
|
|
57496
57612
|
}
|
|
57497
57613
|
return findBefore(candRow, bottom);
|
|
57498
57614
|
}
|
|
57615
|
+
getTargetColAtConsiderRightFrozen(absoluteX, isConsider) {
|
|
57616
|
+
if (absoluteX === 0) {
|
|
57617
|
+
return { left: 0, col: 0, right: 0, width: 0 };
|
|
57618
|
+
}
|
|
57619
|
+
if (isConsider &&
|
|
57620
|
+
absoluteX > this.tableNoFrameWidth - this.getRightFrozenColsWidth() &&
|
|
57621
|
+
absoluteX < this.tableNoFrameWidth) {
|
|
57622
|
+
for (let i = 0; i < this.rightFrozenColCount; i++) {
|
|
57623
|
+
if (absoluteX > this.tableNoFrameWidth - this.getColsWidth(this.colCount - i - 1, this.colCount - 1)) {
|
|
57624
|
+
return {
|
|
57625
|
+
col: this.colCount - i - 1,
|
|
57626
|
+
left: undefined,
|
|
57627
|
+
right: undefined,
|
|
57628
|
+
width: undefined
|
|
57629
|
+
};
|
|
57630
|
+
}
|
|
57631
|
+
}
|
|
57632
|
+
}
|
|
57633
|
+
return this.getTargetColAt(absoluteX);
|
|
57634
|
+
}
|
|
57635
|
+
getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider) {
|
|
57636
|
+
if (absoluteY === 0) {
|
|
57637
|
+
return { top: 0, row: 0, bottom: 0, height: 0 };
|
|
57638
|
+
}
|
|
57639
|
+
if (isConsider &&
|
|
57640
|
+
absoluteY > this.tableNoFrameHeight - this.getBottomFrozenRowsHeight() &&
|
|
57641
|
+
absoluteY < this.tableNoFrameHeight) {
|
|
57642
|
+
for (let i = 0; i < this.rightFrozenColCount; i++) {
|
|
57643
|
+
if (absoluteY > this.tableNoFrameHeight - this.getRowsHeight(this.rowCount - i - 1, this.rowCount - 1)) {
|
|
57644
|
+
return {
|
|
57645
|
+
row: this.rowCount - i - 1,
|
|
57646
|
+
top: undefined,
|
|
57647
|
+
bottom: undefined,
|
|
57648
|
+
height: undefined
|
|
57649
|
+
};
|
|
57650
|
+
}
|
|
57651
|
+
}
|
|
57652
|
+
}
|
|
57653
|
+
return this.getTargetRowAt(absoluteY);
|
|
57654
|
+
}
|
|
57499
57655
|
computeTargetRowByY(absoluteY) {
|
|
57500
57656
|
let defaultRowHeight = this.internalProps.defaultRowHeight;
|
|
57501
57657
|
if (this._rowRangeHeightsMap.get(`$0$${this.rowCount - 1}`)) {
|
|
@@ -57776,7 +57932,7 @@
|
|
|
57776
57932
|
return this.internalProps.layoutMap?.isCornerHeader(col, row);
|
|
57777
57933
|
}
|
|
57778
57934
|
isFrozenColumn(col, row) {
|
|
57779
|
-
return this.
|
|
57935
|
+
return this.isLeftFrozenColumn(col, row) || this.isRightFrozenColumn(col, row);
|
|
57780
57936
|
}
|
|
57781
57937
|
isLeftFrozenColumn(col, row) {
|
|
57782
57938
|
return this.internalProps.layoutMap?.isFrozenColumn(col, row);
|
|
@@ -57785,7 +57941,7 @@
|
|
|
57785
57941
|
return this.internalProps.layoutMap?.isRightFrozenColumn(col, row);
|
|
57786
57942
|
}
|
|
57787
57943
|
isFrozenRow(col, row) {
|
|
57788
|
-
return this.
|
|
57944
|
+
return this.isTopFrozenRow(col, row) || this.isBottomFrozenRow(col, row);
|
|
57789
57945
|
}
|
|
57790
57946
|
isTopFrozenRow(col, row) {
|
|
57791
57947
|
return this.internalProps.layoutMap?.isFrozenRow(col, row);
|
|
@@ -58023,8 +58179,7 @@
|
|
|
58023
58179
|
}
|
|
58024
58180
|
_canDragHeaderPosition(col, row) {
|
|
58025
58181
|
if (this.isHeader(col, row) && this.stateManager.isSelected(col, row)) {
|
|
58026
|
-
if (this.internalProps.frozenColDragHeaderMode === 'disabled' &&
|
|
58027
|
-
(this.isFrozenColumn(col) || this.isRightFrozenColumn(col))) {
|
|
58182
|
+
if (this.internalProps.frozenColDragHeaderMode === 'disabled' && this.isFrozenColumn(col)) {
|
|
58028
58183
|
return false;
|
|
58029
58184
|
}
|
|
58030
58185
|
const selectRange = this.stateManager.select.ranges[0];
|
|
@@ -60584,7 +60739,7 @@
|
|
|
60584
60739
|
return false;
|
|
60585
60740
|
}
|
|
60586
60741
|
if (this._table.internalProps.frozenColDragHeaderMode === 'disabled') {
|
|
60587
|
-
if (this._table.isFrozenColumn(target.col)
|
|
60742
|
+
if (this._table.isFrozenColumn(target.col)) {
|
|
60588
60743
|
return false;
|
|
60589
60744
|
}
|
|
60590
60745
|
}
|
|
@@ -60805,7 +60960,7 @@
|
|
|
60805
60960
|
}
|
|
60806
60961
|
_createOrUpdateTitleComponent(attrs) {
|
|
60807
60962
|
if (this._titleComponent) {
|
|
60808
|
-
if (!isEqual
|
|
60963
|
+
if (!isEqual(attrs, this._cacheAttrs)) {
|
|
60809
60964
|
this._titleComponent.setAttributes(attrs);
|
|
60810
60965
|
}
|
|
60811
60966
|
}
|
|
@@ -61583,7 +61738,7 @@
|
|
|
61583
61738
|
}
|
|
61584
61739
|
}
|
|
61585
61740
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
61586
|
-
const diffDataIndices = this.dataSource.toggleHierarchyState(index);
|
|
61741
|
+
const diffDataIndices = this.dataSource.toggleHierarchyState(index, this.scenegraph.proxy.rowStart - this.columnHeaderLevelCount, Math.max(this.scenegraph.proxy.rowEnd - this.columnHeaderLevelCount, this.scenegraph.proxy.rowStart - this.columnHeaderLevelCount + this.scenegraph.proxy.rowLimit - 1));
|
|
61587
61742
|
const diffPositions = this.internalProps.layoutMap.toggleHierarchyState(diffDataIndices);
|
|
61588
61743
|
this.refreshRowColCount();
|
|
61589
61744
|
this.clearCellStyleCache();
|
|
@@ -62325,6 +62480,39 @@
|
|
|
62325
62480
|
}
|
|
62326
62481
|
}
|
|
62327
62482
|
|
|
62483
|
+
function diffCellAddress(col, row, oldCellIds, newCellIds, oldRowHeaderCellPositons, layout) {
|
|
62484
|
+
const columnHeaderStart = layout.columnHeaderLevelCount;
|
|
62485
|
+
const addCellPositions = [];
|
|
62486
|
+
const removeCellPositions = [];
|
|
62487
|
+
for (let i = 0; i < oldCellIds.length; i++) {
|
|
62488
|
+
if (!newCellIds.includes(oldCellIds[i])) {
|
|
62489
|
+
removeCellPositions.push(oldRowHeaderCellPositons[i]);
|
|
62490
|
+
}
|
|
62491
|
+
}
|
|
62492
|
+
for (let i = 0; i < newCellIds.length; i++) {
|
|
62493
|
+
if (!oldCellIds.includes(newCellIds[i])) {
|
|
62494
|
+
const newCellAddr = { col, row: columnHeaderStart + i };
|
|
62495
|
+
addCellPositions.push(newCellAddr);
|
|
62496
|
+
}
|
|
62497
|
+
}
|
|
62498
|
+
let parentId = layout.getParentCellId(col, row);
|
|
62499
|
+
let parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
62500
|
+
const updateCellPositions = [];
|
|
62501
|
+
parentCellAddress && updateCellPositions.push(parentCellAddress);
|
|
62502
|
+
while (parentId) {
|
|
62503
|
+
parentId = layout.getParentCellId(parentCellAddress.col, parentCellAddress.row);
|
|
62504
|
+
if (parentId) {
|
|
62505
|
+
parentCellAddress = layout.getRowHeaderCellAddressByCellId(parentId);
|
|
62506
|
+
updateCellPositions.push(parentCellAddress);
|
|
62507
|
+
}
|
|
62508
|
+
}
|
|
62509
|
+
return {
|
|
62510
|
+
addCellPositions,
|
|
62511
|
+
removeCellPositions,
|
|
62512
|
+
updateCellPositions
|
|
62513
|
+
};
|
|
62514
|
+
}
|
|
62515
|
+
|
|
62328
62516
|
const defaultDimension = { startInTotal: 0, level: 0 };
|
|
62329
62517
|
class PivotHeaderLayoutMap {
|
|
62330
62518
|
sharedVar;
|
|
@@ -68300,7 +68488,7 @@
|
|
|
68300
68488
|
}
|
|
68301
68489
|
|
|
68302
68490
|
registerForVrender();
|
|
68303
|
-
const version = "0.23.1
|
|
68491
|
+
const version = "0.23.1";
|
|
68304
68492
|
function getIcons() {
|
|
68305
68493
|
return get$2();
|
|
68306
68494
|
}
|