-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module: modal): support customized header (#3579)
* feat(module: form): Add Method and FormName parameter for Form (#3608) * Add Method parameter * Add also the FormName parameter * add documentation * update documentation * use Name instead of new FormName --------- Co-authored-by: James Yeung <shunjiey@hotmail.com> * feat(module: select): Add FilterExpression on select for customize how to filter when searching (#3656) * Add FilterExpression on select for customize how to filter when searching * Remove CultureInfo as parameter for filter. Update example and documentation. * Change FilterExpression to send the SelectOptionItem instead of the label to have more options to make the search. * Add test for filterExpression to check is working fine with the default and custom. * feat(module: comment): avatar placement (#3670) * feat(module: tabs): add CreatePage method for reusetabs (#3671) * Update ReuseTabsService.cs pr3660 * Update ReuseTabsService.cs * Update ReuseTabsService.cs * refactor * fix build error --------- Co-authored-by: James Yeung <shunjiey@hotmail.com> * Add Header RenderFragment parameter to dialogs for customizable headers * refactor header * add a demo --------- Co-authored-by: Sebastian Jura <sebajura1234@gmail.com> Co-authored-by: James Yeung <shunjiey@hotmail.com> Co-authored-by: Magehernan <magehernan@gmail.com> Co-authored-by: jxcproject <cazyyan86@163.com>
- Loading branch information
1 parent
ebca047
commit 7be4807
Showing
11 changed files
with
160 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@namespace AntDesign.Internal.ModalDialog | ||
|
||
@if (Config.Closable) | ||
{ | ||
<button type="button" aria-label="Close" class=@($"{Config.PrefixCls}-close") @onclick="@Parent.OnCloserClick"> | ||
<span class=@($"{Config.PrefixCls}-close-x")> | ||
<span role="img" aria-label="close" class=@($"anticon anticon-close {Config.PrefixCls}-close-icon")> | ||
@Config.CloseIcon | ||
</span> | ||
</span> | ||
</button> | ||
} | ||
@if (Config.Maximizable) | ||
{ | ||
<button type="button" aria-label="Max" class=@($"{Config.PrefixCls}-max-btn") @onclick="@Parent.OnMaxBtnClick"> | ||
<span class=@($"{Config.PrefixCls}-max-btn-x")> | ||
<span role="img" aria-label="close" class=@($"anticon anticon-max {Config.PrefixCls}-max-btn-icon")> | ||
@if (Parent.Status == ModalStatus.Default) | ||
{ | ||
@(Config.MaximizeBtnIcon) | ||
} | ||
else | ||
{ | ||
@(Config.RestoreBtnIcon) | ||
} | ||
</span> | ||
</span> | ||
</button> | ||
} | ||
@if (Config.TitleTemplate != null) | ||
{ | ||
|
||
<div class=@($"{Config.PrefixCls}-title")> | ||
@Config.TitleTemplate | ||
</div> | ||
|
||
} | ||
else if (!string.IsNullOrWhiteSpace(Config.Title)) | ||
{ | ||
|
||
<div class=@($"{Config.PrefixCls}-title")> | ||
@Config.Title | ||
</div> | ||
|
||
} |
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,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace AntDesign.Internal.ModalDialog | ||
{ | ||
public partial class ModalHeader | ||
{ | ||
[CascadingParameter] | ||
public DialogOptions Config { get; set; } | ||
|
||
[CascadingParameter(Name = "Parent")] | ||
public Dialog Parent { get; set; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
site/AntDesign.Docs/Demos/Components/Modal/demo/Header_.razor
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,22 @@ | ||
| ||
<Button Type="primary" OnClick="()=>_visible=true"> | ||
Open Modal with customized header | ||
</Button> | ||
|
||
<Modal Title="@("Title")" @bind-Visible="@_visible" > | ||
<Header> | ||
<Icon Type="@IconType.Outline.Edit"></Icon> Edit | ||
</Header> | ||
<ChildContent> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
</ChildContent> | ||
</Modal> | ||
|
||
|
||
@code { | ||
bool _visible = false; | ||
} |
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,18 @@ | ||
--- | ||
order: 2 | ||
title: | ||
zh-CN: 自定义头部 | ||
en-US: Customized Hender | ||
--- | ||
|
||
## zh-CN | ||
|
||
设置 `Hender` 属性可以自定义消息框的头部。默认头部组件在 [ModelHeader.razor](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/components/modal/modalDialog/ModalHender.razor)。 | ||
|
||
另外,如果设置 `Hender` 为 null 可隐藏头部。 | ||
|
||
## en-US | ||
|
||
Set the `Hender` property to customize the header of the Modal. Default header component in [ModelHeader.razor](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/components/modal/modalDialog/ModalHender.razor). | ||
|
||
Otherwise, if `Hender` is set to null, the header can be hidden. |
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