@visactor/vtable-gantt 1.26.0 → 1.26.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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-gantt.js +153 -64
- package/dist/vtable-gantt.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 +7 -6
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.26.
|
|
9
|
+
export declare const version = "1.26.1";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.26.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.26.1\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -1847,6 +1847,20 @@
|
|
|
1847
1847
|
function crossProduct(dir1, dir2) {
|
|
1848
1848
|
return dir1[0] * dir2[1] - dir1[1] * dir2[0];
|
|
1849
1849
|
}
|
|
1850
|
+
function fixPrecision$1(num, precision = 10) {
|
|
1851
|
+
return Math.round(num * precision) / precision;
|
|
1852
|
+
}
|
|
1853
|
+
function getDecimalPlaces(n) {
|
|
1854
|
+
const dStr = n.toString().split(/[eE]/),
|
|
1855
|
+
s = (dStr[0].split(".")[1] || "").length - (+dStr[1] || 0);
|
|
1856
|
+
return s > 0 ? s : 0;
|
|
1857
|
+
}
|
|
1858
|
+
function precisionAdd(a, b) {
|
|
1859
|
+
return fixPrecision$1(a + b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
|
|
1860
|
+
}
|
|
1861
|
+
function precisionSub(a, b) {
|
|
1862
|
+
return fixPrecision$1(a - b, 10 ** Math.max(getDecimalPlaces(a), getDecimalPlaces(b)));
|
|
1863
|
+
}
|
|
1850
1864
|
|
|
1851
1865
|
class Point {
|
|
1852
1866
|
constructor(x = 0, y = 0, x1, y1) {
|
|
@@ -37505,42 +37519,54 @@
|
|
|
37505
37519
|
if (record) if (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && this.children) {
|
|
37506
37520
|
this.children.push(record);
|
|
37507
37521
|
const value = record.value();
|
|
37508
|
-
this.sum
|
|
37522
|
+
this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
|
|
37509
37523
|
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
37510
37524
|
const value = parseFloat(record[this.field]);
|
|
37511
|
-
this.sum
|
|
37525
|
+
this.sum = precisionAdd(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
|
|
37512
37526
|
}
|
|
37513
37527
|
this.clearCacheValue();
|
|
37514
37528
|
}
|
|
37515
37529
|
deleteRecord(record) {
|
|
37516
|
-
if (record)
|
|
37517
|
-
this.
|
|
37518
|
-
|
|
37519
|
-
|
|
37520
|
-
|
|
37521
|
-
|
|
37522
|
-
|
|
37530
|
+
if (record) {
|
|
37531
|
+
if (this.isRecord && this.records) {
|
|
37532
|
+
const index = this.records.indexOf(record);
|
|
37533
|
+
-1 !== index && this.records.splice(index, 1);
|
|
37534
|
+
}
|
|
37535
|
+
if (record.isAggregator && this.children) {
|
|
37536
|
+
const index = this.children.indexOf(record);
|
|
37537
|
+
-1 !== index && this.children.splice(index, 1);
|
|
37538
|
+
const value = record.value();
|
|
37539
|
+
this.sum = precisionSub(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionSub(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, value)));
|
|
37540
|
+
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
37541
|
+
const value = parseFloat(record[this.field]);
|
|
37542
|
+
this.sum = precisionSub(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionSub(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, value)));
|
|
37543
|
+
}
|
|
37523
37544
|
}
|
|
37524
37545
|
this.clearCacheValue();
|
|
37525
37546
|
}
|
|
37526
37547
|
updateRecord(oldRecord, newRecord) {
|
|
37527
37548
|
if (oldRecord && newRecord) {
|
|
37528
|
-
if (this.isRecord && this.records
|
|
37529
|
-
const
|
|
37530
|
-
|
|
37549
|
+
if (this.isRecord && this.records) {
|
|
37550
|
+
const index = this.records.indexOf(oldRecord);
|
|
37551
|
+
-1 !== index && (this.records[index] = newRecord);
|
|
37552
|
+
}
|
|
37553
|
+
if (oldRecord.isAggregator && this.children) {
|
|
37554
|
+
const oldValue = oldRecord.value(),
|
|
37555
|
+
index = this.children.indexOf(oldRecord);
|
|
37556
|
+
-1 !== index && (this.children[index] = newRecord);
|
|
37531
37557
|
const newValue = newRecord.value();
|
|
37532
|
-
this.
|
|
37558
|
+
this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue)), this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum = precisionSub(this.positiveSum, oldValue) : oldValue < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue)), newValue > 0 ? this.positiveSum = precisionAdd(this.positiveSum, newValue) : newValue < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue)));
|
|
37533
37559
|
} else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
|
|
37534
37560
|
const oldValue = parseFloat(oldRecord[this.field]),
|
|
37535
37561
|
newValue = parseFloat(newRecord[this.field]);
|
|
37536
|
-
this.sum
|
|
37562
|
+
this.sum = precisionAdd(this.sum, precisionSub(newValue, oldValue)), this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum = precisionSub(this.positiveSum, oldValue) : oldValue < 0 && (this.nagetiveSum = precisionSub(this.nagetiveSum, oldValue)), newValue > 0 ? this.positiveSum = precisionAdd(this.positiveSum, newValue) : newValue < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, newValue)));
|
|
37537
37563
|
}
|
|
37538
37564
|
this.clearCacheValue();
|
|
37539
37565
|
}
|
|
37540
37566
|
}
|
|
37541
37567
|
value() {
|
|
37542
|
-
var _a
|
|
37543
|
-
return null !== (_a = this.changedValue) && void 0 !== _a ? _a :
|
|
37568
|
+
var _a;
|
|
37569
|
+
return null !== (_a = this.changedValue) && void 0 !== _a ? _a : this.records && this.records.length >= 1 || !1 === this.isRecord ? this.sum : void 0;
|
|
37544
37570
|
}
|
|
37545
37571
|
positiveValue() {
|
|
37546
37572
|
return this.positiveSum;
|
|
@@ -37556,16 +37582,16 @@
|
|
|
37556
37582
|
const child = this.children[i];
|
|
37557
37583
|
if (child.isAggregator) {
|
|
37558
37584
|
const value = child.value();
|
|
37559
|
-
this.sum
|
|
37585
|
+
this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
|
|
37560
37586
|
}
|
|
37561
37587
|
} else if (this.records) for (let i = 0; i < this.records.length; i++) {
|
|
37562
37588
|
const record = this.records[i];
|
|
37563
37589
|
if (record.isAggregator) {
|
|
37564
37590
|
const value = record.value();
|
|
37565
|
-
this.sum
|
|
37591
|
+
this.sum = precisionAdd(this.sum, null != value ? value : 0), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
|
|
37566
37592
|
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
37567
37593
|
const value = parseFloat(record[this.field]);
|
|
37568
|
-
this.sum
|
|
37594
|
+
this.sum = precisionAdd(this.sum, value), this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum = precisionAdd(this.positiveSum, value) : value < 0 && (this.nagetiveSum = precisionAdd(this.nagetiveSum, value)));
|
|
37569
37595
|
}
|
|
37570
37596
|
}
|
|
37571
37597
|
}
|
|
@@ -37608,17 +37634,43 @@
|
|
|
37608
37634
|
super(...arguments), this.type = AggregationType.AVG, this.sum = 0, this.count = 0;
|
|
37609
37635
|
}
|
|
37610
37636
|
push(record) {
|
|
37611
|
-
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && record.type === AggregationType.AVG ? (this.children && this.children.push(record), this.sum
|
|
37637
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && record.type === AggregationType.AVG ? (this.children && this.children.push(record), this.sum = precisionAdd(this.sum, record.sum), this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionAdd(this.sum, parseFloat(record[this.field])), this.count++)), this.clearCacheValue();
|
|
37612
37638
|
}
|
|
37613
37639
|
deleteRecord(record) {
|
|
37614
|
-
|
|
37640
|
+
if (record) {
|
|
37641
|
+
if (this.isRecord && this.records) {
|
|
37642
|
+
const index = this.records.indexOf(record);
|
|
37643
|
+
-1 !== index && this.records.splice(index, 1);
|
|
37644
|
+
}
|
|
37645
|
+
if (record.isAggregator && record.type === AggregationType.AVG) {
|
|
37646
|
+
if (this.children) {
|
|
37647
|
+
const index = this.children.indexOf(record);
|
|
37648
|
+
-1 !== index && this.children.splice(index, 1);
|
|
37649
|
+
}
|
|
37650
|
+
this.sum = precisionSub(this.sum, record.sum), this.count -= record.count;
|
|
37651
|
+
} else this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionSub(this.sum, parseFloat(record[this.field])), this.count--);
|
|
37652
|
+
}
|
|
37653
|
+
this.clearCacheValue();
|
|
37615
37654
|
}
|
|
37616
37655
|
updateRecord(oldRecord, newRecord) {
|
|
37617
|
-
|
|
37656
|
+
if (oldRecord && newRecord) {
|
|
37657
|
+
if (this.isRecord && this.records) {
|
|
37658
|
+
const index = this.records.indexOf(oldRecord);
|
|
37659
|
+
-1 !== index && (this.records[index] = newRecord);
|
|
37660
|
+
}
|
|
37661
|
+
if (oldRecord.isAggregator && oldRecord.type === AggregationType.AVG) {
|
|
37662
|
+
if (this.children && newRecord.isAggregator) {
|
|
37663
|
+
const index = this.children.indexOf(oldRecord);
|
|
37664
|
+
-1 !== index && (this.children[index] = newRecord);
|
|
37665
|
+
}
|
|
37666
|
+
this.sum = precisionAdd(this.sum, precisionSub(newRecord.sum, oldRecord.sum)), this.count += newRecord.count - oldRecord.count;
|
|
37667
|
+
} else this.field && !isNaN(parseFloat(oldRecord[this.field])) && (this.sum = precisionAdd(this.sum, precisionSub(parseFloat(newRecord[this.field]), parseFloat(oldRecord[this.field]))));
|
|
37668
|
+
this.clearCacheValue();
|
|
37669
|
+
}
|
|
37618
37670
|
}
|
|
37619
37671
|
value() {
|
|
37620
|
-
var _a
|
|
37621
|
-
return null !== (_a = this.changedValue) && void 0 !== _a ? _a :
|
|
37672
|
+
var _a;
|
|
37673
|
+
return null !== (_a = this.changedValue) && void 0 !== _a ? _a : this.records && this.records.length >= 1 || !1 === this.isRecord && this.count > 0 ? this.sum / this.count : void 0;
|
|
37622
37674
|
}
|
|
37623
37675
|
reset() {
|
|
37624
37676
|
this.changedValue = void 0, this.children = [], this.records = [], this.sum = 0, this.count = 0;
|
|
@@ -37628,11 +37680,11 @@
|
|
|
37628
37680
|
const child = this.children[i];
|
|
37629
37681
|
if (child.isAggregator && child.type === AggregationType.AVG) {
|
|
37630
37682
|
const childValue = child.value();
|
|
37631
|
-
this.sum
|
|
37683
|
+
this.sum = precisionAdd(this.sum, childValue * child.count), this.count += child.count;
|
|
37632
37684
|
}
|
|
37633
37685
|
} else if (this.records) for (let i = 0; i < this.records.length; i++) {
|
|
37634
37686
|
const record = this.records[i];
|
|
37635
|
-
record.isAggregator && record.type === AggregationType.AVG ? (this.sum
|
|
37687
|
+
record.isAggregator && record.type === AggregationType.AVG ? (this.sum = precisionAdd(this.sum, record.sum), this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum = precisionAdd(this.sum, parseFloat(record[this.field])), this.count++);
|
|
37636
37688
|
}
|
|
37637
37689
|
}
|
|
37638
37690
|
}
|
|
@@ -50886,7 +50938,7 @@
|
|
|
50886
50938
|
};
|
|
50887
50939
|
function dynamicSetX(x, screenLeft, isEnd, proxy) {
|
|
50888
50940
|
return __awaiter$7(this, void 0, void 0, function* () {
|
|
50889
|
-
if (!screenLeft) return;
|
|
50941
|
+
if (!screenLeft) return proxy.updateDeltaX(x), proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX), void proxy.table.scenegraph.updateNextFrame();
|
|
50890
50942
|
const screenLeftCol = screenLeft.col,
|
|
50891
50943
|
screenLeftX = screenLeft.left;
|
|
50892
50944
|
let deltaCol;
|
|
@@ -51062,7 +51114,7 @@
|
|
|
51062
51114
|
};
|
|
51063
51115
|
function dynamicSetY(y, screenTop, isEnd, proxy) {
|
|
51064
51116
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
51065
|
-
if (!screenTop) return;
|
|
51117
|
+
if (!screenTop) return proxy.updateDeltaY(y), proxy.updateBody(y - proxy.deltaY), void proxy.table.scenegraph.updateNextFrame();
|
|
51066
51118
|
const screenTopRow = screenTop.row,
|
|
51067
51119
|
screenTopY = screenTop.top;
|
|
51068
51120
|
let deltaRow;
|
|
@@ -51667,7 +51719,7 @@
|
|
|
51667
51719
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51668
51720
|
const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2,
|
|
51669
51721
|
yLimitBottom = this.table.getAllRowsHeight() - yLimitTop,
|
|
51670
|
-
screenTop = this.
|
|
51722
|
+
screenTop = this.resolveTargetRowInfo(y + this.table.scenegraph.colHeaderGroup.attribute.height);
|
|
51671
51723
|
screenTop && (this.screenTopRow = screenTop.row), y < yLimitTop && this.rowStart === this.bodyTopRow || y > yLimitBottom && this.rowEnd === this.bodyBottomRow ? (this.updateDeltaY(y), this.updateBody(y - this.deltaY)) : this.table.scenegraph.bodyGroup.firstChild && "group" === this.table.scenegraph.bodyGroup.firstChild.type && 0 !== this.table.scenegraph.bodyGroup.firstChild.childrenCount || this.table.scenegraph.rowHeaderGroup.firstChild && "group" === this.table.scenegraph.rowHeaderGroup.firstChild.type && 0 !== this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount ? this.dynamicSetY(y, screenTop, isEnd) : (this.updateDeltaY(y), this.updateBody(y - this.deltaY));
|
|
51672
51724
|
});
|
|
51673
51725
|
}
|
|
@@ -51676,7 +51728,7 @@
|
|
|
51676
51728
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51677
51729
|
const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2,
|
|
51678
51730
|
xLimitRight = this.table.getAllColsWidth() - xLimitLeft,
|
|
51679
|
-
screenLeft = this.
|
|
51731
|
+
screenLeft = this.resolveTargetColInfo(x + this.table.scenegraph.rowHeaderGroup.attribute.width + (null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0));
|
|
51680
51732
|
screenLeft && (this.screenLeftCol = screenLeft.col), x < xLimitLeft && this.colStart === this.bodyLeftCol || x > xLimitRight && this.colEnd === this.bodyRightCol || this.table.scenegraph.bodyGroup.firstChild && "group" === this.table.scenegraph.bodyGroup.firstChild.type && 0 === this.table.scenegraph.bodyGroup.firstChild.childrenCount ? (this.updateDeltaX(x), this.table.scenegraph.setBodyAndColHeaderX(-x + this.deltaX)) : this.dynamicSetX(x, screenLeft, isEnd);
|
|
51681
51733
|
});
|
|
51682
51734
|
}
|
|
@@ -51690,6 +51742,22 @@
|
|
|
51690
51742
|
dynamicSetX(x, screenLeft, isEnd, this);
|
|
51691
51743
|
});
|
|
51692
51744
|
}
|
|
51745
|
+
resolveTargetColInfo(absoluteX) {
|
|
51746
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
51747
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
51748
|
+
const screenLeft = this.table.getTargetColAt(absoluteX + offsets[i]);
|
|
51749
|
+
if (screenLeft) return screenLeft;
|
|
51750
|
+
}
|
|
51751
|
+
return null;
|
|
51752
|
+
}
|
|
51753
|
+
resolveTargetRowInfo(absoluteY) {
|
|
51754
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
51755
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
51756
|
+
const screenTop = this.table.getTargetRowAt(absoluteY + offsets[i]);
|
|
51757
|
+
if (screenTop) return screenTop;
|
|
51758
|
+
}
|
|
51759
|
+
return null;
|
|
51760
|
+
}
|
|
51693
51761
|
updateBody(y) {
|
|
51694
51762
|
this.table.scenegraph.setBodyAndRowHeaderY(-y);
|
|
51695
51763
|
}
|
|
@@ -54010,15 +54078,17 @@
|
|
|
54010
54078
|
this.table.scenegraph.proxy.setY(-y, isEnd);
|
|
54011
54079
|
}
|
|
54012
54080
|
setBodyAndRowHeaderY(y) {
|
|
54013
|
-
var _a, _b
|
|
54014
|
-
const
|
|
54015
|
-
|
|
54016
|
-
|
|
54081
|
+
var _a, _b;
|
|
54082
|
+
const firstBodyColGroup = this.bodyGroup.firstChild,
|
|
54083
|
+
firstRowHeaderColGroup = this.rowHeaderGroup.firstChild,
|
|
54084
|
+
firstBodyCell = null !== (_a = null == firstBodyColGroup ? void 0 : firstBodyColGroup.firstChild) && void 0 !== _a ? _a : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.firstChild;
|
|
54085
|
+
let lastBodyCell = null !== (_b = null == firstBodyColGroup ? void 0 : firstBodyColGroup.lastChild) && void 0 !== _b ? _b : null == firstRowHeaderColGroup ? void 0 : firstRowHeaderColGroup.lastChild;
|
|
54086
|
+
lastBodyCell && "group" !== lastBodyCell.type && (lastBodyCell = lastBodyCell._prev), 0 === y && firstBodyCell && firstBodyCell.row === this.table.frozenRowCount && firstBodyCell.attribute.y + y < 0 ? y = -firstBodyCell.attribute.y : lastBodyCell && this.table.tableNoFrameHeight < this.table.getAllRowsHeight() && lastBodyCell.row === this.table.rowCount - this.table.bottomFrozenRowCount - 1 && lastBodyCell.attribute.y + this.table.getRowHeight(lastBodyCell.row) + y < this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() && (y = this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() - lastBodyCell.attribute.y - this.table.getRowHeight(lastBodyCell.row)), this.colHeaderGroup.attribute.height + y !== this.bodyGroup.attribute.y && (this.bodyGroup.setAttribute("y", this.colHeaderGroup.attribute.height + y), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height + y), this.bodySelectGroup.setAttribute("y", this.bodyGroup.attribute.y), this.rowHeaderSelectGroup.setAttribute("y", this.rowHeaderGroup.attribute.y), this.colHeaderSelectGroup.setAttribute("y", this.colHeaderGroup.attribute.y), this.cornerHeaderSelectGroup.setAttribute("y", this.cornerHeaderGroup.attribute.y), this.table.rightFrozenColCount > 0 && (this.rightFrozenGroup.setAttribute("y", this.rightTopCornerGroup.attribute.height + y), this.rightFrozenSelectGroup.setAttribute("y", this.rightFrozenGroup.attribute.y), this.rightTopCornerSelectGroup.setAttribute("y", this.rightTopCornerGroup.attribute.y)), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenSelectGroup.setAttribute("y", this.bottomFrozenGroup.attribute.y), this.leftBottomCornerSelectGroup.setAttribute("y", this.leftBottomCornerGroup.attribute.y)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("y", this.rightBottomCornerGroup.attribute.y), this.updateNextFrame());
|
|
54017
54087
|
}
|
|
54018
54088
|
setBodyAndColHeaderX(x) {
|
|
54019
|
-
const firstBodyCol = this.bodyGroup.firstChild
|
|
54020
|
-
|
|
54021
|
-
0 === x && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0 ? x = -firstBodyCol.attribute.x : lastBodyCol && this.table.tableNoFrameWidth < this.table.getAllColsWidth() && lastBodyCol.col === this.table.colCount - this.table.rightFrozenColCount - 1 && lastBodyCol.attribute.x + lastBodyCol.attribute.width + x < this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() && (x = this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() - lastBodyCol.attribute.x - lastBodyCol.attribute.width), this.table.getFrozenColsWidth() + x !== this.bodyGroup.attribute.x && (this.bodyGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
|
|
54089
|
+
const firstBodyCol = this.bodyGroup.firstChild;
|
|
54090
|
+
let lastBodyCol = this.bodyGroup.lastChild;
|
|
54091
|
+
lastBodyCol && "group" !== lastBodyCol.type && (lastBodyCol = lastBodyCol._prev), 0 === x && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0 ? x = -firstBodyCol.attribute.x : lastBodyCol && this.table.tableNoFrameWidth < this.table.getAllColsWidth() && lastBodyCol.col === this.table.colCount - this.table.rightFrozenColCount - 1 && lastBodyCol.attribute.x + lastBodyCol.attribute.width + x < this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() && (x = this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() - lastBodyCol.attribute.x - lastBodyCol.attribute.width), this.table.getFrozenColsWidth() + x !== this.bodyGroup.attribute.x && (this.bodyGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
|
|
54022
54092
|
}
|
|
54023
54093
|
afterScenegraphCreated() {
|
|
54024
54094
|
var _a, _b;
|
|
@@ -57455,6 +57525,7 @@
|
|
|
57455
57525
|
}
|
|
57456
57526
|
function dblclickHandler(e, table) {
|
|
57457
57527
|
var _a, _b, _c, _d, _e, _f;
|
|
57528
|
+
if ("number" == typeof e.button && 0 !== e.button) return;
|
|
57458
57529
|
const eventArgsSet = getCellEventArgsSetWithTable(e, table);
|
|
57459
57530
|
let col = -1,
|
|
57460
57531
|
row = -1;
|
|
@@ -57650,7 +57721,13 @@
|
|
|
57650
57721
|
function bindContainerDomListener$1(eventManager) {
|
|
57651
57722
|
const table = eventManager.table,
|
|
57652
57723
|
stateManager = table.stateManager,
|
|
57653
|
-
handler = table.internalProps.handler
|
|
57724
|
+
handler = table.internalProps.handler,
|
|
57725
|
+
afterCompleteEdit = (completeEditResult, onSuccess) => {
|
|
57726
|
+
getPromiseValue(completeEditResult, isCompleteEdit => {
|
|
57727
|
+
var _a, _b, _c, _d, _e;
|
|
57728
|
+
!1 !== isCompleteEdit ? onSuccess() : null === (_e = null === (_d = null === (_c = null === (_b = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) || void 0 === _b ? void 0 : _b.getInputElement) || void 0 === _c ? void 0 : _c.call(_b)) || void 0 === _d ? void 0 : _d.focus) || void 0 === _e || _e.call(_d);
|
|
57729
|
+
});
|
|
57730
|
+
};
|
|
57654
57731
|
function handleKeydownListener(e) {
|
|
57655
57732
|
var _a;
|
|
57656
57733
|
if (table.hasListeners(TABLE_EVENT_TYPE.KEYDOWN)) {
|
|
@@ -57673,7 +57750,7 @@
|
|
|
57673
57750
|
}
|
|
57674
57751
|
eventManager.dealTableHover();
|
|
57675
57752
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
57676
|
-
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, _0
|
|
57753
|
+
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, _0;
|
|
57677
57754
|
const beforeKeydownEvent = {
|
|
57678
57755
|
keyCode: null !== (_a = e.keyCode) && void 0 !== _a ? _a : e.which,
|
|
57679
57756
|
code: e.code,
|
|
@@ -57683,48 +57760,60 @@
|
|
|
57683
57760
|
if ((null === (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.moveEditCellOnArrowKeys) || void 0 === _d || !_d) && (null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.editingEditor) || !1 === (null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveSelectedCellOnArrowKeys)) return;
|
|
57684
57761
|
let targetCol, targetRow;
|
|
57685
57762
|
if (e.preventDefault(), e.stopPropagation(), "ArrowUp" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = 0) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1))) : "ArrowDown" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = table.rowCount - 1) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1))) : "ArrowLeft" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = 0, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1))) : "ArrowRight" === e.key && (e.ctrlKey || e.metaKey ? (targetCol = table.colCount - 1, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1)))), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57686
|
-
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor)
|
|
57687
|
-
|
|
57688
|
-
|
|
57689
|
-
|
|
57690
|
-
|
|
57691
|
-
|
|
57692
|
-
|
|
57693
|
-
|
|
57694
|
-
|
|
57695
|
-
|
|
57696
|
-
|
|
57697
|
-
|
|
57698
|
-
|
|
57699
|
-
|
|
57763
|
+
const isEditingCell = !!(null === (_g = table.editorManager) || void 0 === _g ? void 0 : _g.editingEditor),
|
|
57764
|
+
completeEditResult = null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.completeEdit();
|
|
57765
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
57766
|
+
var _a, _b, _c, _d, _e;
|
|
57767
|
+
table.getElement().focus();
|
|
57768
|
+
const enableShiftSelectMode = null === (_b = null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.shiftMultiSelect) || void 0 === _b || _b;
|
|
57769
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode), null !== (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.moveEditCellOnArrowKeys) && void 0 !== _d && _d && isEditingCell && table.getEditor(targetCol, targetRow) && (null === (_e = table.editorManager) || void 0 === _e || _e.startEditCell(targetCol, targetRow));
|
|
57770
|
+
});
|
|
57771
|
+
} else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
|
|
57772
|
+
if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
|
|
57773
|
+
handleKeydownListener(e);
|
|
57774
|
+
const completeEditResult = null === (_l = table.editorManager) || void 0 === _l ? void 0 : _l.completeEdit();
|
|
57775
|
+
return void afterCompleteEdit(completeEditResult, () => {
|
|
57776
|
+
var _a, _b, _c;
|
|
57777
|
+
if (table.getElement().focus(), !0 === (null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.moveFocusCellOnEnter)) {
|
|
57778
|
+
const targetCol = stateManager.select.cellPos.col,
|
|
57779
|
+
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
57780
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57781
|
+
const enableShiftSelectMode = null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.shiftMultiSelect) || void 0 === _c || _c;
|
|
57782
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
57783
|
+
}
|
|
57784
|
+
});
|
|
57700
57785
|
}
|
|
57701
|
-
if (!0 === (null === (
|
|
57786
|
+
if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
|
|
57702
57787
|
const targetCol = stateManager.select.cellPos.col,
|
|
57703
57788
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
57704
57789
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57705
|
-
const enableShiftSelectMode = null === (
|
|
57790
|
+
const enableShiftSelectMode = null === (_p = null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.shiftMultiSelect) || void 0 === _p || _p;
|
|
57706
57791
|
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
57707
|
-
} else if ((null === (
|
|
57792
|
+
} else if ((null === (_r = null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.editCellOnEnter) || void 0 === _r || _r) && 1 === (null !== (_t = null === (_s = table.stateManager.select.ranges) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0)) {
|
|
57708
57793
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
57709
57794
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
57710
57795
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
57711
57796
|
endRow = table.stateManager.select.ranges[0].end.row;
|
|
57712
|
-
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (
|
|
57797
|
+
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_u = table.editorManager) || void 0 === _u || _u.startEditCell(startCol, startRow));
|
|
57713
57798
|
}
|
|
57714
57799
|
} else if ("Tab" === e.key) {
|
|
57715
|
-
if ((null === (
|
|
57800
|
+
if ((null === (_w = null === (_v = table.options.keyboardOptions) || void 0 === _v ? void 0 : _v.moveFocusCellOnTab) || void 0 === _w || _w) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
|
|
57716
57801
|
if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
|
|
57717
57802
|
let targetCol, targetRow;
|
|
57718
57803
|
if (e.preventDefault(), stateManager.select.cellPos.col === table.colCount - 1 ? (targetRow = Math.min(table.rowCount - 1, stateManager.select.cellPos.row + 1), targetCol = table.rowHeaderLevelCount) : (targetRow = stateManager.select.cellPos.row, targetCol = stateManager.select.cellPos.col + 1), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
57719
|
-
const isEditingCell = !!(null === (
|
|
57720
|
-
|
|
57804
|
+
const isEditingCell = !!(null === (_x = table.editorManager) || void 0 === _x ? void 0 : _x.editingEditor),
|
|
57805
|
+
completeEditResult = null === (_y = table.editorManager) || void 0 === _y ? void 0 : _y.completeEdit();
|
|
57806
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
57807
|
+
var _a;
|
|
57808
|
+
table.getElement().focus(), table.selectCell(targetCol, targetRow), isEditingCell && table.getEditor(targetCol, targetRow) && (null === (_a = table.editorManager) || void 0 === _a || _a.startEditCell(targetCol, targetRow));
|
|
57809
|
+
});
|
|
57721
57810
|
}
|
|
57722
57811
|
} else if (!e.ctrlKey && !e.metaKey) {
|
|
57723
57812
|
const editCellTrigger = table.options.editCellTrigger,
|
|
57724
57813
|
selectedRanges = table.stateManager.select.ranges;
|
|
57725
|
-
if (1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && ("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (
|
|
57814
|
+
if (1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && ("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_z = table.editorManager) || void 0 === _z ? void 0 : _z.editingEditor)) {
|
|
57726
57815
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
57727
|
-
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (
|
|
57816
|
+
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (_0 = table.editorManager) || void 0 === _0 || _0.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
|
|
57728
57817
|
}
|
|
57729
57818
|
}
|
|
57730
57819
|
handleKeydownListener(e);
|
|
@@ -60986,7 +61075,7 @@
|
|
|
60986
61075
|
}
|
|
60987
61076
|
constructor(container, options = {}) {
|
|
60988
61077
|
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;
|
|
60989
|
-
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.
|
|
61078
|
+
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
60990
61079
|
const g = window;
|
|
60991
61080
|
g[this.id] = this;
|
|
60992
61081
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -78481,7 +78570,7 @@
|
|
|
78481
78570
|
PluginManager: PluginManager
|
|
78482
78571
|
});
|
|
78483
78572
|
|
|
78484
|
-
const version = "1.26.
|
|
78573
|
+
const version = "1.26.1";
|
|
78485
78574
|
|
|
78486
78575
|
exports.Gantt = Gantt;
|
|
78487
78576
|
exports.TYPES = index$4;
|