@visactor/vtable-calendar 1.11.5 → 1.11.6-alpha.1

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.
@@ -26675,6 +26675,8 @@
26675
26675
  HierarchyState.expand = "expand", HierarchyState.collapse = "collapse", HierarchyState.none = "none", HierarchyState.loading = "loading";
26676
26676
  }(HierarchyState || (HierarchyState = {}));
26677
26677
 
26678
+ const cellStyleKeys = ["bgColor", "color", "strokeColor", "borderColor", "linkColor"];
26679
+
26678
26680
  var AggregationType;
26679
26681
  !function (AggregationType) {
26680
26682
  AggregationType.RECORD = "RECORD", AggregationType.NONE = "NONE", AggregationType.SUM = "SUM", AggregationType.MIN = "MIN", AggregationType.MAX = "MAX", AggregationType.AVG = "AVG", AggregationType.COUNT = "COUNT", AggregationType.CUSTOM = "CUSTOM", AggregationType.RECALCULATE = "RECALCULATE";
@@ -32735,7 +32737,7 @@
32735
32737
  }
32736
32738
  return cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight, cellGroup;
32737
32739
  }
32738
- function updateCell$1(col, row, table, addNew, isShadow) {
32740
+ function updateCell$1(col, row, table, addNew, isShadow, forceFastUpdate) {
32739
32741
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
32740
32742
  const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0),
32741
32743
  cellLocation = table.getCellLocation(col, row);
@@ -32776,7 +32778,7 @@
32776
32778
  const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
32777
32779
  autoWrapText = null !== (_a = cellStyle.autoWrapText) && void 0 !== _a ? _a : table.internalProps.autoWrapText,
32778
32780
  cellTheme = getStyleTheme(cellStyle, table, isMerge ? range.start.col : col, isMerge ? range.start.row : row, getProp).theme;
32779
- if (cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), !addNew && !isMerge && !((null == define ? void 0 : define.customLayout) || (null == define ? void 0 : define.customRender) || (null == define ? void 0 : define.headerCustomLayout) || (null == define ? void 0 : define.headerCustomRender)) && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, mayHaveIcon, table)) {
32781
+ if (cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), !addNew && !isMerge && !((null == define ? void 0 : define.customLayout) || (null == define ? void 0 : define.customRender) || (null == define ? void 0 : define.headerCustomLayout) || (null == define ? void 0 : define.headerCustomRender)) && (forceFastUpdate || canUseFastUpdate(col, row, oldCellGroup, autoWrapText, mayHaveIcon, table))) {
32780
32782
  const cellWidth = table.getColWidth(col),
32781
32783
  cellHeight = table.getRowHeight(row);
32782
32784
  oldCellGroup.setAttributes({
@@ -39866,7 +39868,8 @@
39866
39868
  this.component.drillIcon.update(visible, x, y, drillDown, drillUp, this);
39867
39869
  }
39868
39870
  updateCellContent(col, row) {
39869
- if (!this.clear) return updateCell$1(col, row, this.table);
39871
+ let forceFastUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
39872
+ if (!this.clear) return updateCell$1(col, row, this.table, void 0, void 0, forceFastUpdate);
39870
39873
  }
39871
39874
  setPixelRatio(pixelRatio) {
39872
39875
  this.stage.disableDirtyBounds(), this.stage.window.setDpr(pixelRatio), this.stage.render(), this.stage.enableDirtyBounds();
@@ -45398,25 +45401,34 @@
45398
45401
  }), this.table.scenegraph.updateNextFrame();
45399
45402
  }
45400
45403
  arrangeCustomCellStyle(cellPos, customStyleId) {
45404
+ var _a;
45401
45405
  const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
45402
- if (-1 !== index || customStyleId) {
45403
- if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
45404
- cellPosition: {
45405
- col: cellPos.col,
45406
- row: cellPos.row,
45407
- range: cellPos.range
45408
- },
45409
- customStyleId: customStyleId
45410
- });else {
45411
- if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
45412
- customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
45406
+ if (-1 === index && !customStyleId) return;
45407
+ if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
45408
+ cellPosition: {
45409
+ col: cellPos.col,
45410
+ row: cellPos.row,
45411
+ range: cellPos.range
45412
+ },
45413
+ customStyleId: customStyleId
45414
+ });else {
45415
+ if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
45416
+ customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
45417
+ }
45418
+ const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
45419
+ let forceFastUpdate;
45420
+ if (style) {
45421
+ forceFastUpdate = !0;
45422
+ for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
45423
+ forceFastUpdate = !1;
45424
+ break;
45413
45425
  }
45414
- if (cellPos.range) for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
45415
- const range = this.table.getCellRange(col, row);
45416
- for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.table.scenegraph.updateCellContent(c, r);
45417
- } else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
45418
- this.table.scenegraph.updateNextFrame();
45419
45426
  }
45427
+ if (cellPos.range) for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
45428
+ const range = this.table.getCellRange(col, row);
45429
+ for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);
45430
+ } else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);
45431
+ this.table.scenegraph.updateNextFrame();
45420
45432
  }
45421
45433
  updateCustomCell(customCellStyle, customCellStyleArrangement) {
45422
45434
  this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
@@ -45576,7 +45588,7 @@
45576
45588
  constructor(container) {
45577
45589
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45578
45590
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
45579
- if (super(), this.showFrozenIcon = !0, this.version = "1.11.5", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
45591
+ if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
45580
45592
  const {
45581
45593
  frozenColCount = 0,
45582
45594
  frozenRowCount: frozenRowCount,
@@ -48811,7 +48823,7 @@
48811
48823
  height: rect.height
48812
48824
  }
48813
48825
  };
48814
- editor.beginEditing, null === (_c = editor.beginEditing) || void 0 === _c || _c.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_d = editor.bindSuccessCallback) || void 0 === _d || _d.call(editor, () => {
48826
+ col === this.table.colCount - 1 && (referencePosition.rect.width = rect.width - 1), row === this.table.rowCount - 1 && (referencePosition.rect.height = rect.height - 1), editor.beginEditing, null === (_c = editor.beginEditing) || void 0 === _c || _c.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_d = editor.bindSuccessCallback) || void 0 === _d || _d.call(editor, () => {
48815
48827
  this.completeEdit();
48816
48828
  }), null === (_e = editor.onStart) || void 0 === _e || _e.call(editor, {
48817
48829
  value: dataValue,