@visactor/vtable-calendar 1.14.3 → 1.14.4-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.
@@ -46622,6 +46622,10 @@
46622
46622
  }
46623
46623
  }
46624
46624
 
46625
+ function getCustomMergeCellFunc(customMergeCell) {
46626
+ return isFunction$1(customMergeCell) ? customMergeCell : isArray$1(customMergeCell) ? (col, row) => customMergeCell.find(item => item.range.start.col <= col && item.range.end.col >= col && item.range.start.row <= row && item.range.end.row >= row) : void 0;
46627
+ }
46628
+
46625
46629
  const {
46626
46630
  toBoxArray: toBoxArray
46627
46631
  } = style,
@@ -46637,7 +46641,7 @@
46637
46641
  constructor(container) {
46638
46642
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46639
46643
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46640
- if (super(), this.showFrozenIcon = !0, this.version = "1.14.3", 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");
46644
+ if (super(), this.showFrozenIcon = !0, this.version = "1.14.4-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");
46641
46645
  const {
46642
46646
  frozenColCount = 0,
46643
46647
  frozenRowCount: frozenRowCount,
@@ -46721,7 +46725,7 @@
46721
46725
  }
46722
46726
  this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyMergeTitleCache = new Map(), this.bodyBottomStyleCache = new Map(), internalProps.stick = {
46723
46727
  changedCells: new Map()
46724
- }, internalProps.customMergeCell = options.customMergeCell;
46728
+ }, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
46725
46729
  const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
46726
46730
  CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []));
46727
46731
  }
@@ -47474,7 +47478,7 @@
47474
47478
  const MenuHandler = Factory.getComponent("menuHandler");
47475
47479
  internalProps.menuHandler = new MenuHandler(this);
47476
47480
  }
47477
- this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = options.customMergeCell, null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
47481
+ this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
47478
47482
  }
47479
47483
  renderWithRecreateCells() {
47480
47484
  const oldHoverState = {
@@ -49738,7 +49742,7 @@
49738
49742
  sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
49739
49743
  }
49740
49744
  const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
49741
- return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount), this.columnTree.reset(this.columnTree.tree.children, !0), this._cellRangeMap = new Map(), {
49745
+ return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount), this.columnTree.reset(this.columnTree.tree.children), this._cellRangeMap = new Map(), {
49742
49746
  sourceIndex: sourceCellRange.start.col,
49743
49747
  targetIndex: targetIndex,
49744
49748
  sourceSize: sourceSize,
@@ -49757,7 +49761,7 @@
49757
49761
  sourceIds.unshift(targetIndex, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
49758
49762
  }
49759
49763
  const sourceColumns = this._columns.splice(sourceCellRange.start.row, sourceSize);
49760
- return sourceColumns.unshift(targetIndex, 0), Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceCellRange.start.row, targetIndex + (target.row > source.row ? sourceCellRange.end.row - sourceCellRange.start.row : 0)), this.columnTree.reset(this.columnTree.tree.children, !0), this._cellRangeMap = new Map(), {
49764
+ return sourceColumns.unshift(targetIndex, 0), Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceCellRange.start.row, targetIndex + (target.row > source.row ? sourceCellRange.end.row - sourceCellRange.start.row : 0)), this.columnTree.reset(this.columnTree.tree.children), this._cellRangeMap = new Map(), {
49761
49765
  sourceIndex: sourceCellRange.start.row,
49762
49766
  targetIndex: targetIndex,
49763
49767
  sourceSize: sourceSize,