Skip to content

Commit 8ef959a

Browse files
dimodiDimo Dimovyordan-mitev
authored
V30 breaking changes (#700)
* docs: Document GridEditMode.None and TreeListEditMode.None * docs: document ContextMenu OnClick and k class changes * Update Button Overview (#646) * docs: update button overview.md * docs: address review comments * Apply suggestions from code review Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * docs: Document button style changes * docs: Document button style changes 2 * docs: Breaking changes language improvements * docs: DrawerContent Breaking change * docs: Window and Loader Size breaking change * docs: Window Size breaking change * docs: Breaking changes sections and table formatting Co-authored-by: Dimo Dimov <dimo@Dimos-MacBook-Pro.local> Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com>
1 parent 2f9e0f0 commit 8ef959a

30 files changed

+174
-111
lines changed

components/contextmenu/events.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@ This article explains the events available in the Telerik Context Menu for Blazo
1616

1717
## OnClick
1818

19-
The `OnClick` event fires when the user clicks or taps on a menu item. It receives the model of the item as an argument that you can cast to the concrete model type you are using.
19+
The `OnClick` event fires when the user clicks or taps on a menu item. The event handler receives an argument of type `ContextMenuClickEventArgs<TItem>` with the item model (`args.Item`) and a boolean flag that controls component re-rendering (`args.ShouldRender`) after the event.
2020

21-
You can use the `OnClick` event to react to user choices in a menu without using navigation to load new content automatically.
21+
You can use the `OnClick` event to react to user choices, for example load new content without using navigation.
2222

2323
>caption Handle OnClick
2424
2525
````CSHTML
26-
Last clicked item: @ClickedItem?.Text
27-
<div id="context-menu-target" style="background:yellow;">right click for context menu</div>
26+
<p>Last clicked item: @ClickedItem?.Text</p>
27+
28+
<div id="context-menu-target" style="padding:1em;background:yellow;">right-click for context menu</div>
2829
2930
<TelerikContextMenu Data="@MenuItems" Selector="#context-menu-target"
30-
OnClick="@((MenuItem item) => OnClickHandler(item))">
31+
OnClick="@((ContextMenuClickEventArgs<MenuItem> args) => OnClickHandler(args))">
3132
</TelerikContextMenu>
3233
3334
@code {
3435
public MenuItem ClickedItem { get; set; }
3536
36-
protected void OnClickHandler(MenuItem item)
37+
protected void OnClickHandler(ContextMenuClickEventArgs<MenuItem> args)
3738
{
38-
ClickedItem = item;
39+
ClickedItem = args.Item;
3940
}
4041
4142
public List<MenuItem> MenuItems { get; set; }

components/contextmenu/integration.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Hooking to your own HTML elements' events lets you determine what to do with the
4343
<TelerikContextMenu Data="@MenuItems" @ref="@TheContextMenu"
4444
TextField="Text" SeparatorField="Separator" IconField="Icon"
4545
DisabledField="Disabled"
46-
OnClick="@( (ContextMenuItem itm) => ContextMenuClickHandler(itm) )">
46+
OnClick="@( (ContextMenuClickEventArgs<ContextMenuItem> args) => ContextMenuClickHandler(args) )">
4747
</TelerikContextMenu>
4848
4949
<TelerikListView Data="@ListViewData" Width="700px" Pageable="true">
@@ -79,8 +79,9 @@ Hooking to your own HTML elements' events lets you determine what to do with the
7979
MenuItems[2].Items[0].Disabled = clickedItem.IsSpecial;
8080
}
8181
82-
async Task ContextMenuClickHandler(ContextMenuItem clickedItem)
82+
void ContextMenuClickHandler(ContextMenuClickEventArgs<ContextMenuItem> args)
8383
{
84+
var clickedItem = args.Item;
8485
// handle the command from the context menu by using the stored metadata
8586
if (!string.IsNullOrEmpty(clickedItem.CommandName) && LastClickedItem != null)
8687
{
@@ -92,9 +93,8 @@ Hooking to your own HTML elements' events lets you determine what to do with the
9293
// generate sample data for the listview and the menu
9394
protected override void OnInitialized()
9495
{
95-
9696
MenuItems = new List<ContextMenuItem>()
97-
{
97+
{
9898
new ContextMenuItem
9999
{
100100
Text = "More Info",
@@ -185,7 +185,7 @@ In this example, the context menu is used to select/deselect items, put an item
185185
@using System.Collections.ObjectModel
186186
187187
<TelerikContextMenu @ref="@ContextMenuRef" Data="@MenuItems"
188-
OnClick="@((MenuItem item) => ContextMenuClickHandler(item))">
188+
OnClick="@((ContextMenuClickEventArgs<MenuItem> args) => ContextMenuClickHandler(args))">
189189
</TelerikContextMenu>
190190
191191
<TelerikGrid Data="@GridData" @ref="@GridRef"
@@ -253,8 +253,9 @@ In this example, the context menu is used to select/deselect items, put an item
253253
}
254254
255255
// sample handling of the context menu click
256-
async Task ContextMenuClickHandler(MenuItem item)
256+
async Task ContextMenuClickHandler(ContextMenuClickEventArgs<MenuItem> args)
257257
{
258+
var item = args.Item;
258259
// one way to pass handlers is to use an Action, you don't have to use this
259260
if (item.Action != null)
260261
{
@@ -403,7 +404,7 @@ In this example, the context menu is used to select/deselect items and delete it
403404
404405
<TelerikContextMenu Data="@ContextMenuData"
405406
@ref="ContextMenu"
406-
OnClick="@((ContextMenuItem item) => ContextMenuClickHandler(item))">
407+
OnClick="@((ContextMenuClickEventArgs<ContextMenuItem> args) => ContextMenuClickHandler(args))">
407408
</TelerikContextMenu>
408409
409410
<TelerikTreeView Data="@FlatData"
@@ -433,9 +434,9 @@ In this example, the context menu is used to select/deselect items and delete it
433434
}
434435
}
435436
436-
private void ContextMenuClickHandler(ContextMenuItem item)
437+
private void ContextMenuClickHandler(ContextMenuClickEventArgs<ContextMenuItem> args)
437438
{
438-
439+
var item = args.Item;
439440
// Use local code to perform a task such as put select/deselect a node or delete it
440441
switch (item.CommandName)
441442
{

components/contextmenu/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ In addition to built-in [navigation capabilities]({%slug contextmenu-navigation%
3232
3333
<TelerikContextMenu Selector=".context-menu-target" Data="@MenuItems"
3434
TextField="Text" SeparatorField="Separator" IconField="Icon"
35-
OnClick="@( (ContextMenuItem itm) => ClickHandler(itm) )">
35+
OnClick="@( (ContextMenuClickEventArgs<ContextMenuItem> args) => ClickHandler(args) )">
3636
</TelerikContextMenu>
3737
38-
3938
@code {
4039
public List<ContextMenuItem> MenuItems { get; set; }
4140
42-
async Task ClickHandler(ContextMenuItem clickedItem)
41+
async Task ClickHandler(ContextMenuClickEventArgs<ContextMenuItem> args)
4342
{
43+
var clickedItem = args.Item;
4444
if (!string.IsNullOrEmpty(clickedItem.CommandName))
4545
{
4646
Console.WriteLine($"The programm will now perform the {clickedItem.CommandName} operation");

components/drawer/data-bind.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ https://docs.telerik.com/blazor-ui/components/drawer/navigation
6666
6767
<TelerikDrawer Data="@Data" UrlField="ItemUrl" TextField="ItemText" IconField="ItemIcon"
6868
MiniMode="true" Mode="@DrawerMode.Push" Expanded="true">
69-
<Content>
69+
<DrawerContent>
7070
@Body
71-
</Content>
71+
</DrawerContent>
7272
</TelerikDrawer>
7373
7474
@code {

components/drawer/events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ The `SelectedItemChanged` event fires every time the user clicks on a new item f
2828
<TelerikDrawer Data="@Data" Expanded="true" MiniMode="true" Mode="DrawerMode.Push"
2929
SelectedItem="@selectedItem"
3030
SelectedItemChanged="((DrawerItem item) => SelectedItemChangedHandler(item))">
31-
<Content>
31+
<DrawerContent>
3232
<div class="text-info">
3333
Content for the @selectedItem?.Text
3434
</div>
35-
</Content>
35+
</DrawerContent>
3636
</TelerikDrawer>
3737
3838
@code {
@@ -91,11 +91,11 @@ The `ExpandedChanged` event fires every time the component's state is changed -
9191
Mode="@DrawerMode.Push"
9292
@bind-SelectedItem="@selectedItem"
9393
@ref="@DrawerRef">
94-
<Content>
94+
<DrawerContent>
9595
<div class="text-info">
9696
Content for the @selectedItem?.Text
9797
</div>
98-
</Content>
98+
</DrawerContent>
9999
</TelerikDrawer>
100100
101101
@code {

components/drawer/icons.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ The `IconClassField` and `ImageUrlField` are rendered, respectively, as `<span c
3232
Mode="DrawerMode.Push"
3333
@ref="@DrawerRef"
3434
@bind-SelectedItem="@SelectedItem">
35-
<Content>
35+
<DrawerContent>
3636
<TelerikButton OnClick="@(() => DrawerRef.ToggleAsync())" Icon="menu">Toggle drawer</TelerikButton>
3737
<div class="m-5">
3838
Selected Item: @SelectedItem?.Text
3939
</div>
40-
</Content>
40+
</DrawerContent>
4141
</TelerikDrawer>
4242
4343
@code {

components/drawer/modes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ The drawer's height is dynamic based on the height of the content (you can chang
4343
Mode="@DrawerMode.Push"
4444
@bind-SelectedItem="@selectedItem"
4545
@ref="@DrawerRef">
46-
<Content>
46+
<DrawerContent>
4747
<div class="m-5">
4848
Select an item. The drawer is expaned: @Expanded
4949
<div class="text-info">
5050
Content for the @selectedItem?.Text
5151
</div>
5252
</div>
53-
</Content>
53+
</DrawerContent>
5454
</TelerikDrawer>
5555
</div>
5656
@@ -94,13 +94,13 @@ You may want to add padding to the left of the content so that it is not overlap
9494
Mode="@DrawerMode.Overlay"
9595
@bind-SelectedItem="@selectedItem"
9696
@ref="@DrawerRef">
97-
<Content>
97+
<DrawerContent>
9898
<div class="text-info pl-4">
9999
The drawer is expanded: @Expanded
100100
<br />
101101
Content for the @selectedItem?.Text
102102
</div>
103-
</Content>
103+
</DrawerContent>
104104
</TelerikDrawer>
105105
106106
@code {

components/drawer/navigation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Drawer is a different kind of a [menu]({%slug components/menu/overview%}) th
1515
To use the Drawer for navigating between pages:
1616

1717
* Add the Drawer to the `MainLayot.razor` of your app.
18-
* Put the `@Body` tag in the `<Content>` tag of the drawer.
18+
* Put the `@Body` tag in the `<DrawerContent>` tag of the drawer.
1919
* Provide a collection of models that describe the pages you want the user to navigate to.
2020

2121
>tip You can find a runnable sample that showcases this in the [Drawer as Side Navigation](https://github.com/telerik/blazor-ui/tree/master/drawer/sidenav) sample project.
@@ -31,9 +31,9 @@ To use the Drawer for navigating between pages:
3131
<TelerikRootComponent>
3232
3333
<TelerikDrawer Data="@NavigablePages" Expanded="true" MiniMode="true" Mode="@DrawerMode.Push">
34-
<Content>
34+
<DrawerContent>
3535
@Body
36-
</Content>
36+
</DrawerContent>
3737
</TelerikDrawer>
3838
3939
</TelerikRootComponent>

components/drawer/overview.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The <a href="https://www.telerik.com/blazor-ui/drawer" target="_blank">Blazor Dr
1616

1717
1. Add the `TelerikDrawer` tag.
1818
1. Populate its `Data` property with the collection of items you want the user to see.
19-
1. Place the content of the Drawer in the `<Content>` tag.
19+
1. Place the content of the Drawer in the `<DrawerContent>` tag.
2020
* In this example, we keep it simple by using the selected item. See the [Navigation]({%slug drawer-navigation%}) article for a menu-like experience with links.
2121

2222
>caption Basic configuration of the Drawer.
@@ -29,7 +29,7 @@ The <a href="https://www.telerik.com/blazor-ui/drawer" target="_blank">Blazor Dr
2929
Mode="DrawerMode.Push"
3030
@ref="@DrawerRef"
3131
@bind-SelectedItem="@SelectedItem">
32-
<Content>
32+
<DrawerContent>
3333
<TelerikButton OnClick="@(() => DrawerRef.ToggleAsync())" Icon="menu">Toggle drawer</TelerikButton>
3434
3535
@* Place your contents here - it can be as simple as text, it can be conditional components or components that
@@ -38,7 +38,7 @@ The <a href="https://www.telerik.com/blazor-ui/drawer" target="_blank">Blazor Dr
3838
<div class="m-5">
3939
Selected Item: @SelectedItem?.Text
4040
</div>
41-
</Content>
41+
</DrawerContent>
4242
</TelerikDrawer>
4343
4444
@code {
@@ -73,7 +73,7 @@ The <a href="https://www.telerik.com/blazor-ui/drawer" target="_blank">Blazor Dr
7373
* `Position` - you can control the position of the Drawer, through the `DrawerPosition` enum.
7474
The members of the enum are:
7575
* `Left` - the default position
76-
* `Right` - the drawer item list will render on the right hand side of the `Content`
76+
* `Right` - the drawer item list will render on the right hand side of the `DrawerContent`
7777

7878
* `Expanded` - two-way bindable property that specifies whether the Drawer is expanded or collapsed. If this parameter is used to expand or collapse the component the animations will not be available. To use animations you have to use the Drawer's [Methods](#methods). You can, however, use the value to implement custom layouts in the drawer [templates]({%slug drawer-templates%}) or in your own layout.
7979

@@ -85,7 +85,7 @@ The members of the enum are:
8585

8686
* `MiniMode` - controls whether there is mini view when the Drawer is collapsed. For more information read the [Mini View]({%slug drawer-mini-mode%}) article.
8787

88-
* `Content` - the `<Content>` child tag of `<TelerikDrawer>` is a `RenderFragment` where you put a component or custom HTML as the content of the Drawer - this is what the drawer will push or overlay.
88+
* `DrawerContent` - the `<DrawerContent>` child tag of `<TelerikDrawer>` is a `RenderFragment` where you put a component or custom HTML as the content of the Drawer - this is what the drawer will push or overlay.
8989

9090
* `SelectedItem` - two-way bindable property that contains the currently selected item in the Drawer. For more information read the [Selection]({%slug drawer-selection%}) article.
9191

@@ -117,7 +117,7 @@ The Drawer methods are accessible through it's reference. The reference exposes
117117
118118
<TelerikDrawer Data="@Data" Mode="@DrawerMode.Push"
119119
@ref="@DrawerRef">
120-
<Content>lorem ipsum</Content>
120+
<DrawerContent>lorem ipsum</DrawerContent>
121121
</TelerikDrawer>
122122
123123
@code {

components/drawer/refresh-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ In this article:
4242
Mode="DrawerMode.Push"
4343
@ref="@DrawerRef"
4444
@bind-SelectedItem="@SelectedItem">
45-
<Content>
45+
<DrawerContent>
4646
<TelerikButton OnClick="@(() => DrawerRef.ToggleAsync())" Icon="menu">Toggle drawer</TelerikButton>
4747
<div class="m-5">
4848
Selected Item: @SelectedItem?.Text
4949
</div>
50-
</Content>
50+
</DrawerContent>
5151
</TelerikDrawer>
5252
5353
@code {

0 commit comments

Comments
 (0)