-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
50 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
Material.Blazor.MD3/Components/Menu/MBMenuCloseMenuCustomEvent.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Material.Blazor.MD3/Components/Menu/MBMenuSelectionReportCustomEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace Material.Blazor.MenuClose; | ||
|
||
[EventHandler( | ||
attributeName: "onmenuselectionreport", | ||
eventArgsType: typeof(MenuSelectionReportEventArgs), | ||
enableStopPropagation: false, | ||
enablePreventDefault: false)] | ||
public static class EventHandlers | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 11 additions & 7 deletions
18
Material.Blazor.MD3/Scripts/material.blazor.custom.events.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
import { MenuItem } from '@material/web/menu/menu.js'; | ||
import { CloseMenuEvent } from '@material/web/menu/internal/controllers/shared.js'; | ||
import { MenuItem } from '@material/web/menu/menu.js'; | ||
|
||
/* | ||
** MW3 menu-close event arguments | ||
** MW3 close-menu event arguments | ||
** | ||
** This must match the C# definition found in MBMenuEvents.cs | ||
*/ | ||
export function eventArgsCreatorMenuClose(event) { | ||
export function eventArgsCreatorMenuSelectionReport(event: CloseMenuEvent) { | ||
var target: MenuItem = event.target as unknown as MenuItem; | ||
return { | ||
customProperty1: 'any value for property 1', | ||
customProperty2: event.srcElement.value | ||
menuID: target.id, | ||
menuHeadline: target.typeaheadText, | ||
reason: JSON.stringify(event.detail.reason) | ||
}; | ||
} | ||
|
||
/* | ||
** Register all custom events | ||
*/ | ||
export function afterStarted(blazor) { | ||
blazor.registerCustomEventType('menuclose', { | ||
console.log("Registering menuselectionreport event"); | ||
blazor.registerCustomEventType('menuselectionreport', { | ||
browserEventName: "close-menu", | ||
createEventArgs: eventArgsCreatorMenuClose | ||
createEventArgs: eventArgsCreatorMenuSelectionReport | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters