@visactor/vtable-calendar 1.13.1-alpha.7 → 1.13.1-alpha.8
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/dist/vtable-calendar.js +97 -116
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -1794,19 +1794,10 @@
|
|
|
1794
1794
|
}
|
|
1795
1795
|
function isRotateAABBIntersect(box1, box2) {
|
|
1796
1796
|
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1797
|
-
let ctx = arguments.length > 3 ? arguments[3] : undefined;
|
|
1798
1797
|
const rect1 = toRect(box1, isDeg),
|
|
1799
1798
|
rect2 = toRect(box2, isDeg),
|
|
1800
|
-
vector = (start, end) => [end.x - start.x, end.y - start.y]
|
|
1801
|
-
|
|
1802
|
-
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
1803
|
-
}), ctx.fill(), ctx.restore(), ctx.save(), ctx.fillStyle = "green", ctx.globalAlpha = .6, rect2.forEach((item, index) => {
|
|
1804
|
-
0 === index ? ctx.moveTo(item.x, item.y) : ctx.lineTo(item.x, item.y);
|
|
1805
|
-
}), ctx.fill(), ctx.restore());
|
|
1806
|
-
const p1 = getCenterPoint(box1),
|
|
1807
|
-
p2 = getCenterPoint(box2);
|
|
1808
|
-
ctx && ctx.fillRect(p1.x, p1.y, 2, 2), ctx && ctx.fillRect(p2.x, p2.y, 2, 2);
|
|
1809
|
-
const vp1p2 = vector(p1, p2),
|
|
1799
|
+
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
1800
|
+
vp1p2 = vector(getCenterPoint(box1), getCenterPoint(box2)),
|
|
1810
1801
|
AB = vector(rect1[0], rect1[1]),
|
|
1811
1802
|
BC = vector(rect1[1], rect1[2]),
|
|
1812
1803
|
A1B1 = vector(rect2[0], rect2[1]),
|
|
@@ -2195,7 +2186,8 @@
|
|
|
2195
2186
|
class OBBBounds extends Bounds$1 {
|
|
2196
2187
|
constructor(bounds) {
|
|
2197
2188
|
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2198
|
-
|
|
2189
|
+
var _a;
|
|
2190
|
+
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
2199
2191
|
}
|
|
2200
2192
|
intersects(b) {
|
|
2201
2193
|
return isRotateAABBIntersect(this, b);
|
|
@@ -2208,6 +2200,9 @@
|
|
|
2208
2200
|
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2209
2201
|
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
2210
2202
|
}
|
|
2203
|
+
clone() {
|
|
2204
|
+
return new OBBBounds(this);
|
|
2205
|
+
}
|
|
2211
2206
|
}
|
|
2212
2207
|
|
|
2213
2208
|
class Matrix {
|
|
@@ -2658,6 +2653,8 @@
|
|
|
2658
2653
|
return color.getLuminance2();
|
|
2659
2654
|
case "lum3":
|
|
2660
2655
|
return color.getLuminance3();
|
|
2656
|
+
case "wcag":
|
|
2657
|
+
return color.getLuminanceWCAG();
|
|
2661
2658
|
}
|
|
2662
2659
|
}
|
|
2663
2660
|
static parseColorString(value) {
|
|
@@ -2759,6 +2756,14 @@
|
|
|
2759
2756
|
getLuminance3() {
|
|
2760
2757
|
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
2761
2758
|
}
|
|
2759
|
+
getLuminanceWCAG() {
|
|
2760
|
+
const RsRGB = this.color.r / 255,
|
|
2761
|
+
GsRGB = this.color.g / 255,
|
|
2762
|
+
BsRGB = this.color.b / 255;
|
|
2763
|
+
let R, G, B;
|
|
2764
|
+
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
2765
|
+
return .2126 * R + .7152 * G + .0722 * B;
|
|
2766
|
+
}
|
|
2762
2767
|
clone() {
|
|
2763
2768
|
return new Color(this.color.toString());
|
|
2764
2769
|
}
|
|
@@ -4799,6 +4804,9 @@
|
|
|
4799
4804
|
}
|
|
4800
4805
|
compatibleMetrics(metrics, options) {
|
|
4801
4806
|
if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
|
|
4807
|
+
metrics = {
|
|
4808
|
+
width: metrics.width
|
|
4809
|
+
};
|
|
4802
4810
|
const {
|
|
4803
4811
|
ascent: ascent,
|
|
4804
4812
|
descent: descent
|
|
@@ -4806,6 +4814,13 @@
|
|
|
4806
4814
|
metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
|
|
4807
4815
|
}
|
|
4808
4816
|
if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
|
|
4817
|
+
metrics = {
|
|
4818
|
+
width: metrics.width,
|
|
4819
|
+
actualBoundingBoxAscent: metrics.actualBoundingBoxAscent,
|
|
4820
|
+
actualBoundingBoxDescent: metrics.actualBoundingBoxDescent,
|
|
4821
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
4822
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
4823
|
+
};
|
|
4809
4824
|
const {
|
|
4810
4825
|
left: left,
|
|
4811
4826
|
right: right
|
|
@@ -12229,10 +12244,7 @@
|
|
|
12229
12244
|
const {
|
|
12230
12245
|
context: context
|
|
12231
12246
|
} = drawContext;
|
|
12232
|
-
context.highPerformanceSave()
|
|
12233
|
-
const t1 = graphic.parent.globalTransMatrix,
|
|
12234
|
-
t2 = graphic.stage.window.getViewBoxTransform().clone().multiply(t1.a, t1.b, t1.c, t1.d, t1.e, t1.f);
|
|
12235
|
-
if (graphic.parent && context.setTransformFromMatrix(t2, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
12247
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
12236
12248
|
tempDirtyBounds.copy(drawContribution.dirtyBounds), tempBackupDirtyBounds.copy(drawContribution.backupDirtyBounds);
|
|
12237
12249
|
const m = graphic.globalTransMatrix.getInverse();
|
|
12238
12250
|
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
@@ -41524,10 +41536,8 @@
|
|
|
41524
41536
|
function setCheckedState(col, row, field, checked, state) {
|
|
41525
41537
|
const recordIndex = state.table.getRecordShowIndexByCell(col, row);
|
|
41526
41538
|
if (recordIndex >= 0) {
|
|
41527
|
-
const dataIndex = state.table.dataSource.getIndexKey(recordIndex)
|
|
41528
|
-
state.checkedState
|
|
41529
|
-
[field]: checked
|
|
41530
|
-
});
|
|
41539
|
+
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
41540
|
+
state.checkedState[dataIndex] || (state.checkedState[dataIndex] = {}), state.checkedState[dataIndex][field] = checked;
|
|
41531
41541
|
}
|
|
41532
41542
|
}
|
|
41533
41543
|
function setHeaderCheckedState(field, checked, state) {
|
|
@@ -41541,23 +41551,21 @@
|
|
|
41541
41551
|
if (state.table.isHeader(col, row)) {
|
|
41542
41552
|
if (isValid$1(state.headerCheckedState[field])) return state.headerCheckedState[field];
|
|
41543
41553
|
if ("function" == typeof checked) return;
|
|
41544
|
-
if (isValid$1(checked)) state.headerCheckedState[field] = checked;else if ((null === (_a = state.checkedState) || void 0 === _a ? void 0 : _a.
|
|
41554
|
+
if (isValid$1(checked)) state.headerCheckedState[field] = checked;else if ((null === (_a = state.checkedState) || void 0 === _a ? void 0 : _a.length) > 0) {
|
|
41545
41555
|
return state.updateHeaderCheckedState(field, col, row);
|
|
41546
41556
|
}
|
|
41547
41557
|
return state.headerCheckedState[field];
|
|
41548
41558
|
}
|
|
41549
41559
|
const recordIndex = state.table.getRecordShowIndexByCell(col, row);
|
|
41550
41560
|
if (recordIndex >= 0) {
|
|
41551
|
-
const dataIndex = state.table.dataSource.getIndexKey(recordIndex)
|
|
41552
|
-
if (isValid$1(null === (_b = state.checkedState
|
|
41553
|
-
state.checkedState
|
|
41554
|
-
[field]: checked
|
|
41555
|
-
});
|
|
41561
|
+
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
41562
|
+
if (isValid$1(null === (_b = state.checkedState[dataIndex]) || void 0 === _b ? void 0 : _b[field])) return state.checkedState[dataIndex][field];
|
|
41563
|
+
state.checkedState[dataIndex] || (state.checkedState[dataIndex] = {}), state.checkedState[dataIndex][field] = checked;
|
|
41556
41564
|
}
|
|
41557
41565
|
return checked;
|
|
41558
41566
|
}
|
|
41559
41567
|
function initCheckedState(records, state) {
|
|
41560
|
-
state.checkedState
|
|
41568
|
+
state.checkedState = [], state.headerCheckedState = {}, state.radioState = {};
|
|
41561
41569
|
let isNeedInitHeaderCheckedStateFromRecord = !1;
|
|
41562
41570
|
if (state._checkboxCellTypeFields = [], state._headerCheckFuncs = {}, state.table.internalProps.layoutMap.headerObjects.forEach((hd, index) => {
|
|
41563
41571
|
if ("checkbox" === hd.headerType) {
|
|
@@ -41568,29 +41576,46 @@
|
|
|
41568
41576
|
for (let i = 0; i < state.table.leftRowSeriesNumberCount; i++) state.headerCheckedState[`_vtable_rowSeries_number_${i}`] = !1, state._checkboxCellTypeFields.push(`_vtable_rowSeries_number_${i}`);
|
|
41569
41577
|
isNeedInitHeaderCheckedStateFromRecord = !0;
|
|
41570
41578
|
}
|
|
41571
|
-
isNeedInitHeaderCheckedStateFromRecord &&
|
|
41579
|
+
isNeedInitHeaderCheckedStateFromRecord && (null == records || records.forEach((record, index) => {
|
|
41580
|
+
state._checkboxCellTypeFields.forEach(field => {
|
|
41581
|
+
const value = record[field];
|
|
41582
|
+
let isChecked;
|
|
41583
|
+
if (isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value), null == isChecked) {
|
|
41584
|
+
const headerCheckFunc = state._headerCheckFuncs[field];
|
|
41585
|
+
if (headerCheckFunc) {
|
|
41586
|
+
const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
|
|
41587
|
+
isChecked = getOrApply(headerCheckFunc, {
|
|
41588
|
+
col: cellAddr.col,
|
|
41589
|
+
row: cellAddr.row,
|
|
41590
|
+
table: state.table,
|
|
41591
|
+
context: null,
|
|
41592
|
+
value: value
|
|
41593
|
+
});
|
|
41594
|
+
}
|
|
41595
|
+
}
|
|
41596
|
+
state.checkedState[index] || (state.checkedState[index] = {}), state.checkedState[index][field] = isChecked;
|
|
41597
|
+
});
|
|
41598
|
+
}));
|
|
41572
41599
|
}
|
|
41573
41600
|
function updateHeaderCheckedState(field, state, col, row) {
|
|
41574
|
-
|
|
41575
|
-
|
|
41576
|
-
|
|
41577
|
-
|
|
41578
|
-
|
|
41579
|
-
|
|
41580
|
-
|
|
41581
|
-
|
|
41582
|
-
|
|
41583
|
-
|
|
41601
|
+
const allChecked = state.checkedState.every((check_state, index) => {
|
|
41602
|
+
const tableIndex = state.table.getTableIndexByRecordIndex(index);
|
|
41603
|
+
return !!(state.table.transpose ? state.table.getCustomMerge(tableIndex, row) : state.table.getCustomMerge(col, tableIndex)) || !0 === (null == check_state ? void 0 : check_state[field]);
|
|
41604
|
+
});
|
|
41605
|
+
if (allChecked) return state.headerCheckedState[field] = !0, allChecked;
|
|
41606
|
+
if (state.checkedState.every((check_state, index) => {
|
|
41607
|
+
const tableIndex = state.table.getTableIndexByRecordIndex(index);
|
|
41608
|
+
return !!(state.table.transpose ? state.table.getCustomMerge(tableIndex, row) : state.table.getCustomMerge(col, tableIndex)) || !1 === (null == check_state ? void 0 : check_state[field]);
|
|
41609
|
+
})) return state.headerCheckedState[field] = !1, !1;
|
|
41610
|
+
return !!state.checkedState.find(check_state => !0 === (null == check_state ? void 0 : check_state[field])) && (state.headerCheckedState[field] = "indeterminate", "indeterminate");
|
|
41584
41611
|
}
|
|
41585
41612
|
function initLeftRecordsCheckState(records, state) {
|
|
41586
|
-
for (let index = state.checkedState.
|
|
41613
|
+
for (let index = state.checkedState.length; index < records.length; index++) {
|
|
41587
41614
|
const record = records[index];
|
|
41588
41615
|
state._checkboxCellTypeFields.forEach(field => {
|
|
41589
41616
|
const value = record[field];
|
|
41590
41617
|
let isChecked;
|
|
41591
|
-
isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value);
|
|
41592
|
-
const dataIndex = index.toString();
|
|
41593
|
-
state.checkedState.get(dataIndex) || state.checkedState.set(dataIndex, {}), state.checkedState.get(dataIndex)[field] = isChecked;
|
|
41618
|
+
isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value), state.checkedState[index] || (state.checkedState[index] = {}), state.checkedState[index][field] = isChecked;
|
|
41594
41619
|
});
|
|
41595
41620
|
}
|
|
41596
41621
|
}
|
|
@@ -41623,35 +41648,14 @@
|
|
|
41623
41648
|
checkedState: checkedState,
|
|
41624
41649
|
table: table
|
|
41625
41650
|
} = state;
|
|
41626
|
-
|
|
41627
|
-
|
|
41628
|
-
|
|
41629
|
-
|
|
41630
|
-
for (let i = sourceIndex; i > targetIndex; i--) checkedState.set(i.toString(), checkedState.get((i - 1).toString()));
|
|
41631
|
-
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
41632
|
-
} else if (sourceIndex < targetIndex) {
|
|
41633
|
-
const sourceRecord = checkedState.get(sourceIndex.toString());
|
|
41634
|
-
for (let i = sourceIndex; i < targetIndex; i++) checkedState.set(i.toString(), checkedState.get((i + 1).toString()));
|
|
41635
|
-
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
41636
|
-
}
|
|
41637
|
-
} else if (isArray$1(source) && isArray$1(target)) if ((sourceIndex = source[source.length - 1]) > (targetIndex = target[target.length - 1])) {
|
|
41638
|
-
const sourceRecord = checkedState.get(source.toString());
|
|
41639
|
-
for (let i = sourceIndex; i > targetIndex; i--) {
|
|
41640
|
-
const now = [...source];
|
|
41641
|
-
now[now.length - 1] = i;
|
|
41642
|
-
const last = [...source];
|
|
41643
|
-
last[last.length - 1] = i - 1, checkedState.set(now.toString(), checkedState.get(last.toString()));
|
|
41644
|
-
}
|
|
41645
|
-
checkedState.set(target.toString(), sourceRecord);
|
|
41651
|
+
if (table.internalProps.transpose ? (sourceIndex = table.getRecordShowIndexByCell(sourceIndex, 0), targetIndex = table.getRecordShowIndexByCell(targetIndex, 0)) : (sourceIndex = table.getRecordShowIndexByCell(0, sourceIndex), targetIndex = table.getRecordShowIndexByCell(0, targetIndex)), sourceIndex > targetIndex) {
|
|
41652
|
+
const sourceRecord = checkedState[sourceIndex];
|
|
41653
|
+
for (let i = sourceIndex; i > targetIndex; i--) checkedState[i] = checkedState[i - 1];
|
|
41654
|
+
checkedState[targetIndex] = sourceRecord;
|
|
41646
41655
|
} else if (sourceIndex < targetIndex) {
|
|
41647
|
-
const sourceRecord = checkedState
|
|
41648
|
-
for (let i = sourceIndex; i < targetIndex; i++)
|
|
41649
|
-
|
|
41650
|
-
now[now.length - 1] = i;
|
|
41651
|
-
const next = [...source];
|
|
41652
|
-
next[next.length - 1] = i + 1, checkedState.set(now.toString(), checkedState.get(next.toString()));
|
|
41653
|
-
}
|
|
41654
|
-
checkedState.set(target.toString(), sourceRecord);
|
|
41656
|
+
const sourceRecord = checkedState[sourceIndex];
|
|
41657
|
+
for (let i = sourceIndex; i < targetIndex; i++) checkedState[i] = checkedState[i + 1];
|
|
41658
|
+
checkedState[targetIndex] = sourceRecord;
|
|
41655
41659
|
}
|
|
41656
41660
|
}
|
|
41657
41661
|
function getGroupCheckboxState(table) {
|
|
@@ -41663,37 +41667,10 @@
|
|
|
41663
41667
|
const {
|
|
41664
41668
|
vtableOriginIndex: vtableOriginIndex
|
|
41665
41669
|
} = dataSource.getRawRecord(indexArr);
|
|
41666
|
-
result[vtableOriginIndex] = table.stateManager.checkedState
|
|
41670
|
+
result[vtableOriginIndex] = table.stateManager.checkedState[indexArr];
|
|
41667
41671
|
}
|
|
41668
41672
|
}), result;
|
|
41669
41673
|
}
|
|
41670
|
-
function initRecordCheckState(state) {
|
|
41671
|
-
const table = state.table,
|
|
41672
|
-
start = table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
41673
|
-
end = table.internalProps.transpose ? table.colCount : table.rowCount;
|
|
41674
|
-
for (let index = 0; index + start < end; index++) {
|
|
41675
|
-
const record = table.dataSource.get(index);
|
|
41676
|
-
state._checkboxCellTypeFields.forEach(field => {
|
|
41677
|
-
const value = record[field];
|
|
41678
|
-
let isChecked;
|
|
41679
|
-
if (isObject$4(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value), null == isChecked) {
|
|
41680
|
-
const headerCheckFunc = state._headerCheckFuncs[field];
|
|
41681
|
-
if (headerCheckFunc) {
|
|
41682
|
-
const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
|
|
41683
|
-
isChecked = getOrApply(headerCheckFunc, {
|
|
41684
|
-
col: cellAddr.col,
|
|
41685
|
-
row: cellAddr.row,
|
|
41686
|
-
table: state.table,
|
|
41687
|
-
context: null,
|
|
41688
|
-
value: value
|
|
41689
|
-
});
|
|
41690
|
-
}
|
|
41691
|
-
}
|
|
41692
|
-
const dataIndex = state.table.dataSource.getIndexKey(index).toString();
|
|
41693
|
-
state.checkedState.get(dataIndex) || state.checkedState.set(dataIndex, {}), state.checkedState.get(dataIndex)[field] = isChecked;
|
|
41694
|
-
});
|
|
41695
|
-
}
|
|
41696
|
-
}
|
|
41697
41674
|
|
|
41698
41675
|
function updateResizeRow(xInTable, yInTable, state) {
|
|
41699
41676
|
xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
|
|
@@ -41781,7 +41758,7 @@
|
|
|
41781
41758
|
|
|
41782
41759
|
class StateManager {
|
|
41783
41760
|
constructor(table) {
|
|
41784
|
-
this.fastScrolling = !1, this.checkedState =
|
|
41761
|
+
this.fastScrolling = !1, this.checkedState = [], this.headerCheckedState = {}, this._checkboxCellTypeFields = [], this._headerCheckFuncs = {}, this.radioState = {}, this.resetInteractionState = debounce(state => {
|
|
41785
41762
|
this.updateInteractionState(null != state ? state : InteractionState.default);
|
|
41786
41763
|
}, 100), this.table = table, this.initState(), this.updateVerticalScrollBar = this.updateVerticalScrollBar.bind(this), this.updateHorizontalScrollBar = this.updateHorizontalScrollBar.bind(this);
|
|
41787
41764
|
}
|
|
@@ -42464,7 +42441,7 @@
|
|
|
42464
42441
|
return syncRadioState(col, row, field, radioType, indexInCell, isChecked, this);
|
|
42465
42442
|
}
|
|
42466
42443
|
changeCheckboxAndRadioOrder(sourceIndex, targetIndex) {
|
|
42467
|
-
this.checkedState.
|
|
42444
|
+
this.checkedState.length && changeCheckboxOrder(sourceIndex, targetIndex, this), this.radioState.length && changeRadioOrder(sourceIndex, targetIndex, this);
|
|
42468
42445
|
}
|
|
42469
42446
|
setCustomSelectRanges(customSelectRanges) {
|
|
42470
42447
|
deletaCustomSelectRanges(this), addCustomSelectRanges(customSelectRanges, this);
|
|
@@ -46173,7 +46150,7 @@
|
|
|
46173
46150
|
if (cellStyle.customStyleId === customStyleId) if (cellPos.range) for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) this.table.scenegraph.updateCellContent(col, row);else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
|
|
46174
46151
|
}), this.table.scenegraph.updateNextFrame();
|
|
46175
46152
|
}
|
|
46176
|
-
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
46153
|
+
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
46177
46154
|
var _a;
|
|
46178
46155
|
const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
|
|
46179
46156
|
if (-1 === index && !customStyleId) return;
|
|
@@ -46189,7 +46166,6 @@
|
|
|
46189
46166
|
customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
|
|
46190
46167
|
}
|
|
46191
46168
|
const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
|
|
46192
|
-
let forceFastUpdate;
|
|
46193
46169
|
if (style) {
|
|
46194
46170
|
forceFastUpdate = !0;
|
|
46195
46171
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -46361,7 +46337,7 @@
|
|
|
46361
46337
|
constructor(container) {
|
|
46362
46338
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46363
46339
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
46364
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.
|
|
46340
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
46365
46341
|
const {
|
|
46366
46342
|
frozenColCount = 0,
|
|
46367
46343
|
frozenRowCount: frozenRowCount,
|
|
@@ -48056,9 +48032,9 @@
|
|
|
48056
48032
|
var _a;
|
|
48057
48033
|
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.registerCustomCellStyle(customStyleId, customStyle);
|
|
48058
48034
|
}
|
|
48059
|
-
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
48035
|
+
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
48060
48036
|
var _a;
|
|
48061
|
-
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId);
|
|
48037
|
+
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate);
|
|
48062
48038
|
}
|
|
48063
48039
|
isSeriesNumber(col, row) {
|
|
48064
48040
|
return this.internalProps.layoutMap.isSeriesNumber(col, row);
|
|
@@ -49545,7 +49521,7 @@
|
|
|
49545
49521
|
}
|
|
49546
49522
|
}
|
|
49547
49523
|
|
|
49548
|
-
class
|
|
49524
|
+
class EditManager {
|
|
49549
49525
|
constructor(table) {
|
|
49550
49526
|
this.isValidatingValue = !1, this.table = table, this.bindEvent();
|
|
49551
49527
|
}
|
|
@@ -49621,14 +49597,16 @@
|
|
|
49621
49597
|
} else if (!editor.isEditorElement || editor.isEditorElement(target)) return !1;
|
|
49622
49598
|
if (this.editingEditor.getValue, this.editingEditor.validateValue) {
|
|
49623
49599
|
this.isValidatingValue = !0;
|
|
49624
|
-
const
|
|
49600
|
+
const newValue = this.editingEditor.getValue(),
|
|
49601
|
+
oldValue = this.table.getCellOriginValue(this.editCell.col, this.editCell.row),
|
|
49602
|
+
maybePromiseOrValue = null === (_b = (_a = this.editingEditor).validateValue) || void 0 === _b ? void 0 : _b.call(_a, newValue, oldValue, this.editCell, this.table);
|
|
49625
49603
|
return isPromise(maybePromiseOrValue) ? new Promise((resolve, reject) => {
|
|
49626
49604
|
maybePromiseOrValue.then(result => {
|
|
49627
|
-
result
|
|
49605
|
+
dealWithValidateValue(result, this, oldValue, resolve);
|
|
49628
49606
|
}).catch(err => {
|
|
49629
49607
|
this.isValidatingValue = !1, reject(err);
|
|
49630
49608
|
});
|
|
49631
|
-
}) :
|
|
49609
|
+
}) : dealWithValidateValue(maybePromiseOrValue, this, oldValue);
|
|
49632
49610
|
}
|
|
49633
49611
|
return this.doExit(), !0;
|
|
49634
49612
|
}
|
|
@@ -49649,6 +49627,9 @@
|
|
|
49649
49627
|
this.editingEditor && (null === (_b = (_a = this.editingEditor).exit) || void 0 === _b || _b.call(_a), null === (_d = (_c = this.editingEditor).onEnd) || void 0 === _d || _d.call(_c), this.editingEditor = null);
|
|
49650
49628
|
}
|
|
49651
49629
|
}
|
|
49630
|
+
function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
|
|
49631
|
+
return editManager.isValidatingValue = !1, "validate-return" === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : "invalidate-return" === validateValue ? (editManager.editingEditor.setValue(oldValue), editManager.doExit(), null == resolve || resolve(!0), !0) : "validate-not-return" === validateValue || "invalidate-not-return" === validateValue ? (null == resolve || resolve(!1), !1) : !0 === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : (null == resolve || resolve(!1), !1);
|
|
49632
|
+
}
|
|
49652
49633
|
|
|
49653
49634
|
function getGroupByDataConfig(groupByOption) {
|
|
49654
49635
|
if (isString$2(groupByOption)) return {
|
|
@@ -49733,7 +49714,7 @@
|
|
|
49733
49714
|
oldValue = oldValues[i][j],
|
|
49734
49715
|
value = rowValues[j],
|
|
49735
49716
|
maybePromiseOrValue = null === (_b = null === (_a = null == editor ? void 0 : editor.validateValue) || void 0 === _a ? void 0 : _a.call(editor, value, oldValue)) || void 0 === _b || _b;
|
|
49736
|
-
isCanChange = !!isPromise(maybePromiseOrValue) || maybePromiseOrValue;
|
|
49717
|
+
isCanChange = !!isPromise(maybePromiseOrValue) || !0 === maybePromiseOrValue || "validate-return" === maybePromiseOrValue || "invalidate-return" === maybePromiseOrValue;
|
|
49737
49718
|
}
|
|
49738
49719
|
if (isCanChange) {
|
|
49739
49720
|
const value = rowValues[j],
|
|
@@ -50150,7 +50131,7 @@
|
|
|
50150
50131
|
var _a, _b, _c, _d, _e, _f;
|
|
50151
50132
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
|
|
50152
50133
|
const internalProps = this.internalProps;
|
|
50153
|
-
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new
|
|
50134
|
+
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
50154
50135
|
sortState: internalProps.sortState
|
|
50155
50136
|
}) : this.setRecords([]), options.title) {
|
|
50156
50137
|
const Title = Factory.getComponent("title");
|
|
@@ -50563,11 +50544,11 @@
|
|
|
50563
50544
|
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph();
|
|
50564
50545
|
}
|
|
50565
50546
|
getCheckboxState(field) {
|
|
50566
|
-
if (this.stateManager.checkedState.
|
|
50567
|
-
let stateArr = this.stateManager.checkedState
|
|
50547
|
+
if (this.stateManager.checkedState.length < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$1(field)) {
|
|
50548
|
+
let stateArr = this.stateManager.checkedState;
|
|
50568
50549
|
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), stateArr.map(state => state[field]);
|
|
50569
50550
|
}
|
|
50570
|
-
return
|
|
50551
|
+
return this.stateManager.checkedState;
|
|
50571
50552
|
}
|
|
50572
50553
|
getCellCheckboxState(col, row) {
|
|
50573
50554
|
var _a;
|
|
@@ -50575,8 +50556,8 @@
|
|
|
50575
50556
|
field = null == define ? void 0 : define.field,
|
|
50576
50557
|
cellType = this.getCellType(col, row);
|
|
50577
50558
|
if (isValid$1(field) && "checkbox" === cellType) {
|
|
50578
|
-
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row))
|
|
50579
|
-
return null === (_a = this.stateManager.checkedState
|
|
50559
|
+
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
|
|
50560
|
+
return null === (_a = this.stateManager.checkedState[dataIndex]) || void 0 === _a ? void 0 : _a[field];
|
|
50580
50561
|
}
|
|
50581
50562
|
}
|
|
50582
50563
|
getRadioState(field) {
|