Skip to content

Commit

Permalink
Merge pull request #523 from VisActor/478-refactor-upOutSize-select-save
Browse files Browse the repository at this point in the history
refactor: rename dropdown_menu_click
  • Loading branch information
fangsmile authored Nov 3, 2023
2 parents 75e5235 + 7be8eb6 commit 5902a6b
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 38 deletions.
13 changes: 7 additions & 6 deletions docs/assets/api/en/event/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Supported event types:
SORT_CLICK: 'sort_click',
FREEZE_CLICK: 'freeze_click',
SCROLL: 'scroll',
DROPDOWNMENU_CLICK: 'dropdownmenu_click',
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
DRAG_SELECT_END: 'drag_select_end',
DROPDOWN_ICON_CLICK: 'dropdown_icon_click',
Expand Down Expand Up @@ -199,11 +199,6 @@ Event callback function parameter types.
viewHeight: number;
}`

## DROPDOWNMENU_CLICK

Click on the drop-down menu icon event.

{{ use: DropDownMenuEventArgs() }}

## MOUSEOVER_CHART_SYMBOL

Expand All @@ -229,6 +224,12 @@ Click on the drop-down menu button

{{ use: CellAddress() }}

## DROPDOWN_MENU_CLICK

The drop-down menu options click on the event

{{ use: DropDownMenuEventArgs() }}

## DROPDOWN_MENU_CLEAR

Clear drop-down menu event (clicking on other areas while the menu is displayed)
Expand Down
14 changes: 7 additions & 7 deletions docs/assets/api/zh/event/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TABLE_EVENT_TYPE = {
SORT_CLICK: 'sort_click',
FREEZE_CLICK: 'freeze_click',
SCROLL: 'scroll',
DROPDOWNMENU_CLICK: 'dropdownmenu_click',
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
DRAG_SELECT_END: 'drag_select_end',
DROPDOWN_ICON_CLICK: 'dropdown_icon_click',
Expand Down Expand Up @@ -214,12 +214,6 @@ TABLE_EVENT_TYPE = {
}
```

## DROPDOWNMENU_CLICK

点击下拉菜单图标事件。

{{ use: DropDownMenuEventArgs() }}

## MOUSEOVER_CHART_SYMBOL

鼠标经过迷你图标记事件
Expand All @@ -244,6 +238,12 @@ TABLE_EVENT_TYPE = {

{{ use: CellAddress() }}

## DROPDOWN_MENU_CLICK

下拉菜单选项的点击事件。

{{ use: DropDownMenuEventArgs() }}

## DROPDOWN_MENU_CLEAR

清空下拉菜单事件(菜单显示时点击其他区域)
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/demo/en/component/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ tableInstance.on('click_cell', (args) => {
});
}
});
tableInstance.on('dropdownmenu_click', (args) => {
console.log('dropdownmenu_click',args);
tableInstance.on('dropdown_menu_click', (args) => {
console.log('dropdown_menu_click',args);
tableInstance.setDropDownMenuHighlight([args]);
})
})
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/demo/en/interaction/context-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), opti
window['tableInstance'] = tableInstance;


tableInstance.on('dropdownmenu_click', (args) => {
console.log('dropdownmenu_click',args);
tableInstance.on('dropdown_menu_click', (args) => {
console.log('dropdown_menu_click',args);
})
})
```
4 changes: 2 additions & 2 deletions docs/assets/demo/zh/component/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ tableInstance.on('click_cell', (args) => {
});
}
});
tableInstance.on('dropdownmenu_click', (args) => {
console.log('dropdownmenu_click',args);
tableInstance.on('dropdown_menu_click', (args) => {
console.log('dropdown_menu_click',args);
tableInstance.setDropDownMenuHighlight([args]);
})
})
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/demo/zh/interaction/context-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),optio
window['tableInstance'] = tableInstance;


tableInstance.on('dropdownmenu_click', (args) => {
console.log('dropdownmenu_click',args);
tableInstance.on('dropdown_menu_click', (args) => {
console.log('dropdown_menu_click',args);
})
})
```
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/guide/en/Event/event_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The specific return data of the event can be actually tested to observe whether
CHANGED_VALUE,
FREEZE_CLICK,
SORT_CLICK,
DROPDOWNMENU_CLICK,
DROPDOWN_MENU_CLICK,
CONTEXTMENU_CELL,
} = VTable.ListTable.EVENT_TYPE;
const tableInstance =new ListTable(options);
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/guide/zh/Event/event_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const {
CHANGED_VALUE,
FREEZE_CLICK,
SORT_CLICK,
DROPDOWNMENU_CLICK,
DROPDOWN_MENU_CLICK,
CONTEXTMENU_CELL,
} = VTable.ListTable.EVENT_TYPE;
const tableInstance =new ListTable(options);
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/option/en/register/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Supported event types:
SORT_CLICK: 'sort_click',
FREEZE_CLICK: 'freeze_click',
SCROLL: 'scroll',
DROPDOWNMENU_CLICK: 'dropdownmenu_click',
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
DRAG_SELECT_END: 'drag_select_end',
DROPDOWN_ICON_CLICK: 'dropdown_icon_click',
Expand Down Expand Up @@ -199,7 +199,7 @@ Event callback function parameter types.
viewHeight: number;
}`

## DROPDOWNMENU_CLICK
## DROPDOWN_MENU_CLICK

Click the drop-down menu icon event.

Expand Down
4 changes: 2 additions & 2 deletions docs/assets/option/zh/register/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TABLE_EVENT_TYPE = {
SORT_CLICK: 'sort_click',
FREEZE_CLICK: 'freeze_click',
SCROLL: 'scroll',
DROPDOWNMENU_CLICK: 'dropdownmenu_click',
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
DRAG_SELECT_END: 'drag_select_end',
DROPDOWN_ICON_CLICK: 'dropdown_icon_click',
Expand Down Expand Up @@ -214,7 +214,7 @@ TABLE_EVENT_TYPE = {
}
```

## DROPDOWNMENU_CLICK
## DROPDOWN_MENU_CLICK

点击下拉菜单图标事件。

Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/examples/custom-layout-jsx/pivot-jsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ function customLayoutIndicator(args: VTable.TYPES.CustomRenderFunctionArg) {
}

function bindEvent(table) {
const { CLICK_CELL, DROPDOWNMENU_CLICK } = VTable.ListTable.EVENT_TYPE;
const { CLICK_CELL, DROPDOWN_MENU_CLICK } = VTable.ListTable.EVENT_TYPE;
table.addEventListener(CLICK_CELL, (...args) => {
if (args[0].target) {
const target = args[0].target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class MenuContainer {
: table.getHeaderField(col, row);

const highlight = table._dropDownMenuIsHighlight(col, row, dropDownIndex);
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, {
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, {
col,
row,
field: <string>field,
Expand Down
6 changes: 3 additions & 3 deletions packages/vtable/src/components/menu/dom/logic/MenuElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class MenuElement {
: table.getHeaderField(col, row);

const highlight = table._dropDownMenuIsHighlight(col, row, dropDownIndex);
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, {
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, {
col,
row,
field: <string>field,
Expand Down Expand Up @@ -166,7 +166,7 @@ export class MenuElement {
: table.getHeaderField(col, row);

const highlight = table._dropDownMenuIsHighlight(col, row, dropDownIndex);
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, {
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, {
col,
row,
field: <string>field,
Expand Down Expand Up @@ -313,7 +313,7 @@ export class MenuElement {
}
});

table.fireListeners(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, {
table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, {
col,
row,
field: <string>field,
Expand Down
4 changes: 2 additions & 2 deletions packages/vtable/src/core/TABLE_EVENT_TYPE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface TableEvents {
/**
* 点击下拉菜单图标事件
*/
DROPDOWNMENU_CLICK: 'dropdownmenu_click';
DROPDOWN_MENU_CLICK: 'dropdown_menu_click';
/**
* 鼠标经过迷你图标记事件
*/
Expand Down Expand Up @@ -147,7 +147,7 @@ export const TABLE_EVENT_TYPE: TableEvents = {
SORT_CLICK: 'sort_click',
FREEZE_CLICK: 'freeze_click',
SCROLL: 'scroll',
DROPDOWNMENU_CLICK: 'dropdownmenu_click',
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
DRAG_SELECT_END: 'drag_select_end',

Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/src/event/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class EventManeger {
});

// 下拉菜单内容点击
this.table.on(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, () => {
this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
stateManeger.hideMenu();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/src/scenegraph/component/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class MenuHandler {
const resultMenuInfo = this.getEventInfo(target as unknown as Group);
const resultTableInfo = this._table.getMenuInfo(this._menuInfo.col, this._menuInfo.row, this._menuInfo.type);
const result = Object.assign(resultMenuInfo, resultTableInfo);
this._table.fireListeners(TABLE_EVENT_TYPE.DROPDOWNMENU_CLICK, result);
this._table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, result);

// 由DROPDOWNMENU_CLICK事件清空菜单
// this.detach();
Expand Down
4 changes: 2 additions & 2 deletions packages/vtable/src/ts-types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface TableEventHandlersEventArgumentMap {
order: SortOrder;
};
freeze_click: { col: number; row: number; fields: FieldDef[]; colCount: number };
dropdownmenu_click: DropDownMenuEventArgs;
dropdown_menu_click: DropDownMenuEventArgs;
copydata: CellRange[];

mouseover_chart_symbol: MousePointerSparklineEvent;
Expand Down Expand Up @@ -189,7 +189,7 @@ export interface TableEventHandlersReturnMap {
change_header_position: void;
sort_click: boolean;
freeze_click: void;
dropdownmenu_click: void;
dropdown_menu_click: void;
copydata: string;
mouseover_chart_symbol: void;
drag_select_end: void;
Expand Down

0 comments on commit 5902a6b

Please sign in to comment.