@visactor/vtable-gantt 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.
@@ -42898,20 +42898,6 @@
42898
42898
  var _a, _b, _c;
42899
42899
  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;
42900
42900
  }
42901
- refreshRecords(records = [], dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
42902
- var _a;
42903
- 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 = {
42904
- get: index => records[index],
42905
- length: records.length,
42906
- records: records
42907
- }, 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 || {
42908
- totalCount: this.sourceLength,
42909
- perPageCount: this.sourceLength,
42910
- currentPage: 0
42911
- }, this.hierarchyExpandLevel = hierarchyExpandLevel >= 1 ? hierarchyExpandLevel : 0, this.currentIndexedData = Array.from({
42912
- length: this.sourceLength
42913
- }, (_, i) => i), this.userPagination || (this.pagination.perPageCount = this.sourceLength, this.pagination.totalCount = this.sourceLength), "tree" === rowHierarchyType && this.initTreeHierarchyState(), this.updatePagerData();
42914
- }
42915
42901
  updateGroup() {
42916
42902
  var _a, _b, _c;
42917
42903
  this.clearCache();
@@ -43470,17 +43456,14 @@
43470
43456
  table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
43471
43457
  })];
43472
43458
  }
43473
- function getListTableRowHierarchyType(table) {
43474
- var _a, _b;
43475
- const tableWithPlugins = table;
43476
- let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
43477
- 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;
43478
- }
43479
43459
  function _setRecords(table, records = []) {
43460
+ const tableWithPlugins = table;
43480
43461
  _dealWithUpdateDataSource(table, () => {
43462
+ var _a;
43481
43463
  table.internalProps.records = records;
43482
- const rowHierarchyType = getListTableRowHierarchyType(table),
43483
- newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
43464
+ let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
43465
+ isArray$5(null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) && (rowHierarchyType = "tree"), tableWithPlugins.pluginManager.getPluginByName("Master Detail Plugin") && (rowHierarchyType = "grid");
43466
+ const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
43484
43467
  table.addReleaseObj(newDataSource);
43485
43468
  });
43486
43469
  }
@@ -44270,7 +44253,7 @@
44270
44253
  col: null !== (_b = null == range ? void 0 : range.start.col) && void 0 !== _b ? _b : col,
44271
44254
  row: null !== (_c = null == range ? void 0 : range.start.row) && void 0 !== _c ? _c : row,
44272
44255
  dataValue: table.getCellOriginValue(col, row),
44273
- value: table.getCellValue(col, row) || "",
44256
+ value: table.getCellValue(col, row),
44274
44257
  rect: {
44275
44258
  left: 0,
44276
44259
  top: 0,
@@ -44292,7 +44275,7 @@
44292
44275
  col: col,
44293
44276
  row: row,
44294
44277
  dataValue: table.getCellOriginValue(col, row),
44295
- value: table.getCellValue(col, row) || "",
44278
+ value: table.getCellValue(col, row),
44296
44279
  rect: {
44297
44280
  left: 0,
44298
44281
  top: 0,
@@ -44856,7 +44839,7 @@
44856
44839
 
44857
44840
  function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
44858
44841
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44859
- let contentWidth = 0,
44842
+ let contentWidth,
44860
44843
  leftIconWidth = 0,
44861
44844
  rightIconWidth = 0,
44862
44845
  absoluteRightIconWidth = 0;
@@ -44936,8 +44919,8 @@
44936
44919
  }), contentRightIcons.forEach(icon => {
44937
44920
  const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
44938
44921
  iconMark.role = "icon-content-right", iconMark.name = icon.name, cellContent.addRightOccupyingIcon(iconMark);
44939
- }), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), autoColWidth && (contentWidth = cellContent.AABBBounds.width());
44940
- } else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), autoColWidth && (contentWidth = textMark.AABBBounds.width());
44922
+ }), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(), contentWidth = cellContent.AABBBounds.width(), cellContent.AABBBounds.height();
44923
+ } else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark), contentWidth = textMark.AABBBounds.width(), textMark.AABBBounds.height();
44941
44924
  } else if (isValid$1(textStr)) {
44942
44925
  const {
44943
44926
  text: text,
@@ -44961,7 +44944,7 @@
44961
44944
  keepCenterInLine: !0
44962
44945
  },
44963
44946
  wrapText = new Text$1(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
44964
- wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), autoColWidth && (contentWidth = wrapText.AABBBounds.width());
44947
+ wrapText.name = "text", wrapText.textBaseline = textBaseline, cellGroup.appendChild(wrapText), contentWidth = wrapText.AABBBounds.width(), wrapText.AABBBounds.height();
44965
44948
  }
44966
44949
  const width = autoColWidth ? leftIconWidth + contentWidth + rightIconWidth : cellWidth - (padding[1] + padding[3]),
44967
44950
  height = cellHeight - (padding[0] + padding[2]);
@@ -45294,7 +45277,7 @@
45294
45277
  rowEnd = null !== (_k = cellGroup.mergeEndCol) && void 0 !== _k ? _k : cellGroup.row,
45295
45278
  leftIconWidth = null !== (_l = cellGroup._cellLeftIconWidth) && void 0 !== _l ? _l : 0,
45296
45279
  rightIconWidth = null !== (_m = cellGroup._cellRightIconWidth) && void 0 !== _m ? _m : 0;
45297
- if (image.keepAspectRatio) {
45280
+ if (image.keepAspectRatio || isDamagePic(image)) {
45298
45281
  const {
45299
45282
  width: imageWidth,
45300
45283
  height: imageHeight
@@ -45419,7 +45402,7 @@
45419
45402
  }
45420
45403
  }
45421
45404
 
45422
- function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, headerStyle) {
45405
+ function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
45423
45406
  var _a, _b;
45424
45407
  let cellGroup,
45425
45408
  isAsync = !1;
@@ -45454,7 +45437,7 @@
45454
45437
  customElementsGroup: customElementsGroup,
45455
45438
  renderDefault: renderDefault
45456
45439
  } = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult);
45457
- cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
45440
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
45458
45441
  const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
45459
45442
  if (axisConfig) {
45460
45443
  const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_a = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _a ? _a : padding, table);
@@ -45477,20 +45460,20 @@
45477
45460
  } = _generateCustomElementsGroup(table, define, col, row, cellWidth, cellHeight, padding, range, customResult),
45478
45461
  style = table._getCellStyle(col, row),
45479
45462
  dataValue = table.getCellOriginValue(col, row);
45480
- cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle);
45463
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync);
45481
45464
  const progressBarGroup = Factory.getFunction("createProgressBarCell")(define, style, colWidth, value, dataValue, col, row, padding, table, range);
45482
45465
  cellGroup.firstChild ? cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild) : cellGroup.appendChild(progressBarGroup);
45483
45466
  } else if ("sparkline" === type) {
45484
45467
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
45485
45468
  } else if ("checkbox" === type) {
45486
45469
  if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45487
- 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);
45470
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45488
45471
  } else {
45489
45472
  cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
45490
45473
  }
45491
45474
  } else if ("radio" === type) {
45492
45475
  if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
45493
- 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);
45476
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
45494
45477
  } else {
45495
45478
  cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
45496
45479
  }
@@ -46281,7 +46264,7 @@
46281
46264
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
46282
46265
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
46283
46266
  dataValue: table.getCellOriginValue(col, row),
46284
- value: table.getCellValue(col, row) || "",
46267
+ value: table.getCellValue(col, row),
46285
46268
  rect: getCellRect$1(col, row, table),
46286
46269
  table: table,
46287
46270
  originCol: col,
@@ -50462,7 +50445,7 @@
50462
50445
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
50463
50446
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
50464
50447
  dataValue: table.getCellOriginValue(col, row),
50465
- value: table.getCellValue(col, row) || "",
50448
+ value: table.getCellValue(col, row),
50466
50449
  rect: getCellRect(col, row, table),
50467
50450
  table: table,
50468
50451
  originCol: col,
@@ -50702,7 +50685,6 @@
50702
50685
  isMerge,
50703
50686
  customStyle,
50704
50687
  customResult,
50705
- rawRecord,
50706
50688
  cellLocation = table.getCellLocation(col, row),
50707
50689
  value = table.getCellValue(col, row),
50708
50690
  cellWidth = colWidth,
@@ -50732,17 +50714,17 @@
50732
50714
  const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
50733
50715
  isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
50734
50716
  let mayHaveIcon = "body" !== cellLocation || ((null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree)) && !(isAggregation && isSeriesNumber);
50735
- 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)) {
50717
+ 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)) {
50736
50718
  const mergeSize = dealMerge(range, mergeMap, table, rowStart > range.start.row);
50737
50719
  cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
50738
50720
  }
50739
50721
  let isVtableMerge = !1;
50740
50722
  if (table.internalProps.enableTreeNodeMerge && isMerge) {
50741
- rawRecord = null != rawRecord ? rawRecord : table.getCellRawRecord(range.start.col, range.start.row);
50742
- const {
50743
- vtableMergeName: vtableMergeName,
50744
- vtableMerge: vtableMerge
50745
- } = null != rawRecord ? rawRecord : {};
50723
+ const rawRecord = table.getCellRawRecord(range.start.col, range.start.row),
50724
+ {
50725
+ vtableMergeName: vtableMergeName,
50726
+ vtableMerge: vtableMerge
50727
+ } = null != rawRecord ? rawRecord : {};
50746
50728
  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));
50747
50729
  }
50748
50730
  const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
@@ -50772,7 +50754,7 @@
50772
50754
  const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
50773
50755
  cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
50774
50756
  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");
50775
- const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellStyle);
50757
+ const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
50776
50758
  if (columnGroup.updateColumnRowNumber(row), isMerge) {
50777
50759
  const rangeHeight = table.getRowHeight(row),
50778
50760
  {
@@ -50814,7 +50796,7 @@
50814
50796
  } = createCellArgs,
50815
50797
  cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
50816
50798
  cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
50817
- 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);
50799
+ 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);
50818
50800
  }
50819
50801
  function dealMerge(range, mergeMap, table, forceUpdate) {
50820
50802
  let cellWidth = 0,
@@ -54264,28 +54246,16 @@
54264
54246
  updateContainerChildrenX(this.rightFrozenGroup, rightStartX), updateContainerChildrenX(this.rightTopCornerGroup, rightStartX), updateContainerChildrenX(this.rightBottomCornerGroup, rightStartX), this.updateNextFrame();
54265
54247
  }
54266
54248
  updateContainerAttrHeightAndY() {
54267
- this.cornerHeaderGroup.forEachChildrenSkipChild(column => {
54268
- updateContainerChildrenY(column, 0);
54269
- }), this.colHeaderGroup.forEachChildrenSkipChild(column => {
54270
- updateContainerChildrenY(column, 0);
54271
- }), this.rightTopCornerGroup.forEachChildrenSkipChild(column => {
54272
- updateContainerChildrenY(column, 0);
54273
- }), this.rowHeaderGroup.forEachChildrenSkipChild(column => {
54274
- var _a;
54275
- 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);
54276
- }), this.bodyGroup.forEachChildrenSkipChild(column => {
54277
- var _a;
54278
- 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);
54279
- }), this.rightFrozenGroup.forEachChildrenSkipChild(column => {
54280
- var _a;
54281
- 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);
54282
- }), this.leftBottomCornerGroup.forEachChildrenSkipChild(column => {
54283
- updateContainerChildrenY(column, 0);
54284
- }), this.bottomFrozenGroup.forEachChildrenSkipChild(column => {
54285
- updateContainerChildrenY(column, 0);
54286
- }), this.rightBottomCornerGroup.forEachChildrenSkipChild(column => {
54287
- updateContainerChildrenY(column, 0);
54288
- });
54249
+ var _a, _b, _c;
54250
+ for (let i = 0; i < this.cornerHeaderGroup.children.length; i++) updateContainerChildrenY(this.cornerHeaderGroup.children[i], 0);
54251
+ for (let i = 0; i < this.colHeaderGroup.children.length; i++) updateContainerChildrenY(this.colHeaderGroup.children[i], 0);
54252
+ for (let i = 0; i < this.rightTopCornerGroup.children.length; i++) updateContainerChildrenY(this.rightTopCornerGroup.children[i], 0);
54253
+ 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);
54254
+ 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);
54255
+ 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);
54256
+ for (let i = 0; i < this.leftBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.leftBottomCornerGroup.children[i], 0);
54257
+ for (let i = 0; i < this.bottomFrozenGroup.children.length; i++) updateContainerChildrenY(this.bottomFrozenGroup.children[i], 0);
54258
+ for (let i = 0; i < this.rightBottomCornerGroup.children.length; i++) updateContainerChildrenY(this.rightBottomCornerGroup.children[i], 0);
54289
54259
  }
54290
54260
  updateContainer(updateConfig = {
54291
54261
  async: !1,
@@ -57232,70 +57202,73 @@
57232
57202
  });
57233
57203
  }), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
57234
57204
  var _a, _b, _c, _d, _e, _f, _g, _h;
57235
- if (0 === e.button) {
57236
- if ("grabing" === stateManager.interactionState) {
57237
- if (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()) endResizeCol(table);else if (stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
57238
- const endMoveColSuccess = table.stateManager.endMoveCol();
57239
- fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
57240
- } else if (stateManager.isSelecting()) {
57241
- table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
57242
- const eventArgsSet = getEventArgsSet(e);
57243
- if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
57244
- const cellsEvent = {
57245
- event: e.nativeEvent,
57246
- cells: [],
57247
- col: eventArgsSet.eventArgs.target.col,
57248
- row: eventArgsSet.eventArgs.target.row,
57249
- scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
57250
- target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
57251
- mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
57252
- };
57253
- cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
57254
- }
57255
- }
57256
- } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
57257
- if (!table.eventManager.isDraging) {
57205
+ if (0 !== e.button) return;
57206
+ const endedResizeCol = stateManager.isResizeCol(),
57207
+ endedResizeRow = stateManager.isResizeRow(),
57208
+ endedMoveCol = stateManager.isMoveCol(),
57209
+ shouldSkipClickCell = endedResizeCol || endedResizeRow;
57210
+ if ("grabing" === stateManager.interactionState) {
57211
+ if (stateManager.updateInteractionState(InteractionState.default), endedResizeCol) endResizeCol(table);else if (endedResizeRow) endResizeRow(table);else if (endedMoveCol) {
57212
+ const endMoveColSuccess = table.stateManager.endMoveCol();
57213
+ fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
57214
+ } else if (stateManager.isSelecting()) {
57215
+ table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
57258
57216
  const eventArgsSet = getEventArgsSet(e);
57259
- if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
57260
- const {
57261
- col: col,
57262
- row: row
57263
- } = eventArgsSet.eventArgs,
57264
- cellInfo = table.getCellInfo(col, row);
57265
- let icon, position;
57266
- if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
57267
- const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
57268
- iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
57269
- }
57270
- const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
57217
+ if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
57218
+ const cellsEvent = {
57271
57219
  event: e.nativeEvent,
57272
- federatedEvent: e,
57273
57220
  cells: [],
57274
- targetIcon: icon ? {
57275
- name: icon.name,
57276
- position: position,
57277
- funcType: icon.attribute.funcType
57278
- } : void 0,
57279
- target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
57280
- mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
57281
- });
57282
- table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
57221
+ col: eventArgsSet.eventArgs.target.col,
57222
+ row: eventArgsSet.eventArgs.target.row,
57223
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
57224
+ target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
57225
+ mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
57226
+ };
57227
+ cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
57283
57228
  }
57284
57229
  }
57285
- if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
57286
- const eventArgsSet = getEventArgsSet(e);
57287
- eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
57288
- col: eventArgsSet.eventArgs.col,
57289
- row: eventArgsSet.eventArgs.row,
57230
+ } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
57231
+ if (!table.eventManager.isDraging && !shouldSkipClickCell) {
57232
+ const eventArgsSet = getEventArgsSet(e);
57233
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
57234
+ const {
57235
+ col: col,
57236
+ row: row
57237
+ } = eventArgsSet.eventArgs,
57238
+ cellInfo = table.getCellInfo(col, row);
57239
+ let icon, position;
57240
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
57241
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
57242
+ iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
57243
+ }
57244
+ const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
57290
57245
  event: e.nativeEvent,
57291
- target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
57292
- mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
57246
+ federatedEvent: e,
57247
+ cells: [],
57248
+ targetIcon: icon ? {
57249
+ name: icon.name,
57250
+ position: position,
57251
+ funcType: icon.attribute.funcType
57252
+ } : void 0,
57253
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
57254
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
57293
57255
  });
57256
+ table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
57294
57257
  }
57295
- setTimeout(() => {
57296
- eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
57297
- }, 0);
57298
57258
  }
57259
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
57260
+ const eventArgsSet = getEventArgsSet(e);
57261
+ eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
57262
+ col: eventArgsSet.eventArgs.col,
57263
+ row: eventArgsSet.eventArgs.row,
57264
+ event: e.nativeEvent,
57265
+ target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
57266
+ mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
57267
+ });
57268
+ }
57269
+ setTimeout(() => {
57270
+ eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
57271
+ }, 0);
57299
57272
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
57300
57273
  var _a, _b, _c, _d, _e, _f, _g, _h;
57301
57274
  const eventArgsSet = getEventArgsSet(e);
@@ -61113,7 +61086,7 @@
61113
61086
  }
61114
61087
  constructor(container, options = {}) {
61115
61088
  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;
61116
- 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) {
61089
+ 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) {
61117
61090
  const g = window;
61118
61091
  g[this.id] = this;
61119
61092
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -62172,7 +62145,7 @@
62172
62145
  const internalProps = this.internalProps;
62173
62146
  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 => {
62174
62147
  null == legend || legend.release();
62175
- }), 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) {
62148
+ }), 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) {
62176
62149
  internalProps.legends = [];
62177
62150
  const createLegend = Factory.getFunction("createLegend");
62178
62151
  if (Array.isArray(options.legends)) {
@@ -66234,19 +66207,14 @@
66234
66207
  clearRowHeightCache: !0
66235
66208
  }) {
66236
66209
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
66237
- const internalProps = this.internalProps,
66238
- prevSortState = internalProps.sortState,
66239
- 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),
66240
- shouldSkipInitialClearCells = Boolean(options.records) || !!options.dataSource && this.dataSource !== options.dataSource;
66241
- if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, Object.assign(Object.assign({}, updateConfig), {
66242
- skipClearCells: shouldSkipInitialClearCells
66243
- })), 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) : {
66210
+ const internalProps = this.internalProps;
66211
+ 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) : {
66244
66212
  addRecordRule: options.addRecordRule
66245
66213
  }, 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--) {
66246
66214
  const releaseObj = internalProps.releaseList[i];
66247
66215
  releaseObj instanceof DataSource$1 ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj), internalProps.releaseList.splice(i, 1));
66248
66216
  }
66249
- 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, {
66217
+ if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
66250
66218
  sortState: options.sortState
66251
66219
  }) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
66252
66220
  const Title = Factory.getComponent("title");
@@ -66262,22 +66230,6 @@
66262
66230
  setTimeout(resolve, 0);
66263
66231
  });
66264
66232
  }
66265
- _refreshCurrentRecordsForOptionUpdate(records) {
66266
- var _a;
66267
- const dataSource = this.dataSource;
66268
- this.stateManager.endResizeIfResizing(), clearChartRenderQueue();
66269
- const oldHoverState = {
66270
- col: this.stateManager.hover.cellPos.col,
66271
- row: this.stateManager.hover.cellPos.row
66272
- };
66273
- 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();
66274
- (null !== (_a = this.options.componentLayoutOrder) && void 0 !== _a ? _a : ["legend", "title"]).forEach(component => {
66275
- var _a, _b;
66276
- "legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
66277
- null == legend || legend.resize();
66278
- }) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
66279
- }), this.scenegraph.resize(), this.render();
66280
- }
66281
66233
  updatePagination(pagination) {
66282
66234
  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());
66283
66235
  }
@@ -69999,8 +69951,66 @@
69999
69951
  }
70000
69952
 
70001
69953
  const regedIcons = get$2();
69954
+ function releaseVideoResource(video) {
69955
+ try {
69956
+ video.pause();
69957
+ } catch (err) {}
69958
+ video.removeAttribute("src");
69959
+ try {
69960
+ video.load();
69961
+ } catch (err) {}
69962
+ }
69963
+ function getVideoFirstFrameTimeout(table) {
69964
+ var _a;
69965
+ const timeout = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameTimeout;
69966
+ return "number" == typeof timeout && timeout >= 0 ? timeout : 8e3;
69967
+ }
69968
+ function getVideoFirstFrameMaxCanvasSize(table) {
69969
+ var _a;
69970
+ const maxCanvasSize = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.videoFirstFrameMaxCanvasSize;
69971
+ return "number" == typeof maxCanvasSize && maxCanvasSize > 0 ? maxCanvasSize : 512;
69972
+ }
69973
+ function snapshotVideoFirstFrame(video, image, table) {
69974
+ const displayWidth = image.attribute.width,
69975
+ displayHeight = image.attribute.height;
69976
+ if ("number" != typeof displayWidth || "number" != typeof displayHeight || displayWidth <= 0 || displayHeight <= 0) return !1;
69977
+ const canvas = document.createElement("canvas"),
69978
+ context = canvas.getContext("2d");
69979
+ if (!context) return !1;
69980
+ const dpr = Math.min(("undefined" == typeof window ? 1 : window.devicePixelRatio) || 1, 2),
69981
+ maxSize = getVideoFirstFrameMaxCanvasSize(table),
69982
+ scale = Math.min(dpr, maxSize / Math.max(displayWidth, displayHeight));
69983
+ 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`;
69984
+ try {
69985
+ return context.drawImage(video, 0, 0, canvas.width, canvas.height), image.setAttributes({
69986
+ image: canvas
69987
+ }), !0;
69988
+ } catch (err) {
69989
+ return !1;
69990
+ }
69991
+ }
69992
+ function getSvgSize(svg) {
69993
+ var _a;
69994
+ const svgTag = null === (_a = svg.match(/<svg\b[^>]*>/i)) || void 0 === _a ? void 0 : _a[0];
69995
+ if (!svgTag) return;
69996
+ const widthMatch = svgTag.match(/\bwidth=["']?([\d.]+)/i),
69997
+ heightMatch = svgTag.match(/\bheight=["']?([\d.]+)/i),
69998
+ width = widthMatch ? Number(widthMatch[1]) : void 0,
69999
+ height = heightMatch ? Number(heightMatch[1]) : void 0;
70000
+ if (width > 0 && height > 0) return {
70001
+ width: width,
70002
+ height: height
70003
+ };
70004
+ const viewBoxMatch = svgTag.match(/\bviewBox=["']\s*[-\d.]+\s+[-\d.]+\s+([\d.]+)\s+([\d.]+)\s*["']/i),
70005
+ viewBoxWidth = viewBoxMatch ? Number(viewBoxMatch[1]) : void 0,
70006
+ viewBoxHeight = viewBoxMatch ? Number(viewBoxMatch[2]) : void 0;
70007
+ return viewBoxWidth > 0 && viewBoxHeight > 0 ? {
70008
+ width: viewBoxWidth,
70009
+ height: viewBoxHeight
70010
+ } : void 0;
70011
+ }
70002
70012
  function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync) {
70003
- 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;
70013
+ 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;
70004
70014
  const headerStyle = table._getCellStyle(col, row),
70005
70015
  functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70006
70016
  (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);
@@ -70058,7 +70068,55 @@
70058
70068
  }
70059
70069
  const value = table.getCellValue(col, row),
70060
70070
  video = document.createElement("video");
70071
+ video.muted = !0, video.playsInline = !0;
70072
+ const shouldSnapshot = !0 === (null === (_6 = table.options.customConfig) || void 0 === _6 ? void 0 : _6.videoFirstFrameSnapshot);
70073
+ let loadTimer,
70074
+ videoReleased = !1;
70075
+ const clearVideoLoadTimer = () => {
70076
+ void 0 !== loadTimer && (clearTimeout(loadTimer), loadTimer = void 0);
70077
+ },
70078
+ releaseCurrentVideo = () => {
70079
+ videoReleased || (videoReleased = !0, clearVideoLoadTimer(), releaseVideoResource(video));
70080
+ },
70081
+ isCurrentImage = () => cellGroup.getChildByName("image", !0) === image,
70082
+ handleVideoLoadFail = () => {
70083
+ videoReleased || (isCurrentImage() && ((() => {
70084
+ var _a, _b;
70085
+ const regedIcons = get$2(),
70086
+ damageIcon = regedIcons.video_damage_pic || regedIcons.damage_pic,
70087
+ damageImage = damageIcon.svg;
70088
+ image.setAttributes({
70089
+ image: damageImage
70090
+ });
70091
+ const originImage = null === (_b = null === (_a = image.resources) || void 0 === _a ? void 0 : _a.get(damageImage)) || void 0 === _b ? void 0 : _b.data,
70092
+ svgSize = "string" == typeof damageImage ? getSvgSize(damageImage) : void 0,
70093
+ originWidth = (null == originImage ? void 0 : originImage.width) || damageIcon.width || (null == svgSize ? void 0 : svgSize.width) || 24,
70094
+ originHeight = (null == originImage ? void 0 : originImage.height) || damageIcon.height || (null == svgSize ? void 0 : svgSize.height) || 24,
70095
+ {
70096
+ width: cellWidth,
70097
+ height: cellHeight,
70098
+ isMerge: isMerge
70099
+ } = getCellRange$1(cellGroup, table),
70100
+ availableWidth = cellWidth - padding[1] - padding[3],
70101
+ availableHeight = cellHeight - padding[0] - padding[2];
70102
+ if (originWidth > 0 && originHeight > 0 && availableWidth > 0 && availableHeight > 0) {
70103
+ const {
70104
+ width: imageWidth,
70105
+ height: imageHeight
70106
+ } = calcKeepAspectRatioSize(originWidth, originHeight, availableWidth, availableHeight),
70107
+ pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
70108
+ image.setAttributes({
70109
+ x: pos.x,
70110
+ y: pos.y,
70111
+ width: imageWidth,
70112
+ height: imageHeight
70113
+ }), isMerge && updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
70114
+ }
70115
+ })(), table.scenegraph.updateNextFrame()), shouldSnapshot && releaseCurrentVideo());
70116
+ };
70061
70117
  video.addEventListener("loadeddata", () => {
70118
+ if (clearVideoLoadTimer(), videoReleased) return;
70119
+ if (!isCurrentImage()) return void releaseCurrentVideo();
70062
70120
  imageAutoSizing && _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding, cellGroup);
70063
70121
  const {
70064
70122
  width: cellWidth,
@@ -70108,11 +70166,8 @@
70108
70166
  dx: dx,
70109
70167
  dy: dy
70110
70168
  });
70111
- playIcon.name = "play-icon", cellGroup.appendChild(playIcon), table.scenegraph.updateNextFrame();
70112
- }), video.onerror = () => {
70113
- const regedIcons = get$2();
70114
- image.image = regedIcons.video_damage_pic ? regedIcons.video_damage_pic.svg : regedIcons.damage_pic.svg;
70115
- }, video.src = value, video.setAttribute("preload", "auto");
70169
+ playIcon.name = "play-icon", cellGroup.appendChild(playIcon), shouldSnapshot && snapshotVideoFirstFrame(video, image, table) && releaseCurrentVideo(), table.scenegraph.updateNextFrame();
70170
+ }), video.addEventListener("error", handleVideoLoadFail), video.addEventListener("abort", handleVideoLoadFail);
70116
70171
  const image = createImage({
70117
70172
  x: padding[3],
70118
70173
  y: padding[0],
@@ -70121,9 +70176,11 @@
70121
70176
  image: video,
70122
70177
  cursor: "pointer"
70123
70178
  });
70124
- return image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
70179
+ image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
70125
70180
  isDamagePic(image) && (updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame());
70126
- }, cellGroup;
70181
+ }, video.setAttribute("preload", "auto"), video.src = value;
70182
+ const timeout = getVideoFirstFrameTimeout(table);
70183
+ return shouldSnapshot && timeout > 0 && (loadTimer = setTimeout(handleVideoLoadFail, timeout)), cellGroup;
70127
70184
  }
70128
70185
 
70129
70186
  function createMark(marked, cellGroup, table) {
@@ -70183,10 +70240,10 @@
70183
70240
  }
70184
70241
  }
70185
70242
 
70186
- function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync, headerStyle) {
70243
+ function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range, isAsync) {
70187
70244
  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;
70188
- headerStyle = headerStyle || table._getCellStyle(col, row);
70189
- const functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70245
+ const headerStyle = table._getCellStyle(col, row),
70246
+ functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
70190
70247
  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);
70191
70248
  const autoRowHeight = table.isAutoRowHeight(row),
70192
70249
  autoColWidth = "auto" === colWidth,
@@ -78756,7 +78813,7 @@
78756
78813
  PluginManager: PluginManager
78757
78814
  });
78758
78815
 
78759
- const version = "1.26.2";
78816
+ const version = "1.26.4";
78760
78817
 
78761
78818
  exports.Gantt = Gantt;
78762
78819
  exports.TYPES = index$4;