@visactor/vtable-plugins 1.18.3-alpha.0 → 1.18.3
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.d.ts +1 -0
- package/cjs/add-row-column.js +4 -3
- package/cjs/add-row-column.js.map +1 -1
- package/cjs/column-series.d.ts +1 -0
- package/cjs/column-series.js +3 -1
- package/cjs/column-series.js.map +1 -1
- package/cjs/excel-edit-cell-keyboard.d.ts +3 -1
- package/cjs/excel-edit-cell-keyboard.js +3 -2
- package/cjs/excel-edit-cell-keyboard.js.map +1 -1
- package/cjs/focus-highlight.d.ts +1 -0
- package/cjs/focus-highlight.js +2 -1
- package/cjs/focus-highlight.js.map +1 -1
- package/cjs/gantt-export-image.d.ts +18 -0
- package/cjs/gantt-export-image.js +128 -0
- package/cjs/gantt-export-image.js.map +1 -0
- package/cjs/highlight-header-when-select-cell.d.ts +1 -0
- package/cjs/highlight-header-when-select-cell.js +3 -1
- package/cjs/highlight-header-when-select-cell.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -1
- package/cjs/index.js.map +1 -1
- package/cjs/rotate-table.d.ts +4 -1
- package/cjs/rotate-table.js +4 -2
- package/cjs/rotate-table.js.map +1 -1
- package/cjs/row-series.d.ts +1 -0
- package/cjs/row-series.js +2 -1
- package/cjs/row-series.js.map +1 -1
- package/cjs/table-carousel-animation.d.ts +1 -0
- package/cjs/table-carousel-animation.js +9 -8
- package/cjs/table-carousel-animation.js.map +1 -1
- package/dist/vtable-plugins.js +10978 -1520
- package/dist/vtable-plugins.min.js +1 -1
- package/es/add-row-column.d.ts +1 -0
- package/es/add-row-column.js +4 -3
- package/es/add-row-column.js.map +1 -1
- package/es/column-series.d.ts +1 -0
- package/es/column-series.js +3 -1
- package/es/column-series.js.map +1 -1
- package/es/excel-edit-cell-keyboard.d.ts +3 -1
- package/es/excel-edit-cell-keyboard.js +3 -2
- package/es/excel-edit-cell-keyboard.js.map +1 -1
- package/es/focus-highlight.d.ts +1 -0
- package/es/focus-highlight.js +2 -1
- package/es/focus-highlight.js.map +1 -1
- package/es/gantt-export-image.d.ts +18 -0
- package/es/gantt-export-image.js +97 -0
- package/es/gantt-export-image.js.map +1 -0
- package/es/highlight-header-when-select-cell.d.ts +1 -0
- package/es/highlight-header-when-select-cell.js +3 -1
- package/es/highlight-header-when-select-cell.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/rotate-table.d.ts +4 -1
- package/es/rotate-table.js +4 -2
- package/es/rotate-table.js.map +1 -1
- package/es/row-series.d.ts +1 -0
- package/es/row-series.js +2 -1
- package/es/row-series.js.map +1 -1
- package/es/table-carousel-animation.d.ts +1 -0
- package/es/table-carousel-animation.js +8 -8
- package/es/table-carousel-animation.js.map +1 -1
- package/package.json +7 -6
package/cjs/add-row-column.d.ts
CHANGED
package/cjs/add-row-column.js
CHANGED
|
@@ -36,10 +36,11 @@ class AddRowColumnPlugin {
|
|
|
36
36
|
addColumnEnable: !0,
|
|
37
37
|
addRowEnable: !0
|
|
38
38
|
}) {
|
|
39
|
-
var _a, _b;
|
|
39
|
+
var _a, _b, _c;
|
|
40
40
|
this.id = `add-row-column-${Date.now()}`, this.name = "Add Row Column", this.runTime = [ VTable.TABLE_EVENT_TYPE.MOUSEENTER_CELL, VTable.TABLE_EVENT_TYPE.MOUSELEAVE_CELL, VTable.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE ],
|
|
41
|
-
this.
|
|
42
|
-
this.pluginOptions.
|
|
41
|
+
this.id = null !== (_a = pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions,
|
|
42
|
+
this.pluginOptions.addColumnEnable = null === (_b = this.pluginOptions.addColumnEnable) || void 0 === _b || _b,
|
|
43
|
+
this.pluginOptions.addRowEnable = null === (_c = this.pluginOptions.addRowEnable) || void 0 === _c || _c,
|
|
43
44
|
this.pluginOptions.addColumnEnable && (this.initAddColumnDomElement(), this.bindEventForAddColumn()),
|
|
44
45
|
this.pluginOptions.addRowEnable && (this.initAddRowDomElement(), this.bindEventForAddRow());
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["add-row-column.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AA4B3C,MAAa,kBAAkB;IAsB7B,YACE,gBAAqC;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;KACnB;;QAzBH,OAAE,GAAG,kBAAkB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACpC,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,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,GAAG,IAAW;QAChB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;Q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AAK,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;AA/aD,gDA+aC","file":"add-row-column.js","sourcesContent":["import * as VTable from '@visactor/vtable';\n/**\n * 添加行和列的插件的配置选项\n */\nexport interface AddRowColumnOptions {\n /**\n * 是否启用添加列\n */\n addColumnEnable?: boolean;\n /**\n * 是否启用添加行\n */\n addRowEnable?: boolean;\n /**\n * 添加列的回调函数\n */\n addColumnCallback?: (col: number) => void;\n /**\n * 添加行的回调函数\n */\n addRowCallback?: (row: number) => 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-${Date.now()}`;\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.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);\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);\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":["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,kBAAkB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACpC,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,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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) => void;\n /**\n * 添加行的回调函数\n */\n addRowCallback?: (row: number) => 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-${Date.now()}`;\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);\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);\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/column-series.d.ts
CHANGED
package/cjs/column-series.js
CHANGED
|
@@ -33,8 +33,10 @@ const VTable = __importStar(require("@visactor/vtable"));
|
|
|
33
33
|
|
|
34
34
|
class ColumnSeriesPlugin {
|
|
35
35
|
constructor(pluginOptions) {
|
|
36
|
+
var _a;
|
|
36
37
|
this.id = `column-series-${Date.now()}`, this.name = "Column Series", this.runTime = [ VTable.TABLE_EVENT_TYPE.BEFORE_INIT, VTable.TABLE_EVENT_TYPE.BEFORE_KEYDOWN ],
|
|
37
|
-
this.columns = [], this.
|
|
38
|
+
this.columns = [], this.id = null !== (_a = pluginOptions.id) && void 0 !== _a ? _a : this.id,
|
|
39
|
+
this.pluginOptions = Object.assign({
|
|
38
40
|
columnCount: 100
|
|
39
41
|
}, pluginOptions);
|
|
40
42
|
}
|
package/cjs/column-series.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["column-series.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;
|
|
1
|
+
{"version":3,"sources":["column-series.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAkB3C,MAAa,kBAAkB;IAO7B,YAAY,aAAkC;;QAN9C,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,cAAc,CAAC,CAAC;QAGxF,YAAO,GAAwC,EAAE,CAAC;QAEhD,IAAI,CAAC,EAAE,GAAG,MAAA,aAAa,CAAC,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,aAAa,CAAC,CAAC;IAC1E,CAAC;IACD,GAAG,CAAC,GAAG,IAAW;;QAChB,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE;YACnD,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,MAAM,KAAK,GAAwB,IAAI,CAAC,CAAC,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I,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,CAAC;gBAC/C,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC;SACpC,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAMD,mBAAmB,CAAC,KAAa;QAE/B,IAAI,KAAK,GAAG,EAAE,EAAE;YACd,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;SACxC;QAED,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,EAAE,CAAC;QAER,OAAO,KAAK,GAAG,CAAC,EAAE;YAChB,KAAK,EAAE,CAAC;YACR,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACtD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;SAChC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,gBAAgB,CAAC,WAAmB;QAClC,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,OAA+B,CAAC,CAAC;IACjE,CAAC;CACF;AAlFD,gDAkFC","file":"column-series.js","sourcesContent":["import * as VTable from '@visactor/vtable';\n/**\n * 添加行和列的插件的配置选项\n */\nexport interface ColumnSeriesOptions {\n id?: string;\n columnCount: number;\n generateColumnTitle?: (index: number) => string;\n generateColumnField?: (index: number) => string;\n /**\n * 是否自动扩展列, 配置监听键值(键盘事件的key)\n * @default true\n */\n autoExtendColumnTriggerKeys?: ('ArrowRight' | 'Tab')[];\n}\n/**\n * 生成列序号标题的插件\n */\nexport class ColumnSeriesPlugin implements VTable.plugins.IVTablePlugin {\n id = `column-series-${Date.now()}`;\n name = 'Column Series';\n runTime = [VTable.TABLE_EVENT_TYPE.BEFORE_INIT, VTable.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];\n pluginOptions: ColumnSeriesOptions;\n table: VTable.ListTable;\n columns: { field?: string; title: string }[] = [];\n constructor(pluginOptions: ColumnSeriesOptions) {\n this.id = pluginOptions.id ?? this.id;\n this.pluginOptions = Object.assign({ columnCount: 100 }, pluginOptions);\n }\n run(...args: any[]) {\n if (args[1] === VTable.TABLE_EVENT_TYPE.BEFORE_INIT) {\n const eventArgs = args[0];\n const table: VTable.BaseTableAPI = args[2];\n this.table = table as VTable.ListTable;\n const options = eventArgs.options;\n //根据pluginOptions的columnCount组织columns,column的title生成规则和excel一致,如A~Z,AA~AZ,AB~AZ,AA~ZZ,AAA~ZZZ\n this.columns = this.generateColumns(this.pluginOptions.columnCount);\n options.columns = this.columns;\n } else if (args[1] === VTable.TABLE_EVENT_TYPE.BEFORE_KEYDOWN) {\n const eventArgs = args[0];\n const e = eventArgs.event;\n if (this.pluginOptions.autoExtendColumnTriggerKeys?.includes(e.key)) {\n if (this.table.stateManager.select.cellPos.col === this.table.colCount - 1) {\n this.table.addColumn(this.generateColumn(this.table.colCount - 1) as VTable.ColumnDefine);\n }\n }\n }\n }\n /**\n * 生成列字段和标题\n * 规则和excel一致,如A~Z,AA~AZ,AB~AZ,AA~ZZ,AAA~ZZZ\n * @param columnCount 列数\n * @returns 列字段和标题的数组\n */\n generateColumns(columnCount: number): { field?: string; title: string }[] {\n const columnFields = [];\n for (let i = 0; i < columnCount; i++) {\n columnFields.push(this.generateColumn(i));\n }\n return columnFields;\n }\n generateColumn(index: number): { field?: string; title: string } {\n const column = {\n // field: this.pluginOptions.generateColumnField\n // ? this.pluginOptions.generateColumnField(i)\n // : this.generateColumnField(i),\n title: this.pluginOptions.generateColumnTitle\n ? this.pluginOptions.generateColumnTitle(index)\n : this.generateColumnField(index)\n };\n return column;\n }\n /**\n * 生成excel的列标题,规则和excel一致,如A~Z,AA~AZ,AB~AZ,AA~ZZ,AAA~ZZZ\n * @param index 从0开始\n * @returns\n */\n generateColumnField(index: number): string {\n // 处理0-25的情况(A-Z)\n if (index < 26) {\n return String.fromCharCode(65 + index);\n }\n\n const title = [];\n index++; // 调整索引,使得第一个26变成AA\n\n while (index > 0) {\n index--; // 每次循环前减1,以正确处理进位\n title.unshift(String.fromCharCode(65 + (index % 26)));\n index = Math.floor(index / 26);\n }\n\n return title.join('');\n }\n\n resetColumnCount(columnCount: number) {\n this.pluginOptions.columnCount = columnCount;\n this.columns = this.generateColumns(columnCount);\n this.table.updateColumns(this.columns as VTable.ColumnsDefine);\n }\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as VTable from '@visactor/vtable';
|
|
2
2
|
import type { TableEvents } from '@visactor/vtable/src/core/TABLE_EVENT_TYPE';
|
|
3
3
|
import type { EventArg } from './types';
|
|
4
|
-
export type IExcelEditCellKeyboardPluginOptions = {
|
|
4
|
+
export type IExcelEditCellKeyboardPluginOptions = {
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
5
7
|
export declare class ExcelEditCellKeyboardPlugin implements VTable.plugins.IVTablePlugin {
|
|
6
8
|
id: string;
|
|
7
9
|
name: string;
|
|
@@ -33,9 +33,10 @@ const VTable = __importStar(require("@visactor/vtable"));
|
|
|
33
33
|
|
|
34
34
|
class ExcelEditCellKeyboardPlugin {
|
|
35
35
|
constructor(pluginOptions) {
|
|
36
|
+
var _a;
|
|
36
37
|
this.id = `excel-edit-cell-keyboard-${Date.now()}`, this.name = "Excel Edit Cell Keyboard",
|
|
37
|
-
this.runTime = [ VTable.TABLE_EVENT_TYPE.INITIALIZED ], this.
|
|
38
|
-
this.bindEvent();
|
|
38
|
+
this.runTime = [ VTable.TABLE_EVENT_TYPE.INITIALIZED ], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id,
|
|
39
|
+
this.pluginOptions = pluginOptions, this.bindEvent();
|
|
39
40
|
}
|
|
40
41
|
run(...args) {
|
|
41
42
|
const table = args[2];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["excel-edit-cell-keyboard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;
|
|
1
|
+
{"version":3,"sources":["excel-edit-cell-keyboard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAU3C,MAAa,2BAA2B;IAMtC,YAAY,aAAmD;;QAL/D,OAAE,GAAG,4BAA4B,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QAC9C,SAAI,GAAG,0BAA0B,CAAC;QAClC,YAAO,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAI9C,IAAI,CAAC,EAAE,GAAG,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IACD,GAAG,CAAC,GAAG,IAAwG;QAC7G,MAAM,KAAK,GAAwB,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,KAAyB,CAAC;IACzC,CAAC;IAED,SAAS;QAEP,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAc5E,CAAC;IACD,aAAa,CAAC,KAAoB;QAChC,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE;YAE5B,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,wBAAwB,KAAK,SAAS,EAAE;gBACnE,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,IAAI,IA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AkB,CAAC,KAAoB;QACrC,OAAO,CACL,KAAK,CAAC,GAAG,KAAK,OAAO;YACrB,KAAK,CAAC,GAAG,KAAK,KAAK;YACnB,KAAK,CAAC,GAAG,KAAK,WAAW;YACzB,KAAK,CAAC,GAAG,KAAK,YAAY;YAC1B,KAAK,CAAC,GAAG,KAAK,WAAW;YACzB,KAAK,CAAC,GAAG,KAAK,SAAS,CACxB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;CACF;AAvGD,kEAuGC;AAED,SAAS,iBAAiB,CAAC,WAAsC,EAAE,aAA+B;IAChG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,aAAa,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SACjF;KACF;AACH,CAAC","file":"excel-edit-cell-keyboard.js","sourcesContent":["import * as VTable from '@visactor/vtable';\nimport type { TableEvents } from '@visactor/vtable/src/core/TABLE_EVENT_TYPE';\nimport type { EventArg } from './types';\n//备用 插件配置项 目前感觉都走默认逻辑就行\nexport type IExcelEditCellKeyboardPluginOptions = {\n id?: string;\n // 是否响应删除\n // enableDeleteKey?: boolean;\n};\n\nexport class ExcelEditCellKeyboardPlugin implements VTable.plugins.IVTablePlugin {\n id = `excel-edit-cell-keyboard-${Date.now()}`;\n name = 'Excel Edit Cell Keyboard';\n runTime = [VTable.TABLE_EVENT_TYPE.INITIALIZED];\n table: VTable.ListTable;\n pluginOptions: IExcelEditCellKeyboardPluginOptions;\n constructor(pluginOptions?: IExcelEditCellKeyboardPluginOptions) {\n this.id = pluginOptions?.id ?? this.id;\n this.pluginOptions = pluginOptions;\n\n this.bindEvent();\n }\n run(...args: [EventArg, TableEvents[keyof TableEvents] | TableEvents[keyof TableEvents][], VTable.BaseTableAPI]) {\n const table: VTable.BaseTableAPI = args[2];\n this.table = table as VTable.ListTable;\n }\n\n bindEvent() {\n //监听document全局的keydown事件 捕获阶段监听 可以及时阻止事件传播和默认行为\n document.addEventListener('keydown', this.handleKeyDown.bind(this), true);\n // this.table.on('selected_cell', () => {\n // this.updateHighlight();\n // });\n\n // this.table.on('selected_clear', () => {\n // this.clearHighlight();\n // });\n\n // this.table.on('mousemove_table', () => {\n // if (this.table.stateManager.select.selecting) {\n // this.updateHighlight();\n // }\n // });\n }\n handleKeyDown(event: KeyboardEvent) {\n if (this.table.editorManager) {\n //判断是键盘触发编辑单元格的情况下,那么在编辑状态中切换方向需要选中下一个继续编辑\n if (this.table.editorManager.beginTriggerEditCellMode === 'keydown') {\n if (this.table.editorManager.editingEditor && this.isExcelShortcutKey(event)) {\n const { col, row } = this.table.editorManager.editCell;\n this.table.editorManager.completeEdit();\n this.table.getElement().focus();\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n //有这些配合键,则不进行选中下一个单元格的行为 执行vtable内部逻辑\n if (event.key === 'Enter') {\n this.table.selectCell(col, row + 1);\n } else if (event.key === 'Tab') {\n this.table.selectCell(col + 1, row);\n } else if (event.key === 'ArrowLeft') {\n this.table.selectCell(col - 1, row);\n } else if (event.key === 'ArrowRight') {\n this.table.selectCell(col + 1, row);\n } else if (event.key === 'ArrowDown') {\n this.table.selectCell(col, row + 1);\n } else if (event.key === 'ArrowUp') {\n this.table.selectCell(col, row - 1);\n }\n // 阻止事件传播和默认行为\n event.stopPropagation();\n event.preventDefault();\n }\n }\n } else {\n const { col, row } = this.table.stateManager.select.cellPos;\n if (this.table.editorManager.editingEditor && (event.key === 'Enter' || event.key === 'Tab')) {\n this.table.editorManager.completeEdit();\n this.table.getElement().focus();\n if (event.key === 'Enter') {\n this.table.selectCell(col, row + 1);\n } else if (event.key === 'Tab') {\n this.table.selectCell(col + 1, row);\n }\n // 阻止事件传播和默认行为\n event.stopPropagation();\n event.preventDefault();\n } else if (event.key === 'Delete') {\n //响应删除键,删除\n const selectCells = this.table.getSelectedCellInfos();\n if (selectCells?.length > 0) {\n // 如果选中的是范围,则删除范围内的所有单元格\n deleteSelectRange(selectCells, this.table);\n }\n // 阻止事件传播和默认行为\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }\n }\n // 判断event的keyCode是否是excel的快捷键\n isExcelShortcutKey(event: KeyboardEvent) {\n return (\n event.key === 'Enter' ||\n event.key === 'Tab' ||\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' ||\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp'\n );\n }\n release() {\n document.removeEventListener('keydown', this.handleKeyDown, true);\n }\n}\n//将选中单元格的值设置为空\nfunction deleteSelectRange(selectCells: VTable.TYPES.CellInfo[][], tableInstance: VTable.ListTable) {\n for (let i = 0; i < selectCells.length; i++) {\n for (let j = 0; j < selectCells[i].length; j++) {\n tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, '');\n }\n }\n}\n"]}
|
package/cjs/focus-highlight.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { CellAddress, CellRange } from '@visactor/vtable/es/ts-types';
|
|
|
3
3
|
import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table';
|
|
4
4
|
import type * as VTable from '@visactor/vtable';
|
|
5
5
|
export interface FocusHighlightPluginOptions {
|
|
6
|
+
id?: string;
|
|
6
7
|
fill?: string;
|
|
7
8
|
opacity?: number;
|
|
8
9
|
highlightRange?: CellAddress | CellRange;
|
package/cjs/focus-highlight.js
CHANGED
|
@@ -12,8 +12,9 @@ class FocusHighlightPlugin {
|
|
|
12
12
|
opacity: .5,
|
|
13
13
|
highlightRange: void 0
|
|
14
14
|
}) {
|
|
15
|
+
var _a;
|
|
15
16
|
this.id = `focus-highlight-${Date.now()}`, this.name = "Focus Highlight", this.runTime = [ vtable_1.TABLE_EVENT_TYPE.INITIALIZED, vtable_1.TABLE_EVENT_TYPE.SELECTED_CELL, vtable_1.TABLE_EVENT_TYPE.SELECTED_CLEAR ],
|
|
16
|
-
this.pluginOptions = Object.assign({
|
|
17
|
+
this.id = null !== (_a = options.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = Object.assign({
|
|
17
18
|
fill: "#000",
|
|
18
19
|
opacity: .5
|
|
19
20
|
}, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["focus-highlight.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AAEzD,qEAAmE;AAGnE,6DAA+D;AAC/D,6CAAoD;AAQpD,MAAa,oBAAoB;IAQ/B,YACE,UAAuC;QACrC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,SAAS;KAC1B;QAZH,OAAE,GAAG,mBAAmB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACrC,SAAI,GAAG,iBAAiB,CAAC;QACzB,YAAO,GAAG,CAAC,yBAAgB,CAAC,WAAW,EAAE,yBAAgB,CAAC,aAAa,EAAE,yBAAgB,CAAC,cAAc,CAAC,CAAC;QAYxG,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAChC;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,GAAG;SACb,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,GAAG,IAAW;QAChB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAiB,CAAC;SACtC;QACD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,yBAAgB,CAAC,WAAW,EAAE;YAC5C,IAAI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ode } from '@visactor/vtable/es/vrender';\nimport { createRect } from '@visactor/vtable/es/vrender';\nimport type { Group } from '@visactor/vtable/es/scenegraph/graphic/group';\nimport { isSameRange } from '@visactor/vtable/es/tools/cell-range';\nimport type { CellAddress, CellRange } from '@visactor/vtable/es/ts-types';\nimport type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table';\nimport { cellInRange } from '@visactor/vtable/es/tools/helper';\nimport { TABLE_EVENT_TYPE } from '@visactor/vtable';\nimport type * as VTable from '@visactor/vtable';\nexport interface FocusHighlightPluginOptions {\n fill?: string;\n opacity?: number;\n highlightRange?: CellAddress | CellRange; //初始化聚焦高亮范围\n}\n\nexport class FocusHighlightPlugin implements VTable.plugins.IVTablePlugin {\n id = `focus-highlight-${Date.now()}`;\n name = 'Focus Highlight';\n runTime = [TABLE_EVENT_TYPE.INITIALIZED, TABLE_EVENT_TYPE.SELECTED_CELL, TABLE_EVENT_TYPE.SELECTED_CLEAR];\n table: BaseTableAPI;\n range?: CellRange;\n pluginOptions: FocusHighlightPluginOptions;\n\n constructor(\n options: FocusHighlightPluginOptions = {\n fill: '#000',\n opacity: 0.5,\n highlightRange: undefined\n }\n ) {\n this.pluginOptions = Object.assign(\n {\n fill: '#000',\n opacity: 0.5\n },\n options\n );\n }\n run(...args: any[]) {\n if (!this.table) {\n this.table = args[2] as BaseTableAPI;\n }\n if (args[1] === TABLE_EVENT_TYPE.INITIALIZED) {\n this.pluginOptions.highlightRange && this.setFocusHighlightRange(this.pluginOptions.highlightRange);\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CELL) {\n const posCell = this.table.stateManager.select.cellPos;\n if (this.table.isHeader(posCell.col, posCell.row)) {\n this.setFocusHighlightRange(undefined);\n } else {\n const ranges = this.table.stateManager.select.ranges;\n const min_col = 0;\n const max_col = this.table.colCount - 1;\n const min_row = Math.min(ranges[0].start.row, ranges[0].end.row);\n const max_row = Math.max(ranges[0].start.row, ranges[0].end.row);\n this.setFocusHighlightRange({\n start: { col: min_col, row: min_row },\n end: { col: max_col, row: max_row }\n });\n }\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CLEAR) {\n this.setFocusHighlightRange(undefined);\n }\n }\n\n setFocusHighlightRange(range?: CellAddress | CellRange, forceUpdate: boolean = false) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range as CellRange;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n if (isSameRange(this.range, cellRange) && !forceUpdate) {\n return;\n }\n\n this.range = cellRange;\n if (!range) {\n // reset highlight\n this.deleteAllCellGroupShadow();\n } else {\n // update highlight\n this.updateCellGroupShadow();\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n deleteAllCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);\n }\n\n updateCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);\n }\n updateCellGroupShadowInContainer(container: Group, range?: CellAddress | CellRange) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n container.forEachChildrenSkipChild((item: INode) => {\n const column = item as unknown as Group;\n if (column.role === 'column') {\n column.forEachChildrenSkipChild((item: INode) => {\n const cell = item as unknown as Group;\n if (cell.role !== 'cell') {\n return;\n }\n cell.attachShadow(cell.shadowRoot);\n const shadowGroup = cell.shadowRoot;\n if (!cellRange) {\n // no highlight\n shadowGroup.removeAllChild();\n } else if (cellInRange(cellRange, cell.col, cell.row)) {\n // inside highlight\n shadowGroup.removeAllChild();\n } else if (!shadowGroup.firstChild) {\n // outside highlight\n const shadowRect = createRect({\n x: 0,\n y: 0,\n width: cell.attribute.width,\n height: cell.attribute.height,\n fill: this.pluginOptions.fill,\n opacity: this.pluginOptions.opacity\n });\n shadowRect.name = 'shadow-rect';\n shadowGroup.appendChild(shadowRect);\n }\n });\n }\n });\n }\n update() {\n this.setFocusHighlightRange(this.range, true);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["focus-highlight.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AAEzD,qEAAmE;AAGnE,6DAA+D;AAC/D,6CAAoD;AASpD,MAAa,oBAAoB;IAQ/B,YACE,UAAuC;QACrC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,SAAS;KAC1B;;QAZH,OAAE,GAAG,mBAAmB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACrC,SAAI,GAAG,iBAAiB,CAAC;QACzB,YAAO,GAAG,CAAC,yBAAgB,CAAC,WAAW,EAAE,yBAAgB,CAAC,aAAa,EAAE,yBAAgB,CAAC,cAAc,CAAC,CAAC;QAYxG,IAAI,CAAC,EAAE,GAAG,MAAA,OAAO,CAAC,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAChC;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,G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WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;qBACrC;gBACH,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM;QACJ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;CACF;AA/ID,oDA+IC","file":"focus-highlight.js","sourcesContent":["import type { INode } from '@visactor/vtable/es/vrender';\nimport { createRect } from '@visactor/vtable/es/vrender';\nimport type { Group } from '@visactor/vtable/es/scenegraph/graphic/group';\nimport { isSameRange } from '@visactor/vtable/es/tools/cell-range';\nimport type { CellAddress, CellRange } from '@visactor/vtable/es/ts-types';\nimport type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table';\nimport { cellInRange } from '@visactor/vtable/es/tools/helper';\nimport { TABLE_EVENT_TYPE } from '@visactor/vtable';\nimport type * as VTable from '@visactor/vtable';\nexport interface FocusHighlightPluginOptions {\n id?: string;\n fill?: string;\n opacity?: number;\n highlightRange?: CellAddress | CellRange; //初始化聚焦高亮范围\n}\n\nexport class FocusHighlightPlugin implements VTable.plugins.IVTablePlugin {\n id = `focus-highlight-${Date.now()}`;\n name = 'Focus Highlight';\n runTime = [TABLE_EVENT_TYPE.INITIALIZED, TABLE_EVENT_TYPE.SELECTED_CELL, TABLE_EVENT_TYPE.SELECTED_CLEAR];\n table: BaseTableAPI;\n range?: CellRange;\n pluginOptions: FocusHighlightPluginOptions;\n\n constructor(\n options: FocusHighlightPluginOptions = {\n fill: '#000',\n opacity: 0.5,\n highlightRange: undefined\n }\n ) {\n this.id = options.id ?? this.id;\n this.pluginOptions = Object.assign(\n {\n fill: '#000',\n opacity: 0.5\n },\n options\n );\n }\n run(...args: any[]) {\n if (!this.table) {\n this.table = args[2] as BaseTableAPI;\n }\n if (args[1] === TABLE_EVENT_TYPE.INITIALIZED) {\n this.pluginOptions.highlightRange && this.setFocusHighlightRange(this.pluginOptions.highlightRange);\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CELL) {\n const posCell = this.table.stateManager.select.cellPos;\n if (this.table.isHeader(posCell.col, posCell.row)) {\n this.setFocusHighlightRange(undefined);\n } else {\n const ranges = this.table.stateManager.select.ranges;\n const min_col = 0;\n const max_col = this.table.colCount - 1;\n const min_row = Math.min(ranges[0].start.row, ranges[0].end.row);\n const max_row = Math.max(ranges[0].start.row, ranges[0].end.row);\n this.setFocusHighlightRange({\n start: { col: min_col, row: min_row },\n end: { col: max_col, row: max_row }\n });\n }\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CLEAR) {\n this.setFocusHighlightRange(undefined);\n }\n }\n\n setFocusHighlightRange(range?: CellAddress | CellRange, forceUpdate: boolean = false) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range as CellRange;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n if (isSameRange(this.range, cellRange) && !forceUpdate) {\n return;\n }\n\n this.range = cellRange;\n if (!range) {\n // reset highlight\n this.deleteAllCellGroupShadow();\n } else {\n // update highlight\n this.updateCellGroupShadow();\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n deleteAllCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);\n }\n\n updateCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);\n }\n updateCellGroupShadowInContainer(container: Group, range?: CellAddress | CellRange) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n container.forEachChildrenSkipChild((item: INode) => {\n const column = item as unknown as Group;\n if (column.role === 'column') {\n column.forEachChildrenSkipChild((item: INode) => {\n const cell = item as unknown as Group;\n if (cell.role !== 'cell') {\n return;\n }\n cell.attachShadow(cell.shadowRoot);\n const shadowGroup = cell.shadowRoot;\n if (!cellRange) {\n // no highlight\n shadowGroup.removeAllChild();\n } else if (cellInRange(cellRange, cell.col, cell.row)) {\n // inside highlight\n shadowGroup.removeAllChild();\n } else if (!shadowGroup.firstChild) {\n // outside highlight\n const shadowRect = createRect({\n x: 0,\n y: 0,\n width: cell.attribute.width,\n height: cell.attribute.height,\n fill: this.pluginOptions.fill,\n opacity: this.pluginOptions.opacity\n });\n shadowRect.name = 'shadow-rect';\n shadowGroup.appendChild(shadowRect);\n }\n });\n }\n });\n }\n update() {\n this.setFocusHighlightRange(this.range, true);\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as VTableGantt from '@visactor/vtable-gantt';
|
|
2
|
+
export interface ExportOptions {
|
|
3
|
+
fileName?: string;
|
|
4
|
+
type?: 'png' | 'jpeg';
|
|
5
|
+
quality?: number;
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
scale?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class ExportGanttPlugin implements VTableGantt.plugins.IGanttPlugin {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
private _gantt;
|
|
13
|
+
run(...args: any[]): void;
|
|
14
|
+
exportToImage(options?: ExportOptions): Promise<string | undefined>;
|
|
15
|
+
private createFullSizeContainer;
|
|
16
|
+
private finalizeExport;
|
|
17
|
+
release(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
}, __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
27
|
+
return new (P || (P = Promise))((function(resolve, reject) {
|
|
28
|
+
function fulfilled(value) {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.next(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function rejected(value) {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.throw(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function step(result) {
|
|
43
|
+
var value;
|
|
44
|
+
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
45
|
+
resolve(value);
|
|
46
|
+
}))).then(fulfilled, rejected);
|
|
47
|
+
}
|
|
48
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
Object.defineProperty(exports, "__esModule", {
|
|
53
|
+
value: !0
|
|
54
|
+
}), exports.ExportGanttPlugin = void 0;
|
|
55
|
+
|
|
56
|
+
const VTableGantt = __importStar(require("@visactor/vtable-gantt"));
|
|
57
|
+
|
|
58
|
+
class ExportGanttPlugin {
|
|
59
|
+
constructor() {
|
|
60
|
+
this.id = "gantt-export-helper", this.name = "Gantt Export Helper", this._gantt = null;
|
|
61
|
+
}
|
|
62
|
+
run(...args) {
|
|
63
|
+
const ganttInstance = args[0];
|
|
64
|
+
ganttInstance && (this._gantt = ganttInstance);
|
|
65
|
+
}
|
|
66
|
+
exportToImage(options = {}) {
|
|
67
|
+
var _a;
|
|
68
|
+
return __awaiter(this, void 0, void 0, (function*() {
|
|
69
|
+
if (!this._gantt) return;
|
|
70
|
+
const {fileName: fileName = "gantt-export", type: type = "png", quality: quality = 1, backgroundColor: backgroundColor = "#ffffff", scale: scale = window.devicePixelRatio || 1} = options;
|
|
71
|
+
try {
|
|
72
|
+
const {tempContainer: tempContainer, clonedGantt: clonedGantt} = this.createFullSizeContainer(scale);
|
|
73
|
+
try {
|
|
74
|
+
yield new Promise((resolve => requestAnimationFrame(resolve)));
|
|
75
|
+
const totalWidth = (clonedGantt.taskListTableInstance.getAllColsWidth() + clonedGantt.getAllDateColsWidth()) * scale, totalHeight = clonedGantt.getAllRowsHeight() * scale, exportCanvas = document.createElement("canvas");
|
|
76
|
+
exportCanvas.width = totalWidth, exportCanvas.height = totalHeight;
|
|
77
|
+
const ctx = exportCanvas.getContext("2d");
|
|
78
|
+
ctx.fillStyle = backgroundColor, ctx.fillRect(0, 0, totalWidth, totalHeight), (null === (_a = clonedGantt.taskListTableInstance) || void 0 === _a ? void 0 : _a.canvas) && ctx.drawImage(clonedGantt.taskListTableInstance.canvas, 0, 0, clonedGantt.taskListTableInstance.getAllColsWidth() * scale, totalHeight);
|
|
79
|
+
const splitLineWidth = 3 * scale, splitLineX = clonedGantt.taskListTableInstance.getAllColsWidth() * scale;
|
|
80
|
+
ctx.fillStyle = "rgb(225, 228, 232)", ctx.fillRect(splitLineX - splitLineWidth / 2, 0, splitLineWidth, totalHeight);
|
|
81
|
+
const sourceX = 4 * scale, sourceWidth = clonedGantt.canvas.width - sourceX;
|
|
82
|
+
return clonedGantt.canvas && ctx.drawImage(clonedGantt.canvas, sourceX, 0, sourceWidth, clonedGantt.canvas.height, (clonedGantt.taskListTableInstance.getAllColsWidth() + 1.5) * scale, 0, (clonedGantt.getAllDateColsWidth() - 1.5) * scale, totalHeight),
|
|
83
|
+
this.finalizeExport(exportCanvas, fileName, type, quality);
|
|
84
|
+
} finally {
|
|
85
|
+
tempContainer.remove(), clonedGantt.release();
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
throw new Error(`甘特图导出失败: ${error instanceof Error ? error.message : "未知错误"}`);
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
createFullSizeContainer(scale) {
|
|
93
|
+
var _a, _b, _c;
|
|
94
|
+
if (!this._gantt) throw new Error("ExportGanttPlugin: Gantt instance not available to create container.");
|
|
95
|
+
const tempContainer = document.createElement("div");
|
|
96
|
+
tempContainer.style.position = "fixed", tempContainer.style.left = "-9999px", tempContainer.style.overflow = "hidden",
|
|
97
|
+
tempContainer.style.width = `${window.innerWidth + 100}px`, tempContainer.style.height = `${window.innerHeight + 100}px`,
|
|
98
|
+
document.body.appendChild(tempContainer);
|
|
99
|
+
const clonedContainer = document.createElement("div"), totalWidth = this._gantt.taskListTableInstance.getAllColsWidth() + this._gantt.getAllDateColsWidth(), totalHeight = this._gantt.getAllRowsHeight();
|
|
100
|
+
clonedContainer.style.width = `${totalWidth}px`, clonedContainer.style.height = `${totalHeight}px`,
|
|
101
|
+
tempContainer.appendChild(clonedContainer);
|
|
102
|
+
const clonedGantt = new VTableGantt.Gantt(clonedContainer, Object.assign(Object.assign({}, this._gantt.options), {
|
|
103
|
+
records: JSON.parse(JSON.stringify(this._gantt.records)),
|
|
104
|
+
taskListTable: Object.assign(Object.assign({}, this._gantt.options.taskListTable), {
|
|
105
|
+
tableWidth: void 0,
|
|
106
|
+
minTableWidth: void 0,
|
|
107
|
+
maxTableWidth: void 0
|
|
108
|
+
})
|
|
109
|
+
}));
|
|
110
|
+
return clonedGantt.setPixelRatio(scale), (null === (_a = clonedGantt.scenegraph) || void 0 === _a ? void 0 : _a.ganttGroup) && clonedGantt.scenegraph.ganttGroup.setAttribute("clip", !1),
|
|
111
|
+
(null === (_c = null === (_b = clonedGantt.taskListTableInstance) || void 0 === _b ? void 0 : _b.scenegraph) || void 0 === _c ? void 0 : _c.tableGroup) && clonedGantt.taskListTableInstance.scenegraph.tableGroup.setAttribute("clip", !1),
|
|
112
|
+
clonedGantt.scenegraph.stage.render(), {
|
|
113
|
+
tempContainer: tempContainer,
|
|
114
|
+
clonedGantt: clonedGantt
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
finalizeExport(canvas, fileName, type, quality) {
|
|
118
|
+
const base64 = canvas.toDataURL(`image/${type}`, quality), link = document.createElement("a");
|
|
119
|
+
return link.download = `${fileName}.${type}`, link.href = base64, document.body.appendChild(link),
|
|
120
|
+
link.click(), document.body.removeChild(link), base64;
|
|
121
|
+
}
|
|
122
|
+
release() {
|
|
123
|
+
this._gantt = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
exports.ExportGanttPlugin = ExportGanttPlugin;
|
|
128
|
+
//# sourceMappingURL=gantt-export-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["gantt-export-image.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;AAgBtD,MAAa,iBAAiB;IAA9B;QACI,OAAE,GAAG,qBAAqB,CAAC;QAC3B,SAAI,GAAG,qBAAqB,CAAC;QACrB,WAAM,GAA6B,IAAI,CAAC;IA+JpD,CAAC;IA5JG,GAAG,CAAC,GAAG,IAAW;QACd,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAsB,CAAC;QACnD,IAAI,CAAC,aAAa,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YAC/E,OAAO;SACX;QACD,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAChC,CAAC;IASY,aAAa,CAAC,UAAyB,EAAE;;;YAClD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAEd,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;gBAClE,OAAO,SAAS,CAAC;aACpB;YAED,MAAM,EACF,QAAQ,GAAG,cAAc,EACzB,IAAI,GAAG,KAAK,EACZ,OAAO,GAAG,CAAC,EACX,eAAe,GAAG,SAAS,EAC3B,KAAK,GAAG,MAAM,CAAC,gBAAgB,IAAI,CAAC,EACvC,GAAG,OAAO,CAAC;YAEZ,IAAI;gBACA,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;gBAE3E,IAAI;oBACA,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;oBAE7D,MAAM,UAAU,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC,eAAe,EAAE,GAA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W,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAEtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;IAC1C,CAAC;IAEO,cAAc,CAAC,MAAyB,EAAE,QAAgB,EAAE,IAAY,EAAE,OAAe;QAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;CACJ;AAlKD,8CAkKC","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}\r\n\r\n\r\n/**\r\n * 甘特图导出插件\r\n * @description 提供完整的甘特图导出功能,支持高分辨率输出和精准布局保留\r\n */\r\nexport class ExportGanttPlugin implements VTableGantt.plugins.IGanttPlugin {\r\n id = '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 * 执行甘特图导出操作\r\n * @async\r\n * @param {ExportOptions} [options={}] 导出配置选项\r\n * @returns {Promise<string | undefined>} 返回Base64格式的图片数据,或在未初始化时返回 undefined\r\n * @throws {Error} 导出过程中发生错误时抛出异常\r\n */\r\n public 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 } = 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 = (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, 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(\r\n splitLineX - splitLineWidth / 2,\r\n 0,\r\n splitLineWidth,\r\n totalHeight\r\n );\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, 0,\r\n sourceWidth, clonedGantt.canvas.height,\r\n (clonedGantt.taskListTableInstance.getAllColsWidth() + 1.5) * scale, 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);\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 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: JSON.parse(JSON.stringify(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 });\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\r\n private finalizeExport(canvas: HTMLCanvasElement, fileName: string, type: string, quality: number): string {\r\n const base64 = canvas.toDataURL(`image/${type}`, quality);\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 return base64;\r\n }\r\n \r\n release(): void {\r\n this._gantt = null;\r\n }\r\n}"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CellRange } from '@visactor/vtable/es/ts-types';
|
|
2
2
|
import type { BaseTableAPI, plugins } from '@visactor/vtable';
|
|
3
3
|
interface IHighlightHeaderWhenSelectCellPluginOptions {
|
|
4
|
+
id?: string;
|
|
4
5
|
rowHighlight?: boolean;
|
|
5
6
|
colHighlight?: boolean;
|
|
6
7
|
colHighlightBGColor?: string;
|