@visactor/vtable 0.13.1 → 0.13.2-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/ListTable.d.ts +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +2 -1
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +5 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +1 -0
- package/cjs/dataset/dataset.js +12 -2
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -1
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +3 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -0
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js +8 -5
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +17 -2
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +4 -4
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -1
- package/cjs/ts-types/icon.js.map +1 -1
- package/dist/vtable.js +72 -21
- package/dist/vtable.min.js +1 -1
- package/es/ListTable.d.ts +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +1 -1
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +5 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +1 -0
- package/es/dataset/dataset.js +12 -2
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/listener/table-group.js +1 -1
- package/es/event/listener/table-group.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +3 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -0
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js +8 -5
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +17 -2
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +4 -4
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -1
- package/es/ts-types/icon.js.map +1 -1
- package/package.json +3 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["event/listener/table-group.ts"],"names":[],"mappings":";;;AAEA,6CAAkD;AAElD,kCAA8C;AAC9C,kEAA+D;AAE/D,6CAAiD;AACjD,sDAA2E;AAC3E,+CAAkD;AAClD,2CAAwC;AAKxC,IAAI,aAAuC,CAAC;AAC5C,SAAgB,sBAAsB,CAAC,YAA0B;IAC/D,MAAM,K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AAG,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAwB,CAAC,CAAC;gBACvG,MAAM,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAAC,wBAAwB,CAAC,QAAQ,CAAC,KAAwB,CAAC,CAAC;gBAC7G,IAAI,qBAAqB,KAAK,qBAAqB,EAAE;oBACnD,KAAK,CAAC,UAAU,CAAC,6BAA6B,CAAC,GAAG,EAAE,GAAG,EAAE,qBAAqB,CAAC,CAAC;iBACjF;aACF;SACF;QACD,KAAK,CAAC,aAAa,CAAC,mCAAgB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC;AAzlBD,wDAylBC;AAED,SAAS,YAAY,CAAC,KAAmB;IACvC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;IAClC,IAAK,KAAa,CAAC,YAAY,CAAC,mCAAgB,CAAC,iBAAiB,CAAC,EAAE;QAEnE,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;YAC7C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SACtC;QACD,KAAK,CAAC,aAAa,CAAC,mCAAgB,CAAC,iBAAiB,EAAE;YACtD,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG;YACxC,OAAO;SACR,CAAC,CAAC;KACJ;AACH,CAAC","file":"table-group.js","sourcesContent":["import type { FederatedPointerEvent } from '@visactor/vrender';\nimport type { MousePointerCellEvent, MousePointerMultiCellEvent, MousePointerSparklineEvent } from '../../ts-types';\nimport { InteractionState } from '../../ts-types';\nimport type { SceneEvent } from '../util';\nimport { getCellEventArgsSet } from '../util';\nimport { TABLE_EVENT_TYPE } from '../../core/TABLE_EVENT_TYPE';\nimport type { Group } from '../../scenegraph/graphic/group';\nimport { isValid, last } from '@visactor/vutils';\nimport { getIconAndPositionFromTarget } from '../../scenegraph/utils/icon';\nimport { cellInRanges } from '../../tools/helper';\nimport { Rect } from '../../tools/Rect';\nimport type { EventManeger } from '../event';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { IIconGraphicAttribute } from '../../scenegraph/graphic/icon';\n// PointerMove敏感度太高了 记录下上一个鼠标位置 在接收到PointerMove事件时做判断 是否到到触发框选或者移动表头操作的标准,防止误触\nlet LastPointerXY: { x: number; y: number };\nexport function bindTableGroupListener(eventManeger: EventManeger) {\n const table = eventManeger.table;\n const stateManeger = table.stateManeger;\n document.body.addEventListener('pointermove', (e: FederatedPointerEvent) => {\n // 注释掉。因为: 这里pointermove太敏感了 点击快的时候 可能动了1px这里也会执行到 就影响到下面选中不触发的问题。下面pointermove就有这段逻辑,这里先去掉\n // if (eventManeger.touchSetTimeout) {\n // clearTimeout(eventManeger.touchSetTimeout);\n // console.log('eventManeger.touchSetTimeout', eventManeger.touchSetTimeout);\n // eventManeger.touchSetTimeout = undefined;\n // }\n // const eventArgsSet = getCellEventArgsSet(e);\n const { x, y } = table._getMouseAbstractPoint(e, false);\n if (stateManeger.interactionState === InteractionState.scrolling) {\n return;\n }\n if (stateManeger.interactionState === InteractionState.grabing) {\n if (stateManeger.isResizeCol()) {\n eventManeger.dealColumnResize(x, y);\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN)) {\n table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {\n col: table.stateManeger.columnResize.col,\n colWidth: table.getColWidth(table.stateManeger.columnResize.col)\n });\n }\n }\n }\n });\n table.scenegraph.tableGroup.addEventListener('pointermove', (e: FederatedPointerEvent) => {\n // console.log('scenegraph pointermove', e.pageX, e.pageY);\n const lastX = LastPointerXY?.x ?? e.x;\n const lastY = LastPointerXY?.y ?? e.y;\n LastPointerXY = { x: e.x, y: e.y };\n // const eventArgsSet: SceneEvent = (table as any).getCellEventArgsSet(e);\n if (eventManeger.touchSetTimeout) {\n // 移动端事件特殊处理\n clearTimeout(eventManeger.touchSetTimeout);\n eventManeger.touchSetTimeout = undefined;\n }\n const eventArgsSet = getCellEventArgsSet(e);\n\n if (stateManeger.interactionState === InteractionState.scrolling) {\n return;\n }\n if (\n stateManeger.interactionState === InteractionState.grabing &&\n Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1\n ) {\n if (stateManeger.isResizeCol()) {\n /* do nothing */\n } else if (stateManeger.isMoveCol()) {\n eventManeger.dealColumnMover(eventArgsSet);\n } else {\n eventManeger.dealTableSelect(eventArgsSet);\n }\n return;\n }\n // if (stateManeger.menu.isShow && stateManeger.menu.bounds.inPoint(e.x, e.y)) {\n // eventManeger.dealMenuHover(eventArgsSet);\n // return;\n // }\n // 更新列宽调整pointer\n if (stateManeger.isResizeCol() || eventManeger.checkColumnResize(eventArgsSet)) {\n stateManeger.updateCursor('col-resize');\n } else {\n stateManeger.updateCursor();\n }\n const cellGoup: any = e.path.find(node => (node as any).role === 'cell');\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (\n cellGoup?.role === 'cell' &&\n table.stateManeger.hover.cellPos.col !== -1 &&\n table.stateManeger.hover.cellPos.row !== -1 &&\n (cellGoup.col !== table.stateManeger.hover.cellPos.col || cellGoup.row !== table.stateManeger.hover.cellPos.row)\n ) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {\n col: table.stateManeger.hover.cellPos.col,\n row: table.stateManeger.hover.cellPos.row,\n cellRange: table.getCellRangeRelativeRect({\n col: table.stateManeger.hover.cellPos.col,\n row: table.stateManeger.hover.cellPos.row\n }),\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (\n cellGoup?.role === 'cell' &&\n isValid(cellGoup.col) &&\n isValid(cellGoup.row) &&\n (cellGoup.col !== table.stateManeger.hover.cellPos.col || cellGoup.row !== table.stateManeger.hover.cellPos.row)\n ) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {\n col: cellGoup.col,\n row: cellGoup.row,\n cellRange: table.getCellRangeRelativeRect({\n col: cellGoup.col,\n row: cellGoup.row\n }),\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n eventManeger.dealIconHover(eventArgsSet);\n eventManeger.dealTableHover(eventArgsSet);\n\n // 触发MOUSEMOVE_CELL\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL)) {\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n x: eventArgsSet.abstractPos.x,\n y: eventArgsSet.abstractPos.y,\n event: e.nativeEvent,\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerout', (e: FederatedPointerEvent) => {\n const eventArgsSet = getCellEventArgsSet(e);\n const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (cellGoup?.role === 'table') {\n eventManeger.dealTableHover();\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerover', (e: FederatedPointerEvent) => {\n const eventArgsSet = getCellEventArgsSet(e);\n const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n // console.log('pointerover', cellGoup);\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEOVER_CHART_SYMBOL) && cellGoup.type === 'symbol') {\n const cellGroup = e.composedPath().find(p => (p as any).roll === 'cell');\n if (cellGroup) {\n const { col, row } = cellGroup as unknown as Group;\n const eventInfo: MousePointerSparklineEvent = {\n col,\n row,\n field: table.getHeaderField(col, row),\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.internalProps.layoutMap.getCellHeaderPaths(col, row),\n title: table.getBodyColumnDefine(col, row).title,\n cellRange: table.getCellRelativeRect(col, row),\n event: e.nativeEvent,\n sparkline: {\n pointData: undefined // chartPoint.pointData,\n },\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n target: eventArgsSet?.eventArgs?.target\n };\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEOVER_CHART_SYMBOL, eventInfo);\n }\n }\n //MOUSEENTER_CELL 不能在这里触发 引发在单元格内移动会触发多次的问题【迷你图的单元格中】\n // if ((table as any).hasListeners(DG_EVENT_TYPE.MOUSEENTER_CELL)) {\n // const eventArgsSet = getCellEventArgsSet(e);\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n // console.log('hover cell', table.stateManeger.hover.cellPos);\n // if (\n // cellGoup?.role === 'cell' &&\n // (cellGoup.col !== table.stateManeger.hover.cellPos.col ||\n // cellGoup.row !== table.stateManeger.hover.cellPos.row)\n // ) {\n // table.fireListeners(DG_EVENT_TYPE.MOUSEENTER_CELL, {\n // col: cellGoup.col,\n // row: cellGoup.row,\n // cellRange: table.getCellRangeRelativeRect({\n // col: cellGoup.col,\n // row: cellGoup.row,\n // }),\n // scaleRatio:\n // table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n // event: e.nativeEvent,\n // });\n // }\n // }\n });\n // table.scenegraph.tableGroup.addEventListener('pointerenter', (e: FederatedPointerEvent) => {\n // console.log('pointerenter', e.target);\n // 触发MOUSEOVER_CELL\n // const eventArgsSet = getCellEventArgsSet(e);\n // if ((eventArgsSet?.eventArgs?.target as unknown as Group)?.role === 'cell') {\n // table.fireListeners(DG_EVENT_TYPE.MOUSEENTER_CELL, {\n // col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n // row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n // cellRange: table.getCellRangeRelativeRect({\n // col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n // row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n // }),\n // scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n // event: e.nativeEvent,\n // });\n // }\n // });\n table.scenegraph.tableGroup.addEventListener('pointerleave', (e: FederatedPointerEvent) => {\n //resize 列宽 当鼠标离开table也需要继续响应\n if (!stateManeger.isResizeCol()) {\n stateManeger.updateInteractionState(InteractionState.default);\n stateManeger.updateCursor();\n }\n eventManeger.dealTableHover();\n\n const target = e.target;\n if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {\n col: -1,\n row: -1,\n event: e.nativeEvent,\n target: undefined\n });\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e: FederatedPointerEvent) => {\n // pointerup中的逻辑 resize column size 当鼠标在外部松开也应该响应\n if (stateManeger.isResizeCol()) {\n endResizeCol(table);\n }\n stateManeger.updateInteractionState(InteractionState.default);\n eventManeger.dealTableHover();\n eventManeger.dealTableSelect();\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerdown', (e: FederatedPointerEvent) => {\n LastPointerXY = { x: e.x, y: e.y };\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n\n if (stateManeger.interactionState !== InteractionState.default) {\n return;\n }\n //处理当点击到的不是图表上时 更新图表的状态为空\n if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {\n table.scenegraph.updateChartState(null);\n }\n // 处理menu\n if (\n stateManeger.menu.isShow &&\n eventArgsSet.eventArgs &&\n (eventArgsSet.eventArgs.target as any) !== stateManeger.residentHoverIcon?.icon\n ) {\n // 点击在menu外,且不是下拉菜单的icon,移除menu\n stateManeger.hideMenu();\n }\n const hitIcon = (eventArgsSet?.eventArgs?.target as any)?.role?.startsWith('icon')\n ? eventArgsSet.eventArgs.target\n : undefined;\n if (!hitIcon || (hitIcon.attribute as IIconGraphicAttribute).interactive === false) {\n if (e.pointerType === 'touch') {\n // 移动端事件特殊处理\n eventManeger.touchEnd = false;\n eventManeger.touchSetTimeout = setTimeout(() => {\n eventManeger.isTouchdown = false;\n eventManeger.touchMove = true;\n // 处理列宽调整\n if (!eventManeger.touchEnd && eventManeger.checkColumnResize(eventArgsSet, true)) {\n // eventManeger.startColumnResize(e);\n // eventManeger._resizing = true;\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理column mover\n if (!eventManeger.touchEnd && eventManeger.chechColumnMover(eventArgsSet)) {\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理单元格选择\n if (eventManeger.dealTableSelect(eventArgsSet) && !eventManeger.touchEnd) {\n // 先执行单选逻辑,再更新为grabing模式\n // stateManeger.interactionState = 'grabing';\n stateManeger.updateInteractionState(InteractionState.grabing);\n // console.log('DRAG_SELECT_START');\n }\n }, 500);\n // 这里处理成hover 这样移动端 当点击到带有下拉菜单dropdown的单元格时 那个icon才能绘制出来。可以测试example的menu示例\n eventManeger.dealTableHover(eventArgsSet);\n } else {\n // 处理列宽调整\n if (eventManeger.checkColumnResize(eventArgsSet, true)) {\n // eventManeger.startColumnResize(e);\n // eventManeger._resizing = true;\n table.scenegraph.updateChartState(null);\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理column mover\n if (eventManeger.chechColumnMover(eventArgsSet)) {\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理单元格选择\n if (eventManeger.dealTableSelect(eventArgsSet)) {\n // 先执行单选逻辑,再更新为grabing模式\n // stateManeger.interactionState = 'grabing';\n stateManeger.updateInteractionState(InteractionState.grabing);\n // console.log('DRAG_SELECT_START');\n }\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL)) {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerup', (e: FederatedPointerEvent) => {\n // console.log('pointerup');\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n if (stateManeger.interactionState === 'grabing') {\n // stateManeger.interactionState = 'default';\n stateManeger.updateInteractionState(InteractionState.default);\n // eventManeger._resizing = false;\n if (stateManeger.isResizeCol()) {\n endResizeCol(table);\n } else if (stateManeger.isMoveCol()) {\n table.stateManeger.endMoveCol();\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {\n target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },\n source: {\n col: table.stateManeger.columnMove.colSource,\n row: table.stateManeger.columnMove.colSource //TODO row\n }\n });\n }\n } else if (stateManeger.isSelecting()) {\n table.stateManeger.endSelectCells();\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {\n const cellsEvent: MousePointerMultiCellEvent = {\n event: e.nativeEvent,\n cells: [],\n col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n target: eventArgsSet?.eventArgs?.target\n };\n\n cellsEvent.cells = table.getSelectedCellInfos();\n table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);\n }\n }\n } else if (stateManeger.interactionState === InteractionState.scrolling) {\n stateManeger.updateInteractionState(InteractionState.default);\n // scroll end\n }\n // console.log('DRAG_SELECT_END');\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('rightdown', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n // 右键点击\n if (eventArgsSet.eventArgs) {\n stateManeger.triggerContextMenu(\n eventArgsSet.eventArgs.col,\n eventArgsSet.eventArgs.row,\n eventArgsSet.abstractPos.x,\n eventArgsSet.abstractPos.y\n );\n\n //处理监听的右键事件\n const { col, row } = eventArgsSet.eventArgs;\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n if (cellInRanges(table.stateManeger.select.ranges, col, row)) {\n // 用户右键点击已经选中的区域\n // const { start, end } = eventManeger.selection.range;\n cellsEvent.cells = table.getSelectedCellInfos();\n } else {\n // 用户右键点击新单元格\n cellsEvent.cells = [[cellInfo]];\n }\n\n table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointertap', (e: FederatedPointerEvent) => {\n if (table.stateManeger.columnResize.resizing || table.stateManeger.columnMove.moving) {\n return;\n }\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n eventManeger.dealIconClick(e, eventArgsSet);\n if (!eventArgsSet?.eventArgs) {\n return;\n }\n if (eventManeger.touchSetTimeout || e.pointerType !== 'touch') {\n // 通过这个变量判断非drag鼠标拖拽状态,就不再增加其他变量isDrag了(touchSetTimeout如果拖拽过会变成undefined pointermove事件有置为undefined)\n if (e.pointerType === 'touch') {\n // 移动端事件特殊处理\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventManeger.touchSetTimeout) {\n clearTimeout(eventManeger.touchSetTimeout);\n eventManeger.dealTableSelect(eventArgsSet);\n eventManeger.touchSetTimeout = undefined;\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {\n const { col, row } = eventArgsSet.eventArgs;\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n\n table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);\n }\n }\n });\n\n // click outside\n table.scenegraph.stage.addEventListener('pointertap', (e: FederatedPointerEvent) => {\n const target = e.target;\n if (\n target &&\n !target.isDescendantsOf(table.scenegraph.tableGroup) &&\n (target as any) !== table.scenegraph.tableGroup\n ) {\n stateManeger.updateInteractionState(InteractionState.default);\n eventManeger.dealTableHover();\n eventManeger.dealTableSelect();\n stateManeger.updateCursor();\n table.scenegraph.updateChartState(null);\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('dblclick', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n const bounds = eventArgsSet.eventArgs.targetCell.globalAABBBounds;\n const { col, row } = eventArgsSet.eventArgs;\n const value = table.getCellValue(col, row);\n table.internalProps.focusControl.setFocusRect(\n new Rect(bounds.x1 + table.scrollLeft, bounds.y1 + table.scrollTop, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1),\n value\n );\n // console.log('activeElement',document.activeElement);\n // table.getElement().focus();\n // console.log('activeElement 2',document.activeElement);\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.DBLCLICK_CELL)) {\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n federatedEvent: e,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_CELL, cellsEvent);\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('checkbox_state_change', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n const { col, row } = eventArgsSet.eventArgs;\n const cellInfo = table.getCellInfo(col, row);\n\n const cellsEvent: MousePointerCellEvent & { checked: boolean } = {\n ...cellInfo,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target,\n checked: (e.detail as unknown as { checked: boolean }).checked\n };\n\n if (table.isHeader(col, row)) {\n //点击的表头部分的checkbox 需要同时处理表头和body单元格的状态\n table.stateManeger.setHeaderCheckedState(\n cellInfo.field as string | number,\n (e.detail as unknown as { checked: boolean }).checked\n );\n const define = table.getBodyColumnDefine(col, row);\n if (define.cellType === 'checkbox') {\n table.scenegraph.updateCheckboxCellState(col, row, (e.detail as unknown as { checked: boolean }).checked);\n }\n } else {\n //点击的是body单元格的checkbox 处理本单元格的状态维护 同时需要检查表头是否改变状态\n table.stateManeger.setCheckedState(\n col,\n row,\n cellInfo.field as string | number,\n (e.detail as unknown as { checked: boolean }).checked\n );\n const define = table.getBodyColumnDefine(col, row);\n if (define.headerType === 'checkbox') {\n const oldHeaderCheckedState = table.stateManeger.headerCheckedState[cellInfo.field as string | number];\n const newHeaderCheckedState = table.stateManeger.updateHeaderCheckedState(cellInfo.field as string | number);\n if (oldHeaderCheckedState !== newHeaderCheckedState) {\n table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);\n }\n }\n }\n table.fireListeners(TABLE_EVENT_TYPE.CHECKBOX_STATE_CHANGE, cellsEvent);\n });\n}\n\nfunction endResizeCol(table: BaseTableAPI) {\n table.stateManeger.endResizeCol();\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {\n // RESIZE_COLUMN_END事件触发,返回所有列宽\n const columns = [];\n // 返回所有列宽信息\n for (let col = 0; col < table.colCount; col++) {\n columns.push(table.getColWidth(col));\n }\n table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {\n col: table.stateManeger.columnResize.col,\n columns\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["event/listener/table-group.ts"],"names":[],"m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or/vrender';\nimport type { MousePointerCellEvent, MousePointerMultiCellEvent, MousePointerSparklineEvent } from '../../ts-types';\nimport { InteractionState } from '../../ts-types';\nimport type { SceneEvent } from '../util';\nimport { getCellEventArgsSet } from '../util';\nimport { TABLE_EVENT_TYPE } from '../../core/TABLE_EVENT_TYPE';\nimport type { Group } from '../../scenegraph/graphic/group';\nimport { isValid, last } from '@visactor/vutils';\nimport { getIconAndPositionFromTarget } from '../../scenegraph/utils/icon';\nimport { cellInRanges } from '../../tools/helper';\nimport { Rect } from '../../tools/Rect';\nimport type { EventManeger } from '../event';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { IIconGraphicAttribute } from '../../scenegraph/graphic/icon';\n// PointerMove敏感度太高了 记录下上一个鼠标位置 在接收到PointerMove事件时做判断 是否到到触发框选或者移动表头操作的标准,防止误触\nlet LastPointerXY: { x: number; y: number };\nexport function bindTableGroupListener(eventManeger: EventManeger) {\n const table = eventManeger.table;\n const stateManeger = table.stateManeger;\n document.body.addEventListener('pointermove', (e: FederatedPointerEvent) => {\n // 注释掉。因为: 这里pointermove太敏感了 点击快的时候 可能动了1px这里也会执行到 就影响到下面选中不触发的问题。下面pointermove就有这段逻辑,这里先去掉\n // if (eventManeger.touchSetTimeout) {\n // clearTimeout(eventManeger.touchSetTimeout);\n // console.log('eventManeger.touchSetTimeout', eventManeger.touchSetTimeout);\n // eventManeger.touchSetTimeout = undefined;\n // }\n // const eventArgsSet = getCellEventArgsSet(e);\n const { x, y } = table._getMouseAbstractPoint(e, false);\n if (stateManeger.interactionState === InteractionState.scrolling) {\n return;\n }\n if (stateManeger.interactionState === InteractionState.grabing) {\n if (stateManeger.isResizeCol()) {\n eventManeger.dealColumnResize(x, y);\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN)) {\n table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {\n col: table.stateManeger.columnResize.col,\n colWidth: table.getColWidth(table.stateManeger.columnResize.col)\n });\n }\n }\n }\n });\n table.scenegraph.tableGroup.addEventListener('pointermove', (e: FederatedPointerEvent) => {\n // console.log('scenegraph pointermove', e.pageX, e.pageY);\n const lastX = LastPointerXY?.x ?? e.x;\n const lastY = LastPointerXY?.y ?? e.y;\n LastPointerXY = { x: e.x, y: e.y };\n // const eventArgsSet: SceneEvent = (table as any).getCellEventArgsSet(e);\n if (eventManeger.touchSetTimeout) {\n // 移动端事件特殊处理\n clearTimeout(eventManeger.touchSetTimeout);\n eventManeger.touchSetTimeout = undefined;\n }\n const eventArgsSet = getCellEventArgsSet(e);\n\n if (stateManeger.interactionState === InteractionState.scrolling) {\n return;\n }\n if (\n stateManeger.interactionState === InteractionState.grabing &&\n Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1\n ) {\n if (stateManeger.isResizeCol()) {\n /* do nothing */\n } else if (stateManeger.isMoveCol()) {\n eventManeger.dealColumnMover(eventArgsSet);\n } else {\n eventManeger.dealTableSelect(eventArgsSet);\n }\n return;\n }\n // if (stateManeger.menu.isShow && stateManeger.menu.bounds.inPoint(e.x, e.y)) {\n // eventManeger.dealMenuHover(eventArgsSet);\n // return;\n // }\n // 更新列宽调整pointer\n if (stateManeger.isResizeCol() || eventManeger.checkColumnResize(eventArgsSet)) {\n stateManeger.updateCursor('col-resize');\n } else {\n stateManeger.updateCursor();\n }\n const cellGoup: any = e.path.find(node => (node as any).role === 'cell');\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (\n cellGoup?.role === 'cell' &&\n table.stateManeger.hover.cellPos.col !== -1 &&\n table.stateManeger.hover.cellPos.row !== -1 &&\n (cellGoup.col !== table.stateManeger.hover.cellPos.col || cellGoup.row !== table.stateManeger.hover.cellPos.row)\n ) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {\n col: table.stateManeger.hover.cellPos.col,\n row: table.stateManeger.hover.cellPos.row,\n cellRange: table.getCellRangeRelativeRect({\n col: table.stateManeger.hover.cellPos.col,\n row: table.stateManeger.hover.cellPos.row\n }),\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (\n cellGoup?.role === 'cell' &&\n isValid(cellGoup.col) &&\n isValid(cellGoup.row) &&\n (cellGoup.col !== table.stateManeger.hover.cellPos.col || cellGoup.row !== table.stateManeger.hover.cellPos.row)\n ) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {\n col: cellGoup.col,\n row: cellGoup.row,\n cellRange: table.getCellRangeRelativeRect({\n col: cellGoup.col,\n row: cellGoup.row\n }),\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n eventManeger.dealIconHover(eventArgsSet);\n eventManeger.dealTableHover(eventArgsSet);\n\n // 触发MOUSEMOVE_CELL\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL)) {\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n x: eventArgsSet.abstractPos.x,\n y: eventArgsSet.abstractPos.y,\n event: e.nativeEvent,\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerout', (e: FederatedPointerEvent) => {\n const eventArgsSet = getCellEventArgsSet(e);\n const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n if (cellGoup?.role === 'table') {\n eventManeger.dealTableHover();\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerover', (e: FederatedPointerEvent) => {\n const eventArgsSet = getCellEventArgsSet(e);\n const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n // console.log('pointerover', cellGoup);\n if (\n cellGoup &&\n (table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEOVER_CHART_SYMBOL) &&\n cellGoup.type === 'symbol'\n ) {\n const cellGroup = e.composedPath().find(p => (p as any).roll === 'cell');\n if (cellGroup) {\n const { col, row } = cellGroup as unknown as Group;\n const eventInfo: MousePointerSparklineEvent = {\n col,\n row,\n field: table.getHeaderField(col, row),\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.internalProps.layoutMap.getCellHeaderPaths(col, row),\n title: table.getBodyColumnDefine(col, row).title,\n cellRange: table.getCellRelativeRect(col, row),\n event: e.nativeEvent,\n sparkline: {\n pointData: undefined // chartPoint.pointData,\n },\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n target: eventArgsSet?.eventArgs?.target\n };\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEOVER_CHART_SYMBOL, eventInfo);\n }\n }\n //MOUSEENTER_CELL 不能在这里触发 引发在单元格内移动会触发多次的问题【迷你图的单元格中】\n // if ((table as any).hasListeners(DG_EVENT_TYPE.MOUSEENTER_CELL)) {\n // const eventArgsSet = getCellEventArgsSet(e);\n // const cellGoup = eventArgsSet?.eventArgs?.target as unknown as Group;\n // console.log('hover cell', table.stateManeger.hover.cellPos);\n // if (\n // cellGoup?.role === 'cell' &&\n // (cellGoup.col !== table.stateManeger.hover.cellPos.col ||\n // cellGoup.row !== table.stateManeger.hover.cellPos.row)\n // ) {\n // table.fireListeners(DG_EVENT_TYPE.MOUSEENTER_CELL, {\n // col: cellGoup.col,\n // row: cellGoup.row,\n // cellRange: table.getCellRangeRelativeRect({\n // col: cellGoup.col,\n // row: cellGoup.row,\n // }),\n // scaleRatio:\n // table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n // event: e.nativeEvent,\n // });\n // }\n // }\n });\n // table.scenegraph.tableGroup.addEventListener('pointerenter', (e: FederatedPointerEvent) => {\n // console.log('pointerenter', e.target);\n // 触发MOUSEOVER_CELL\n // const eventArgsSet = getCellEventArgsSet(e);\n // if ((eventArgsSet?.eventArgs?.target as unknown as Group)?.role === 'cell') {\n // table.fireListeners(DG_EVENT_TYPE.MOUSEENTER_CELL, {\n // col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n // row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n // cellRange: table.getCellRangeRelativeRect({\n // col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n // row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n // }),\n // scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n // event: e.nativeEvent,\n // });\n // }\n // });\n table.scenegraph.tableGroup.addEventListener('pointerleave', (e: FederatedPointerEvent) => {\n //resize 列宽 当鼠标离开table也需要继续响应\n if (!stateManeger.isResizeCol()) {\n stateManeger.updateInteractionState(InteractionState.default);\n stateManeger.updateCursor();\n }\n eventManeger.dealTableHover();\n\n const target = e.target;\n if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {\n col: -1,\n row: -1,\n event: e.nativeEvent,\n target: undefined\n });\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e: FederatedPointerEvent) => {\n // pointerup中的逻辑 resize column size 当鼠标在外部松开也应该响应\n if (stateManeger.isResizeCol()) {\n endResizeCol(table);\n }\n stateManeger.updateInteractionState(InteractionState.default);\n eventManeger.dealTableHover();\n eventManeger.dealTableSelect();\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerdown', (e: FederatedPointerEvent) => {\n LastPointerXY = { x: e.x, y: e.y };\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n\n if (stateManeger.interactionState !== InteractionState.default) {\n return;\n }\n //处理当点击到的不是图表上时 更新图表的状态为空\n if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {\n table.scenegraph.updateChartState(null);\n }\n // 处理menu\n if (\n stateManeger.menu.isShow &&\n eventArgsSet.eventArgs &&\n (eventArgsSet.eventArgs.target as any) !== stateManeger.residentHoverIcon?.icon\n ) {\n // 点击在menu外,且不是下拉菜单的icon,移除menu\n stateManeger.hideMenu();\n }\n const hitIcon = (eventArgsSet?.eventArgs?.target as any)?.role?.startsWith('icon')\n ? eventArgsSet.eventArgs.target\n : undefined;\n if (!hitIcon || (hitIcon.attribute as IIconGraphicAttribute).interactive === false) {\n if (e.pointerType === 'touch') {\n // 移动端事件特殊处理\n eventManeger.touchEnd = false;\n eventManeger.touchSetTimeout = setTimeout(() => {\n eventManeger.isTouchdown = false;\n eventManeger.touchMove = true;\n // 处理列宽调整\n if (!eventManeger.touchEnd && eventManeger.checkColumnResize(eventArgsSet, true)) {\n // eventManeger.startColumnResize(e);\n // eventManeger._resizing = true;\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理column mover\n if (!eventManeger.touchEnd && eventManeger.chechColumnMover(eventArgsSet)) {\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理单元格选择\n if (eventManeger.dealTableSelect(eventArgsSet) && !eventManeger.touchEnd) {\n // 先执行单选逻辑,再更新为grabing模式\n // stateManeger.interactionState = 'grabing';\n stateManeger.updateInteractionState(InteractionState.grabing);\n // console.log('DRAG_SELECT_START');\n }\n }, 500);\n // 这里处理成hover 这样移动端 当点击到带有下拉菜单dropdown的单元格时 那个icon才能绘制出来。可以测试example的menu示例\n eventManeger.dealTableHover(eventArgsSet);\n } else {\n // 处理列宽调整\n if (eventManeger.checkColumnResize(eventArgsSet, true)) {\n // eventManeger.startColumnResize(e);\n // eventManeger._resizing = true;\n table.scenegraph.updateChartState(null);\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理column mover\n if (eventManeger.chechColumnMover(eventArgsSet)) {\n stateManeger.updateInteractionState(InteractionState.grabing);\n return;\n }\n\n // 处理单元格选择\n if (eventManeger.dealTableSelect(eventArgsSet)) {\n // 先执行单选逻辑,再更新为grabing模式\n // stateManeger.interactionState = 'grabing';\n stateManeger.updateInteractionState(InteractionState.grabing);\n // console.log('DRAG_SELECT_START');\n }\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL)) {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointerup', (e: FederatedPointerEvent) => {\n // console.log('pointerup');\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n if (stateManeger.interactionState === 'grabing') {\n // stateManeger.interactionState = 'default';\n stateManeger.updateInteractionState(InteractionState.default);\n // eventManeger._resizing = false;\n if (stateManeger.isResizeCol()) {\n endResizeCol(table);\n } else if (stateManeger.isMoveCol()) {\n table.stateManeger.endMoveCol();\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {\n target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },\n source: {\n col: table.stateManeger.columnMove.colSource,\n row: table.stateManeger.columnMove.colSource //TODO row\n }\n });\n }\n } else if (stateManeger.isSelecting()) {\n table.stateManeger.endSelectCells();\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs && (table as any).hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {\n const cellsEvent: MousePointerMultiCellEvent = {\n event: e.nativeEvent,\n cells: [],\n col: (eventArgsSet.eventArgs.target as unknown as Group).col,\n row: (eventArgsSet.eventArgs.target as unknown as Group).row,\n scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,\n target: eventArgsSet?.eventArgs?.target\n };\n\n cellsEvent.cells = table.getSelectedCellInfos();\n table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);\n }\n }\n } else if (stateManeger.interactionState === InteractionState.scrolling) {\n stateManeger.updateInteractionState(InteractionState.default);\n // scroll end\n }\n // console.log('DRAG_SELECT_END');\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventArgsSet.eventArgs) {\n table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {\n col: eventArgsSet.eventArgs.col,\n row: eventArgsSet.eventArgs.row,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target\n });\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('rightdown', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n // 右键点击\n if (eventArgsSet.eventArgs) {\n stateManeger.triggerContextMenu(\n eventArgsSet.eventArgs.col,\n eventArgsSet.eventArgs.row,\n eventArgsSet.abstractPos.x,\n eventArgsSet.abstractPos.y\n );\n\n //处理监听的右键事件\n const { col, row } = eventArgsSet.eventArgs;\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n if (cellInRanges(table.stateManeger.select.ranges, col, row)) {\n // 用户右键点击已经选中的区域\n // const { start, end } = eventManeger.selection.range;\n cellsEvent.cells = table.getSelectedCellInfos();\n } else {\n // 用户右键点击新单元格\n cellsEvent.cells = [[cellInfo]];\n }\n\n table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);\n }\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('pointertap', (e: FederatedPointerEvent) => {\n if (table.stateManeger.columnResize.resizing || table.stateManeger.columnMove.moving) {\n return;\n }\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n eventManeger.dealIconClick(e, eventArgsSet);\n if (!eventArgsSet?.eventArgs) {\n return;\n }\n if (eventManeger.touchSetTimeout || e.pointerType !== 'touch') {\n // 通过这个变量判断非drag鼠标拖拽状态,就不再增加其他变量isDrag了(touchSetTimeout如果拖拽过会变成undefined pointermove事件有置为undefined)\n if (e.pointerType === 'touch') {\n // 移动端事件特殊处理\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n if (eventManeger.touchSetTimeout) {\n clearTimeout(eventManeger.touchSetTimeout);\n eventManeger.dealTableSelect(eventArgsSet);\n eventManeger.touchSetTimeout = undefined;\n }\n }\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {\n const { col, row } = eventArgsSet.eventArgs;\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n\n table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);\n }\n }\n });\n\n // click outside\n table.scenegraph.stage.addEventListener('pointertap', (e: FederatedPointerEvent) => {\n const target = e.target;\n if (\n target &&\n !target.isDescendantsOf(table.scenegraph.tableGroup) &&\n (target as any) !== table.scenegraph.tableGroup\n ) {\n stateManeger.updateInteractionState(InteractionState.default);\n eventManeger.dealTableHover();\n eventManeger.dealTableSelect();\n stateManeger.updateCursor();\n table.scenegraph.updateChartState(null);\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('dblclick', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n const bounds = eventArgsSet.eventArgs.targetCell.globalAABBBounds;\n const { col, row } = eventArgsSet.eventArgs;\n const value = table.getCellValue(col, row);\n table.internalProps.focusControl.setFocusRect(\n new Rect(bounds.x1 + table.scrollLeft, bounds.y1 + table.scrollTop, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1),\n value\n );\n // console.log('activeElement',document.activeElement);\n // table.getElement().focus();\n // console.log('activeElement 2',document.activeElement);\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.DBLCLICK_CELL)) {\n const cellInfo = table.getCellInfo(col, row);\n let icon;\n let position;\n if (eventArgsSet.eventArgs?.target) {\n const iconInfo = getIconAndPositionFromTarget(eventArgsSet.eventArgs?.target);\n if (iconInfo) {\n icon = iconInfo.icon;\n position = iconInfo.position;\n }\n }\n const cellsEvent: MousePointerMultiCellEvent = {\n ...cellInfo,\n event: e.nativeEvent,\n federatedEvent: e,\n cells: [],\n targetIcon: icon\n ? {\n name: icon.name,\n position: position,\n funcType: (icon as any).attribute.funcType\n }\n : undefined,\n target: eventArgsSet?.eventArgs?.target\n };\n table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_CELL, cellsEvent);\n }\n });\n\n table.scenegraph.tableGroup.addEventListener('checkbox_state_change', (e: FederatedPointerEvent) => {\n const eventArgsSet: SceneEvent = getCellEventArgsSet(e);\n const { col, row } = eventArgsSet.eventArgs;\n const cellInfo = table.getCellInfo(col, row);\n\n const cellsEvent: MousePointerCellEvent & { checked: boolean } = {\n ...cellInfo,\n event: e.nativeEvent,\n target: eventArgsSet?.eventArgs?.target,\n checked: (e.detail as unknown as { checked: boolean }).checked\n };\n\n if (table.isHeader(col, row)) {\n //点击的表头部分的checkbox 需要同时处理表头和body单元格的状态\n table.stateManeger.setHeaderCheckedState(\n cellInfo.field as string | number,\n (e.detail as unknown as { checked: boolean }).checked\n );\n const define = table.getBodyColumnDefine(col, row);\n if (define.cellType === 'checkbox') {\n table.scenegraph.updateCheckboxCellState(col, row, (e.detail as unknown as { checked: boolean }).checked);\n }\n } else {\n //点击的是body单元格的checkbox 处理本单元格的状态维护 同时需要检查表头是否改变状态\n table.stateManeger.setCheckedState(\n col,\n row,\n cellInfo.field as string | number,\n (e.detail as unknown as { checked: boolean }).checked\n );\n const define = table.getBodyColumnDefine(col, row);\n if (define.headerType === 'checkbox') {\n const oldHeaderCheckedState = table.stateManeger.headerCheckedState[cellInfo.field as string | number];\n const newHeaderCheckedState = table.stateManeger.updateHeaderCheckedState(cellInfo.field as string | number);\n if (oldHeaderCheckedState !== newHeaderCheckedState) {\n table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);\n }\n }\n }\n table.fireListeners(TABLE_EVENT_TYPE.CHECKBOX_STATE_CHANGE, cellsEvent);\n });\n}\n\nfunction endResizeCol(table: BaseTableAPI) {\n table.stateManeger.endResizeCol();\n if ((table as any).hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {\n // RESIZE_COLUMN_END事件触发,返回所有列宽\n const columns = [];\n // 返回所有列宽信息\n for (let col = 0; col < table.colCount; col++) {\n columns.push(table.getColWidth(col));\n }\n table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {\n col: table.stateManeger.columnResize.col,\n columns\n });\n }\n}\n"]}
|
package/cjs/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { MousePointerCellEvent } from './ts-types/events';
|
|
|
12
12
|
import * as CustomLayout from './render/layout';
|
|
13
13
|
export { getDataCellPath } from './tools/get-data-path';
|
|
14
14
|
export * from './render/jsx';
|
|
15
|
-
export declare const version = "0.13.
|
|
15
|
+
export declare const version = "0.13.2-alpha.2";
|
|
16
16
|
export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
|
|
17
17
|
declare function getIcons(): {
|
|
18
18
|
[key: string]: TYPES.ColumnIconOption;
|
package/cjs/index.js
CHANGED
|
@@ -101,6 +101,6 @@ Object.defineProperty(exports, "getDataCellPath", {
|
|
|
101
101
|
get: function() {
|
|
102
102
|
return get_data_path_1.getDataCellPath;
|
|
103
103
|
}
|
|
104
|
-
}), __exportStar(require("./render/jsx"), exports), exports.version = "0.13.
|
|
104
|
+
}), __exportStar(require("./render/jsx"), exports), exports.version = "0.13.2-alpha.2",
|
|
105
105
|
exports.getIcons = getIcons, exports.clearGlobal = clearGlobal, TYPES.AggregationType;
|
|
106
106
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/* eslint-disable sort-imports */\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\n// import { container, loadCanvasPicker } from '@visactor/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.13.2-alpha.2\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
|
|
@@ -97,9 +97,10 @@ function updateCell(col, row, table, addNew) {
|
|
|
97
97
|
|
|
98
98
|
function updateCellContent(type, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, isMerge, range, addNew, cellTheme) {
|
|
99
99
|
var _a, _b;
|
|
100
|
+
if (oldCellGroup.row !== row || oldCellGroup.col !== col) return null;
|
|
100
101
|
const newCellGroup = createCell(type, define, table, col, row, table.getColWidth(col), cellWidth, cellHeight, addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent, addNew ? 0 : table.scenegraph.getCellGroupY(row), padding, textAlign, textBaseline, mayHaveIcon, isMerge, range, cellTheme);
|
|
101
|
-
return addNew
|
|
102
|
-
(null === (_a = table.scenegraph) || void 0 === _a ? void 0 : _a.proxy.cellCache.get(col)) && (null === (_b = table.scenegraph) || void 0 === _b || _b.proxy.cellCache.set(col, newCellGroup))),
|
|
102
|
+
return !addNew && oldCellGroup.parent && (oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup),
|
|
103
|
+
oldCellGroup.parent.removeChild(oldCellGroup), (null === (_a = table.scenegraph) || void 0 === _a ? void 0 : _a.proxy.cellCache.get(col)) && (null === (_b = table.scenegraph) || void 0 === _b || _b.proxy.cellCache.set(col, newCellGroup))),
|
|
103
104
|
newCellGroup;
|
|
104
105
|
}
|
|
105
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AACrD,4CAAyC;AACzC,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAAuD;AACvD,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA2D;AAC3D,6DAAoE;AAIpE,SAAgB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C;QAC5D,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAG9C,IAAI,MAAA,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC9C,MAAA,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAC1D;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","file":"cell-helper.js","sourcesContent":["import type { Cursor, IThemeSpec } from '@visactor/vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\n\nexport function createCell(\n type: ColumnTypeOption,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n isMerge: boolean,\n range: CellRange,\n cellTheme: IThemeSpec\n): Group {\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = table.getCellValue(col, row);\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n cellGroup = createCellGroup(\n table,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme\n );\n if (isMerge) {\n cellGroup.mergeCol = range.end.col;\n cellGroup.mergeRow = range.end.row;\n }\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.clear();\n }\n\n // if ((define as any)?.isAxis && cellLocation === 'columnHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'top',\n // type: 'band',\n // data: ['A', 'B', 'C'],\n // title: {\n // visible: true,\n // text: 'X Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('y', 40);\n // cellGroup.appendChild(axis.component);\n // } else if ((define as any)?.isAxis && cellLocation === 'rowHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'left',\n // type: 'linear',\n // range: { min: 0, max: 30 },\n // label: {\n // flush: true\n // },\n // grid: {\n // visible: true\n // },\n // title: {\n // visible: true,\n // text: 'Y Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('x', 80);\n // cellGroup.appendChild(axis.component);\n // axis.overlap();\n // }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n padding,\n table.getCellValue(col, row),\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const value = table.getCellValue(col, row);\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n const cellLocation = table.getCellLocation(col, row);\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n\n let isMerge;\n let range;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n let newCellGroup;\n if (isMerge && (col !== range.start.col || row !== range.start.row)) {\n // 合并单元格的非起始单元格不需要绘制\n newCellGroup = new Group({\n x: 0,\n y: addNew ? 0 : oldCellGroup.attribute.y,\n width: 0,\n height: 0,\n visible: false,\n pickable: false\n });\n newCellGroup.role = 'shadow-cell';\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.mergeCol = range.start.col;\n newCellGroup.mergeRow = range.start.row;\n\n if (!addNew) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update merge cell\n updateCell(range.start.col, range.start.row, table, false);\n }\n } else {\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const headerStyle = table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let customRender;\n let customLayout;\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n const value = table.getCellValue(col, row);\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n addNew,\n cellTheme\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n addNew,\n cellTheme\n );\n }\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n isMerge: boolean,\n range: CellRange,\n addNew: boolean,\n cellTheme?: IThemeSpec\n) {\n const newCellGroup = createCell(\n type,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n cellTheme\n );\n if (!addNew) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AACrD,4CAAyC;AACzC,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAAuD;AACvD,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA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AW,EACX,OAAO,EACP,KAAK,EACL,SAAS,CACV,CAAC;IACF,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,EAAE;QAClC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC5D,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAG9C,IAAI,MAAA,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC9C,MAAA,KAAK,CAAC,UAAU,0CAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAC1D;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","file":"cell-helper.js","sourcesContent":["import type { Cursor, IThemeSpec } from '@visactor/vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\n\nexport function createCell(\n type: ColumnTypeOption,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n isMerge: boolean,\n range: CellRange,\n cellTheme: IThemeSpec\n): Group {\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = table.getCellValue(col, row);\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n cellGroup = createCellGroup(\n table,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme\n );\n if (isMerge) {\n cellGroup.mergeCol = range.end.col;\n cellGroup.mergeRow = range.end.row;\n }\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.clear();\n }\n\n // if ((define as any)?.isAxis && cellLocation === 'columnHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'top',\n // type: 'band',\n // data: ['A', 'B', 'C'],\n // title: {\n // visible: true,\n // text: 'X Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('y', 40);\n // cellGroup.appendChild(axis.component);\n // } else if ((define as any)?.isAxis && cellLocation === 'rowHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'left',\n // type: 'linear',\n // range: { min: 0, max: 30 },\n // label: {\n // flush: true\n // },\n // grid: {\n // visible: true\n // },\n // title: {\n // visible: true,\n // text: 'Y Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('x', 80);\n // cellGroup.appendChild(axis.component);\n // axis.overlap();\n // }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n padding,\n table.getCellValue(col, row),\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const value = table.getCellValue(col, row);\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n const cellLocation = table.getCellLocation(col, row);\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n\n let isMerge;\n let range;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n let newCellGroup;\n if (isMerge && (col !== range.start.col || row !== range.start.row)) {\n // 合并单元格的非起始单元格不需要绘制\n newCellGroup = new Group({\n x: 0,\n y: addNew ? 0 : oldCellGroup.attribute.y,\n width: 0,\n height: 0,\n visible: false,\n pickable: false\n });\n newCellGroup.role = 'shadow-cell';\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.mergeCol = range.start.col;\n newCellGroup.mergeRow = range.start.row;\n\n if (!addNew) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update merge cell\n updateCell(range.start.col, range.start.row, table, false);\n }\n } else {\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const headerStyle = table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let customRender;\n let customLayout;\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n const value = table.getCellValue(col, row);\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n addNew,\n cellTheme\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n addNew,\n cellTheme\n );\n }\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n isMerge: boolean,\n range: CellRange,\n addNew: boolean,\n cellTheme?: IThemeSpec\n) {\n //解决报错 getCellByCache递归调用 死循环问题\n if (oldCellGroup.row !== row || oldCellGroup.col !== col) {\n return null;\n }\n const newCellGroup = createCell(\n type,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n cellTheme\n );\n if (!addNew && oldCellGroup.parent) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n"]}
|
|
@@ -147,6 +147,7 @@ function updateRowContent(syncTopRow, syncBottomRow, proxy) {
|
|
|
147
147
|
const cellGroup = proxy.highPerformanceGetCell(col, row);
|
|
148
148
|
proxy.updateCellGroupContent(cellGroup);
|
|
149
149
|
}
|
|
150
|
+
proxy.table.scenegraph.updateNextFrame();
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
exports.dynamicSetY = dynamicSetY, exports.updateRowContent = updateRowContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-y.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AAEvE,uDAAkD;AAClD,iCAA4C;AAE5C,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAI5D,MAAM,SAAS,GAAI,KAAK,CAAC,KAAa,CAAC,cAAc,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAClH,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC;QACnC,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC;QACjC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAClC,MAAM,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACnD,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEhB,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAC1D,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;SACpC;aAAM,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEvB,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAC7D,KAAK,CAAC,UAAU,CAAC,CAAC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IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IAED,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE;QAClE,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;AACH,CAAC;AAzBD,4CAyBC","file":"dynamic-set-y.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\nimport { checkFirstRowMerge } from './util';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n\n // proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n // syncTopRow = Math.max(distStartRow, topRow);\n // syncBottomRow = Math.min(distEndRow, bottomRow);\n syncTopRow = topRow;\n syncBottomRow = bottomRow;\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n checkFirstRowMerge(syncTopRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n direction\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, distStartRow);\n proxy.rowUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n //console.log('更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n checkFirstRowMerge(syncTopRow, proxy);\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n proxy.table.scenegraph.proxy.deltaY = 0;\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-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AAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IACD,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;AAC3C,CAAC;AA1BD,4CA0BC","file":"dynamic-set-y.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\nimport { checkFirstRowMerge } from './util';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n\n // proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n // syncTopRow = Math.max(distStartRow, topRow);\n // syncBottomRow = Math.min(distEndRow, bottomRow);\n syncTopRow = topRow;\n syncBottomRow = bottomRow;\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n checkFirstRowMerge(syncTopRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n direction\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, distStartRow);\n proxy.rowUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n //console.log('更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n checkFirstRowMerge(syncTopRow, proxy);\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n proxy.table.scenegraph.proxy.deltaY = 0;\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n proxy.table.scenegraph.updateNextFrame();\n}\n"]}
|
|
@@ -34,12 +34,15 @@ const compute_col_width_1 = require("../../../layout/compute-col-width"), dynami
|
|
|
34
34
|
|
|
35
35
|
function sortHorizontal(proxy) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
37
|
+
proxy.table.scenegraph.bottomFrozenGroup.forEachChildren(((colGroup, index) => {
|
|
38
|
+
"group" === colGroup.type && (colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
40
39
|
cellGroup.needUpdate = !0;
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
40
|
+
})));
|
|
41
|
+
})), proxy.table.scenegraph.bodyGroup.forEachChildren(((colGroup, index) => {
|
|
42
|
+
"group" === colGroup.type && (colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
43
|
+
cellGroup.needUpdate = !0;
|
|
44
|
+
})));
|
|
45
|
+
}));
|
|
43
46
|
const syncLeftCol = Math.max(proxy.bodyLeftCol, proxy.screenLeftCol - 1 * proxy.screenColCount), syncRightCol = Math.min(proxy.bodyRightCol, proxy.screenLeftCol + 2 * proxy.screenColCount);
|
|
44
47
|
(0, compute_col_width_1.computeColsWidth)(proxy.table, syncLeftCol, syncRightCol),
|
|
45
48
|
(0, dynamic_set_x_1.updateColContent)(syncLeftCol, syncRightCol, proxy), proxy.colUpdatePos = proxy.colStart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/sort-horizontal.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAqE;AAErE,mDAAmD;AAGnD,SAAsB,cAAc,CAAC,KAAiB;;
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/sort-horizontal.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAqE;AAErE,mDAAmD;AAGnD,SAAsB,cAAc,CAAC,KAAiB;;QAgBpD,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;YAC1F,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;gBAC7B,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;gBAC3B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,CAAC,C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AC,eAAe,EAAE,CAAC;QACzC,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CAAA;AApED,wCAoEC","file":"sort-horizontal.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateColContent } from './dynamic-set-x';\nimport { updateAutoColumn } from './update-auto-column';\n\nexport async function sortHorizontal(proxy: SceneProxy) {\n // for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n // const colGroup = proxy.table.scenegraph.getColGroup(col);\n // colGroup.needUpdate = true;\n // colGroup?.forEachChildren((cellGroup: Group) => {\n // (cellGroup as any).needUpdate = true;\n // });\n // }\n // proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n // if (colGroup.type === 'group') {\n // colGroup.needUpdate = true;\n // colGroup?.forEachChildren((cellGroup: Group) => {\n // (cellGroup as any).needUpdate = true;\n // });\n // }\n // });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n colGroup.needUpdate = true;\n colGroup?.forEachChildren((cellGroup: Group) => {\n (cellGroup as any).needUpdate = true;\n });\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n colGroup.needUpdate = true;\n colGroup?.forEachChildren((cellGroup: Group) => {\n (cellGroup as any).needUpdate = true;\n });\n }\n });\n\n // 更新同步范围\n const syncLeftCol = Math.max(proxy.bodyLeftCol, proxy.screenLeftCol - proxy.screenColCount * 1);\n const syncRightCol = Math.min(proxy.bodyRightCol, proxy.screenLeftCol + proxy.screenColCount * 2);\n\n computeColsWidth(proxy.table, syncLeftCol, syncRightCol);\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n // updateAutoColumn(\n // syncLeftCol, // colStart\n // syncRightCol, // colEnd\n // proxy.table,\n // proxy.colEnd > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n // );\n\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = proxy.colEnd > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n // if (\n // proxy.colEnd === proxy.table.scenegraph.proxy.bodyRightCol &&\n // proxy.colStart === proxy.table.scenegraph.proxy.bodyLeftCol\n // ) {\n // // 全量更新,do nothing\n // } else if (proxy.colEnd === proxy.table.scenegraph.proxy.bodyRightCol) {\n // const totalWidth = proxy.table.getAllColsWidth();\n // const left = totalWidth - proxy.table.scenegraph.width;\n // // proxy.updateBody(top);\n // proxy.table.scenegraph.setBodyAndColHeaderX(-left);\n // } else if (proxy.colStart === proxy.table.scenegraph.proxy.bodyLeftCol) {\n // // proxy.updateBody(0);\n // proxy.table.scenegraph.setBodyAndColHeaderX(0);\n // }\n\n proxy.table.scenegraph.updateNextFrame();\n await proxy.progress();\n}\n"]}
|