@visactor/vtable-calendar 1.26.3-alpha.0 → 1.26.4-alpha.0
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 +116 -53
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -38981,6 +38981,20 @@
|
|
|
38981
38981
|
var _a, _b, _c;
|
|
38982
38982
|
return null !== (_c = null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0;
|
|
38983
38983
|
}
|
|
38984
|
+
refreshRecords(records = [], dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
|
|
38985
|
+
var _a;
|
|
38986
|
+
this.clearCache(), this.beforeChangedRecordsMap.clear(), this.groupAggregator = null, this.addRecordRule = (null == dataConfig ? void 0 : dataConfig.addRecordRule) || "Object", this.dataConfig = dataConfig, this.columns = columns, this._isGrouped = isArray$5(null == dataConfig ? void 0 : dataConfig.groupByRules), this.rowHierarchyType = rowHierarchyType, this.dataSourceObj = {
|
|
38987
|
+
get: index => records[index],
|
|
38988
|
+
length: records.length,
|
|
38989
|
+
records: records
|
|
38990
|
+
}, this._source = this.processRecords(records), this.sourceLength = (null === (_a = this.source) || void 0 === _a ? void 0 : _a.length) || 0, this.sortedIndexMap.clear(), this._currentPagerIndexedData = [], this.userPagination = pagination, this.pagination = pagination || {
|
|
38991
|
+
totalCount: this.sourceLength,
|
|
38992
|
+
perPageCount: this.sourceLength,
|
|
38993
|
+
currentPage: 0
|
|
38994
|
+
}, this.hierarchyExpandLevel = hierarchyExpandLevel >= 1 ? hierarchyExpandLevel : 0, this.currentIndexedData = Array.from({
|
|
38995
|
+
length: this.sourceLength
|
|
38996
|
+
}, (_, i) => i), this.userPagination || (this.pagination.perPageCount = this.sourceLength, this.pagination.totalCount = this.sourceLength), "tree" === rowHierarchyType && this.initTreeHierarchyState(), this.updatePagerData();
|
|
38997
|
+
}
|
|
38984
38998
|
updateGroup() {
|
|
38985
38999
|
var _a, _b, _c;
|
|
38986
39000
|
this.clearCache();
|
|
@@ -39296,13 +39310,20 @@
|
|
|
39296
39310
|
return parse$2(font);
|
|
39297
39311
|
}
|
|
39298
39312
|
|
|
39299
|
-
function
|
|
39313
|
+
function normalizeQuadArray(values) {
|
|
39314
|
+
return 0 === values.length ? [0, 0, 0, 0] : 1 === values.length ? [values[0], values[0], values[0], values[0]] : 2 === values.length ? [values[0], values[1], values[0], values[1]] : 3 === values.length ? [values[0], values[1], values[2], values[1]] : [values[0], values[1], values[2], values[3]];
|
|
39315
|
+
}
|
|
39316
|
+
function parseStringQuad(padding) {
|
|
39317
|
+
const tokens = padding.trim().split(/\s+/),
|
|
39318
|
+
values = tokens.map(token => Number.parseFloat(token)).filter(value => Number.isFinite(value));
|
|
39319
|
+
return values.length === tokens.length && values.length > 0 ? normalizeQuadArray(values) : [padding, padding, padding, padding];
|
|
39320
|
+
}
|
|
39321
|
+
function normalizePaddingObject(paddingOrigin) {
|
|
39300
39322
|
var _a, _b, _c, _d;
|
|
39301
|
-
|
|
39302
|
-
|
|
39303
|
-
|
|
39304
|
-
|
|
39305
|
-
return paddingOrigin && (isFinite(paddingOrigin.bottom) || isFinite(paddingOrigin.left) || isFinite(paddingOrigin.right) || isFinite(paddingOrigin.top)) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
|
|
39323
|
+
return Number.isFinite(paddingOrigin.bottom) || Number.isFinite(paddingOrigin.left) || Number.isFinite(paddingOrigin.right) || Number.isFinite(paddingOrigin.top) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
|
|
39324
|
+
}
|
|
39325
|
+
function getQuadProps(paddingOrigin) {
|
|
39326
|
+
return Array.isArray(paddingOrigin) ? normalizeQuadArray(paddingOrigin.slice(0, 4)) : "number" == typeof paddingOrigin && Number.isFinite(paddingOrigin) ? [paddingOrigin, paddingOrigin, paddingOrigin, paddingOrigin] : "string" == typeof paddingOrigin ? parseStringQuad(paddingOrigin) : paddingOrigin && "object" == typeof paddingOrigin ? normalizePaddingObject(paddingOrigin) : [0, 0, 0, 0];
|
|
39306
39327
|
}
|
|
39307
39328
|
|
|
39308
39329
|
const TYPE_PAREN = 0,
|
|
@@ -39532,14 +39553,17 @@
|
|
|
39532
39553
|
table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
|
|
39533
39554
|
})];
|
|
39534
39555
|
}
|
|
39535
|
-
function
|
|
39556
|
+
function getListTableRowHierarchyType(table) {
|
|
39557
|
+
var _a, _b;
|
|
39536
39558
|
const tableWithPlugins = table;
|
|
39559
|
+
let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
|
|
39560
|
+
return isArray$5(null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) && (rowHierarchyType = "tree"), (null === (_b = tableWithPlugins.pluginManager) || void 0 === _b ? void 0 : _b.getPluginByName("Master Detail Plugin")) && (rowHierarchyType = "grid"), rowHierarchyType;
|
|
39561
|
+
}
|
|
39562
|
+
function _setRecords(table, records = []) {
|
|
39537
39563
|
_dealWithUpdateDataSource(table, () => {
|
|
39538
|
-
var _a;
|
|
39539
39564
|
table.internalProps.records = records;
|
|
39540
|
-
|
|
39541
|
-
|
|
39542
|
-
const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
|
|
39565
|
+
const rowHierarchyType = getListTableRowHierarchyType(table),
|
|
39566
|
+
newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
|
|
39543
39567
|
table.addReleaseObj(newDataSource);
|
|
39544
39568
|
});
|
|
39545
39569
|
}
|
|
@@ -40915,7 +40939,7 @@
|
|
|
40915
40939
|
|
|
40916
40940
|
function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
|
|
40917
40941
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40918
|
-
let contentWidth,
|
|
40942
|
+
let contentWidth = 0,
|
|
40919
40943
|
leftIconWidth = 0,
|
|
40920
40944
|
rightIconWidth = 0,
|
|
40921
40945
|
absoluteRightIconWidth = 0;
|
|
@@ -40995,8 +41019,8 @@
|
|
|
40995
41019
|
}), contentRightIcons.forEach(icon => {
|
|
40996
41020
|
const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
|
|
40997
41021
|
iconMark.role = "icon-content-right", iconMark.name = icon.name, cellContent.addRightOccupyingIcon(iconMark);
|
|
40998
|
-
}), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), contentWidth = cellContent.AABBBounds.width()
|
|
40999
|
-
} else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), contentWidth = textMark.AABBBounds.width()
|
|
41022
|
+
}), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), autoColWidth && (contentWidth = cellContent.AABBBounds.width());
|
|
41023
|
+
} else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), autoColWidth && (contentWidth = textMark.AABBBounds.width());
|
|
41000
41024
|
} else if (isValid$1(textStr)) {
|
|
41001
41025
|
const {
|
|
41002
41026
|
text: text,
|
|
@@ -41020,7 +41044,7 @@
|
|
|
41020
41044
|
keepCenterInLine: !0
|
|
41021
41045
|
},
|
|
41022
41046
|
wrapText = new Text(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
41023
|
-
wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), contentWidth = wrapText.AABBBounds.width()
|
|
41047
|
+
wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), autoColWidth && (contentWidth = wrapText.AABBBounds.width());
|
|
41024
41048
|
}
|
|
41025
41049
|
const width = autoColWidth ? leftIconWidth + contentWidth + rightIconWidth : cellWidth - (padding[1] + padding[3]),
|
|
41026
41050
|
height = cellHeight - (padding[0] + padding[2]);
|
|
@@ -41478,7 +41502,7 @@
|
|
|
41478
41502
|
}
|
|
41479
41503
|
}
|
|
41480
41504
|
|
|
41481
|
-
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
|
|
41505
|
+
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, headerStyle) {
|
|
41482
41506
|
var _a, _b;
|
|
41483
41507
|
let cellGroup,
|
|
41484
41508
|
isAsync = !1;
|
|
@@ -41513,7 +41537,7 @@
|
|
|
41513
41537
|
customElementsGroup: customElementsGroup,
|
|
41514
41538
|
renderDefault: renderDefault
|
|
41515
41539
|
} = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult);
|
|
41516
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
|
|
41540
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
|
|
41517
41541
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
41518
41542
|
if (axisConfig) {
|
|
41519
41543
|
const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_a = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _a ? _a : padding, table);
|
|
@@ -41536,20 +41560,20 @@
|
|
|
41536
41560
|
} = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult),
|
|
41537
41561
|
style = table._getCellStyle(col, row),
|
|
41538
41562
|
dataValue = table.getCellOriginValue(col, row);
|
|
41539
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
|
|
41563
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
|
|
41540
41564
|
const progressBarGroup = Factory.getFunction("createProgressBarCell")(define, style, colWidth, value, dataValue, col, row, padding, table, range);
|
|
41541
41565
|
cellGroup.firstChild ? cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild) : cellGroup.appendChild(progressBarGroup);
|
|
41542
41566
|
} else if ("sparkline" === type) {
|
|
41543
41567
|
cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
|
|
41544
41568
|
} else if ("checkbox" === type) {
|
|
41545
41569
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
41546
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
41570
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync, headerStyle);
|
|
41547
41571
|
} else {
|
|
41548
41572
|
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
|
|
41549
41573
|
}
|
|
41550
41574
|
} else if ("radio" === type) {
|
|
41551
41575
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
41552
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
41576
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync, headerStyle);
|
|
41553
41577
|
} else {
|
|
41554
41578
|
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
41555
41579
|
}
|
|
@@ -46761,6 +46785,7 @@
|
|
|
46761
46785
|
isMerge,
|
|
46762
46786
|
customStyle,
|
|
46763
46787
|
customResult,
|
|
46788
|
+
rawRecord,
|
|
46764
46789
|
cellLocation = table.getCellLocation(col, row),
|
|
46765
46790
|
value = table.getCellValue(col, row),
|
|
46766
46791
|
cellWidth = colWidth,
|
|
@@ -46790,17 +46815,17 @@
|
|
|
46790
46815
|
const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
|
|
46791
46816
|
isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
|
|
46792
46817
|
let mayHaveIcon = "body" !== cellLocation || ((null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree)) && !(isAggregation && isSeriesNumber);
|
|
46793
|
-
if (!range && (table.internalProps.enableTreeNodeMerge || "body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (range = table.getCellRange(col, row), isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row, isMerge)) {
|
|
46818
|
+
if (!range && (table.internalProps.enableTreeNodeMerge || "body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (table.internalProps.enableTreeNodeMerge && "body" === cellLocation && !(null == define ? void 0 : define.mergeCell) ? (rawRecord = table.getCellRawRecord(col, row), (null == rawRecord ? void 0 : rawRecord.vtableMerge) && (range = table.getCellRange(col, row), isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row)) : (range = table.getCellRange(col, row), isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row), isMerge)) {
|
|
46794
46819
|
const mergeSize = dealMerge(range, mergeMap, table, rowStart > range.start.row);
|
|
46795
46820
|
cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
|
|
46796
46821
|
}
|
|
46797
46822
|
let isVtableMerge = !1;
|
|
46798
46823
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
46799
|
-
|
|
46800
|
-
|
|
46801
|
-
|
|
46802
|
-
|
|
46803
|
-
|
|
46824
|
+
rawRecord = null != rawRecord ? rawRecord : table.getCellRawRecord(range.start.col, range.start.row);
|
|
46825
|
+
const {
|
|
46826
|
+
vtableMergeName: vtableMergeName,
|
|
46827
|
+
vtableMerge: vtableMerge
|
|
46828
|
+
} = null != rawRecord ? rawRecord : {};
|
|
46804
46829
|
isVtableMerge = vtableMerge, vtableMerge && (mayHaveIcon = !0, table.internalProps.groupTitleCustomLayout && (customResult = dealWithCustom(table.internalProps.groupTitleCustomLayout, void 0, range.start.col, range.start.row, table.getColsWidth(range.start.col, range.end.col), table.getRowsHeight(range.start.row, range.end.row), !1, table.isAutoRowHeight(row), [0, 0, 0, 0], range, table)), table.internalProps.groupTitleFieldFormat ? value = table.internalProps.groupTitleFieldFormat(rawRecord, col, row, table) : void 0 !== vtableMergeName && (value = vtableMergeName));
|
|
46805
46830
|
}
|
|
46806
46831
|
const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
|
|
@@ -46830,7 +46855,7 @@
|
|
|
46830
46855
|
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
46831
46856
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
46832
46857
|
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight, cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign), cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff");
|
|
46833
|
-
const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
|
|
46858
|
+
const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellStyle);
|
|
46834
46859
|
if (columnGroup.updateColumnRowNumber(row), isMerge) {
|
|
46835
46860
|
const rangeHeight = table.getRowHeight(row),
|
|
46836
46861
|
{
|
|
@@ -46872,7 +46897,7 @@
|
|
|
46872
46897
|
} = createCellArgs,
|
|
46873
46898
|
cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
46874
46899
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
46875
|
-
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight, cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign), cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff"), createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
|
|
46900
|
+
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight, cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign), cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff"), createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellStyle);
|
|
46876
46901
|
}
|
|
46877
46902
|
function dealMerge(range, mergeMap, table, forceUpdate) {
|
|
46878
46903
|
let cellWidth = 0,
|
|
@@ -48768,7 +48793,8 @@
|
|
|
48768
48793
|
for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {
|
|
48769
48794
|
insertBefore(rightFrozenGroup, scene.getColGroup(col), rightFrozenGroup.firstChild);
|
|
48770
48795
|
insertBefore(rightTopCornerGroup, scene.getColGroup(col, !0), rightTopCornerGroup.firstChild);
|
|
48771
|
-
|
|
48796
|
+
const bottomColGroup = scene.getColGroupInBottom(col);
|
|
48797
|
+
bottomColGroup && insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
|
|
48772
48798
|
}
|
|
48773
48799
|
let x = 0;
|
|
48774
48800
|
rightFrozenGroup.forEachChildren(columnGroup => {
|
|
@@ -48785,7 +48811,10 @@
|
|
|
48785
48811
|
const headerColGroup = scene.getColGroupInRightTopCorner(col);
|
|
48786
48812
|
headerColGroup.setAttribute("x", colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col)), colHeaderGroup.appendChild(headerColGroup);
|
|
48787
48813
|
const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
|
|
48788
|
-
|
|
48814
|
+
if (bottomColGroup) {
|
|
48815
|
+
const lastBottomColGroup = bottomFrozenGroup.lastChild;
|
|
48816
|
+
bottomColGroup.setAttribute("x", lastBottomColGroup ? lastBottomColGroup.attribute.x + table.getColWidth(lastBottomColGroup.col) : 0), bottomFrozenGroup.appendChild(bottomColGroup);
|
|
48817
|
+
}
|
|
48789
48818
|
}
|
|
48790
48819
|
let x = 0;
|
|
48791
48820
|
rightFrozenGroup.forEachChildren(columnGroup => {
|
|
@@ -50318,16 +50347,28 @@
|
|
|
50318
50347
|
updateContainerChildrenX(this.rightFrozenGroup, rightStartX), updateContainerChildrenX(this.rightTopCornerGroup, rightStartX), updateContainerChildrenX(this.rightBottomCornerGroup, rightStartX), this.updateNextFrame();
|
|
50319
50348
|
}
|
|
50320
50349
|
updateContainerAttrHeightAndY() {
|
|
50321
|
-
|
|
50322
|
-
|
|
50323
|
-
|
|
50324
|
-
|
|
50325
|
-
|
|
50326
|
-
|
|
50327
|
-
|
|
50328
|
-
|
|
50329
|
-
|
|
50330
|
-
|
|
50350
|
+
this.cornerHeaderGroup.forEachChildrenSkipChild(column => {
|
|
50351
|
+
updateContainerChildrenY(column, 0);
|
|
50352
|
+
}), this.colHeaderGroup.forEachChildrenSkipChild(column => {
|
|
50353
|
+
updateContainerChildrenY(column, 0);
|
|
50354
|
+
}), this.rightTopCornerGroup.forEachChildrenSkipChild(column => {
|
|
50355
|
+
updateContainerChildrenY(column, 0);
|
|
50356
|
+
}), this.rowHeaderGroup.forEachChildrenSkipChild(column => {
|
|
50357
|
+
var _a;
|
|
50358
|
+
column.firstChild && updateContainerChildrenY(column, column.firstChild.row > 0 ? this.table.getRowsHeight(null !== (_a = this.table.frozenRowCount) && void 0 !== _a ? _a : 0, column.firstChild.row - 1) : 0);
|
|
50359
|
+
}), this.bodyGroup.forEachChildrenSkipChild(column => {
|
|
50360
|
+
var _a;
|
|
50361
|
+
column.firstChild && updateContainerChildrenY(column, column.firstChild.row > 0 ? this.table.getRowsHeight(null !== (_a = this.table.frozenRowCount) && void 0 !== _a ? _a : 0, column.firstChild.row - 1) : 0);
|
|
50362
|
+
}), this.rightFrozenGroup.forEachChildrenSkipChild(column => {
|
|
50363
|
+
var _a;
|
|
50364
|
+
column.firstChild && updateContainerChildrenY(column, column.firstChild.row > 0 ? this.table.getRowsHeight(null !== (_a = this.table.frozenRowCount) && void 0 !== _a ? _a : 0, column.firstChild.row - 1) : 0);
|
|
50365
|
+
}), this.leftBottomCornerGroup.forEachChildrenSkipChild(column => {
|
|
50366
|
+
updateContainerChildrenY(column, 0);
|
|
50367
|
+
}), this.bottomFrozenGroup.forEachChildrenSkipChild(column => {
|
|
50368
|
+
updateContainerChildrenY(column, 0);
|
|
50369
|
+
}), this.rightBottomCornerGroup.forEachChildrenSkipChild(column => {
|
|
50370
|
+
updateContainerChildrenY(column, 0);
|
|
50371
|
+
});
|
|
50331
50372
|
}
|
|
50332
50373
|
updateContainer(updateConfig = {
|
|
50333
50374
|
async: !1,
|
|
@@ -58214,7 +58255,7 @@
|
|
|
58214
58255
|
const internalProps = this.internalProps;
|
|
58215
58256
|
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_e = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _e || _e, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode, internalProps.canResizeColumn = null == resize ? void 0 : resize.canResizeColumn, internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode, internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps.groupBy = null !== (_k = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _k ? _k : groupBy, internalProps.groupTitleCheckbox = null == groupConfig ? void 0 : groupConfig.titleCheckbox, internalProps.groupTitleFieldFormat = null !== (_l = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _l ? _l : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _m ? _m : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_o = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _o ? _o : enableTreeStickCell, (null == updateConfig ? void 0 : updateConfig.clearColWidthCache) && (internalProps._widthResizedColMap.clear(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}), (null == updateConfig ? void 0 : updateConfig.clearRowHeightCache) && (internalProps._heightResizedRowMap.clear(), internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map()), internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0, internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_s = internalProps.legends) || void 0 === _s || _s.forEach(legend => {
|
|
58216
58257
|
null == legend || legend.release();
|
|
58217
|
-
}), null === (_t = internalProps.title) || void 0 === _t || _t.release(), internalProps.title = null, null === (_u = internalProps.emptyTip) || void 0 === _u || _u.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
58258
|
+
}), null === (_t = internalProps.title) || void 0 === _t || _t.release(), internalProps.title = null, null === (_u = internalProps.emptyTip) || void 0 === _u || _u.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), (null == updateConfig ? void 0 : updateConfig.skipClearCells) || this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
58218
58259
|
internalProps.legends = [];
|
|
58219
58260
|
const createLegend = Factory.getFunction("createLegend");
|
|
58220
58261
|
if (Array.isArray(options.legends)) {
|
|
@@ -59368,16 +59409,17 @@
|
|
|
59368
59409
|
}
|
|
59369
59410
|
scrollToRow(row, animationOption) {
|
|
59370
59411
|
var _a;
|
|
59371
|
-
const targetRow = Math.min(Math.max(
|
|
59412
|
+
const targetRow = Math.min(Math.max(row, 0), this.rowCount - 1),
|
|
59413
|
+
targetRowInt = Math.floor(targetRow);
|
|
59372
59414
|
if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
|
|
59373
|
-
row:
|
|
59374
|
-
}), void this._scheduleScrollToRowCorrect(
|
|
59415
|
+
row: targetRowInt
|
|
59416
|
+
}), void this._scheduleScrollToRowCorrect(targetRowInt);
|
|
59375
59417
|
const duration = isBoolean$2(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
|
|
59376
59418
|
this.animationManager.scrollTo({
|
|
59377
59419
|
row: targetRow
|
|
59378
|
-
}, animationOption), this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
59379
|
-
this.scrollToRow(
|
|
59380
|
-
}, duration);
|
|
59420
|
+
}, animationOption), targetRowInt === targetRow && (this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
59421
|
+
this.scrollToRow(targetRowInt, !1);
|
|
59422
|
+
}, duration));
|
|
59381
59423
|
}
|
|
59382
59424
|
scrollToCol(col, animationOption) {
|
|
59383
59425
|
animationOption ? this.animationManager.scrollTo({
|
|
@@ -62239,14 +62281,19 @@
|
|
|
62239
62281
|
clearRowHeightCache: !0
|
|
62240
62282
|
}) {
|
|
62241
62283
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62242
|
-
const internalProps = this.internalProps
|
|
62243
|
-
|
|
62284
|
+
const internalProps = this.internalProps,
|
|
62285
|
+
prevSortState = internalProps.sortState,
|
|
62286
|
+
hasActiveSortState = (Array.isArray(options.sortState) ? options.sortState : options.sortState ? [options.sortState] : []).some(item => (null == item ? void 0 : item.field) && (null == item ? void 0 : item.order) && "normal" !== item.order),
|
|
62287
|
+
shouldSkipInitialClearCells = Boolean(options.records) || !!options.dataSource && this.dataSource !== options.dataSource;
|
|
62288
|
+
if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, Object.assign(Object.assign({}, updateConfig), {
|
|
62289
|
+
skipClearCells: shouldSkipInitialClearCells
|
|
62290
|
+
})), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
|
|
62244
62291
|
addRecordRule: options.addRecordRule
|
|
62245
62292
|
}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$1(this.internalProps.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.internalProps.rowHeightConfig = options.rowHeightConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
|
|
62246
62293
|
const releaseObj = internalProps.releaseList[i];
|
|
62247
62294
|
releaseObj instanceof DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj), internalProps.releaseList.splice(i, 1));
|
|
62248
62295
|
}
|
|
62249
|
-
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
62296
|
+
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records && options.records === internalProps.records && options.sortState === prevSortState && !hasActiveSortState && this.dataSource instanceof CachedDataSource ? this._refreshCurrentRecordsForOptionUpdate(options.records) : options.records ? this.setRecords(options.records, {
|
|
62250
62297
|
sortState: options.sortState
|
|
62251
62298
|
}) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
|
|
62252
62299
|
const Title = Factory.getComponent("title");
|
|
@@ -62262,6 +62309,22 @@
|
|
|
62262
62309
|
setTimeout(resolve, 0);
|
|
62263
62310
|
});
|
|
62264
62311
|
}
|
|
62312
|
+
_refreshCurrentRecordsForOptionUpdate(records) {
|
|
62313
|
+
var _a;
|
|
62314
|
+
const dataSource = this.dataSource;
|
|
62315
|
+
this.stateManager.endResizeIfResizing(), clearChartRenderQueue();
|
|
62316
|
+
const oldHoverState = {
|
|
62317
|
+
col: this.stateManager.hover.cellPos.col,
|
|
62318
|
+
row: this.stateManager.hover.cellPos.row
|
|
62319
|
+
};
|
|
62320
|
+
this.scenegraph.clearCells(), this.internalProps.records = records, dataSource.refreshRecords(records, this.internalProps.dataConfig, this.pagination, this.internalProps.columns, getListTableRowHierarchyType(this), getHierarchyExpandLevel(this)), this.refreshRowColCount(), this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
|
|
62321
|
+
(null !== (_a = this.options.componentLayoutOrder) && void 0 !== _a ? _a : ["legend", "title"]).forEach(component => {
|
|
62322
|
+
var _a, _b;
|
|
62323
|
+
"legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
62324
|
+
null == legend || legend.resize();
|
|
62325
|
+
}) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
|
|
62326
|
+
}), this.scenegraph.resize(), this.render();
|
|
62327
|
+
}
|
|
62265
62328
|
updatePagination(pagination) {
|
|
62266
62329
|
this.pagination && ("number" == typeof pagination.currentPage && pagination.currentPage >= 0 && (this.pagination.currentPage = pagination.currentPage), pagination.perPageCount && (this.pagination.perPageCount = pagination.perPageCount || this.pagination.perPageCount), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.clearCells(), this.dataSource.updatePagination(this.pagination), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(), this.renderAsync());
|
|
62267
62330
|
}
|
|
@@ -66167,10 +66230,10 @@
|
|
|
66167
66230
|
}
|
|
66168
66231
|
}
|
|
66169
66232
|
|
|
66170
|
-
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync) {
|
|
66233
|
+
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle) {
|
|
66171
66234
|
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, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
66172
|
-
|
|
66173
|
-
|
|
66235
|
+
headerStyle = headerStyle || table._getCellStyle(col, row);
|
|
66236
|
+
const functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
66174
66237
|
isValid$1(functionalPadding) && (padding = functionalPadding), (null === (_a = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _a ? void 0 : _a.textAlign) && (textAlign = null === (_b = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _b ? void 0 : _b.textAlign), (null === (_c = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _c ? void 0 : _c.textBaseline) && (textBaseline = null === (_d = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _d ? void 0 : _d.textBaseline);
|
|
66175
66238
|
const autoRowHeight = table.isAutoRowHeight(row),
|
|
66176
66239
|
autoColWidth = "auto" === colWidth,
|