@visactor/vtable-plugins 1.20.0-alpha.1 → 1.20.0-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.
- package/cjs/add-row-column.js +3 -3
- package/cjs/add-row-column.js.map +1 -1
- package/cjs/contextmenu/types.js +1 -2
- package/cjs/filter/filter-state-manager.js +2 -1
- package/cjs/gantt-export-image.d.ts +2 -2
- package/cjs/gantt-export-image.js +3 -26
- package/cjs/gantt-export-image.js.map +1 -1
- package/cjs/table-export/excel/index.js +0 -1
- package/cjs/table-export/excel/style.js +1 -0
- package/dist/vtable-plugins.js +116 -8214
- package/dist/vtable-plugins.min.js +14 -14
- package/es/add-row-column.js +3 -3
- package/es/add-row-column.js.map +1 -1
- package/es/contextmenu/types.js +1 -2
- package/es/filter/filter-state-manager.js +2 -1
- package/es/gantt-export-image.d.ts +2 -2
- package/es/gantt-export-image.js +2 -2
- package/es/gantt-export-image.js.map +1 -1
- package/es/table-export/excel/index.js +1 -2
- package/es/table-export/excel/style.js +2 -1
- package/package.json +11 -5
package/cjs/add-row-column.js
CHANGED
|
@@ -151,9 +151,9 @@ class AddRowColumnPlugin {
|
|
|
151
151
|
this.addIconForAddRow.style.height = "18px", this.addIconForAddRow.style.backgroundColor = "#4A90E2",
|
|
152
152
|
this.addIconForAddRow.style.position = "absolute", this.addIconForAddRow.style.zIndex = "1001",
|
|
153
153
|
this.addIconForAddRow.style.display = "none", this.addIconForAddRow.style.borderRadius = "50%",
|
|
154
|
-
this.addIconForAddRow.style.boxShadow = "0 2px 5px rgba(0,0,0,0.2)", this.addIconForAddRow.style.
|
|
155
|
-
this.addIconForAddRow.style.
|
|
156
|
-
|
|
154
|
+
this.addIconForAddRow.style.boxShadow = "0 2px 5px rgba(0,0,0,0.2)", this.addIconForAddRow.style.justifyContent = "center",
|
|
155
|
+
this.addIconForAddRow.style.alignItems = "center", this.addIconForAddRow.style.border = "1px solid white",
|
|
156
|
+
document.body.appendChild(this.addIconForAddRow);
|
|
157
157
|
const addIconText = document.createElement("div");
|
|
158
158
|
addIconText.textContent = "+", addIconText.style.color = "white", addIconText.style.fontSize = "18px",
|
|
159
159
|
addIconText.style.fontWeight = "bold", addIconText.style.lineHeight = "15px", addIconText.style.userSelect = "none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/add-row-column.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AA6B3C,MAAa,kBAAkB;IAsB7B,YACE,gBAAqC;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;KACnB;;QAzBH,OAAE,GAAG,gBAAgB,CAAC;QACtB,SAAI,GAAG,gBAAgB,CAAC;QACxB,YAAO,GAAG;YACR,MAAM,CAAC,gBAAgB,CAAC,eAAe;YACvC,MAAM,CAAC,gBAAgB,CAAC,eAAe;YACvC,MAAM,CAAC,gBAAgB,CAAC,gBAAgB;SACzC,CAAC;QAqBA,IAAI,CAAC,EAAE,GAAG,MAAA,aAAa,CAAC,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,CAAC,eAAe,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,eAAe,mCAAI,IAAI,CAAC;QAChF,IAAI,CAAC,aAAa,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,YAAY,mCAAI,IAAI,CAAC;QAC1E,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE;YACtC,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAC/B,IAAI,CAAC,qBAAqB,EAAE,CAAC;SAC9B;QACD,IAAI,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;IACH,CAAC;IACD,GAAG,CAAC,GA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GAAG,IAAI,IAAI,CAAC;QAC/C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;QAC7C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,KAAK,IAAI,CAAC;QACjD,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;IAChD,CAAC;IACD,qBAAqB,CAAC,QAAgB,IAAI;QACxC,IAAI,CAAC,uBAAuB,GAAG,UAAU,CAAC,GAAG,EAAE;YAC7C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;YAC7C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;YAC5C,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QACjD,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;IAED,OAAO;QACL,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;CACF;AAhbD,gDAgbC","file":"add-row-column.js","sourcesContent":["import * as VTable from '@visactor/vtable';\n/**\n * 添加行和列的插件的配置选项\n */\nexport interface AddRowColumnOptions {\n id?: string;\n /**\n * 是否启用添加列\n */\n addColumnEnable?: boolean;\n /**\n * 是否启用添加行\n */\n addRowEnable?: boolean;\n /**\n * 添加列的回调函数\n */\n addColumnCallback?: (col: number, table: VTable.ListTable) => void;\n /**\n * 添加行的回调函数\n */\n addRowCallback?: (row: number, table: VTable.ListTable) => void;\n}\n/**\n * 添加行和列的插件\n * 该插件监听了table的MOUSEENTER_CELL,MOUSELEAVE_CELL,MOUSELEAVE_TABLE事件\n * 当鼠标hover到table的cell时,会显示添加行和列的dot和加号\n * 当鼠标离开table的cell时,会隐藏添加行和列的dot和加号\n */\nexport class AddRowColumnPlugin implements VTable.plugins.IVTablePlugin {\n id = `add-row-column`;\n name = 'Add Row Column';\n runTime = [\n VTable.TABLE_EVENT_TYPE.MOUSEENTER_CELL,\n VTable.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,\n VTable.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE\n ];\n pluginOptions: AddRowColumnOptions;\n table: VTable.ListTable;\n hoverCell: VTable.TYPES.CellAddressWithBound;\n hideAllTimeoutId_addColumn: NodeJS.Timeout;\n hideAllTimeoutId_addRow: NodeJS.Timeout;\n leftDotForAddColumn: HTMLElement;\n rightDotForAddColumn: HTMLElement;\n addIconForAddColumn: HTMLElement;\n addLineForAddColumn: HTMLElement;\n topDotForAddRow: HTMLElement;\n bottomDotForAddRow: HTMLElement;\n addIconForAddRow: HTMLElement;\n addLineForAddRow: HTMLElement;\n\n constructor(\n pluginOptions: AddRowColumnOptions = {\n addColumnEnable: true,\n addRowEnable: true\n }\n ) {\n this.id = pluginOptions.id ?? this.id;\n this.pluginOptions = pluginOptions;\n this.pluginOptions.addColumnEnable = this.pluginOptions.addColumnEnable ?? true;\n this.pluginOptions.addRowEnable = this.pluginOptions.addRowEnable ?? true;\n if (this.pluginOptions.addColumnEnable) {\n this.initAddColumnDomElement();\n this.bindEventForAddColumn();\n }\n if (this.pluginOptions.addRowEnable) {\n this.initAddRowDomElement();\n this.bindEventForAddRow();\n }\n }\n run(...args: any[]) {\n const eventArgs = args[0];\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.MOUSEENTER_CELL) {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n clearTimeout(this.hideAllTimeoutId_addRow);\n const canvasBounds = table.canvas.getBoundingClientRect();\n const cell = table.getCellAtRelativePosition(\n eventArgs.event.clientX - canvasBounds.left,\n eventArgs.event.clientY - canvasBounds.top\n );\n this.hoverCell = cell;\n const cellRect = table.getCellRelativeRect(cell.col, cell.row);\n if (this.pluginOptions.addColumnEnable) {\n const isRowSerierNumberCol = table.isSeriesNumber(cell.col, 0);\n this.showDotForAddColumn(\n canvasBounds.top - 6,\n cellRect.left + canvasBounds.left,\n cellRect.right + canvasBounds.left,\n !isRowSerierNumberCol\n );\n }\n if (this.pluginOptions.addRowEnable) {\n const isHeader = table.isHeader(cell.col, cell.row);\n this.showDotForAddRow(\n cellRect.top + canvasBounds.top,\n canvasBounds.left - 6,\n cellRect.bottom + canvasBounds.top,\n !isHeader,\n !isHeader\n );\n }\n } else if (runTime === VTable.TABLE_EVENT_TYPE.MOUSELEAVE_CELL) {\n } else if (runTime === VTable.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE) {\n if (this.pluginOptions.addColumnEnable) {\n this.delayHideAllForAddColumn();\n }\n if (this.pluginOptions.addRowEnable) {\n this.delayHideAllForAddRow();\n }\n }\n }\n // #region 添加列\n initAddColumnDomElement() {\n //创建一个div 作为hoverCell的顶部左侧的圆点\n this.leftDotForAddColumn = document.createElement('div');\n this.leftDotForAddColumn.style.width = '6px';\n this.leftDotForAddColumn.style.height = '6px';\n this.leftDotForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.leftDotForAddColumn.style.position = 'absolute';\n this.leftDotForAddColumn.style.cursor = 'pointer';\n this.leftDotForAddColumn.style.zIndex = '1000';\n this.leftDotForAddColumn.style.borderRadius = '50%';\n this.leftDotForAddColumn.style.border = '1px solid white';\n this.leftDotForAddColumn.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.leftDotForAddColumn);\n\n //创建一个div 作为hoverCell的顶部右侧的圆点\n this.rightDotForAddColumn = document.createElement('div');\n this.rightDotForAddColumn.style.width = '6px';\n this.rightDotForAddColumn.style.height = '6px';\n this.rightDotForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.rightDotForAddColumn.style.position = 'absolute';\n this.rightDotForAddColumn.style.cursor = 'pointer';\n this.rightDotForAddColumn.style.zIndex = '1000';\n this.rightDotForAddColumn.style.borderRadius = '50%';\n this.rightDotForAddColumn.style.border = '1px solid white';\n this.rightDotForAddColumn.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.rightDotForAddColumn);\n\n //创建+加号 当鼠标hover到圆点上时,显示+加号\n this.addIconForAddColumn = document.createElement('div');\n this.addIconForAddColumn.style.width = '18px';\n this.addIconForAddColumn.style.height = '18px';\n this.addIconForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addIconForAddColumn.style.position = 'absolute';\n this.addIconForAddColumn.style.zIndex = '1001';\n this.addIconForAddColumn.style.display = 'none';\n this.addIconForAddColumn.style.borderRadius = '50%';\n this.addIconForAddColumn.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)';\n this.addIconForAddColumn.style.display = 'flex';\n this.addIconForAddColumn.style.justifyContent = 'center';\n this.addIconForAddColumn.style.alignItems = 'center';\n this.addIconForAddColumn.style.border = '1px solid white';\n document.body.appendChild(this.addIconForAddColumn);\n\n //addIcon中添加一个+号\n const addIconText = document.createElement('div');\n addIconText.textContent = '+';\n addIconText.style.color = 'white';\n addIconText.style.fontSize = '18px';\n addIconText.style.fontWeight = 'bold';\n addIconText.style.lineHeight = '15px';\n addIconText.style.userSelect = 'none';\n addIconText.style.cursor = 'pointer';\n addIconText.style.verticalAlign = 'top';\n addIconText.style.textAlign = 'center';\n\n this.addIconForAddColumn.appendChild(addIconText);\n\n // 创建加号下面列间隔线\n this.addLineForAddColumn = document.createElement('div');\n this.addLineForAddColumn.style.width = '2px';\n this.addLineForAddColumn.style.height = '10px';\n this.addLineForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addLineForAddColumn.style.position = 'absolute';\n this.addLineForAddColumn.style.zIndex = '1001';\n this.addLineForAddColumn.style.display = 'none';\n document.body.appendChild(this.addLineForAddColumn);\n }\n bindEventForAddColumn() {\n this.leftDotForAddColumn.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n this.addIconForAddColumn.style.display = 'block';\n const dotWidth = this.leftDotForAddColumn.offsetWidth;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.showAddIconForAddColumn(\n this.leftDotForAddColumn.offsetLeft + dotWidth / 2,\n this.leftDotForAddColumn.offsetTop + dotHeight / 2,\n true\n );\n this.showSplitLineForAddColumn(\n this.leftDotForAddColumn.offsetLeft + dotWidth / 2 - 1,\n this.leftDotForAddColumn.offsetTop + dotHeight / 2 + 2,\n this.table.getDrawRange().height\n );\n });\n\n this.rightDotForAddColumn.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n this.addIconForAddColumn.style.display = 'block';\n const dotWidth = this.rightDotForAddColumn.offsetWidth;\n const dotHeight = this.rightDotForAddColumn.offsetHeight;\n this.showAddIconForAddColumn(\n this.rightDotForAddColumn.offsetLeft + dotWidth / 2,\n this.rightDotForAddColumn.offsetTop + dotHeight / 2,\n false\n );\n this.showSplitLineForAddColumn(\n this.rightDotForAddColumn.offsetLeft + dotWidth / 2 - 1,\n this.rightDotForAddColumn.offsetTop + dotHeight / 2 + 2,\n this.table.getDrawRange().height\n );\n });\n\n // this.addIconForAddColumn.addEventListener('mouseenter', () => {\n // clearTimeout(this.hideAllTimeoutId_addColumn);\n // });\n this.addIconForAddColumn.addEventListener('mouseleave', () => {\n this.addIconForAddColumn.style.display = 'none';\n this.addLineForAddColumn.style.display = 'none';\n this.delayHideAllForAddColumn();\n });\n\n this.addIconForAddColumn.addEventListener('click', (e: MouseEvent) => {\n const isLeft = this.addIconForAddColumn.dataset.addIconType === 'left';\n const columns = this.table.options.columns;\n const col = this.hoverCell.col;\n const addColIndex = isLeft ? col : col + 1;\n if (this.pluginOptions.addColumnCallback) {\n this.pluginOptions.addColumnCallback(addColIndex, this.table);\n } else {\n columns.splice(addColIndex, 0, {\n field: ``,\n title: `New Column ${col}`,\n width: 100\n });\n this.table.updateColumns(columns);\n }\n this.delayHideAllForAddColumn(0);\n });\n }\n showDotForAddColumn(\n top: number,\n left: number,\n right: number,\n isShowLeft: boolean = true,\n isShowRight: boolean = true\n ) {\n // 动态获取元素尺寸\n const dotWidth = this.leftDotForAddColumn.offsetWidth;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.leftDotForAddColumn.style.left = `${left - dotWidth / 2}px`;\n this.leftDotForAddColumn.style.top = `${top - dotHeight / 2}px`;\n this.rightDotForAddColumn.style.left = `${right - dotWidth / 2}px`;\n this.rightDotForAddColumn.style.top = `${top - dotHeight / 2}px`;\n this.leftDotForAddColumn.style.display = isShowLeft ? 'block' : 'none';\n this.rightDotForAddColumn.style.display = isShowRight ? 'block' : 'none';\n }\n showAddIconForAddColumn(left: number, top: number, isLeft: boolean) {\n // 动态获取元素尺寸\n const iconWidth = this.addIconForAddColumn.offsetWidth;\n const iconHeight = this.addIconForAddColumn.offsetHeight;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.addIconForAddColumn.style.left = `${left - iconWidth / 2}px`;\n this.addIconForAddColumn.style.top = `${top - iconHeight / 2 - dotHeight / 2}px`;\n if (isLeft) {\n this.addIconForAddColumn.dataset.addIconType = 'left';\n } else {\n this.addIconForAddColumn.dataset.addIconType = 'right';\n }\n }\n showSplitLineForAddColumn(left: number, top: number, height: number) {\n this.addLineForAddColumn.style.left = `${left}px`;\n this.addLineForAddColumn.style.top = `${top}px`;\n this.addLineForAddColumn.style.height = `${height}px`;\n this.addLineForAddColumn.style.display = 'block';\n }\n delayHideAllForAddColumn(delay: number = 1000) {\n this.hideAllTimeoutId_addColumn = setTimeout(() => {\n this.addIconForAddColumn.style.display = 'none';\n this.addLineForAddColumn.style.display = 'none';\n this.leftDotForAddColumn.style.display = 'none';\n this.rightDotForAddColumn.style.display = 'none';\n }, delay);\n }\n // #endregion\n\n // #region 添加行\n initAddRowDomElement() {\n //创建一个div 作为hoverCell的顶部左侧的圆点\n this.topDotForAddRow = document.createElement('div');\n this.topDotForAddRow.style.width = '6px';\n this.topDotForAddRow.style.height = '6px';\n this.topDotForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.topDotForAddRow.style.position = 'absolute';\n this.topDotForAddRow.style.cursor = 'pointer';\n this.topDotForAddRow.style.zIndex = '1000';\n this.topDotForAddRow.style.borderRadius = '50%';\n this.topDotForAddRow.style.border = '1px solid white';\n this.topDotForAddRow.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.topDotForAddRow);\n\n //创建一个div 作为hoverCell的底部右侧的圆点\n this.bottomDotForAddRow = document.createElement('div');\n this.bottomDotForAddRow.style.width = '6px';\n this.bottomDotForAddRow.style.height = '6px';\n this.bottomDotForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.bottomDotForAddRow.style.position = 'absolute';\n this.bottomDotForAddRow.style.cursor = 'pointer';\n this.bottomDotForAddRow.style.zIndex = '1000';\n this.bottomDotForAddRow.style.borderRadius = '50%';\n this.bottomDotForAddRow.style.border = '1px solid white';\n this.bottomDotForAddRow.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.bottomDotForAddRow);\n\n //创建+加号 当鼠标hover到圆点上时,显示+加号\n this.addIconForAddRow = document.createElement('div');\n this.addIconForAddRow.style.width = '18px';\n this.addIconForAddRow.style.height = '18px';\n this.addIconForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addIconForAddRow.style.position = 'absolute';\n this.addIconForAddRow.style.zIndex = '1001';\n this.addIconForAddRow.style.display = 'none';\n this.addIconForAddRow.style.borderRadius = '50%';\n this.addIconForAddRow.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)';\n this.addIconForAddRow.style.display = 'flex';\n this.addIconForAddRow.style.justifyContent = 'center';\n this.addIconForAddRow.style.alignItems = 'center';\n this.addIconForAddRow.style.border = '1px solid white';\n document.body.appendChild(this.addIconForAddRow);\n\n //addIcon中添加一个+号\n const addIconText = document.createElement('div');\n addIconText.textContent = '+';\n addIconText.style.color = 'white';\n addIconText.style.fontSize = '18px';\n addIconText.style.fontWeight = 'bold';\n addIconText.style.lineHeight = '15px';\n addIconText.style.userSelect = 'none';\n addIconText.style.cursor = 'pointer';\n addIconText.style.verticalAlign = 'top';\n addIconText.style.textAlign = 'center';\n\n this.addIconForAddRow.appendChild(addIconText);\n\n // 创建加号下面行间隔线\n this.addLineForAddRow = document.createElement('div');\n this.addLineForAddRow.style.width = '10px';\n this.addLineForAddRow.style.height = '2px';\n this.addLineForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addLineForAddRow.style.position = 'absolute';\n this.addLineForAddRow.style.zIndex = '1001';\n this.addLineForAddRow.style.display = 'none';\n document.body.appendChild(this.addLineForAddRow);\n }\n bindEventForAddRow() {\n this.topDotForAddRow.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addRow);\n this.addIconForAddRow.style.display = 'block';\n const dotWidth = this.topDotForAddRow.offsetWidth;\n const dotHeight = this.topDotForAddRow.offsetHeight;\n this.showAddIconForAddRow(\n this.topDotForAddRow.offsetLeft + dotWidth / 2,\n this.topDotForAddRow.offsetTop + dotHeight / 2,\n true\n );\n this.showSplitLineForAddRow(\n this.topDotForAddRow.offsetLeft + dotWidth + 2,\n this.topDotForAddRow.offsetTop + dotHeight / 2 - 1,\n this.table.getDrawRange().width\n );\n });\n\n this.bottomDotForAddRow.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addRow);\n this.addIconForAddRow.style.display = 'block';\n const dotWidth = this.bottomDotForAddRow.offsetWidth;\n const dotHeight = this.bottomDotForAddRow.offsetHeight;\n this.showAddIconForAddRow(\n this.bottomDotForAddRow.offsetLeft + dotWidth / 2,\n this.bottomDotForAddRow.offsetTop + dotHeight / 2,\n false\n );\n this.showSplitLineForAddRow(\n this.bottomDotForAddRow.offsetLeft + dotWidth + 2,\n this.bottomDotForAddRow.offsetTop + dotHeight / 2 - 1,\n this.table.getDrawRange().height\n );\n });\n\n this.addIconForAddRow.addEventListener('mouseleave', () => {\n this.addIconForAddRow.style.display = 'none';\n this.addLineForAddRow.style.display = 'none';\n this.delayHideAllForAddRow();\n });\n\n this.addIconForAddRow.addEventListener('click', (e: MouseEvent) => {\n const isTop = this.addIconForAddRow.dataset.addIconType === 'top';\n const row = this.hoverCell.row;\n const addRowIndex = isTop ? row : row + 1;\n if (this.pluginOptions.addRowCallback) {\n this.pluginOptions.addRowCallback(addRowIndex, this.table as VTable.ListTable);\n } else {\n const recordIndex = this.table.getRecordIndexByCell(0, addRowIndex);\n this.table.addRecord({}, recordIndex);\n }\n this.delayHideAllForAddRow(0);\n });\n }\n showDotForAddRow(top: number, left: number, bottom: number, isShowTop: boolean = true, isShowBottom: boolean = true) {\n // 动态获取元素尺寸\n const dotWidth = this.topDotForAddRow.offsetWidth;\n const dotHeight = this.topDotForAddRow.offsetHeight;\n this.topDotForAddRow.style.left = `${left - dotWidth / 2}px`;\n this.topDotForAddRow.style.top = `${top - dotHeight / 2}px`;\n this.bottomDotForAddRow.style.left = `${left - dotWidth / 2}px`;\n this.bottomDotForAddRow.style.top = `${bottom - dotHeight / 2}px`;\n this.topDotForAddRow.style.display = isShowTop ? 'block' : 'none';\n this.bottomDotForAddRow.style.display = isShowBottom ? 'block' : 'none';\n }\n showAddIconForAddRow(left: number, top: number, isTop: boolean) {\n // 动态获取元素尺寸\n const iconWidth = this.addIconForAddRow.offsetWidth;\n const iconHeight = this.addIconForAddRow.offsetHeight;\n const dotWidth = this.topDotForAddRow.offsetWidth;\n this.addIconForAddRow.style.left = `${left - iconWidth / 2 - dotWidth / 2}px`;\n this.addIconForAddRow.style.top = `${top - iconHeight / 2}px`;\n if (isTop) {\n this.addIconForAddRow.dataset.addIconType = 'top';\n } else {\n this.addIconForAddRow.dataset.addIconType = 'bottom';\n }\n }\n showSplitLineForAddRow(left: number, top: number, width: number) {\n this.addLineForAddRow.style.left = `${left}px`;\n this.addLineForAddRow.style.top = `${top}px`;\n this.addLineForAddRow.style.width = `${width}px`;\n this.addLineForAddRow.style.display = 'block';\n }\n delayHideAllForAddRow(delay: number = 1000) {\n this.hideAllTimeoutId_addRow = setTimeout(() => {\n this.addIconForAddRow.style.display = 'none';\n this.addLineForAddRow.style.display = 'none';\n this.topDotForAddRow.style.display = 'none';\n this.bottomDotForAddRow.style.display = 'none';\n }, delay);\n }\n // #endregion\n release() {\n this.leftDotForAddColumn.remove();\n this.rightDotForAddColumn.remove();\n this.addIconForAddColumn.remove();\n this.addLineForAddColumn.remove();\n this.topDotForAddRow.remove();\n this.bottomDotForAddRow.remove();\n this.addIconForAddRow.remove();\n this.addLineForAddRow.remove();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/add-row-column.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AA6B3C,MAAa,kBAAkB;IAsB7B,YACE,gBAAqC;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;KACnB;;QAzBH,OAAE,GAAG,gBAAgB,CAAC;QACtB,SAAI,GAAG,gBAAgB,CAAC;QACxB,YAAO,GAAG;YACR,MAAM,CAAC,gBAAgB,CAAC,eAAe;YACvC,MAAM,CAAC,gBAAgB,CAAC,eAAe;YACvC,MAAM,CAAC,gBAAgB,CAAC,gBAAgB;SACzC,CAAC;QAqBA,IAAI,CAAC,EAAE,GAAG,MAAA,aAAa,CAAC,EAA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E,CAAC;QAClC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;CACF;AA/aD,gDA+aC","file":"add-row-column.js","sourcesContent":["import * as VTable from '@visactor/vtable';\n/**\n * 添加行和列的插件的配置选项\n */\nexport interface AddRowColumnOptions {\n id?: string;\n /**\n * 是否启用添加列\n */\n addColumnEnable?: boolean;\n /**\n * 是否启用添加行\n */\n addRowEnable?: boolean;\n /**\n * 添加列的回调函数\n */\n addColumnCallback?: (col: number, table: VTable.ListTable) => void;\n /**\n * 添加行的回调函数\n */\n addRowCallback?: (row: number, table: VTable.ListTable) => void;\n}\n/**\n * 添加行和列的插件\n * 该插件监听了table的MOUSEENTER_CELL,MOUSELEAVE_CELL,MOUSELEAVE_TABLE事件\n * 当鼠标hover到table的cell时,会显示添加行和列的dot和加号\n * 当鼠标离开table的cell时,会隐藏添加行和列的dot和加号\n */\nexport class AddRowColumnPlugin implements VTable.plugins.IVTablePlugin {\n id = `add-row-column`;\n name = 'Add Row Column';\n runTime = [\n VTable.TABLE_EVENT_TYPE.MOUSEENTER_CELL,\n VTable.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,\n VTable.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE\n ];\n pluginOptions: AddRowColumnOptions;\n table: VTable.ListTable;\n hoverCell: VTable.TYPES.CellAddressWithBound;\n hideAllTimeoutId_addColumn: NodeJS.Timeout;\n hideAllTimeoutId_addRow: NodeJS.Timeout;\n leftDotForAddColumn: HTMLElement;\n rightDotForAddColumn: HTMLElement;\n addIconForAddColumn: HTMLElement;\n addLineForAddColumn: HTMLElement;\n topDotForAddRow: HTMLElement;\n bottomDotForAddRow: HTMLElement;\n addIconForAddRow: HTMLElement;\n addLineForAddRow: HTMLElement;\n\n constructor(\n pluginOptions: AddRowColumnOptions = {\n addColumnEnable: true,\n addRowEnable: true\n }\n ) {\n this.id = pluginOptions.id ?? this.id;\n this.pluginOptions = pluginOptions;\n this.pluginOptions.addColumnEnable = this.pluginOptions.addColumnEnable ?? true;\n this.pluginOptions.addRowEnable = this.pluginOptions.addRowEnable ?? true;\n if (this.pluginOptions.addColumnEnable) {\n this.initAddColumnDomElement();\n this.bindEventForAddColumn();\n }\n if (this.pluginOptions.addRowEnable) {\n this.initAddRowDomElement();\n this.bindEventForAddRow();\n }\n }\n run(...args: any[]) {\n const eventArgs = args[0];\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.MOUSEENTER_CELL) {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n clearTimeout(this.hideAllTimeoutId_addRow);\n const canvasBounds = table.canvas.getBoundingClientRect();\n const cell = table.getCellAtRelativePosition(\n eventArgs.event.clientX - canvasBounds.left,\n eventArgs.event.clientY - canvasBounds.top\n );\n this.hoverCell = cell;\n const cellRect = table.getCellRelativeRect(cell.col, cell.row);\n if (this.pluginOptions.addColumnEnable) {\n const isRowSerierNumberCol = table.isSeriesNumber(cell.col, 0);\n this.showDotForAddColumn(\n canvasBounds.top - 6,\n cellRect.left + canvasBounds.left,\n cellRect.right + canvasBounds.left,\n !isRowSerierNumberCol\n );\n }\n if (this.pluginOptions.addRowEnable) {\n const isHeader = table.isHeader(cell.col, cell.row);\n this.showDotForAddRow(\n cellRect.top + canvasBounds.top,\n canvasBounds.left - 6,\n cellRect.bottom + canvasBounds.top,\n !isHeader,\n !isHeader\n );\n }\n } else if (runTime === VTable.TABLE_EVENT_TYPE.MOUSELEAVE_CELL) {\n } else if (runTime === VTable.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE) {\n if (this.pluginOptions.addColumnEnable) {\n this.delayHideAllForAddColumn();\n }\n if (this.pluginOptions.addRowEnable) {\n this.delayHideAllForAddRow();\n }\n }\n }\n // #region 添加列\n initAddColumnDomElement() {\n //创建一个div 作为hoverCell的顶部左侧的圆点\n this.leftDotForAddColumn = document.createElement('div');\n this.leftDotForAddColumn.style.width = '6px';\n this.leftDotForAddColumn.style.height = '6px';\n this.leftDotForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.leftDotForAddColumn.style.position = 'absolute';\n this.leftDotForAddColumn.style.cursor = 'pointer';\n this.leftDotForAddColumn.style.zIndex = '1000';\n this.leftDotForAddColumn.style.borderRadius = '50%';\n this.leftDotForAddColumn.style.border = '1px solid white';\n this.leftDotForAddColumn.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.leftDotForAddColumn);\n\n //创建一个div 作为hoverCell的顶部右侧的圆点\n this.rightDotForAddColumn = document.createElement('div');\n this.rightDotForAddColumn.style.width = '6px';\n this.rightDotForAddColumn.style.height = '6px';\n this.rightDotForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.rightDotForAddColumn.style.position = 'absolute';\n this.rightDotForAddColumn.style.cursor = 'pointer';\n this.rightDotForAddColumn.style.zIndex = '1000';\n this.rightDotForAddColumn.style.borderRadius = '50%';\n this.rightDotForAddColumn.style.border = '1px solid white';\n this.rightDotForAddColumn.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.rightDotForAddColumn);\n\n //创建+加号 当鼠标hover到圆点上时,显示+加号\n this.addIconForAddColumn = document.createElement('div');\n this.addIconForAddColumn.style.width = '18px';\n this.addIconForAddColumn.style.height = '18px';\n this.addIconForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addIconForAddColumn.style.position = 'absolute';\n this.addIconForAddColumn.style.zIndex = '1001';\n this.addIconForAddColumn.style.display = 'none';\n this.addIconForAddColumn.style.borderRadius = '50%';\n this.addIconForAddColumn.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)';\n this.addIconForAddColumn.style.display = 'flex';\n this.addIconForAddColumn.style.justifyContent = 'center';\n this.addIconForAddColumn.style.alignItems = 'center';\n this.addIconForAddColumn.style.border = '1px solid white';\n document.body.appendChild(this.addIconForAddColumn);\n\n //addIcon中添加一个+号\n const addIconText = document.createElement('div');\n addIconText.textContent = '+';\n addIconText.style.color = 'white';\n addIconText.style.fontSize = '18px';\n addIconText.style.fontWeight = 'bold';\n addIconText.style.lineHeight = '15px';\n addIconText.style.userSelect = 'none';\n addIconText.style.cursor = 'pointer';\n addIconText.style.verticalAlign = 'top';\n addIconText.style.textAlign = 'center';\n\n this.addIconForAddColumn.appendChild(addIconText);\n\n // 创建加号下面列间隔线\n this.addLineForAddColumn = document.createElement('div');\n this.addLineForAddColumn.style.width = '2px';\n this.addLineForAddColumn.style.height = '10px';\n this.addLineForAddColumn.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addLineForAddColumn.style.position = 'absolute';\n this.addLineForAddColumn.style.zIndex = '1001';\n this.addLineForAddColumn.style.display = 'none';\n document.body.appendChild(this.addLineForAddColumn);\n }\n bindEventForAddColumn() {\n this.leftDotForAddColumn.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n this.addIconForAddColumn.style.display = 'block';\n const dotWidth = this.leftDotForAddColumn.offsetWidth;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.showAddIconForAddColumn(\n this.leftDotForAddColumn.offsetLeft + dotWidth / 2,\n this.leftDotForAddColumn.offsetTop + dotHeight / 2,\n true\n );\n this.showSplitLineForAddColumn(\n this.leftDotForAddColumn.offsetLeft + dotWidth / 2 - 1,\n this.leftDotForAddColumn.offsetTop + dotHeight / 2 + 2,\n this.table.getDrawRange().height\n );\n });\n\n this.rightDotForAddColumn.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addColumn);\n this.addIconForAddColumn.style.display = 'block';\n const dotWidth = this.rightDotForAddColumn.offsetWidth;\n const dotHeight = this.rightDotForAddColumn.offsetHeight;\n this.showAddIconForAddColumn(\n this.rightDotForAddColumn.offsetLeft + dotWidth / 2,\n this.rightDotForAddColumn.offsetTop + dotHeight / 2,\n false\n );\n this.showSplitLineForAddColumn(\n this.rightDotForAddColumn.offsetLeft + dotWidth / 2 - 1,\n this.rightDotForAddColumn.offsetTop + dotHeight / 2 + 2,\n this.table.getDrawRange().height\n );\n });\n\n // this.addIconForAddColumn.addEventListener('mouseenter', () => {\n // clearTimeout(this.hideAllTimeoutId_addColumn);\n // });\n this.addIconForAddColumn.addEventListener('mouseleave', () => {\n this.addIconForAddColumn.style.display = 'none';\n this.addLineForAddColumn.style.display = 'none';\n this.delayHideAllForAddColumn();\n });\n\n this.addIconForAddColumn.addEventListener('click', (e: MouseEvent) => {\n const isLeft = this.addIconForAddColumn.dataset.addIconType === 'left';\n const columns = this.table.options.columns;\n const col = this.hoverCell.col;\n const addColIndex = isLeft ? col : col + 1;\n if (this.pluginOptions.addColumnCallback) {\n this.pluginOptions.addColumnCallback(addColIndex, this.table);\n } else {\n columns.splice(addColIndex, 0, {\n field: ``,\n title: `New Column ${col}`,\n width: 100\n });\n this.table.updateColumns(columns);\n }\n this.delayHideAllForAddColumn(0);\n });\n }\n showDotForAddColumn(\n top: number,\n left: number,\n right: number,\n isShowLeft: boolean = true,\n isShowRight: boolean = true\n ) {\n // 动态获取元素尺寸\n const dotWidth = this.leftDotForAddColumn.offsetWidth;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.leftDotForAddColumn.style.left = `${left - dotWidth / 2}px`;\n this.leftDotForAddColumn.style.top = `${top - dotHeight / 2}px`;\n this.rightDotForAddColumn.style.left = `${right - dotWidth / 2}px`;\n this.rightDotForAddColumn.style.top = `${top - dotHeight / 2}px`;\n this.leftDotForAddColumn.style.display = isShowLeft ? 'block' : 'none';\n this.rightDotForAddColumn.style.display = isShowRight ? 'block' : 'none';\n }\n showAddIconForAddColumn(left: number, top: number, isLeft: boolean) {\n // 动态获取元素尺寸\n const iconWidth = this.addIconForAddColumn.offsetWidth;\n const iconHeight = this.addIconForAddColumn.offsetHeight;\n const dotHeight = this.leftDotForAddColumn.offsetHeight;\n this.addIconForAddColumn.style.left = `${left - iconWidth / 2}px`;\n this.addIconForAddColumn.style.top = `${top - iconHeight / 2 - dotHeight / 2}px`;\n if (isLeft) {\n this.addIconForAddColumn.dataset.addIconType = 'left';\n } else {\n this.addIconForAddColumn.dataset.addIconType = 'right';\n }\n }\n showSplitLineForAddColumn(left: number, top: number, height: number) {\n this.addLineForAddColumn.style.left = `${left}px`;\n this.addLineForAddColumn.style.top = `${top}px`;\n this.addLineForAddColumn.style.height = `${height}px`;\n this.addLineForAddColumn.style.display = 'block';\n }\n delayHideAllForAddColumn(delay: number = 1000) {\n this.hideAllTimeoutId_addColumn = setTimeout(() => {\n this.addIconForAddColumn.style.display = 'none';\n this.addLineForAddColumn.style.display = 'none';\n this.leftDotForAddColumn.style.display = 'none';\n this.rightDotForAddColumn.style.display = 'none';\n }, delay);\n }\n // #endregion\n\n // #region 添加行\n initAddRowDomElement() {\n //创建一个div 作为hoverCell的顶部左侧的圆点\n this.topDotForAddRow = document.createElement('div');\n this.topDotForAddRow.style.width = '6px';\n this.topDotForAddRow.style.height = '6px';\n this.topDotForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.topDotForAddRow.style.position = 'absolute';\n this.topDotForAddRow.style.cursor = 'pointer';\n this.topDotForAddRow.style.zIndex = '1000';\n this.topDotForAddRow.style.borderRadius = '50%';\n this.topDotForAddRow.style.border = '1px solid white';\n this.topDotForAddRow.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.topDotForAddRow);\n\n //创建一个div 作为hoverCell的底部右侧的圆点\n this.bottomDotForAddRow = document.createElement('div');\n this.bottomDotForAddRow.style.width = '6px';\n this.bottomDotForAddRow.style.height = '6px';\n this.bottomDotForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.bottomDotForAddRow.style.position = 'absolute';\n this.bottomDotForAddRow.style.cursor = 'pointer';\n this.bottomDotForAddRow.style.zIndex = '1000';\n this.bottomDotForAddRow.style.borderRadius = '50%';\n this.bottomDotForAddRow.style.border = '1px solid white';\n this.bottomDotForAddRow.style.boxShadow = '0 1px 3px rgba(0,0,0,0.2)';\n document.body.appendChild(this.bottomDotForAddRow);\n\n //创建+加号 当鼠标hover到圆点上时,显示+加号\n this.addIconForAddRow = document.createElement('div');\n this.addIconForAddRow.style.width = '18px';\n this.addIconForAddRow.style.height = '18px';\n this.addIconForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addIconForAddRow.style.position = 'absolute';\n this.addIconForAddRow.style.zIndex = '1001';\n this.addIconForAddRow.style.display = 'none';\n this.addIconForAddRow.style.borderRadius = '50%';\n this.addIconForAddRow.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)';\n this.addIconForAddRow.style.justifyContent = 'center';\n this.addIconForAddRow.style.alignItems = 'center';\n this.addIconForAddRow.style.border = '1px solid white';\n document.body.appendChild(this.addIconForAddRow);\n\n //addIcon中添加一个+号\n const addIconText = document.createElement('div');\n addIconText.textContent = '+';\n addIconText.style.color = 'white';\n addIconText.style.fontSize = '18px';\n addIconText.style.fontWeight = 'bold';\n addIconText.style.lineHeight = '15px';\n addIconText.style.userSelect = 'none';\n addIconText.style.cursor = 'pointer';\n addIconText.style.verticalAlign = 'top';\n addIconText.style.textAlign = 'center';\n\n this.addIconForAddRow.appendChild(addIconText);\n\n // 创建加号下面行间隔线\n this.addLineForAddRow = document.createElement('div');\n this.addLineForAddRow.style.width = '10px';\n this.addLineForAddRow.style.height = '2px';\n this.addLineForAddRow.style.backgroundColor = '#4A90E2'; // 蓝色\n this.addLineForAddRow.style.position = 'absolute';\n this.addLineForAddRow.style.zIndex = '1001';\n this.addLineForAddRow.style.display = 'none';\n document.body.appendChild(this.addLineForAddRow);\n }\n bindEventForAddRow() {\n this.topDotForAddRow.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addRow);\n this.addIconForAddRow.style.display = 'block';\n const dotWidth = this.topDotForAddRow.offsetWidth;\n const dotHeight = this.topDotForAddRow.offsetHeight;\n this.showAddIconForAddRow(\n this.topDotForAddRow.offsetLeft + dotWidth / 2,\n this.topDotForAddRow.offsetTop + dotHeight / 2,\n true\n );\n this.showSplitLineForAddRow(\n this.topDotForAddRow.offsetLeft + dotWidth + 2,\n this.topDotForAddRow.offsetTop + dotHeight / 2 - 1,\n this.table.getDrawRange().width\n );\n });\n\n this.bottomDotForAddRow.addEventListener('mouseenter', () => {\n clearTimeout(this.hideAllTimeoutId_addRow);\n this.addIconForAddRow.style.display = 'block';\n const dotWidth = this.bottomDotForAddRow.offsetWidth;\n const dotHeight = this.bottomDotForAddRow.offsetHeight;\n this.showAddIconForAddRow(\n this.bottomDotForAddRow.offsetLeft + dotWidth / 2,\n this.bottomDotForAddRow.offsetTop + dotHeight / 2,\n false\n );\n this.showSplitLineForAddRow(\n this.bottomDotForAddRow.offsetLeft + dotWidth + 2,\n this.bottomDotForAddRow.offsetTop + dotHeight / 2 - 1,\n this.table.getDrawRange().height\n );\n });\n\n this.addIconForAddRow.addEventListener('mouseleave', () => {\n this.addIconForAddRow.style.display = 'none';\n this.addLineForAddRow.style.display = 'none';\n this.delayHideAllForAddRow();\n });\n\n this.addIconForAddRow.addEventListener('click', (e: MouseEvent) => {\n const isTop = this.addIconForAddRow.dataset.addIconType === 'top';\n const row = this.hoverCell.row;\n const addRowIndex = isTop ? row : row + 1;\n if (this.pluginOptions.addRowCallback) {\n this.pluginOptions.addRowCallback(addRowIndex, this.table as VTable.ListTable);\n } else {\n const recordIndex = this.table.getRecordIndexByCell(0, addRowIndex);\n this.table.addRecord({}, recordIndex);\n }\n this.delayHideAllForAddRow(0);\n });\n }\n showDotForAddRow(top: number, left: number, bottom: number, isShowTop: boolean = true, isShowBottom: boolean = true) {\n // 动态获取元素尺寸\n const dotWidth = this.topDotForAddRow.offsetWidth;\n const dotHeight = this.topDotForAddRow.offsetHeight;\n this.topDotForAddRow.style.left = `${left - dotWidth / 2}px`;\n this.topDotForAddRow.style.top = `${top - dotHeight / 2}px`;\n this.bottomDotForAddRow.style.left = `${left - dotWidth / 2}px`;\n this.bottomDotForAddRow.style.top = `${bottom - dotHeight / 2}px`;\n this.topDotForAddRow.style.display = isShowTop ? 'block' : 'none';\n this.bottomDotForAddRow.style.display = isShowBottom ? 'block' : 'none';\n }\n showAddIconForAddRow(left: number, top: number, isTop: boolean) {\n // 动态获取元素尺寸\n const iconWidth = this.addIconForAddRow.offsetWidth;\n const iconHeight = this.addIconForAddRow.offsetHeight;\n const dotWidth = this.topDotForAddRow.offsetWidth;\n this.addIconForAddRow.style.left = `${left - iconWidth / 2 - dotWidth / 2}px`;\n this.addIconForAddRow.style.top = `${top - iconHeight / 2}px`;\n if (isTop) {\n this.addIconForAddRow.dataset.addIconType = 'top';\n } else {\n this.addIconForAddRow.dataset.addIconType = 'bottom';\n }\n }\n showSplitLineForAddRow(left: number, top: number, width: number) {\n this.addLineForAddRow.style.left = `${left}px`;\n this.addLineForAddRow.style.top = `${top}px`;\n this.addLineForAddRow.style.width = `${width}px`;\n this.addLineForAddRow.style.display = 'block';\n }\n delayHideAllForAddRow(delay: number = 1000) {\n this.hideAllTimeoutId_addRow = setTimeout(() => {\n this.addIconForAddRow.style.display = 'none';\n this.addLineForAddRow.style.display = 'none';\n this.topDotForAddRow.style.display = 'none';\n this.bottomDotForAddRow.style.display = 'none';\n }, delay);\n }\n // #endregion\n release() {\n this.leftDotForAddColumn.remove();\n this.rightDotForAddColumn.remove();\n this.addIconForAddColumn.remove();\n this.addLineForAddColumn.remove();\n this.topDotForAddRow.remove();\n this.bottomDotForAddRow.remove();\n this.addIconForAddRow.remove();\n this.addLineForAddRow.remove();\n }\n}\n"]}
|
package/cjs/contextmenu/types.js
CHANGED
|
@@ -119,5 +119,4 @@ exports.DEFAULT_BODY_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_ME
|
|
|
119
119
|
exports.DEFAULT_HEADER_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_MENU_ITEMS[MenuKey.CUT], DEFAULT_MENU_ITEMS[MenuKey.PASTE], "---", DEFAULT_MENU_ITEMS[MenuKey.INSERT_COLUMN_LEFT], DEFAULT_MENU_ITEMS[MenuKey.INSERT_COLUMN_RIGHT], DEFAULT_MENU_ITEMS[MenuKey.DELETE_COLUMN] ],
|
|
120
120
|
exports.DEFAULT_COLUMN_SERIES_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_MENU_ITEMS[MenuKey.CUT], DEFAULT_MENU_ITEMS[MenuKey.PASTE], "---", DEFAULT_MENU_ITEMS[MenuKey.INSERT_COLUMN_LEFT], DEFAULT_MENU_ITEMS[MenuKey.INSERT_COLUMN_RIGHT], DEFAULT_MENU_ITEMS[MenuKey.DELETE_COLUMN] ],
|
|
121
121
|
exports.DEFAULT_ROW_SERIES_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_MENU_ITEMS[MenuKey.CUT], DEFAULT_MENU_ITEMS[MenuKey.PASTE], "---", DEFAULT_MENU_ITEMS[MenuKey.INSERT_ROW_ABOVE], DEFAULT_MENU_ITEMS[MenuKey.INSERT_ROW_BELOW], DEFAULT_MENU_ITEMS[MenuKey.DELETE_ROW] ],
|
|
122
|
-
exports.DEFAULT_CORNER_SERIES_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_MENU_ITEMS[MenuKey.CUT], DEFAULT_MENU_ITEMS[MenuKey.PASTE] ];
|
|
123
|
-
//# sourceMappingURL=types.js.map
|
|
122
|
+
exports.DEFAULT_CORNER_SERIES_MENU_ITEMS = [ DEFAULT_MENU_ITEMS[MenuKey.COPY], DEFAULT_MENU_ITEMS[MenuKey.CUT], DEFAULT_MENU_ITEMS[MenuKey.PASTE] ];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { plugins } from '@visactor/vtable-gantt';
|
|
2
2
|
export interface ExportOptions {
|
|
3
3
|
fileName?: string;
|
|
4
4
|
type?: 'png' | 'jpeg';
|
|
@@ -7,7 +7,7 @@ export interface ExportOptions {
|
|
|
7
7
|
scale?: number;
|
|
8
8
|
download?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare class ExportGanttPlugin implements
|
|
10
|
+
export declare class ExportGanttPlugin implements plugins.IGanttPlugin {
|
|
11
11
|
id: string;
|
|
12
12
|
name: string;
|
|
13
13
|
private _gantt;
|
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
-
}, __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
3
|
+
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
27
4
|
return new (P || (P = Promise))((function(resolve, reject) {
|
|
28
5
|
function fulfilled(value) {
|
|
29
6
|
try {
|
|
@@ -53,7 +30,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
53
30
|
value: !0
|
|
54
31
|
}), exports.ExportGanttPlugin = void 0;
|
|
55
32
|
|
|
56
|
-
const
|
|
33
|
+
const vtable_gantt_1 = require("@visactor/vtable-gantt");
|
|
57
34
|
|
|
58
35
|
class ExportGanttPlugin {
|
|
59
36
|
constructor() {
|
|
@@ -106,7 +83,7 @@ class ExportGanttPlugin {
|
|
|
106
83
|
const clonedContainer = document.createElement("div"), totalWidth = this._gantt.taskListTableInstance.getAllColsWidth() + this._gantt.getAllDateColsWidth(), totalHeight = this._gantt.getAllRowsHeight();
|
|
107
84
|
clonedContainer.style.width = `${totalWidth}px`, clonedContainer.style.height = `${totalHeight}px`,
|
|
108
85
|
tempContainer.appendChild(clonedContainer);
|
|
109
|
-
const clonedGantt = new
|
|
86
|
+
const clonedGantt = new vtable_gantt_1.Gantt(clonedContainer, Object.assign(Object.assign({}, this._gantt.options), {
|
|
110
87
|
records: this._gantt.records,
|
|
111
88
|
taskListTable: Object.assign(Object.assign({}, this._gantt.options.taskListTable), {
|
|
112
89
|
tableWidth: void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/gantt-export-image.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;AAgBtD,MAAa,iBAAiB;IAA9B;QACE,OAAE,GAAW,qBAAqB,CAAC;QACnC,SAAI,GAAG,qBAAqB,CAAC;QACrB,WAAM,GAA6B,IAAI,CAAC;IAyLlD,CAA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AS,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAG1D,IAAI,QAAQ,EAAE;YACZ,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YACnB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACjC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CACF;AA5LD,8CA4LC","file":"gantt-export-image.js","sourcesContent":["import * as VTableGantt from '@visactor/vtable-gantt';\r\n\r\n// 甘特图导出配置项接口\r\nexport interface ExportOptions {\r\n fileName?: string;\r\n type?: 'png' | 'jpeg';\r\n quality?: number;\r\n backgroundColor?: string;\r\n scale?: number;\r\n download?: boolean;\r\n}\r\n\r\n/**\r\n * 甘特图导出插件\r\n * @description 提供完整的甘特图导出功能,支持高分辨率输出和精准布局保留\r\n */\r\nexport class ExportGanttPlugin implements VTableGantt.plugins.IGanttPlugin {\r\n id: string = `gantt-export-helper`;\r\n name = 'Gantt Export Helper';\r\n private _gantt: VTableGantt.Gantt | null = null;\r\n\r\n // run 方法,在插件初始化时由 PluginManager调用\r\n run(...args: any[]): void {\r\n const ganttInstance = args[0] as VTableGantt.Gantt;\r\n if (!ganttInstance) {\r\n console.error('ExportGanttPlugin: Gantt instance not provided to run method.');\r\n return;\r\n }\r\n this._gantt = ganttInstance;\r\n }\r\n /**\r\n * 执行甘特图导出操作\r\n * @async\r\n * @param {ExportOptions} [options={}] 导出配置选项\r\n * @returns {Promise<string | undefined>} 返回Base64格式的图片数据,或在未初始化时返回 undefined\r\n * @throws {Error} 导出过程中发生错误时抛出异常\r\n */\r\n async exportToImage(options: ExportOptions = {}): Promise<string | undefined> {\r\n if (!this._gantt) {\r\n // 保留这个 error\r\n console.error('ExportGanttPlugin: Gantt instance not available.');\r\n return undefined;\r\n }\r\n\r\n const {\r\n fileName = 'gantt-export',\r\n type = 'png',\r\n quality = 1,\r\n backgroundColor = '#ffffff',\r\n scale = window.devicePixelRatio || 1,\r\n download = true // 默认执行下载\r\n } = options;\r\n\r\n try {\r\n const { tempContainer, clonedGantt } = this.createFullSizeContainer(scale);\r\n\r\n try {\r\n await new Promise(resolve => requestAnimationFrame(resolve));\r\n\r\n const totalWidth =\r\n (clonedGantt.taskListTableInstance.getAllColsWidth() + clonedGantt.getAllDateColsWidth()) * scale;\r\n const totalHeight = clonedGantt.getAllRowsHeight() * scale;\r\n\r\n const exportCanvas = document.createElement('canvas');\r\n exportCanvas.width = totalWidth;\r\n exportCanvas.height = totalHeight;\r\n const ctx = exportCanvas.getContext('2d')!;\r\n\r\n ctx.fillStyle = backgroundColor;\r\n ctx.fillRect(0, 0, totalWidth, totalHeight);\r\n\r\n if (clonedGantt.taskListTableInstance?.canvas) {\r\n ctx.drawImage(\r\n clonedGantt.taskListTableInstance.canvas,\r\n 0,\r\n 0,\r\n clonedGantt.taskListTableInstance.getAllColsWidth() * scale,\r\n totalHeight\r\n );\r\n }\r\n\r\n const splitLineWidth = 3 * scale;\r\n const splitLineX = clonedGantt.taskListTableInstance.getAllColsWidth() * scale;\r\n ctx.fillStyle = 'rgb(225, 228, 232)';\r\n ctx.fillRect(splitLineX - splitLineWidth / 2, 0, splitLineWidth, totalHeight);\r\n\r\n const sourceX = 4 * scale;\r\n const sourceWidth = clonedGantt.canvas.width - sourceX;\r\n\r\n if (clonedGantt.canvas) {\r\n ctx.drawImage(\r\n clonedGantt.canvas,\r\n sourceX,\r\n 0,\r\n sourceWidth,\r\n clonedGantt.canvas.height,\r\n (clonedGantt.taskListTableInstance.getAllColsWidth() + 1.5) * scale,\r\n 0,\r\n (clonedGantt.getAllDateColsWidth() - 1.5) * scale,\r\n totalHeight\r\n );\r\n }\r\n\r\n return this.finalizeExport(exportCanvas, fileName, type, quality, download);\r\n } finally {\r\n tempContainer.remove();\r\n // 确保克隆的甘特图实例被释放\r\n clonedGantt.release();\r\n }\r\n } catch (error) {\r\n console.error('[Gantt Export Plugin] Export failed:', error);\r\n throw new Error(`甘特图导出失败: ${error instanceof Error ? error.message : '未知错误'}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取甘特图的 Base64 图片数据,不触发下载\r\n * @async\r\n * @param {Omit<ExportOptions, 'download'>} [options={}] 导出配置选项(不包含 download 参数)\r\n * @returns {Promise<string | undefined>} 返回 Base64 格式的图片数据,或在未初始化时返回 undefined\r\n * @throws {Error} 导出过程中发生错误时抛出异常\r\n */\r\n async exportToBase64(options: Omit<ExportOptions, 'download'> = {}): Promise<string | undefined> {\r\n // 调用 exportToImage 方法,但设置 download 为 false\r\n return this.exportToImage({\r\n ...options,\r\n download: false\r\n });\r\n }\r\n\r\n private createFullSizeContainer(scale: number) {\r\n if (!this._gantt) {\r\n // 保留这个 error\r\n throw new Error('ExportGanttPlugin: Gantt instance not available to create container.');\r\n }\r\n\r\n const tempContainer = document.createElement('div');\r\n tempContainer.style.position = 'fixed';\r\n tempContainer.style.left = '-9999px';\r\n tempContainer.style.overflow = 'hidden';\r\n tempContainer.style.width = `${window.innerWidth + 100}px`;\r\n tempContainer.style.height = `${window.innerHeight + 100}px`;\r\n document.body.appendChild(tempContainer);\r\n\r\n const clonedContainer = document.createElement('div');\r\n\r\n const totalWidth = this._gantt.taskListTableInstance.getAllColsWidth() + this._gantt.getAllDateColsWidth();\r\n const totalHeight = this._gantt.getAllRowsHeight();\r\n\r\n clonedContainer.style.width = `${totalWidth}px`;\r\n clonedContainer.style.height = `${totalHeight}px`;\r\n tempContainer.appendChild(clonedContainer);\r\n\r\n const clonedGantt = new VTableGantt.Gantt(clonedContainer, {\r\n ...this._gantt.options,\r\n records: this._gantt.records,\r\n taskListTable: {\r\n ...this._gantt.options.taskListTable,\r\n tableWidth: undefined as unknown as number,\r\n minTableWidth: undefined as unknown as number,\r\n maxTableWidth: undefined as unknown as number\r\n },\r\n plugins: []\r\n });\r\n\r\n clonedGantt.setPixelRatio(scale);\r\n\r\n // 禁用裁剪\r\n if ((clonedGantt as any).scenegraph?.ganttGroup) {\r\n (clonedGantt as any).scenegraph.ganttGroup.setAttribute('clip', false);\r\n }\r\n if ((clonedGantt.taskListTableInstance as any)?.scenegraph?.tableGroup) {\r\n (clonedGantt.taskListTableInstance as any).scenegraph.tableGroup.setAttribute('clip', false);\r\n }\r\n\r\n clonedGantt.scenegraph.stage.render();\r\n\r\n return { tempContainer, clonedGantt };\r\n }\r\n private finalizeExport(\r\n canvas: HTMLCanvasElement,\r\n fileName: string,\r\n type: string,\r\n quality: number,\r\n download: boolean = true\r\n ): string {\r\n const base64 = canvas.toDataURL(`image/${type}`, quality);\r\n\r\n // 如果需要下载,则创建下载链接\r\n if (download) {\r\n const link = document.createElement('a');\r\n link.download = `${fileName}.${type}`;\r\n link.href = base64;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n\r\n return base64;\r\n }\r\n\r\n release(): void {\r\n this._gantt = null;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/gantt-export-image.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yDAA+C;AAgB/C,MAAa,iBAAiB;IAA9B;QACE,OAAE,GAAW,qBAAqB,CAAC;QACnC,SAAI,GAAG,qBAAqB,CAAC;QACrB,WAAM,GAAiB,IAAI,CAAC;IAyLtC,CAAC;IAtLC,GAAG,CAAC,GAAG,IAAW;QAChB,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAU,CAAC;QACvC,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YAC/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AQ,IAAI,IAAI,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YACnB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACjC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CACF;AA5LD,8CA4LC","file":"gantt-export-image.js","sourcesContent":["import type { plugins } from '@visactor/vtable-gantt';\r\nimport { Gantt } from '@visactor/vtable-gantt';\r\n\r\n// 甘特图导出配置项接口\r\nexport interface ExportOptions {\r\n fileName?: string;\r\n type?: 'png' | 'jpeg';\r\n quality?: number;\r\n backgroundColor?: string;\r\n scale?: number;\r\n download?: boolean;\r\n}\r\n\r\n/**\r\n * 甘特图导出插件\r\n * @description 提供完整的甘特图导出功能,支持高分辨率输出和精准布局保留\r\n */\r\nexport class ExportGanttPlugin implements plugins.IGanttPlugin {\r\n id: string = `gantt-export-helper`;\r\n name = 'Gantt Export Helper';\r\n private _gantt: Gantt | null = null;\r\n\r\n // run 方法,在插件初始化时由 PluginManager调用\r\n run(...args: any[]): void {\r\n const ganttInstance = args[0] as Gantt;\r\n if (!ganttInstance) {\r\n console.error('ExportGanttPlugin: Gantt instance not provided to run method.');\r\n return;\r\n }\r\n this._gantt = ganttInstance;\r\n }\r\n /**\r\n * 执行甘特图导出操作\r\n * @async\r\n * @param {ExportOptions} [options={}] 导出配置选项\r\n * @returns {Promise<string | undefined>} 返回Base64格式的图片数据,或在未初始化时返回 undefined\r\n * @throws {Error} 导出过程中发生错误时抛出异常\r\n */\r\n async exportToImage(options: ExportOptions = {}): Promise<string | undefined> {\r\n if (!this._gantt) {\r\n // 保留这个 error\r\n console.error('ExportGanttPlugin: Gantt instance not available.');\r\n return undefined;\r\n }\r\n\r\n const {\r\n fileName = 'gantt-export',\r\n type = 'png',\r\n quality = 1,\r\n backgroundColor = '#ffffff',\r\n scale = window.devicePixelRatio || 1,\r\n download = true // 默认执行下载\r\n } = options;\r\n\r\n try {\r\n const { tempContainer, clonedGantt } = this.createFullSizeContainer(scale);\r\n\r\n try {\r\n await new Promise(resolve => requestAnimationFrame(resolve));\r\n\r\n const totalWidth =\r\n (clonedGantt.taskListTableInstance.getAllColsWidth() + clonedGantt.getAllDateColsWidth()) * scale;\r\n const totalHeight = clonedGantt.getAllRowsHeight() * scale;\r\n\r\n const exportCanvas = document.createElement('canvas');\r\n exportCanvas.width = totalWidth;\r\n exportCanvas.height = totalHeight;\r\n const ctx = exportCanvas.getContext('2d')!;\r\n\r\n ctx.fillStyle = backgroundColor;\r\n ctx.fillRect(0, 0, totalWidth, totalHeight);\r\n\r\n if (clonedGantt.taskListTableInstance?.canvas) {\r\n ctx.drawImage(\r\n clonedGantt.taskListTableInstance.canvas,\r\n 0,\r\n 0,\r\n clonedGantt.taskListTableInstance.getAllColsWidth() * scale,\r\n totalHeight\r\n );\r\n }\r\n\r\n const splitLineWidth = 3 * scale;\r\n const splitLineX = clonedGantt.taskListTableInstance.getAllColsWidth() * scale;\r\n ctx.fillStyle = 'rgb(225, 228, 232)';\r\n ctx.fillRect(splitLineX - splitLineWidth / 2, 0, splitLineWidth, totalHeight);\r\n\r\n const sourceX = 4 * scale;\r\n const sourceWidth = clonedGantt.canvas.width - sourceX;\r\n\r\n if (clonedGantt.canvas) {\r\n ctx.drawImage(\r\n clonedGantt.canvas,\r\n sourceX,\r\n 0,\r\n sourceWidth,\r\n clonedGantt.canvas.height,\r\n (clonedGantt.taskListTableInstance.getAllColsWidth() + 1.5) * scale,\r\n 0,\r\n (clonedGantt.getAllDateColsWidth() - 1.5) * scale,\r\n totalHeight\r\n );\r\n }\r\n\r\n return this.finalizeExport(exportCanvas, fileName, type, quality, download);\r\n } finally {\r\n tempContainer.remove();\r\n // 确保克隆的甘特图实例被释放\r\n clonedGantt.release();\r\n }\r\n } catch (error) {\r\n console.error('[Gantt Export Plugin] Export failed:', error);\r\n throw new Error(`甘特图导出失败: ${error instanceof Error ? error.message : '未知错误'}`);\r\n }\r\n }\r\n\r\n /**\r\n * 获取甘特图的 Base64 图片数据,不触发下载\r\n * @async\r\n * @param {Omit<ExportOptions, 'download'>} [options={}] 导出配置选项(不包含 download 参数)\r\n * @returns {Promise<string | undefined>} 返回 Base64 格式的图片数据,或在未初始化时返回 undefined\r\n * @throws {Error} 导出过程中发生错误时抛出异常\r\n */\r\n async exportToBase64(options: Omit<ExportOptions, 'download'> = {}): Promise<string | undefined> {\r\n // 调用 exportToImage 方法,但设置 download 为 false\r\n return this.exportToImage({\r\n ...options,\r\n download: false\r\n });\r\n }\r\n\r\n private createFullSizeContainer(scale: number) {\r\n if (!this._gantt) {\r\n // 保留这个 error\r\n throw new Error('ExportGanttPlugin: Gantt instance not available to create container.');\r\n }\r\n\r\n const tempContainer = document.createElement('div');\r\n tempContainer.style.position = 'fixed';\r\n tempContainer.style.left = '-9999px';\r\n tempContainer.style.overflow = 'hidden';\r\n tempContainer.style.width = `${window.innerWidth + 100}px`;\r\n tempContainer.style.height = `${window.innerHeight + 100}px`;\r\n document.body.appendChild(tempContainer);\r\n\r\n const clonedContainer = document.createElement('div');\r\n\r\n const totalWidth = this._gantt.taskListTableInstance.getAllColsWidth() + this._gantt.getAllDateColsWidth();\r\n const totalHeight = this._gantt.getAllRowsHeight();\r\n\r\n clonedContainer.style.width = `${totalWidth}px`;\r\n clonedContainer.style.height = `${totalHeight}px`;\r\n tempContainer.appendChild(clonedContainer);\r\n\r\n const clonedGantt = new Gantt(clonedContainer, {\r\n ...this._gantt.options,\r\n records: this._gantt.records,\r\n taskListTable: {\r\n ...this._gantt.options.taskListTable,\r\n tableWidth: undefined as unknown as number,\r\n minTableWidth: undefined as unknown as number,\r\n maxTableWidth: undefined as unknown as number\r\n },\r\n plugins: []\r\n });\r\n\r\n clonedGantt.setPixelRatio(scale);\r\n\r\n // 禁用裁剪\r\n if ((clonedGantt as any).scenegraph?.ganttGroup) {\r\n (clonedGantt as any).scenegraph.ganttGroup.setAttribute('clip', false);\r\n }\r\n if ((clonedGantt.taskListTableInstance as any)?.scenegraph?.tableGroup) {\r\n (clonedGantt.taskListTableInstance as any).scenegraph.tableGroup.setAttribute('clip', false);\r\n }\r\n\r\n clonedGantt.scenegraph.stage.render();\r\n\r\n return { tempContainer, clonedGantt };\r\n }\r\n private finalizeExport(\r\n canvas: HTMLCanvasElement,\r\n fileName: string,\r\n type: string,\r\n quality: number,\r\n download: boolean = true\r\n ): string {\r\n const base64 = canvas.toDataURL(`image/${type}`, quality);\r\n\r\n // 如果需要下载,则创建下载链接\r\n if (download) {\r\n const link = document.createElement('a');\r\n link.download = `${fileName}.${type}`;\r\n link.href = base64;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n\r\n return base64;\r\n }\r\n\r\n release(): void {\r\n this._gantt = null;\r\n }\r\n}\r\n"]}
|
|
@@ -239,5 +239,4 @@ function needCellImageExport(cellType, isAxisCell, isCustomCell, isTextWithIcon,
|
|
|
239
239
|
return !(null == options ? void 0 : options.skipImageExportCellType) || ("image" === cellType || "video" === cellType || "progressbar" === cellType || "sparkline" === cellType || "chart" === cellType ? !options.skipImageExportCellType.includes(cellType) : isAxisCell ? !options.skipImageExportCellType.includes("chart") : isCustomCell ? !options.skipImageExportCellType.includes("custom") : !isTextWithIcon || !options.skipImageExportCellType.includes("textWithIcon"));
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
//# sourceMappingURL=index.js.map
|
|
243
242
|
exports.exportVTableToExcel = exportVTableToExcel;
|