@visactor/vtable-sheet 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.
@@ -43257,20 +43257,6 @@
43257
43257
  var _a, _b, _c;
43258
43258
  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;
43259
43259
  }
43260
- refreshRecords(records = [], dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
43261
- var _a;
43262
- 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$8(null == dataConfig ? void 0 : dataConfig.groupByRules), this.rowHierarchyType = rowHierarchyType, this.dataSourceObj = {
43263
- get: index => records[index],
43264
- length: records.length,
43265
- records: records
43266
- }, 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 || {
43267
- totalCount: this.sourceLength,
43268
- perPageCount: this.sourceLength,
43269
- currentPage: 0
43270
- }, this.hierarchyExpandLevel = hierarchyExpandLevel >= 1 ? hierarchyExpandLevel : 0, this.currentIndexedData = Array.from({
43271
- length: this.sourceLength
43272
- }, (_, i) => i), this.userPagination || (this.pagination.perPageCount = this.sourceLength, this.pagination.totalCount = this.sourceLength), "tree" === rowHierarchyType && this.initTreeHierarchyState(), this.updatePagerData();
43273
- }
43274
43260
  updateGroup() {
43275
43261
  var _a, _b, _c;
43276
43262
  this.clearCache();
@@ -43829,17 +43815,14 @@
43829
43815
  table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
43830
43816
  })];
43831
43817
  }
43832
- function getListTableRowHierarchyType(table) {
43833
- var _a, _b;
43834
- const tableWithPlugins = table;
43835
- let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
43836
- return isArray$8(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;
43837
- }
43838
43818
  function _setRecords(table, records = []) {
43819
+ const tableWithPlugins = table;
43839
43820
  _dealWithUpdateDataSource(table, () => {
43821
+ var _a;
43840
43822
  table.internalProps.records = records;
43841
- const rowHierarchyType = getListTableRowHierarchyType(table),
43842
- newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
43823
+ let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
43824
+ isArray$8(null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) && (rowHierarchyType = "tree"), tableWithPlugins.pluginManager.getPluginByName("Master Detail Plugin") && (rowHierarchyType = "grid");
43825
+ const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
43843
43826
  table.addReleaseObj(newDataSource);
43844
43827
  });
43845
43828
  }
@@ -44629,7 +44612,7 @@
44629
44612
  col: null !== (_b = null == range ? void 0 : range.start.col) && void 0 !== _b ? _b : col,
44630
44613
  row: null !== (_c = null == range ? void 0 : range.start.row) && void 0 !== _c ? _c : row,
44631
44614
  dataValue: table.getCellOriginValue(col, row),
44632
- value: table.getCellValue(col, row) || "",
44615
+ value: table.getCellValue(col, row),
44633
44616
  rect: {
44634
44617
  left: 0,
44635
44618
  top: 0,
@@ -44651,7 +44634,7 @@
44651
44634
  col: col,
44652
44635
  row: row,
44653
44636
  dataValue: table.getCellOriginValue(col, row),
44654
- value: table.getCellValue(col, row) || "",
44637
+ value: table.getCellValue(col, row),
44655
44638
  rect: {
44656
44639
  left: 0,
44657
44640
  top: 0,
@@ -45215,7 +45198,7 @@
45215
45198
 
45216
45199
  function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
45217
45200
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
45218
- let contentWidth = 0,
45201
+ let contentWidth,
45219
45202
  leftIconWidth = 0,
45220
45203
  rightIconWidth = 0,
45221
45204
  absoluteRightIconWidth = 0;
@@ -45295,8 +45278,8 @@
45295
45278
  }), contentRightIcons.forEach(icon => {
45296
45279
  const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
45297
45280
  iconMark.role = "icon-content-right", iconMark.name = icon.name, cellContent.addRightOccupyingIcon(iconMark);
45298
- }), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), autoColWidth && (contentWidth = cellContent.AABBBounds.width());
45299
- } else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), autoColWidth && (contentWidth = textMark.AABBBounds.width());
45281
+ }), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), contentWidth = cellContent.AABBBounds.width(), cellContent.AABBBounds.height();
45282
+ } else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), contentWidth = textMark.AABBBounds.width(), textMark.AABBBounds.height();
45300
45283
  } else if (isValid$2(textStr)) {
45301
45284
  const {
45302
45285
  text: text,
@@ -45320,7 +45303,7 @@
45320
45303
  keepCenterInLine: !0
45321
45304
  },
45322
45305
  wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
45323
- wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), autoColWidth && (contentWidth = wrapText.AABBBounds.width());
45306
+ wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), contentWidth = wrapText.AABBBounds.width(), wrapText.AABBBounds.height();
45324
45307
  }
45325
45308
  const width = autoColWidth ? leftIconWidth + contentWidth + rightIconWidth : cellWidth - (padding[1] + padding[3]),
45326
45309
  height = cellHeight - (padding[0] + padding[2]);
@@ -45653,7 +45636,7 @@
45653
45636
  rowEnd = null !== (_k = cellGroup.mergeEndCol) && void 0 !== _k ? _k : cellGroup.row,
45654
45637
  leftIconWidth = null !== (_l = cellGroup._cellLeftIconWidth) && void 0 !== _l ? _l : 0,
45655
45638
  rightIconWidth = null !== (_m = cellGroup._cellRightIconWidth) && void 0 !== _m ? _m : 0;
45656
- if (image.keepAspectRatio) {
45639
+ if (image.keepAspectRatio || isDamagePic(image)) {
45657
45640
  const {
45658
45641
  width: imageWidth,
45659
45642
  height: imageHeight
@@ -45778,7 +45761,7 @@
45778
45761
  }
45779
45762
  }
45780
45763
 
45781
- function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, headerStyle) {
45764
+ function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
45782
45765
  var _a, _b;
45783
45766
  let cellGroup,
45784
45767
  isAsync = !1;
@@ -45813,7 +45796,7 @@
45813
45796
  customElementsGroup: customElementsGroup,
45814
45797
  renderDefault: renderDefault
45815
45798
  } = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult);
45816
- cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
45799
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
45817
45800
  const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
45818
45801
  if (axisConfig) {
45819
45802
  const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_a = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _a ? _a : padding, table);
@@ -45836,20 +45819,20 @@
45836
45819
  } = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult),
45837
45820
  style = table._getCellStyle(col, row),
45838
45821
  dataValue = table.getCellOriginValue(col, row);
45839
- cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
45822
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
45840
45823
  const progressBarGroup = Factory.getFunction("createProgressBarCell")(define, style, colWidth, value, dataValue, col, row, padding, table, range);
45841
45824
  cellGroup.firstChild ? cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild) : cellGroup.appendChild(progressBarGroup);
45842
45825
  } else if ("sparkline" === type) {
45843
45826
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
45844
45827
  } else if ("checkbox" === type) {
45845
45828
  if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45846
- 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);
45829
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45847
45830
  } else {
45848
45831
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
45849
45832
  }
45850
45833
  } else if ("radio" === type) {
45851
45834
  if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45852
- 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);
45835
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45853
45836
  } else {
45854
45837
  cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45855
45838
  }
@@ -46640,7 +46623,7 @@
46640
46623
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
46641
46624
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
46642
46625
  dataValue: table.getCellOriginValue(col, row),
46643
- value: table.getCellValue(col, row) || "",
46626
+ value: table.getCellValue(col, row),
46644
46627
  rect: getCellRect$1(col, row, table),
46645
46628
  table: table,
46646
46629
  originCol: col,
@@ -50821,7 +50804,7 @@
50821
50804
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
50822
50805
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
50823
50806
  dataValue: table.getCellOriginValue(col, row),
50824
- value: table.getCellValue(col, row) || "",
50807
+ value: table.getCellValue(col, row),
50825
50808
  rect: getCellRect(col, row, table),
50826
50809
  table: table,
50827
50810
  originCol: col,
@@ -51061,7 +51044,6 @@
51061
51044
  isMerge,
51062
51045
  customStyle,
51063
51046
  customResult,
51064
- rawRecord,
51065
51047
  cellLocation = table.getCellLocation(col, row),
51066
51048
  value = table.getCellValue(col, row),
51067
51049
  cellWidth = colWidth,
@@ -51091,17 +51073,17 @@
51091
51073
  const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
51092
51074
  isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
51093
51075
  let mayHaveIcon = "body" !== cellLocation || ((null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree)) && !(isAggregation && isSeriesNumber);
51094
- 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)) {
51076
+ 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)) {
51095
51077
  const mergeSize = dealMerge(range, mergeMap, table, rowStart > range.start.row);
51096
51078
  cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
51097
51079
  }
51098
51080
  let isVtableMerge = !1;
51099
51081
  if (table.internalProps.enableTreeNodeMerge && isMerge) {
51100
- rawRecord = null != rawRecord ? rawRecord : table.getCellRawRecord(range.start.col, range.start.row);
51101
- const {
51102
- vtableMergeName: vtableMergeName,
51103
- vtableMerge: vtableMerge
51104
- } = null != rawRecord ? rawRecord : {};
51082
+ const rawRecord = table.getCellRawRecord(range.start.col, range.start.row),
51083
+ {
51084
+ vtableMergeName: vtableMergeName,
51085
+ vtableMerge: vtableMerge
51086
+ } = null != rawRecord ? rawRecord : {};
51105
51087
  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));
51106
51088
  }
51107
51089
  const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
@@ -51131,7 +51113,7 @@
51131
51113
  const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
51132
51114
  cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
51133
51115
  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");
51134
- const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellStyle);
51116
+ const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
51135
51117
  if (columnGroup.updateColumnRowNumber(row), isMerge) {
51136
51118
  const rangeHeight = table.getRowHeight(row),
51137
51119
  {
@@ -51173,7 +51155,7 @@
51173
51155
  } = createCellArgs,
51174
51156
  cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
51175
51157
  cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
51176
- 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);
51158
+ 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);
51177
51159
  }
51178
51160
  function dealMerge(range, mergeMap, table, forceUpdate) {
51179
51161
  let cellWidth = 0,
@@ -54623,28 +54605,16 @@
54623
54605
  updateContainerChildrenX(this.rightFrozenGroup, rightStartX), updateContainerChildrenX(this.rightTopCornerGroup, rightStartX), updateContainerChildrenX(this.rightBottomCornerGroup, rightStartX), this.updateNextFrame();
54624
54606
  }
54625
54607
  updateContainerAttrHeightAndY() {
54626
- this.cornerHeaderGroup.forEachChildrenSkipChild(column => {
54627
- updateContainerChildrenY(column, 0);
54628
- }), this.colHeaderGroup.forEachChildrenSkipChild(column => {
54629
- updateContainerChildrenY(column, 0);
54630
- }), this.rightTopCornerGroup.forEachChildrenSkipChild(column => {
54631
- updateContainerChildrenY(column, 0);
54632
- }), this.rowHeaderGroup.forEachChildrenSkipChild(column => {
54633
- var _a;
54634
- 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);
54635
- }), this.bodyGroup.forEachChildrenSkipChild(column => {
54636
- var _a;
54637
- 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);
54638
- }), this.rightFrozenGroup.forEachChildrenSkipChild(column => {
54639
- var _a;
54640
- 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);
54641
- }), this.leftBottomCornerGroup.forEachChildrenSkipChild(column => {
54642
- updateContainerChildrenY(column, 0);
54643
- }), this.bottomFrozenGroup.forEachChildrenSkipChild(column => {
54644
- updateContainerChildrenY(column, 0);
54645
- }), this.rightBottomCornerGroup.forEachChildrenSkipChild(column => {
54646
- updateContainerChildrenY(column, 0);
54647
- });
54608
+ var _a, _b, _c;
54609
+ for (let i = 0; i < this.cornerHeaderGroup.children.length; i++) updateContainerChildrenY(this.cornerHeaderGroup.children[i], 0);
54610
+ for (let i = 0; i < this.colHeaderGroup.children.length; i++) updateContainerChildrenY(this.colHeaderGroup.children[i], 0);
54611
+ for (let i = 0; i < this.rightTopCornerGroup.children.length; i++) updateContainerChildrenY(this.rightTopCornerGroup.children[i], 0);
54612
+ 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);
54613
+ 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);
54614
+ 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);
54615
+ for (let i = 0; i < this.leftBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.leftBottomCornerGroup.children[i], 0);
54616
+ for (let i = 0; i < this.bottomFrozenGroup.children.length; i++) updateContainerChildrenY(this.bottomFrozenGroup.children[i], 0);
54617
+ for (let i = 0; i < this.rightBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.rightBottomCornerGroup.children[i], 0);
54648
54618
  }
54649
54619
  updateContainer(updateConfig = {
54650
54620
  async: !1,
@@ -57591,70 +57561,73 @@
57591
57561
  });
57592
57562
  }), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
57593
57563
  var _a, _b, _c, _d, _e, _f, _g, _h;
57594
- if (0 === e.button) {
57595
- if ("grabing" === stateManager.interactionState) {
57596
- if (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()) endResizeCol(table);else if (stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
57597
- const endMoveColSuccess = table.stateManager.endMoveCol();
57598
- fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
57599
- } else if (stateManager.isSelecting()) {
57600
- table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
57601
- const eventArgsSet = getEventArgsSet(e);
57602
- if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
57603
- const cellsEvent = {
57604
- event: e.nativeEvent,
57605
- cells: [],
57606
- col: eventArgsSet.eventArgs.target.col,
57607
- row: eventArgsSet.eventArgs.target.row,
57608
- scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
57609
- target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
57610
- mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
57611
- };
57612
- cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
57613
- }
57614
- }
57615
- } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
57616
- if (!table.eventManager.isDraging) {
57564
+ if (0 !== e.button) return;
57565
+ const endedResizeCol = stateManager.isResizeCol(),
57566
+ endedResizeRow = stateManager.isResizeRow(),
57567
+ endedMoveCol = stateManager.isMoveCol(),
57568
+ shouldSkipClickCell = endedResizeCol || endedResizeRow;
57569
+ if ("grabing" === stateManager.interactionState) {
57570
+ if (stateManager.updateInteractionState(InteractionState.default), endedResizeCol) endResizeCol(table);else if (endedResizeRow) endResizeRow(table);else if (endedMoveCol) {
57571
+ const endMoveColSuccess = table.stateManager.endMoveCol();
57572
+ fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
57573
+ } else if (stateManager.isSelecting()) {
57574
+ table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
57617
57575
  const eventArgsSet = getEventArgsSet(e);
57618
- if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
57619
- const {
57620
- col: col,
57621
- row: row
57622
- } = eventArgsSet.eventArgs,
57623
- cellInfo = table.getCellInfo(col, row);
57624
- let icon, position;
57625
- if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
57626
- const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
57627
- iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
57628
- }
57629
- const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
57576
+ if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
57577
+ const cellsEvent = {
57630
57578
  event: e.nativeEvent,
57631
- federatedEvent: e,
57632
57579
  cells: [],
57633
- targetIcon: icon ? {
57634
- name: icon.name,
57635
- position: position,
57636
- funcType: icon.attribute.funcType
57637
- } : void 0,
57638
- target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
57639
- mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
57640
- });
57641
- table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
57580
+ col: eventArgsSet.eventArgs.target.col,
57581
+ row: eventArgsSet.eventArgs.target.row,
57582
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
57583
+ target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
57584
+ mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
57585
+ };
57586
+ cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
57642
57587
  }
57643
57588
  }
57644
- if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
57645
- const eventArgsSet = getEventArgsSet(e);
57646
- eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
57647
- col: eventArgsSet.eventArgs.col,
57648
- row: eventArgsSet.eventArgs.row,
57589
+ } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
57590
+ if (!table.eventManager.isDraging && !shouldSkipClickCell) {
57591
+ const eventArgsSet = getEventArgsSet(e);
57592
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
57593
+ const {
57594
+ col: col,
57595
+ row: row
57596
+ } = eventArgsSet.eventArgs,
57597
+ cellInfo = table.getCellInfo(col, row);
57598
+ let icon, position;
57599
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
57600
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
57601
+ iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
57602
+ }
57603
+ const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
57649
57604
  event: e.nativeEvent,
57650
- target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
57651
- mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
57605
+ federatedEvent: e,
57606
+ cells: [],
57607
+ targetIcon: icon ? {
57608
+ name: icon.name,
57609
+ position: position,
57610
+ funcType: icon.attribute.funcType
57611
+ } : void 0,
57612
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
57613
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
57652
57614
  });
57615
+ table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
57653
57616
  }
57654
- setTimeout(() => {
57655
- eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
57656
- }, 0);
57657
57617
  }
57618
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
57619
+ const eventArgsSet = getEventArgsSet(e);
57620
+ eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
57621
+ col: eventArgsSet.eventArgs.col,
57622
+ row: eventArgsSet.eventArgs.row,
57623
+ event: e.nativeEvent,
57624
+ target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
57625
+ mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
57626
+ });
57627
+ }
57628
+ setTimeout(() => {
57629
+ eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
57630
+ }, 0);
57658
57631
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
57659
57632
  var _a, _b, _c, _d, _e, _f, _g, _h;
57660
57633
  const eventArgsSet = getEventArgsSet(e);
@@ -61472,7 +61445,7 @@
61472
61445
  }
61473
61446
  constructor(container, options = {}) {
61474
61447
  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;
61475
- 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.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
61448
+ 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) {
61476
61449
  const g = window;
61477
61450
  g[this.id] = this;
61478
61451
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -62531,7 +62504,7 @@
62531
62504
  const internalProps = this.internalProps;
62532
62505
  if ("node" === Env$1.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 => {
62533
62506
  null == legend || legend.release();
62534
- }), 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) {
62507
+ }), 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) {
62535
62508
  internalProps.legends = [];
62536
62509
  const createLegend = Factory.getFunction("createLegend");
62537
62510
  if (Array.isArray(options.legends)) {
@@ -66593,19 +66566,14 @@
66593
66566
  clearRowHeightCache: !0
66594
66567
  }) {
66595
66568
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
66596
- const internalProps = this.internalProps,
66597
- prevSortState = internalProps.sortState,
66598
- 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),
66599
- shouldSkipInitialClearCells = Boolean(options.records) || !!options.dataSource && this.dataSource !== options.dataSource;
66600
- if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, Object.assign(Object.assign({}, updateConfig), {
66601
- skipClearCells: shouldSkipInitialClearCells
66602
- })), 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) : {
66569
+ const internalProps = this.internalProps;
66570
+ 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) : {
66603
66571
  addRecordRule: options.addRecordRule
66604
66572
  }, 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$2(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--) {
66605
66573
  const releaseObj = internalProps.releaseList[i];
66606
66574
  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));
66607
66575
  }
66608
- 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, {
66576
+ if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
66609
66577
  sortState: options.sortState
66610
66578
  }) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
66611
66579
  const Title = Factory.getComponent("title");
@@ -66621,22 +66589,6 @@
66621
66589
  setTimeout(resolve, 0);
66622
66590
  });
66623
66591
  }
66624
- _refreshCurrentRecordsForOptionUpdate(records) {
66625
- var _a;
66626
- const dataSource = this.dataSource;
66627
- this.stateManager.endResizeIfResizing(), clearChartRenderQueue();
66628
- const oldHoverState = {
66629
- col: this.stateManager.hover.cellPos.col,
66630
- row: this.stateManager.hover.cellPos.row
66631
- };
66632
- 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();
66633
- (null !== (_a = this.options.componentLayoutOrder) && void 0 !== _a ? _a : ["legend", "title"]).forEach(component => {
66634
- var _a, _b;
66635
- "legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
66636
- null == legend || legend.resize();
66637
- }) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
66638
- }), this.scenegraph.resize(), this.render();
66639
- }
66640
66592
  updatePagination(pagination) {
66641
66593
  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());
66642
66594
  }
@@ -70358,8 +70310,66 @@
70358
70310
  }
70359
70311
 
70360
70312
  const regedIcons = get$2();
70313
+ function releaseVideoResource(video) {
70314
+ try {
70315
+ video.pause();
70316
+ } catch (err) {}
70317
+ video.removeAttribute("src");
70318
+ try {
70319
+ video.load();
70320
+ } catch (err) {}
70321
+ }
70322
+ function getVideoFirstFrameTimeout(table) {
70323
+ var _a;
70324
+ const timeout = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameTimeout;
70325
+ return "number" == typeof timeout && timeout >= 0 ? timeout : 8e3;
70326
+ }
70327
+ function getVideoFirstFrameMaxCanvasSize(table) {
70328
+ var _a;
70329
+ const maxCanvasSize = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameMaxCanvasSize;
70330
+ return "number" == typeof maxCanvasSize && maxCanvasSize > 0 ? maxCanvasSize : 512;
70331
+ }
70332
+ function snapshotVideoFirstFrame(video, image, table) {
70333
+ const displayWidth = image.attribute.width,
70334
+ displayHeight = image.attribute.height;
70335
+ if ("number" != typeof displayWidth || "number" != typeof displayHeight || displayWidth <= 0 || displayHeight <= 0) return !1;
70336
+ const canvas = document.createElement("canvas"),
70337
+ context = canvas.getContext("2d");
70338
+ if (!context) return !1;
70339
+ const dpr = Math.min(("undefined" == typeof window ? 1 : window.devicePixelRatio) || 1, 2),
70340
+ maxSize = getVideoFirstFrameMaxCanvasSize(table),
70341
+ scale = Math.min(dpr, maxSize / Math.max(displayWidth, displayHeight));
70342
+ 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`;
70343
+ try {
70344
+ return context.drawImage(video, 0, 0, canvas.width, canvas.height), image.setAttributes({
70345
+ image: canvas
70346
+ }), !0;
70347
+ } catch (err) {
70348
+ return !1;
70349
+ }
70350
+ }
70351
+ function getSvgSize(svg) {
70352
+ var _a;
70353
+ const svgTag = null === (_a = svg.match(/<svg\b[^>]*>/i)) || void 0 === _a ? void 0 : _a[0];
70354
+ if (!svgTag) return;
70355
+ const widthMatch = svgTag.match(/\bwidth=["']?([\d.]+)/i),
70356
+ heightMatch = svgTag.match(/\bheight=["']?([\d.]+)/i),
70357
+ width = widthMatch ? Number(widthMatch[1]) : void 0,
70358
+ height = heightMatch ? Number(heightMatch[1]) : void 0;
70359
+ if (width > 0 && height > 0) return {
70360
+ width: width,
70361
+ height: height
70362
+ };
70363
+ const viewBoxMatch = svgTag.match(/\bviewBox=["']\s*[-\d.]+\s+[-\d.]+\s+([\d.]+)\s+([\d.]+)\s*["']/i),
70364
+ viewBoxWidth = viewBoxMatch ? Number(viewBoxMatch[1]) : void 0,
70365
+ viewBoxHeight = viewBoxMatch ? Number(viewBoxMatch[2]) : void 0;
70366
+ return viewBoxWidth > 0 && viewBoxHeight > 0 ? {
70367
+ width: viewBoxWidth,
70368
+ height: viewBoxHeight
70369
+ } : void 0;
70370
+ }
70361
70371
  function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync) {
70362
- 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;
70372
+ 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;
70363
70373
  const headerStyle = table._getCellStyle(col, row),
70364
70374
  functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70365
70375
  (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$2(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);
@@ -70417,7 +70427,55 @@
70417
70427
  }
70418
70428
  const value = table.getCellValue(col, row),
70419
70429
  video = document.createElement("video");
70430
+ video.muted = !0, video.playsInline = !0;
70431
+ const shouldSnapshot = !0 === (null === (_6 = table.options.customConfig) || void 0 === _6 ? void 0 : _6.videoFirstFrameSnapshot);
70432
+ let loadTimer,
70433
+ videoReleased = !1;
70434
+ const clearVideoLoadTimer = () => {
70435
+ void 0 !== loadTimer && (clearTimeout(loadTimer), loadTimer = void 0);
70436
+ },
70437
+ releaseCurrentVideo = () => {
70438
+ videoReleased || (videoReleased = !0, clearVideoLoadTimer(), releaseVideoResource(video));
70439
+ },
70440
+ isCurrentImage = () => cellGroup.getChildByName("image", !0) === image,
70441
+ handleVideoLoadFail = () => {
70442
+ videoReleased || (isCurrentImage() && ((() => {
70443
+ var _a, _b;
70444
+ const regedIcons = get$2(),
70445
+ damageIcon = regedIcons.video_damage_pic || regedIcons.damage_pic,
70446
+ damageImage = damageIcon.svg;
70447
+ image.setAttributes({
70448
+ image: damageImage
70449
+ });
70450
+ const originImage = null === (_b = null === (_a = image.resources) || void 0 === _a ? void 0 : _a.get(damageImage)) || void 0 === _b ? void 0 : _b.data,
70451
+ svgSize = "string" == typeof damageImage ? getSvgSize(damageImage) : void 0,
70452
+ originWidth = (null == originImage ? void 0 : originImage.width) || damageIcon.width || (null == svgSize ? void 0 : svgSize.width) || 24,
70453
+ originHeight = (null == originImage ? void 0 : originImage.height) || damageIcon.height || (null == svgSize ? void 0 : svgSize.height) || 24,
70454
+ {
70455
+ width: cellWidth,
70456
+ height: cellHeight,
70457
+ isMerge: isMerge
70458
+ } = getCellRange$1(cellGroup, table),
70459
+ availableWidth = cellWidth - padding[1] - padding[3],
70460
+ availableHeight = cellHeight - padding[0] - padding[2];
70461
+ if (originWidth > 0 && originHeight > 0 && availableWidth > 0 && availableHeight > 0) {
70462
+ const {
70463
+ width: imageWidth,
70464
+ height: imageHeight
70465
+ } = calcKeepAspectRatioSize(originWidth, originHeight, availableWidth, availableHeight),
70466
+ pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
70467
+ image.setAttributes({
70468
+ x: pos.x,
70469
+ y: pos.y,
70470
+ width: imageWidth,
70471
+ height: imageHeight
70472
+ }), isMerge && updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
70473
+ }
70474
+ })(), table.scenegraph.updateNextFrame()), shouldSnapshot && releaseCurrentVideo());
70475
+ };
70420
70476
  video.addEventListener("loadeddata", () => {
70477
+ if (clearVideoLoadTimer(), videoReleased) return;
70478
+ if (!isCurrentImage()) return void releaseCurrentVideo();
70421
70479
  imageAutoSizing && _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding, cellGroup);
70422
70480
  const {
70423
70481
  width: cellWidth,
@@ -70467,11 +70525,8 @@
70467
70525
  dx: dx,
70468
70526
  dy: dy
70469
70527
  });
70470
- playIcon.name = "play-icon", cellGroup.appendChild(playIcon), table.scenegraph.updateNextFrame();
70471
- }), video.onerror = () => {
70472
- const regedIcons = get$2();
70473
- image.image = regedIcons.video_damage_pic ? regedIcons.video_damage_pic.svg : regedIcons.damage_pic.svg;
70474
- }, video.src = value, video.setAttribute("preload", "auto");
70528
+ playIcon.name = "play-icon", cellGroup.appendChild(playIcon), shouldSnapshot && snapshotVideoFirstFrame(video, image, table) && releaseCurrentVideo(), table.scenegraph.updateNextFrame();
70529
+ }), video.addEventListener("error", handleVideoLoadFail), video.addEventListener("abort", handleVideoLoadFail);
70475
70530
  const image = createImage({
70476
70531
  x: padding[3],
70477
70532
  y: padding[0],
@@ -70480,9 +70535,11 @@
70480
70535
  image: video,
70481
70536
  cursor: "pointer"
70482
70537
  });
70483
- return image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
70538
+ image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
70484
70539
  isDamagePic(image) && (updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame());
70485
- }, cellGroup;
70540
+ }, video.setAttribute("preload", "auto"), video.src = value;
70541
+ const timeout = getVideoFirstFrameTimeout(table);
70542
+ return shouldSnapshot && timeout > 0 && (loadTimer = setTimeout(handleVideoLoadFail, timeout)), cellGroup;
70486
70543
  }
70487
70544
 
70488
70545
  function createMark(marked, cellGroup, table) {
@@ -70542,10 +70599,10 @@
70542
70599
  }
70543
70600
  }
70544
70601
 
70545
- function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle) {
70602
+ function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync) {
70546
70603
  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;
70547
- headerStyle = headerStyle || table._getCellStyle(col, row);
70548
- const functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70604
+ const headerStyle = table._getCellStyle(col, row),
70605
+ functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70549
70606
  isValid$2(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);
70550
70607
  const autoRowHeight = table.isAutoRowHeight(row),
70551
70608
  autoColWidth = "auto" === colWidth,
@@ -96277,7 +96334,7 @@
96277
96334
  importStyle();
96278
96335
  }
96279
96336
 
96280
- const version = "1.26.2";
96337
+ const version = "1.26.4";
96281
96338
  importStyles();
96282
96339
 
96283
96340
  exports.TYPES = index;