@visactor/vtable-plugins 1.19.4-alpha.2 → 1.19.5

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.
@@ -13092,7 +13092,7 @@
13092
13092
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
13093
13093
  }
13094
13094
  clearScreen(renderService, context, drawContext) {
13095
- var _a, _b;
13095
+ var _a, _b, _c;
13096
13096
  const {
13097
13097
  clear: clear,
13098
13098
  viewBox: viewBox
@@ -13100,9 +13100,9 @@
13100
13100
  width = viewBox.width(),
13101
13101
  height = viewBox.height();
13102
13102
  if (clear) {
13103
- context.clearRect(0, 0, width, height);
13104
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
13105
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
13103
+ context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
13104
+ const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
13105
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
13106
13106
  const res = stage.resources.get(clear);
13107
13107
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
13108
13108
  } else context.fillStyle = createColor(context, clear, {
@@ -13632,6 +13632,8 @@
13632
13632
  this._beforeRender && this._beforeRender(stage);
13633
13633
  }, this.afterClearScreen = drawParams => {
13634
13634
  this._afterClearScreen && this._afterClearScreen(drawParams);
13635
+ }, this.afterClearRect = drawParams => {
13636
+ this._afterClearRect && this._afterClearRect(drawParams);
13635
13637
  }, this.afterRender = stage => {
13636
13638
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
13637
13639
  }, this.afterTickCb = () => {
@@ -13639,7 +13641,8 @@
13639
13641
  }, this.params = params, this.theme = new Theme(), this.hooks = {
13640
13642
  beforeRender: new SyncHook(["stage"]),
13641
13643
  afterRender: new SyncHook(["stage"]),
13642
- afterClearScreen: new SyncHook(["stage"])
13644
+ afterClearScreen: new SyncHook(["stage"]),
13645
+ afterClearRect: new SyncHook(["stage"])
13643
13646
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
13644
13647
  width: params.width,
13645
13648
  height: params.height,
@@ -13651,7 +13654,7 @@
13651
13654
  canvas: params.canvas
13652
13655
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
13653
13656
  main: !0
13654
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
13657
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
13655
13658
  tickRenderMode: "effect"
13656
13659
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
13657
13660
  background: this._background
@@ -16649,7 +16652,8 @@
16649
16652
  CLICK_DEPENDENCY_LINK_POINT: "click_dependency_link_point",
16650
16653
  CONTEXTMENU_DEPENDENCY_LINK: "contextmenu_dependency_link",
16651
16654
  CLICK_MARKLINE_CREATE: "click_markline_create",
16652
- CLICK_MARKLINE_CONTENT: "click_markline_content"
16655
+ CLICK_MARKLINE_CONTENT: "click_markline_content",
16656
+ MOVE_END_TASK_BAR: "move_end_task_bar"
16653
16657
  };
16654
16658
 
16655
16659
  function throttle(func, delay) {
@@ -20801,7 +20805,8 @@
20801
20805
  deltaY = this.moveTaskBar.deltaY,
20802
20806
  target = this.moveTaskBar.target;
20803
20807
  if (Math.abs(deltaX) >= 1 || Math.abs(deltaY) >= 1) {
20804
- const taskIndex = target.task_index,
20808
+ const oldRowIndex = target.task_index,
20809
+ taskIndex = target.task_index,
20805
20810
  sub_task_index = target.sub_task_index,
20806
20811
  {
20807
20812
  startDate: oldStartDate,
@@ -20827,6 +20832,30 @@
20827
20832
  index: taskIndex,
20828
20833
  record: newRecord
20829
20834
  });
20835
+ const newRowIndex = getTaskIndexsByTaskY(targetEndY, this._gantt).task_index;
20836
+ this._gantt.hasListeners(GANTT_EVENT_TYPE.MOVE_END_TASK_BAR) && this._gantt.fireListeners(GANTT_EVENT_TYPE.MOVE_END_TASK_BAR, {
20837
+ startDate: newRecord[this._gantt.parsedOptions.startDateField],
20838
+ endDate: newRecord[this._gantt.parsedOptions.endDateField],
20839
+ oldStartDate: oldStartDate,
20840
+ oldEndDate: oldEndDate,
20841
+ oldRowIndex: oldRowIndex,
20842
+ newRowIndex: newRowIndex,
20843
+ index: taskIndex,
20844
+ record: newRecord
20845
+ });
20846
+ } else {
20847
+ const newRecord = this._gantt.getRecordByIndex(taskIndex, sub_task_index),
20848
+ newRowIndex = getTaskIndexsByTaskY(targetEndY, this._gantt).task_index;
20849
+ this._gantt.hasListeners(GANTT_EVENT_TYPE.MOVE_END_TASK_BAR) && this._gantt.fireListeners(GANTT_EVENT_TYPE.MOVE_END_TASK_BAR, {
20850
+ startDate: newRecord[this._gantt.parsedOptions.startDateField],
20851
+ endDate: newRecord[this._gantt.parsedOptions.endDateField],
20852
+ oldStartDate: oldStartDate,
20853
+ oldEndDate: oldEndDate,
20854
+ oldRowIndex: oldRowIndex,
20855
+ newRowIndex: newRowIndex,
20856
+ index: newRowIndex,
20857
+ record: newRecord
20858
+ });
20830
20859
  }
20831
20860
  if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) {
20832
20861
  const indexs = getTaskIndexsByTaskY(targetEndY, this._gantt);