@visactor/vtable-calendar 1.26.4-alpha.0 → 1.26.4
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 +216 -159
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -38981,20 +38981,6 @@
|
|
|
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
|
-
}
|
|
38998
38984
|
updateGroup() {
|
|
38999
38985
|
var _a, _b, _c;
|
|
39000
38986
|
this.clearCache();
|
|
@@ -39553,17 +39539,14 @@
|
|
|
39553
39539
|
table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
|
|
39554
39540
|
})];
|
|
39555
39541
|
}
|
|
39556
|
-
function getListTableRowHierarchyType(table) {
|
|
39557
|
-
var _a, _b;
|
|
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
39542
|
function _setRecords(table, records = []) {
|
|
39543
|
+
const tableWithPlugins = table;
|
|
39563
39544
|
_dealWithUpdateDataSource(table, () => {
|
|
39545
|
+
var _a;
|
|
39564
39546
|
table.internalProps.records = records;
|
|
39565
|
-
|
|
39566
|
-
|
|
39547
|
+
let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
|
|
39548
|
+
isArray$5(null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) && (rowHierarchyType = "tree"), tableWithPlugins.pluginManager.getPluginByName("Master Detail Plugin") && (rowHierarchyType = "grid");
|
|
39549
|
+
const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
|
|
39567
39550
|
table.addReleaseObj(newDataSource);
|
|
39568
39551
|
});
|
|
39569
39552
|
}
|
|
@@ -40353,7 +40336,7 @@
|
|
|
40353
40336
|
col: null !== (_b = null == range ? void 0 : range.start.col) && void 0 !== _b ? _b : col,
|
|
40354
40337
|
row: null !== (_c = null == range ? void 0 : range.start.row) && void 0 !== _c ? _c : row,
|
|
40355
40338
|
dataValue: table.getCellOriginValue(col, row),
|
|
40356
|
-
value: table.getCellValue(col, row)
|
|
40339
|
+
value: table.getCellValue(col, row),
|
|
40357
40340
|
rect: {
|
|
40358
40341
|
left: 0,
|
|
40359
40342
|
top: 0,
|
|
@@ -40375,7 +40358,7 @@
|
|
|
40375
40358
|
col: col,
|
|
40376
40359
|
row: row,
|
|
40377
40360
|
dataValue: table.getCellOriginValue(col, row),
|
|
40378
|
-
value: table.getCellValue(col, row)
|
|
40361
|
+
value: table.getCellValue(col, row),
|
|
40379
40362
|
rect: {
|
|
40380
40363
|
left: 0,
|
|
40381
40364
|
top: 0,
|
|
@@ -40939,7 +40922,7 @@
|
|
|
40939
40922
|
|
|
40940
40923
|
function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
|
|
40941
40924
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40942
|
-
let contentWidth
|
|
40925
|
+
let contentWidth,
|
|
40943
40926
|
leftIconWidth = 0,
|
|
40944
40927
|
rightIconWidth = 0,
|
|
40945
40928
|
absoluteRightIconWidth = 0;
|
|
@@ -41019,8 +41002,8 @@
|
|
|
41019
41002
|
}), contentRightIcons.forEach(icon => {
|
|
41020
41003
|
const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
|
|
41021
41004
|
iconMark.role = "icon-content-right", iconMark.name = icon.name, cellContent.addRightOccupyingIcon(iconMark);
|
|
41022
|
-
}), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(),
|
|
41023
|
-
} else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark),
|
|
41005
|
+
}), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), contentWidth = cellContent.AABBBounds.width(), cellContent.AABBBounds.height();
|
|
41006
|
+
} else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), contentWidth = textMark.AABBBounds.width(), textMark.AABBBounds.height();
|
|
41024
41007
|
} else if (isValid$1(textStr)) {
|
|
41025
41008
|
const {
|
|
41026
41009
|
text: text,
|
|
@@ -41044,7 +41027,7 @@
|
|
|
41044
41027
|
keepCenterInLine: !0
|
|
41045
41028
|
},
|
|
41046
41029
|
wrapText = new Text(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
|
|
41047
|
-
wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText),
|
|
41030
|
+
wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), contentWidth = wrapText.AABBBounds.width(), wrapText.AABBBounds.height();
|
|
41048
41031
|
}
|
|
41049
41032
|
const width = autoColWidth ? leftIconWidth + contentWidth + rightIconWidth : cellWidth - (padding[1] + padding[3]),
|
|
41050
41033
|
height = cellHeight - (padding[0] + padding[2]);
|
|
@@ -41377,7 +41360,7 @@
|
|
|
41377
41360
|
rowEnd = null !== (_k = cellGroup.mergeEndCol) && void 0 !== _k ? _k : cellGroup.row,
|
|
41378
41361
|
leftIconWidth = null !== (_l = cellGroup._cellLeftIconWidth) && void 0 !== _l ? _l : 0,
|
|
41379
41362
|
rightIconWidth = null !== (_m = cellGroup._cellRightIconWidth) && void 0 !== _m ? _m : 0;
|
|
41380
|
-
if (image.keepAspectRatio) {
|
|
41363
|
+
if (image.keepAspectRatio || isDamagePic(image)) {
|
|
41381
41364
|
const {
|
|
41382
41365
|
width: imageWidth,
|
|
41383
41366
|
height: imageHeight
|
|
@@ -41502,7 +41485,7 @@
|
|
|
41502
41485
|
}
|
|
41503
41486
|
}
|
|
41504
41487
|
|
|
41505
|
-
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult
|
|
41488
|
+
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
|
|
41506
41489
|
var _a, _b;
|
|
41507
41490
|
let cellGroup,
|
|
41508
41491
|
isAsync = !1;
|
|
@@ -41537,7 +41520,7 @@
|
|
|
41537
41520
|
customElementsGroup: customElementsGroup,
|
|
41538
41521
|
renderDefault: renderDefault
|
|
41539
41522
|
} = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult);
|
|
41540
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync
|
|
41523
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
|
|
41541
41524
|
const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
|
|
41542
41525
|
if (axisConfig) {
|
|
41543
41526
|
const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_a = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _a ? _a : padding, table);
|
|
@@ -41560,20 +41543,20 @@
|
|
|
41560
41543
|
} = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult),
|
|
41561
41544
|
style = table._getCellStyle(col, row),
|
|
41562
41545
|
dataValue = table.getCellOriginValue(col, row);
|
|
41563
|
-
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync
|
|
41546
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
|
|
41564
41547
|
const progressBarGroup = Factory.getFunction("createProgressBarCell")(define, style, colWidth, value, dataValue, col, row, padding, table, range);
|
|
41565
41548
|
cellGroup.firstChild ? cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild) : cellGroup.appendChild(progressBarGroup);
|
|
41566
41549
|
} else if ("sparkline" === type) {
|
|
41567
41550
|
cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
|
|
41568
41551
|
} else if ("checkbox" === type) {
|
|
41569
41552
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
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
|
|
41553
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
41571
41554
|
} else {
|
|
41572
41555
|
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
|
|
41573
41556
|
}
|
|
41574
41557
|
} else if ("radio" === type) {
|
|
41575
41558
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
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
|
|
41559
|
+
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
41577
41560
|
} else {
|
|
41578
41561
|
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
41579
41562
|
}
|
|
@@ -42364,7 +42347,7 @@
|
|
|
42364
42347
|
col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
|
|
42365
42348
|
row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
|
|
42366
42349
|
dataValue: table.getCellOriginValue(col, row),
|
|
42367
|
-
value: table.getCellValue(col, row)
|
|
42350
|
+
value: table.getCellValue(col, row),
|
|
42368
42351
|
rect: getCellRect$1(col, row, table),
|
|
42369
42352
|
table: table,
|
|
42370
42353
|
originCol: col,
|
|
@@ -46545,7 +46528,7 @@
|
|
|
46545
46528
|
col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
|
|
46546
46529
|
row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
|
|
46547
46530
|
dataValue: table.getCellOriginValue(col, row),
|
|
46548
|
-
value: table.getCellValue(col, row)
|
|
46531
|
+
value: table.getCellValue(col, row),
|
|
46549
46532
|
rect: getCellRect(col, row, table),
|
|
46550
46533
|
table: table,
|
|
46551
46534
|
originCol: col,
|
|
@@ -46785,7 +46768,6 @@
|
|
|
46785
46768
|
isMerge,
|
|
46786
46769
|
customStyle,
|
|
46787
46770
|
customResult,
|
|
46788
|
-
rawRecord,
|
|
46789
46771
|
cellLocation = table.getCellLocation(col, row),
|
|
46790
46772
|
value = table.getCellValue(col, row),
|
|
46791
46773
|
cellWidth = colWidth,
|
|
@@ -46815,17 +46797,17 @@
|
|
|
46815
46797
|
const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
|
|
46816
46798
|
isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
|
|
46817
46799
|
let mayHaveIcon = "body" !== cellLocation || ((null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree)) && !(isAggregation && isSeriesNumber);
|
|
46818
|
-
if (!range && (table.internalProps.enableTreeNodeMerge || "body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (
|
|
46800
|
+
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)) {
|
|
46819
46801
|
const mergeSize = dealMerge(range, mergeMap, table, rowStart > range.start.row);
|
|
46820
46802
|
cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
|
|
46821
46803
|
}
|
|
46822
46804
|
let isVtableMerge = !1;
|
|
46823
46805
|
if (table.internalProps.enableTreeNodeMerge && isMerge) {
|
|
46824
|
-
rawRecord =
|
|
46825
|
-
|
|
46826
|
-
|
|
46827
|
-
|
|
46828
|
-
|
|
46806
|
+
const rawRecord = table.getCellRawRecord(range.start.col, range.start.row),
|
|
46807
|
+
{
|
|
46808
|
+
vtableMergeName: vtableMergeName,
|
|
46809
|
+
vtableMerge: vtableMerge
|
|
46810
|
+
} = null != rawRecord ? rawRecord : {};
|
|
46829
46811
|
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));
|
|
46830
46812
|
}
|
|
46831
46813
|
const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
|
|
@@ -46855,7 +46837,7 @@
|
|
|
46855
46837
|
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
46856
46838
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
46857
46839
|
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");
|
|
46858
|
-
const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult
|
|
46840
|
+
const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
|
|
46859
46841
|
if (columnGroup.updateColumnRowNumber(row), isMerge) {
|
|
46860
46842
|
const rangeHeight = table.getRowHeight(row),
|
|
46861
46843
|
{
|
|
@@ -46897,7 +46879,7 @@
|
|
|
46897
46879
|
} = createCellArgs,
|
|
46898
46880
|
cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
46899
46881
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
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
|
|
46882
|
+
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);
|
|
46901
46883
|
}
|
|
46902
46884
|
function dealMerge(range, mergeMap, table, forceUpdate) {
|
|
46903
46885
|
let cellWidth = 0,
|
|
@@ -50347,28 +50329,16 @@
|
|
|
50347
50329
|
updateContainerChildrenX(this.rightFrozenGroup, rightStartX), updateContainerChildrenX(this.rightTopCornerGroup, rightStartX), updateContainerChildrenX(this.rightBottomCornerGroup, rightStartX), this.updateNextFrame();
|
|
50348
50330
|
}
|
|
50349
50331
|
updateContainerAttrHeightAndY() {
|
|
50350
|
-
|
|
50351
|
-
|
|
50352
|
-
|
|
50353
|
-
|
|
50354
|
-
|
|
50355
|
-
|
|
50356
|
-
|
|
50357
|
-
|
|
50358
|
-
|
|
50359
|
-
|
|
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
|
-
});
|
|
50332
|
+
var _a, _b, _c;
|
|
50333
|
+
for (let i = 0; i < this.cornerHeaderGroup.children.length; i++) updateContainerChildrenY(this.cornerHeaderGroup.children[i], 0);
|
|
50334
|
+
for (let i = 0; i < this.colHeaderGroup.children.length; i++) updateContainerChildrenY(this.colHeaderGroup.children[i], 0);
|
|
50335
|
+
for (let i = 0; i < this.rightTopCornerGroup.children.length; i++) updateContainerChildrenY(this.rightTopCornerGroup.children[i], 0);
|
|
50336
|
+
for (let i = 0; i < this.rowHeaderGroup.children.length; i++) this.rowHeaderGroup.children[i].firstChild && updateContainerChildrenY(this.rowHeaderGroup.children[i], this.rowHeaderGroup.children[i].firstChild.row > 0 ? this.table.getRowsHeight(null !== (_a = this.table.frozenRowCount) && void 0 !== _a ? _a : 0, this.rowHeaderGroup.children[i].firstChild.row - 1) : 0);
|
|
50337
|
+
for (let i = 0; i < this.bodyGroup.children.length; i++) this.bodyGroup.children[i].firstChild && updateContainerChildrenY(this.bodyGroup.children[i], this.bodyGroup.children[i].firstChild.row > 0 ? this.table.getRowsHeight(null !== (_b = this.table.frozenRowCount) && void 0 !== _b ? _b : 0, this.bodyGroup.children[i].firstChild.row - 1) : 0);
|
|
50338
|
+
for (let i = 0; i < this.rightFrozenGroup.children.length; i++) this.rightFrozenGroup.children[i].firstChild && updateContainerChildrenY(this.rightFrozenGroup.children[i], this.rightFrozenGroup.children[i].firstChild.row > 0 ? this.table.getRowsHeight(null !== (_c = this.table.frozenRowCount) && void 0 !== _c ? _c : 0, this.rightFrozenGroup.children[i].firstChild.row - 1) : 0);
|
|
50339
|
+
for (let i = 0; i < this.leftBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.leftBottomCornerGroup.children[i], 0);
|
|
50340
|
+
for (let i = 0; i < this.bottomFrozenGroup.children.length; i++) updateContainerChildrenY(this.bottomFrozenGroup.children[i], 0);
|
|
50341
|
+
for (let i = 0; i < this.rightBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.rightBottomCornerGroup.children[i], 0);
|
|
50372
50342
|
}
|
|
50373
50343
|
updateContainer(updateConfig = {
|
|
50374
50344
|
async: !1,
|
|
@@ -53315,70 +53285,73 @@
|
|
|
53315
53285
|
});
|
|
53316
53286
|
}), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
|
|
53317
53287
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
53318
|
-
if (0
|
|
53319
|
-
|
|
53320
|
-
|
|
53321
|
-
|
|
53322
|
-
|
|
53323
|
-
|
|
53324
|
-
|
|
53325
|
-
|
|
53326
|
-
|
|
53327
|
-
|
|
53328
|
-
|
|
53329
|
-
cells: [],
|
|
53330
|
-
col: eventArgsSet.eventArgs.target.col,
|
|
53331
|
-
row: eventArgsSet.eventArgs.target.row,
|
|
53332
|
-
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
53333
|
-
target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
|
|
53334
|
-
mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
|
|
53335
|
-
};
|
|
53336
|
-
cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
|
|
53337
|
-
}
|
|
53338
|
-
}
|
|
53339
|
-
} else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
|
|
53340
|
-
if (!table.eventManager.isDraging) {
|
|
53288
|
+
if (0 !== e.button) return;
|
|
53289
|
+
const endedResizeCol = stateManager.isResizeCol(),
|
|
53290
|
+
endedResizeRow = stateManager.isResizeRow(),
|
|
53291
|
+
endedMoveCol = stateManager.isMoveCol(),
|
|
53292
|
+
shouldSkipClickCell = endedResizeCol || endedResizeRow;
|
|
53293
|
+
if ("grabing" === stateManager.interactionState) {
|
|
53294
|
+
if (stateManager.updateInteractionState(InteractionState.default), endedResizeCol) endResizeCol(table);else if (endedResizeRow) endResizeRow(table);else if (endedMoveCol) {
|
|
53295
|
+
const endMoveColSuccess = table.stateManager.endMoveCol();
|
|
53296
|
+
fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
|
|
53297
|
+
} else if (stateManager.isSelecting()) {
|
|
53298
|
+
table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
|
|
53341
53299
|
const eventArgsSet = getEventArgsSet(e);
|
|
53342
|
-
if (
|
|
53343
|
-
const {
|
|
53344
|
-
col: col,
|
|
53345
|
-
row: row
|
|
53346
|
-
} = eventArgsSet.eventArgs,
|
|
53347
|
-
cellInfo = table.getCellInfo(col, row);
|
|
53348
|
-
let icon, position;
|
|
53349
|
-
if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
|
|
53350
|
-
const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
|
|
53351
|
-
iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
|
|
53352
|
-
}
|
|
53353
|
-
const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
|
|
53300
|
+
if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
53301
|
+
const cellsEvent = {
|
|
53354
53302
|
event: e.nativeEvent,
|
|
53355
|
-
federatedEvent: e,
|
|
53356
53303
|
cells: [],
|
|
53357
|
-
|
|
53358
|
-
|
|
53359
|
-
|
|
53360
|
-
|
|
53361
|
-
|
|
53362
|
-
|
|
53363
|
-
|
|
53364
|
-
});
|
|
53365
|
-
table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
|
|
53304
|
+
col: eventArgsSet.eventArgs.target.col,
|
|
53305
|
+
row: eventArgsSet.eventArgs.target.row,
|
|
53306
|
+
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
53307
|
+
target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
|
|
53308
|
+
mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
|
|
53309
|
+
};
|
|
53310
|
+
cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
|
|
53366
53311
|
}
|
|
53367
53312
|
}
|
|
53368
|
-
|
|
53369
|
-
|
|
53370
|
-
|
|
53371
|
-
|
|
53372
|
-
|
|
53313
|
+
} else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
|
|
53314
|
+
if (!table.eventManager.isDraging && !shouldSkipClickCell) {
|
|
53315
|
+
const eventArgsSet = getEventArgsSet(e);
|
|
53316
|
+
if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
53317
|
+
const {
|
|
53318
|
+
col: col,
|
|
53319
|
+
row: row
|
|
53320
|
+
} = eventArgsSet.eventArgs,
|
|
53321
|
+
cellInfo = table.getCellInfo(col, row);
|
|
53322
|
+
let icon, position;
|
|
53323
|
+
if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
|
|
53324
|
+
const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
|
|
53325
|
+
iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
|
|
53326
|
+
}
|
|
53327
|
+
const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
|
|
53373
53328
|
event: e.nativeEvent,
|
|
53374
|
-
|
|
53375
|
-
|
|
53329
|
+
federatedEvent: e,
|
|
53330
|
+
cells: [],
|
|
53331
|
+
targetIcon: icon ? {
|
|
53332
|
+
name: icon.name,
|
|
53333
|
+
position: position,
|
|
53334
|
+
funcType: icon.attribute.funcType
|
|
53335
|
+
} : void 0,
|
|
53336
|
+
target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
|
|
53337
|
+
mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
|
|
53376
53338
|
});
|
|
53339
|
+
table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
|
|
53377
53340
|
}
|
|
53378
|
-
setTimeout(() => {
|
|
53379
|
-
eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
|
|
53380
|
-
}, 0);
|
|
53381
53341
|
}
|
|
53342
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
|
|
53343
|
+
const eventArgsSet = getEventArgsSet(e);
|
|
53344
|
+
eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
|
|
53345
|
+
col: eventArgsSet.eventArgs.col,
|
|
53346
|
+
row: eventArgsSet.eventArgs.row,
|
|
53347
|
+
event: e.nativeEvent,
|
|
53348
|
+
target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
|
|
53349
|
+
mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
|
|
53350
|
+
});
|
|
53351
|
+
}
|
|
53352
|
+
setTimeout(() => {
|
|
53353
|
+
eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
|
|
53354
|
+
}, 0);
|
|
53382
53355
|
}), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
|
|
53383
53356
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
53384
53357
|
const eventArgsSet = getEventArgsSet(e);
|
|
@@ -57196,7 +57169,7 @@
|
|
|
57196
57169
|
}
|
|
57197
57170
|
constructor(container, options = {}) {
|
|
57198
57171
|
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;
|
|
57199
|
-
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.
|
|
57172
|
+
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.4", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
57200
57173
|
const g = window;
|
|
57201
57174
|
g[this.id] = this;
|
|
57202
57175
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -58255,7 +58228,7 @@
|
|
|
58255
58228
|
const internalProps = this.internalProps;
|
|
58256
58229
|
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 => {
|
|
58257
58230
|
null == legend || legend.release();
|
|
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(),
|
|
58231
|
+
}), 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) {
|
|
58259
58232
|
internalProps.legends = [];
|
|
58260
58233
|
const createLegend = Factory.getFunction("createLegend");
|
|
58261
58234
|
if (Array.isArray(options.legends)) {
|
|
@@ -62281,19 +62254,14 @@
|
|
|
62281
62254
|
clearRowHeightCache: !0
|
|
62282
62255
|
}) {
|
|
62283
62256
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62284
|
-
const internalProps = this.internalProps
|
|
62285
|
-
|
|
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) : {
|
|
62257
|
+
const internalProps = this.internalProps;
|
|
62258
|
+
if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, updateConfig), 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) : {
|
|
62291
62259
|
addRecordRule: options.addRecordRule
|
|
62292
62260
|
}, 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--) {
|
|
62293
62261
|
const releaseObj = internalProps.releaseList[i];
|
|
62294
62262
|
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));
|
|
62295
62263
|
}
|
|
62296
|
-
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records
|
|
62264
|
+
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
62297
62265
|
sortState: options.sortState
|
|
62298
62266
|
}) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
|
|
62299
62267
|
const Title = Factory.getComponent("title");
|
|
@@ -62309,22 +62277,6 @@
|
|
|
62309
62277
|
setTimeout(resolve, 0);
|
|
62310
62278
|
});
|
|
62311
62279
|
}
|
|
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
|
-
}
|
|
62328
62280
|
updatePagination(pagination) {
|
|
62329
62281
|
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());
|
|
62330
62282
|
}
|
|
@@ -66046,8 +65998,66 @@
|
|
|
66046
65998
|
}
|
|
66047
65999
|
|
|
66048
66000
|
const regedIcons = get$2();
|
|
66001
|
+
function releaseVideoResource(video) {
|
|
66002
|
+
try {
|
|
66003
|
+
video.pause();
|
|
66004
|
+
} catch (err) {}
|
|
66005
|
+
video.removeAttribute("src");
|
|
66006
|
+
try {
|
|
66007
|
+
video.load();
|
|
66008
|
+
} catch (err) {}
|
|
66009
|
+
}
|
|
66010
|
+
function getVideoFirstFrameTimeout(table) {
|
|
66011
|
+
var _a;
|
|
66012
|
+
const timeout = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameTimeout;
|
|
66013
|
+
return "number" == typeof timeout && timeout >= 0 ? timeout : 8e3;
|
|
66014
|
+
}
|
|
66015
|
+
function getVideoFirstFrameMaxCanvasSize(table) {
|
|
66016
|
+
var _a;
|
|
66017
|
+
const maxCanvasSize = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameMaxCanvasSize;
|
|
66018
|
+
return "number" == typeof maxCanvasSize && maxCanvasSize > 0 ? maxCanvasSize : 512;
|
|
66019
|
+
}
|
|
66020
|
+
function snapshotVideoFirstFrame(video, image, table) {
|
|
66021
|
+
const displayWidth = image.attribute.width,
|
|
66022
|
+
displayHeight = image.attribute.height;
|
|
66023
|
+
if ("number" != typeof displayWidth || "number" != typeof displayHeight || displayWidth <= 0 || displayHeight <= 0) return !1;
|
|
66024
|
+
const canvas = document.createElement("canvas"),
|
|
66025
|
+
context = canvas.getContext("2d");
|
|
66026
|
+
if (!context) return !1;
|
|
66027
|
+
const dpr = Math.min(("undefined" == typeof window ? 1 : window.devicePixelRatio) || 1, 2),
|
|
66028
|
+
maxSize = getVideoFirstFrameMaxCanvasSize(table),
|
|
66029
|
+
scale = Math.min(dpr, maxSize / Math.max(displayWidth, displayHeight));
|
|
66030
|
+
canvas.width = Math.max(1, Math.ceil(displayWidth * scale)), canvas.height = Math.max(1, Math.ceil(displayHeight * scale)), canvas.style.width = `${displayWidth}px`, canvas.style.height = `${displayHeight}px`;
|
|
66031
|
+
try {
|
|
66032
|
+
return context.drawImage(video, 0, 0, canvas.width, canvas.height), image.setAttributes({
|
|
66033
|
+
image: canvas
|
|
66034
|
+
}), !0;
|
|
66035
|
+
} catch (err) {
|
|
66036
|
+
return !1;
|
|
66037
|
+
}
|
|
66038
|
+
}
|
|
66039
|
+
function getSvgSize(svg) {
|
|
66040
|
+
var _a;
|
|
66041
|
+
const svgTag = null === (_a = svg.match(/<svg\b[^>]*>/i)) || void 0 === _a ? void 0 : _a[0];
|
|
66042
|
+
if (!svgTag) return;
|
|
66043
|
+
const widthMatch = svgTag.match(/\bwidth=["']?([\d.]+)/i),
|
|
66044
|
+
heightMatch = svgTag.match(/\bheight=["']?([\d.]+)/i),
|
|
66045
|
+
width = widthMatch ? Number(widthMatch[1]) : void 0,
|
|
66046
|
+
height = heightMatch ? Number(heightMatch[1]) : void 0;
|
|
66047
|
+
if (width > 0 && height > 0) return {
|
|
66048
|
+
width: width,
|
|
66049
|
+
height: height
|
|
66050
|
+
};
|
|
66051
|
+
const viewBoxMatch = svgTag.match(/\bviewBox=["']\s*[-\d.]+\s+[-\d.]+\s+([\d.]+)\s+([\d.]+)\s*["']/i),
|
|
66052
|
+
viewBoxWidth = viewBoxMatch ? Number(viewBoxMatch[1]) : void 0,
|
|
66053
|
+
viewBoxHeight = viewBoxMatch ? Number(viewBoxMatch[2]) : void 0;
|
|
66054
|
+
return viewBoxWidth > 0 && viewBoxHeight > 0 ? {
|
|
66055
|
+
width: viewBoxWidth,
|
|
66056
|
+
height: viewBoxHeight
|
|
66057
|
+
} : void 0;
|
|
66058
|
+
}
|
|
66049
66059
|
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync) {
|
|
66050
|
-
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;
|
|
66060
|
+
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;
|
|
66051
66061
|
const headerStyle = table._getCellStyle(col, row),
|
|
66052
66062
|
functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
66053
66063
|
(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.imageMargin) ? padding = getQuadProps(null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.imageMargin) : isValid$1(functionalPadding) && (padding = functionalPadding), (null === (_c = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _c ? void 0 : _c.textAlign) && (textAlign = null === (_d = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _d ? void 0 : _d.textAlign), (null === (_e = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _e ? void 0 : _e.textBaseline) && (textBaseline = null === (_f = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _f ? void 0 : _f.textBaseline);
|
|
@@ -66105,7 +66115,55 @@
|
|
|
66105
66115
|
}
|
|
66106
66116
|
const value = table.getCellValue(col, row),
|
|
66107
66117
|
video = document.createElement("video");
|
|
66118
|
+
video.muted = !0, video.playsInline = !0;
|
|
66119
|
+
const shouldSnapshot = !0 === (null === (_6 = table.options.customConfig) || void 0 === _6 ? void 0 : _6.videoFirstFrameSnapshot);
|
|
66120
|
+
let loadTimer,
|
|
66121
|
+
videoReleased = !1;
|
|
66122
|
+
const clearVideoLoadTimer = () => {
|
|
66123
|
+
void 0 !== loadTimer && (clearTimeout(loadTimer), loadTimer = void 0);
|
|
66124
|
+
},
|
|
66125
|
+
releaseCurrentVideo = () => {
|
|
66126
|
+
videoReleased || (videoReleased = !0, clearVideoLoadTimer(), releaseVideoResource(video));
|
|
66127
|
+
},
|
|
66128
|
+
isCurrentImage = () => cellGroup.getChildByName("image", !0) === image,
|
|
66129
|
+
handleVideoLoadFail = () => {
|
|
66130
|
+
videoReleased || (isCurrentImage() && ((() => {
|
|
66131
|
+
var _a, _b;
|
|
66132
|
+
const regedIcons = get$2(),
|
|
66133
|
+
damageIcon = regedIcons.video_damage_pic || regedIcons.damage_pic,
|
|
66134
|
+
damageImage = damageIcon.svg;
|
|
66135
|
+
image.setAttributes({
|
|
66136
|
+
image: damageImage
|
|
66137
|
+
});
|
|
66138
|
+
const originImage = null === (_b = null === (_a = image.resources) || void 0 === _a ? void 0 : _a.get(damageImage)) || void 0 === _b ? void 0 : _b.data,
|
|
66139
|
+
svgSize = "string" == typeof damageImage ? getSvgSize(damageImage) : void 0,
|
|
66140
|
+
originWidth = (null == originImage ? void 0 : originImage.width) || damageIcon.width || (null == svgSize ? void 0 : svgSize.width) || 24,
|
|
66141
|
+
originHeight = (null == originImage ? void 0 : originImage.height) || damageIcon.height || (null == svgSize ? void 0 : svgSize.height) || 24,
|
|
66142
|
+
{
|
|
66143
|
+
width: cellWidth,
|
|
66144
|
+
height: cellHeight,
|
|
66145
|
+
isMerge: isMerge
|
|
66146
|
+
} = getCellRange$1(cellGroup, table),
|
|
66147
|
+
availableWidth = cellWidth - padding[1] - padding[3],
|
|
66148
|
+
availableHeight = cellHeight - padding[0] - padding[2];
|
|
66149
|
+
if (originWidth > 0 && originHeight > 0 && availableWidth > 0 && availableHeight > 0) {
|
|
66150
|
+
const {
|
|
66151
|
+
width: imageWidth,
|
|
66152
|
+
height: imageHeight
|
|
66153
|
+
} = calcKeepAspectRatioSize(originWidth, originHeight, availableWidth, availableHeight),
|
|
66154
|
+
pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
|
|
66155
|
+
image.setAttributes({
|
|
66156
|
+
x: pos.x,
|
|
66157
|
+
y: pos.y,
|
|
66158
|
+
width: imageWidth,
|
|
66159
|
+
height: imageHeight
|
|
66160
|
+
}), isMerge && updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
66161
|
+
}
|
|
66162
|
+
})(), table.scenegraph.updateNextFrame()), shouldSnapshot && releaseCurrentVideo());
|
|
66163
|
+
};
|
|
66108
66164
|
video.addEventListener("loadeddata", () => {
|
|
66165
|
+
if (clearVideoLoadTimer(), videoReleased) return;
|
|
66166
|
+
if (!isCurrentImage()) return void releaseCurrentVideo();
|
|
66109
66167
|
imageAutoSizing && _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding, cellGroup);
|
|
66110
66168
|
const {
|
|
66111
66169
|
width: cellWidth,
|
|
@@ -66155,11 +66213,8 @@
|
|
|
66155
66213
|
dx: dx,
|
|
66156
66214
|
dy: dy
|
|
66157
66215
|
});
|
|
66158
|
-
playIcon.name = "play-icon", cellGroup.appendChild(playIcon), table.scenegraph.updateNextFrame();
|
|
66159
|
-
}), video.
|
|
66160
|
-
const regedIcons = get$2();
|
|
66161
|
-
image.image = regedIcons.video_damage_pic ? regedIcons.video_damage_pic.svg : regedIcons.damage_pic.svg;
|
|
66162
|
-
}, video.src = value, video.setAttribute("preload", "auto");
|
|
66216
|
+
playIcon.name = "play-icon", cellGroup.appendChild(playIcon), shouldSnapshot && snapshotVideoFirstFrame(video, image, table) && releaseCurrentVideo(), table.scenegraph.updateNextFrame();
|
|
66217
|
+
}), video.addEventListener("error", handleVideoLoadFail), video.addEventListener("abort", handleVideoLoadFail);
|
|
66163
66218
|
const image = createImage({
|
|
66164
66219
|
x: padding[3],
|
|
66165
66220
|
y: padding[0],
|
|
@@ -66168,9 +66223,11 @@
|
|
|
66168
66223
|
image: video,
|
|
66169
66224
|
cursor: "pointer"
|
|
66170
66225
|
});
|
|
66171
|
-
|
|
66226
|
+
image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
|
|
66172
66227
|
isDamagePic(image) && (updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame());
|
|
66173
|
-
},
|
|
66228
|
+
}, video.setAttribute("preload", "auto"), video.src = value;
|
|
66229
|
+
const timeout = getVideoFirstFrameTimeout(table);
|
|
66230
|
+
return shouldSnapshot && timeout > 0 && (loadTimer = setTimeout(handleVideoLoadFail, timeout)), cellGroup;
|
|
66174
66231
|
}
|
|
66175
66232
|
|
|
66176
66233
|
function createMark(marked, cellGroup, table) {
|
|
@@ -66230,10 +66287,10 @@
|
|
|
66230
66287
|
}
|
|
66231
66288
|
}
|
|
66232
66289
|
|
|
66233
|
-
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync
|
|
66290
|
+
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync) {
|
|
66234
66291
|
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;
|
|
66235
|
-
headerStyle =
|
|
66236
|
-
|
|
66292
|
+
const headerStyle = table._getCellStyle(col, row),
|
|
66293
|
+
functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
66237
66294
|
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);
|
|
66238
66295
|
const autoRowHeight = table.isAutoRowHeight(row),
|
|
66239
66296
|
autoColWidth = "auto" === colWidth,
|