@visactor/vtable-calendar 1.19.3-alpha.0 → 1.19.4-alpha.0

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.
@@ -45224,13 +45224,20 @@
45224
45224
  const pos = _getUpdateRowIndex(addRows[0] - 1, addRows[addRows.length - 1] + 1, scene);
45225
45225
  rowUpdatePos = isValid$3(rowUpdatePos) ? isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
45226
45226
  }
45227
+ const batchMergePos = new Set();
45227
45228
  for (let col = 0; col < table.colCount; col++) updateRows.forEach(row => {
45228
45229
  if (row < table.frozenRowCount) {
45229
45230
  const mergeInfo = getCellMergeInfo(scene.table, col, row);
45230
- if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) updateCell$1(col, row, scene.table, !1);else updateCell$1(col, row, scene.table, !1);
45231
+ if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
45232
+ const key = `${col}-${row}`;
45233
+ batchMergePos.has(key) || (updateCell$1(col, row, scene.table, !1), batchMergePos.add(key));
45234
+ } else updateCell$1(col, row, scene.table, !1);
45231
45235
  } else if (row > table.rowCount - 1 || row < scene.table.rowCount - scene.table.bottomFrozenRowCount && (row < scene.proxy.rowStart || row > scene.proxy.rowEnd)) removeCellGroup(row, scene);else {
45232
45236
  const mergeInfo = getCellMergeInfo(scene.table, col, row);
45233
- if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) updateCell$1(col, row, scene.table, !1);else updateCell$1(col, row, scene.table, !1);
45237
+ if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
45238
+ const key = `${col}-${row}`;
45239
+ batchMergePos.has(key) || (updateCell$1(col, row, scene.table, !1), batchMergePos.add(key));
45240
+ } else updateCell$1(col, row, scene.table, !1);
45234
45241
  }
45235
45242
  });
45236
45243
  if (updateRows.length) {
@@ -46207,15 +46214,20 @@
46207
46214
  });
46208
46215
  const colWidthsMap = table.colWidthsMap;
46209
46216
  let updateAfter;
46210
- if (removeCols.forEach(col => {
46217
+ removeCols.forEach(col => {
46211
46218
  colWidthsMap.delAndReorder(col);
46212
46219
  }), removeCols.length && resetColNumber(scene), scene.table._clearColRangeWidthsMap(), addCols.forEach(col => {
46213
46220
  const needUpdateAfter = addCol(col, scene);
46214
46221
  resetColNumber(scene), updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, colWidthsMap.addAndReorder(col);
46215
- }), resetColNumberAndX(scene), updateCols.forEach(col => {
46222
+ }), resetColNumberAndX(scene);
46223
+ const batchMergePos = new Set();
46224
+ if (updateCols.forEach(col => {
46216
46225
  for (let row = 0; row < table.rowCount; row++) {
46217
46226
  const mergeInfo = getCellMergeInfo(scene.table, col, row);
46218
- if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) updateCell$1(col, row, scene.table, !1);else updateCell$1(col, row, scene.table, !1);
46227
+ if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
46228
+ const key = `${col}-${row}`;
46229
+ batchMergePos.has(key) || (updateCell$1(col, row, scene.table, !1), batchMergePos.add(key));
46230
+ } else updateCell$1(col, row, scene.table, !1);
46219
46231
  }
46220
46232
  }), isNumber$4(updateAfter)) {
46221
46233
  for (let col = updateAfter; col < Math.max(table.colCount, null !== (_a = table.internalProps._oldColCount) && void 0 !== _a ? _a : table.colCount); col++) for (let row = 0; row < Math.max(table.rowCount, null !== (_b = table.internalProps._oldRowCount) && void 0 !== _b ? _b : table.rowCount); row++) {
@@ -49585,7 +49597,7 @@
49585
49597
  }
49586
49598
  });
49587
49599
  }), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
49588
- var _a, _b, _c, _d;
49600
+ var _a, _b, _c, _d, _e, _f, _g, _h;
49589
49601
  if (0 === e.button) {
49590
49602
  if ("grabing" === stateManager.interactionState) {
49591
49603
  if (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()) endResizeCol(table);else if (stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
@@ -49608,14 +49620,42 @@
49608
49620
  }
49609
49621
  }
49610
49622
  } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
49623
+ if (!table.eventManager.isDraging) {
49624
+ const eventArgsSet = getCellEventArgsSet(e);
49625
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
49626
+ const {
49627
+ col: col,
49628
+ row: row
49629
+ } = eventArgsSet.eventArgs,
49630
+ cellInfo = table.getCellInfo(col, row);
49631
+ let icon, position;
49632
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
49633
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
49634
+ iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
49635
+ }
49636
+ const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
49637
+ event: e.nativeEvent,
49638
+ federatedEvent: e,
49639
+ cells: [],
49640
+ targetIcon: icon ? {
49641
+ name: icon.name,
49642
+ position: position,
49643
+ funcType: icon.attribute.funcType
49644
+ } : void 0,
49645
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
49646
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
49647
+ });
49648
+ table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
49649
+ }
49650
+ }
49611
49651
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
49612
49652
  const eventArgsSet = getCellEventArgsSet(e);
49613
49653
  eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
49614
49654
  col: eventArgsSet.eventArgs.col,
49615
49655
  row: eventArgsSet.eventArgs.row,
49616
49656
  event: e.nativeEvent,
49617
- target: null === (_c = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target,
49618
- mergeCellInfo: null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.mergeInfo
49657
+ target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
49658
+ mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
49619
49659
  });
49620
49660
  }
49621
49661
  setTimeout(() => {
@@ -49653,39 +49693,14 @@
49653
49693
  }
49654
49694
  }
49655
49695
  }), table.scenegraph.tableGroup.addEventListener("pointertap", e => {
49656
- var _a, _b, _c, _d, _e;
49696
+ var _a;
49657
49697
  if (table.stateManager.columnResize.resizing) return;
49658
49698
  const eventArgsSet = getCellEventArgsSet(e);
49659
- if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
49660
- const {
49661
- col: col,
49662
- row: row
49663
- } = eventArgsSet.eventArgs,
49664
- cellInfo = table.getCellInfo(col, row);
49665
- let icon, position;
49666
- if (null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target) {
49667
- const iconInfo = getIconAndPositionFromTarget(null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target);
49668
- iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
49669
- }
49670
- const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
49671
- event: e.nativeEvent,
49672
- federatedEvent: e,
49673
- cells: [],
49674
- targetIcon: icon ? {
49675
- name: icon.name,
49676
- position: position,
49677
- funcType: icon.attribute.funcType
49678
- } : void 0,
49679
- target: null === (_c = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target,
49680
- mergeCellInfo: null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.mergeInfo
49681
- });
49682
- table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
49683
- }
49684
49699
  if (!table.stateManager.columnResize.resizing && !table.stateManager.columnMove.moving && (eventManager.dealIconClick(e, eventArgsSet), (null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) && eventManager.touchSetTimeout && "touch" === e.pointerType)) {
49685
49700
  const eventArgsSet = getCellEventArgsSet(e);
49686
49701
  if (eventManager.touchSetTimeout) {
49687
49702
  clearTimeout(eventManager.touchSetTimeout);
49688
- const isHasSelected = !!(null === (_e = stateManager.select.ranges) || void 0 === _e ? void 0 : _e.length);
49703
+ const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
49689
49704
  eventManager.dealTableSelect(eventArgsSet), stateManager.endSelectCells(!0, isHasSelected), eventManager.touchSetTimeout = void 0;
49690
49705
  }
49691
49706
  }
@@ -53616,7 +53631,7 @@
53616
53631
  }
53617
53632
  constructor(container, options = {}) {
53618
53633
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
53619
- if (super(), this.showFrozenIcon = !0, this.version = "1.19.3-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
53634
+ if (super(), this.showFrozenIcon = !0, this.version = "1.19.4-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
53620
53635
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
53621
53636
  options: options,
53622
53637
  container: container