Skip to content

Commit

Permalink
fix: change_header_position_start event add argumment
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile authored and Rui-Sun committed Oct 11, 2024
1 parent da6b074 commit 2caaf3c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('listTable-cellType-function init test', () => {
const listTable = new ListTable(containerDom, option);
test('listTable dragHeader interaction', () => {
listTable.selectCell(4, 1);
listTable.stateManager.startMoveCol(4, 1, 342, 60);
listTable.stateManager.startMoveCol(4, 1, 342, 60, null);
listTable.stateManager.updateMoveCol(1, 1, 100, 60);
listTable.stateManager.endMoveCol();
expect(listTable.columns).toEqual([
Expand Down
6 changes: 3 additions & 3 deletions packages/vtable/examples/cell-move/pivot-move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export function createTable() {
console.log('copy_data', e);
});

VTable.bindDebugTool(instance.scenegraph.stage as any, {
customGrapicKeys: ['role', '_updateTag']
});
// VTable.bindDebugTool(instance.scenegraph.stage as any, {
// customGrapicKeys: ['role', '_updateTag']
// });
}
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export function createTable(el: any, v: any) {
];
//初始化表格
const tableInstance = new PivotTable({
dragHeaderMode: 'all',
container: document.getElementById(CONTAINER_ID),
rowTree,
columnTree,
Expand Down
4 changes: 2 additions & 2 deletions packages/vtable/src/event/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,11 @@ export class EventManager {
this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)
) {
this.table.stateManager.startMoveCol(
eventArgs.event.nativeEvent,
eventArgs.col,
eventArgs.row,
eventArgsSet.abstractPos.x,
eventArgsSet.abstractPos.y
eventArgsSet.abstractPos.y,
eventArgs?.event?.nativeEvent
);
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/vtable/src/event/listener/table-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,11 @@ export function bindTableGroupListener(eventManager: EventManager) {
}
} else if ((hitIcon.attribute as any).funcType === IconFuncTypeEnum.dragReorder) {
stateManager.startMoveCol(
e.nativeEvent,
eventArgsSet.eventArgs.col,
eventArgsSet.eventArgs.row,
eventArgsSet.abstractPos.x,
eventArgsSet.abstractPos.y
eventArgsSet.abstractPos.y,
eventArgsSet.eventArgs?.event?.nativeEvent
);
stateManager.updateInteractionState(InteractionState.grabing);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/src/state/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ export class StateManager {
this.fillHandle.beforeFillMinRow = undefined;
}

startMoveCol(event: MouseEvent | PointerEvent | TouchEvent, col: number, row: number, x: number, y: number) {
startMoveCol(col: number, row: number, x: number, y: number, event: MouseEvent | PointerEvent | TouchEvent) {
startMoveCol(col, row, x, y, this);
this.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, { col, row, x, y, event });
}
Expand Down

0 comments on commit 2caaf3c

Please sign in to comment.