Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

Merge branch 'wzhudev/refactor-toolbar' of https://github.com/dream-num/univer into refactor-toolbar

Dushusir21d08a28e257
diff --cc packages/ui-plugin-sheets/src/Controller/menu.ts
index 1194d8fbed,e8b3964a9b..01a4c97105
--- a/packages/ui-plugin-sheets/src/Controller/menu.ts
+++ b/packages/ui-plugin-sheets/src/Controller/menu.ts
@@@ -730,12 -727,10 +727,11 @@@ export function RenameSheetMenuItemFact
type: MenuItemType.BUTTON,
positions: [MenuPosition.SHEET_BAR],
title: 'sheetConfig.rename',
- parentId: 'sheet-bar-right-menu',
- onClick:()=>{
+ onClick: () => {
// TODO@Dushusir 这里能监听到点击事件,但是无法触发到 this._sheetBar.reNameSheet(this._dataId);
- console.info('rename=========');
- },
+ // 或许不应该通过这里的onClick直接更新UI?
+ console.info('rename=========')
+ }
};
}
@@@ -774,6 -767,22 +768,5 @@@ export function UnHideSheetMenuItemFact
type: MenuItemType.BUTTON,
positions: [MenuPosition.SHEET_BAR],
title: 'sheetConfig.unhide',
- parentId: 'sheet-bar-right-menu',
};
- }
+ }
-
-/** @deprecated not the correct ui mechanism */
-export function buildMenuTree(items: IMenuItem[], parentId?: string): IDisplayMenuItem[] {
- const tree: IDisplayMenuItem[] = [];
-
- for (const item of items) {
- if (item.parentId === parentId) {
- const treeItem: IDisplayMenuItem = {
- ...item,
- subMenuItems: buildMenuTree(items, item.id),
- };
- tree.push(treeItem);
- }
- }
-
- return tree;
-}