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

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.
@@ -108,4 +108,5 @@ const parseValue = value => {
108
108
  translateRowObj_1.translateRowArrayToObj)(newData, columns);
109
109
  };
110
110
 
111
- exports.generateAutoFillData = generateAutoFillData;
111
+ exports.generateAutoFillData = generateAutoFillData;
112
+ //# sourceMappingURL=autoFillHandle.js.map
package/cjs/index.d.ts CHANGED
@@ -11,5 +11,6 @@ export * from './focus-highlight';
11
11
  export * from './table-carousel-animation';
12
12
  export * from './rotate-table';
13
13
  export * from './gantt-export-image';
14
+ export * from './paste-add-row-column';
14
15
  export * from './wps-fill-handle';
15
16
  export * from './excel-import';
package/cjs/index.js CHANGED
@@ -23,6 +23,6 @@ __exportStar(require("./column-series"), exports), __exportStar(require("./row-s
23
23
  __exportStar(require("./highlight-header-when-select-cell"), exports), __exportStar(require("./excel-edit-cell-keyboard"), exports),
24
24
  __exportStar(require("./types"), exports), __exportStar(require("./focus-highlight"), exports),
25
25
  __exportStar(require("./table-carousel-animation"), exports), __exportStar(require("./rotate-table"), exports),
26
- __exportStar(require("./gantt-export-image"), exports), __exportStar(require("./wps-fill-handle"), exports),
27
- __exportStar(require("./excel-import"), exports);
26
+ __exportStar(require("./gantt-export-image"), exports), __exportStar(require("./paste-add-row-column"), exports),
27
+ __exportStar(require("./wps-fill-handle"), exports), __exportStar(require("./excel-import"), exports);
28
28
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,mDAAiC;AACjC,kDAAgC;AAChC,+CAA6B;AAC7B,sEAAoD;AACpD,6DAA2C;AAC3C,0CAAwB;AACxB,oDAAkC;AAClC,6DAA2C;AAC3C,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,iDAA+B","file":"index.js","sourcesContent":["export * from './carousel-animation';\nexport * from './invert-highlight';\nexport * from './header-highlight';\nexport * from './add-row-column';\nexport * from './column-series';\nexport * from './row-series';\nexport * from './highlight-header-when-select-cell';\nexport * from './excel-edit-cell-keyboard';\nexport * from './types';\nexport * from './focus-highlight';\nexport * from './table-carousel-animation';\nexport * from './rotate-table';\nexport * from './gantt-export-image';\nexport * from './wps-fill-handle';\nexport * from './excel-import';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,mDAAiC;AACjC,kDAAgC;AAChC,+CAA6B;AAC7B,sEAAoD;AACpD,6DAA2C;AAC3C,0CAAwB;AACxB,oDAAkC;AAClC,6DAA2C;AAC3C,iDAA+B;AAC/B,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,iDAA+B","file":"index.js","sourcesContent":["export * from './carousel-animation';\nexport * from './invert-highlight';\nexport * from './header-highlight';\nexport * from './add-row-column';\nexport * from './column-series';\nexport * from './row-series';\nexport * from './highlight-header-when-select-cell';\nexport * from './excel-edit-cell-keyboard';\nexport * from './types';\nexport * from './focus-highlight';\nexport * from './table-carousel-animation';\nexport * from './rotate-table';\nexport * from './gantt-export-image';\nexport * from './paste-add-row-column';\nexport * from './wps-fill-handle';\nexport * from './excel-import';\n"]}
@@ -0,0 +1,17 @@
1
+ import * as VTable from '@visactor/vtable';
2
+ export type IPasteAddRowColumnPluginOptions = {
3
+ addRowCallback?: (addedRow: number, table: VTable.ListTable) => void;
4
+ addColumnCallback?: (addedCount: number, table: VTable.ListTable) => void;
5
+ };
6
+ export declare class PasteAddRowColumnPlugin implements VTable.plugins.IVTablePlugin {
7
+ id: string;
8
+ name: string;
9
+ runTime: ("initialized" | "pasted_data")[];
10
+ table: VTable.ListTable;
11
+ pluginOptions: IPasteAddRowColumnPluginOptions;
12
+ pastedData: any;
13
+ constructor(pluginOptions?: IPasteAddRowColumnPluginOptions);
14
+ run(...args: any[]): void;
15
+ handlePaste(): void;
16
+ release(): void;
17
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
15
+ Object.defineProperty(o, "default", {
16
+ enumerable: !0,
17
+ value: v
18
+ });
19
+ } : function(o, v) {
20
+ o.default = v;
21
+ }), __importStar = this && this.__importStar || function(mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
25
+ return __setModuleDefault(result, mod), result;
26
+ };
27
+
28
+ Object.defineProperty(exports, "__esModule", {
29
+ value: !0
30
+ }), exports.PasteAddRowColumnPlugin = void 0;
31
+
32
+ const VTable = __importStar(require("@visactor/vtable"));
33
+
34
+ class PasteAddRowColumnPlugin {
35
+ constructor(pluginOptions) {
36
+ this.id = `paste-add-row-${Date.now()}`, this.name = "Paste Add row", this.runTime = [ VTable.TABLE_EVENT_TYPE.INITIALIZED, VTable.TABLE_EVENT_TYPE.PASTED_DATA ],
37
+ this.pluginOptions = pluginOptions;
38
+ }
39
+ run(...args) {
40
+ const runtime = args[1], table = args[2];
41
+ this.table = table, runtime === VTable.TABLE_EVENT_TYPE.PASTED_DATA && (this.pastedData = args[0],
42
+ this.handlePaste());
43
+ }
44
+ handlePaste() {
45
+ var _a, _b, _c;
46
+ const {pasteData: pasteData, row: row, col: col} = this.pastedData, rowCount = this.table.rowCount, colCount = this.table.colCount, rowsNeeded = row + pasteData.length - rowCount, colsNeeded = col + ((null === (_a = pasteData[0]) || void 0 === _a ? void 0 : _a.length) || 0) - colCount;
47
+ if (rowsNeeded > 0) for (let i = 0; i < rowsNeeded; i++) (null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.addRowCallback) ? this.pluginOptions.addRowCallback(rowCount + i, this.table) : this.table.addRecord([]);
48
+ if (colsNeeded > 0) for (let i = 0; i < colsNeeded; i++) {
49
+ const newColIndex = colCount + i;
50
+ (null === (_c = this.pluginOptions) || void 0 === _c ? void 0 : _c.addColumnCallback) ? this.pluginOptions.addColumnCallback(newColIndex, this.table) : this.table.addColumn({
51
+ field: `field_${newColIndex}`,
52
+ title: `New Column ${newColIndex}`,
53
+ width: 100
54
+ });
55
+ }
56
+ this.table.changeCellValues(col, row, pasteData, !0);
57
+ }
58
+ release() {
59
+ this.table.internalProps.handler.clear();
60
+ }
61
+ }
62
+
63
+ exports.PasteAddRowColumnPlugin = PasteAddRowColumnPlugin;
64
+ //# sourceMappingURL=paste-add-row-column.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["paste-add-row-column.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAM3C,MAAa,uBAAuB;IAOlC,YAAY,aAA+C;QAN3D,OAAE,GAAG,iBAAiB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACnC,SAAI,GAAG,eAAe,CAAC;QACvB,YAAO,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAKnF,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IACD,GAAG,CAAC,GAAG,IAAW;QAChB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,KAAK,GAAwB,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,KAAyB,CAAC;QACvC,IAAI,OAAO,KAAK,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE;YACnD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;IACH,CAAC;IAED,WAAW;;QACT,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAErC,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC;QACxC,MAAM,cAAc,GAAG,CAAA,MAAA,SAAS,CAAC,CAAC,CAAC,0CAAE,MAAM,KAAI,CAAC,CAAC;QAEjD,MAAM,UAAU,GAAG,GAAG,GAAG,cAAc,GAAG,QAAQ,CAAC;QACnD,MAAM,UAAU,GAAG,GAAG,GAAG,cAAc,GAAG,QAAQ,CAAC;QAGnD,IAAI,UAAU,GAAG,CAAC,EAAE;YAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;gBACnC,IAAI,MAAA,IAAI,CAAC,aAAa,0CAAE,cAAc,EAAE;oBACtC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC7D;qBAAM;oBACL,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;iBAC1B;aACF;SACF;QAGD,IAAI,UAAU,GAAG,CAAC,EAAE;YAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;gBACnC,MAAM,WAAW,GAAG,QAAQ,GAAG,CAAC,CAAC;gBACjC,IAAI,MAAA,IAAI,CAAC,aAAa,0CAAE,iBAAiB,EAAE;oBACzC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC/D;qBAAM;oBACL,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,SAAS,WAAW,EAAE;wBAC7B,KAAK,EAAE,cAAc,WAAW,EAAE;wBAClC,KAAK,EAAE,GAAG;qBACX,CAAC,CAAC;iBACJ;aACF;SACF;QAGD,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACL,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;CACF;AAjED,0DAiEC","file":"paste-add-row-column.js","sourcesContent":["import * as VTable from '@visactor/vtable';\nexport type IPasteAddRowColumnPluginOptions = {\n addRowCallback?: (addedRow: number, table: VTable.ListTable) => void;\n addColumnCallback?: (addedCount: number, table: VTable.ListTable) => void;\n};\n\nexport class PasteAddRowColumnPlugin implements VTable.plugins.IVTablePlugin {\n id = `paste-add-row-${Date.now()}`;\n name = 'Paste Add row';\n runTime = [VTable.TABLE_EVENT_TYPE.INITIALIZED, VTable.TABLE_EVENT_TYPE.PASTED_DATA];\n table: VTable.ListTable;\n pluginOptions: IPasteAddRowColumnPluginOptions;\n pastedData: any;\n constructor(pluginOptions?: IPasteAddRowColumnPluginOptions) {\n this.pluginOptions = pluginOptions;\n }\n run(...args: any[]) {\n const runtime = args[1];\n const table: VTable.BaseTableAPI = args[2];\n this.table = table as VTable.ListTable;\n if (runtime === VTable.TABLE_EVENT_TYPE.PASTED_DATA) {\n this.pastedData = args[0];\n this.handlePaste();\n }\n }\n\n handlePaste() {\n const { pasteData, row, col } = this.pastedData;\n const rowCount = this.table.rowCount;\n const colCount = this.table.colCount;\n\n const pastedRowCount = pasteData.length;\n const pastedColCount = pasteData[0]?.length || 0;\n\n const rowsNeeded = row + pastedRowCount - rowCount;\n const colsNeeded = col + pastedColCount - colCount;\n\n // 扩展行\n if (rowsNeeded > 0) {\n for (let i = 0; i < rowsNeeded; i++) {\n if (this.pluginOptions?.addRowCallback) {\n this.pluginOptions.addRowCallback(rowCount + i, this.table);\n } else {\n this.table.addRecord([]);\n }\n }\n }\n\n // 扩展列\n if (colsNeeded > 0) {\n for (let i = 0; i < colsNeeded; i++) {\n const newColIndex = colCount + i;\n if (this.pluginOptions?.addColumnCallback) {\n this.pluginOptions.addColumnCallback(newColIndex, this.table);\n } else {\n this.table.addColumn({\n field: `field_${newColIndex}`,\n title: `New Column ${newColIndex}`,\n width: 100\n });\n }\n }\n }\n\n // 最后统一写入数据\n this.table.changeCellValues(col, row, pasteData, true);\n }\n\n release() {\n this.table.internalProps.handler.clear();\n }\n}\n"]}
@@ -96,5 +96,4 @@ function deleteSelectRange(selectCells, tableInstance) {
96
96
  for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "");
97
97
  }
98
98
 
99
- //# sourceMappingURL=wps-fill-handle.js.map
100
99
  exports.WpsFillHandlePlugin = WpsFillHandlePlugin;
@@ -8799,7 +8799,7 @@
8799
8799
  }
8800
8800
  removeChild(child) {
8801
8801
  const data = super.removeChild(child);
8802
- return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
8802
+ return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
8803
8803
  }
8804
8804
  removeAllChild(deep = !1) {
8805
8805
  this.forEachChildren(child => {
@@ -10310,9 +10310,10 @@
10310
10310
  return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
10311
10311
  }
10312
10312
  toCustomPath() {
10313
- const points = this.attribute.points,
10314
- path = new CustomPath2D();
10315
- return points.forEach((point, index) => {
10313
+ let path = super.toCustomPath();
10314
+ if (path) return path;
10315
+ const points = this.attribute.points;
10316
+ return path = new CustomPath2D(), points.forEach((point, index) => {
10316
10317
  0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
10317
10318
  }), path.closePath(), path;
10318
10319
  }
@@ -12940,6 +12941,7 @@
12940
12941
  drawContext.updateBounds ? this.useDirtyBounds = !0 : this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;
12941
12942
  }
12942
12943
  draw(renderService, drawContext) {
12944
+ var _a;
12943
12945
  this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
12944
12946
  const {
12945
12947
  context: context,
@@ -12954,7 +12956,7 @@
12954
12956
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
12955
12957
  }
12956
12958
  const d = context.dpr % 1;
12957
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
12959
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams), renderService.renderTreeRoots.sort((a, b) => {
12958
12960
  var _a, _b;
12959
12961
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
12960
12962
  }).forEach(group => {
@@ -13628,13 +13630,16 @@
13628
13630
  } else this._skipRender = 1;
13629
13631
  }, this.beforeRender = stage => {
13630
13632
  this._beforeRender && this._beforeRender(stage);
13633
+ }, this.afterClearScreen = drawParams => {
13634
+ this._afterClearScreen && this._afterClearScreen(drawParams);
13631
13635
  }, this.afterRender = stage => {
13632
13636
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
13633
13637
  }, this.afterTickCb = () => {
13634
13638
  this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
13635
13639
  }, this.params = params, this.theme = new Theme(), this.hooks = {
13636
13640
  beforeRender: new SyncHook(["stage"]),
13637
- afterRender: new SyncHook(["stage"])
13641
+ afterRender: new SyncHook(["stage"]),
13642
+ afterClearScreen: new SyncHook(["stage"])
13638
13643
  }, 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({
13639
13644
  width: params.width,
13640
13645
  height: params.height,
@@ -13646,7 +13651,7 @@
13646
13651
  canvas: params.canvas
13647
13652
  }), 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, {
13648
13653
  main: !0
13649
- })), 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._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
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 = {
13650
13655
  tickRenderMode: "effect"
13651
13656
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
13652
13657
  background: this._background
@@ -14041,7 +14046,7 @@
14041
14046
  return this._cursor;
14042
14047
  }
14043
14048
  eventPointTransform(e) {
14044
- const point = this.global.mapToCanvasPoint(e, this.window.getContext().canvas.nativeCanvas);
14049
+ const point = this.global.mapToCanvasPoint(e, this.window);
14045
14050
  return this.stage.window.pointTransform(point.x, point.y);
14046
14051
  }
14047
14052
  pauseTriggerEvent() {
@@ -21983,6 +21988,65 @@
21983
21988
  }
21984
21989
  }
21985
21990
 
21991
+ class PasteAddRowColumnPlugin {
21992
+ id = `paste-add-row-${Date.now()}`;
21993
+ name = 'Paste Add row';
21994
+ runTime = [VTable__namespace.TABLE_EVENT_TYPE.INITIALIZED, VTable__namespace.TABLE_EVENT_TYPE.PASTED_DATA];
21995
+ table;
21996
+ pluginOptions;
21997
+ pastedData;
21998
+ constructor(pluginOptions) {
21999
+ this.pluginOptions = pluginOptions;
22000
+ }
22001
+ run(...args) {
22002
+ const runtime = args[1];
22003
+ const table = args[2];
22004
+ this.table = table;
22005
+ if (runtime === VTable__namespace.TABLE_EVENT_TYPE.PASTED_DATA) {
22006
+ this.pastedData = args[0];
22007
+ this.handlePaste();
22008
+ }
22009
+ }
22010
+ handlePaste() {
22011
+ const { pasteData, row, col } = this.pastedData;
22012
+ const rowCount = this.table.rowCount;
22013
+ const colCount = this.table.colCount;
22014
+ const pastedRowCount = pasteData.length;
22015
+ const pastedColCount = pasteData[0]?.length || 0;
22016
+ const rowsNeeded = row + pastedRowCount - rowCount;
22017
+ const colsNeeded = col + pastedColCount - colCount;
22018
+ if (rowsNeeded > 0) {
22019
+ for (let i = 0; i < rowsNeeded; i++) {
22020
+ if (this.pluginOptions?.addRowCallback) {
22021
+ this.pluginOptions.addRowCallback(rowCount + i, this.table);
22022
+ }
22023
+ else {
22024
+ this.table.addRecord([]);
22025
+ }
22026
+ }
22027
+ }
22028
+ if (colsNeeded > 0) {
22029
+ for (let i = 0; i < colsNeeded; i++) {
22030
+ const newColIndex = colCount + i;
22031
+ if (this.pluginOptions?.addColumnCallback) {
22032
+ this.pluginOptions.addColumnCallback(newColIndex, this.table);
22033
+ }
22034
+ else {
22035
+ this.table.addColumn({
22036
+ field: `field_${newColIndex}`,
22037
+ title: `New Column ${newColIndex}`,
22038
+ width: 100
22039
+ });
22040
+ }
22041
+ }
22042
+ }
22043
+ this.table.changeCellValues(col, row, pasteData, true);
22044
+ }
22045
+ release() {
22046
+ this.table.internalProps.handler.clear();
22047
+ }
22048
+ }
22049
+
21986
22050
  /*
21987
22051
  * big.js v6.2.2
21988
22052
  * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
@@ -101161,6 +101225,7 @@ ${recordsStr}
101161
101225
  exports.HeaderHighlightPlugin = HeaderHighlightPlugin;
101162
101226
  exports.HighlightHeaderWhenSelectCellPlugin = HighlightHeaderWhenSelectCellPlugin;
101163
101227
  exports.InvertHighlightPlugin = InvertHighlightPlugin;
101228
+ exports.PasteAddRowColumnPlugin = PasteAddRowColumnPlugin;
101164
101229
  exports.RotateTablePlugin = RotateTablePlugin;
101165
101230
  exports.RowSeriesPlugin = RowSeriesPlugin;
101166
101231
  exports.TableCarouselAnimationPlugin = TableCarouselAnimationPlugin;