2020-06-01 14:09:28 +08:00
|
|
|
|
@namespace AntDesign
|
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
@typeparam TModel
|
|
|
|
|
@using Microsoft.AspNetCore.Components.Forms;
|
|
|
|
|
@using AntDesign.Internal;
|
|
|
|
|
|
2020-06-10 19:13:09 +08:00
|
|
|
|
<Spin Spinning="Loading">
|
|
|
|
|
<EditForm class="@ClassMapper.Class"
|
|
|
|
|
style="@Style"
|
|
|
|
|
id="@Id"
|
|
|
|
|
EditContext="_editContext"
|
2020-07-16 08:56:15 +08:00
|
|
|
|
OnValidSubmit="OnValidSubmit"
|
|
|
|
|
OnInvalidSubmit="OnInvalidSubmit">
|
2021-05-28 17:08:42 +08:00
|
|
|
|
@if(ValidateMode.IsIn(FormValidateMode.Rules, FormValidateMode.Complex))
|
|
|
|
|
{
|
|
|
|
|
<FormRulesValidator @ref="_rulesValidator" />
|
|
|
|
|
}
|
|
|
|
|
@if (ValidateMode.IsIn(FormValidateMode.Default, FormValidateMode.Complex))
|
|
|
|
|
{
|
|
|
|
|
@Validator
|
|
|
|
|
}
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<CascadingValue Value="this" Name="Form" TValue="IForm" IsFixed="@true">
|
2020-06-10 19:13:09 +08:00
|
|
|
|
@if (!string.IsNullOrEmpty(Size))
|
|
|
|
|
{
|
|
|
|
|
<CascadingValue Value="Size" Name="FormSize">
|
|
|
|
|
@ChildContent(Model)
|
|
|
|
|
</CascadingValue>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@ChildContent(Model)
|
2020-06-10 19:13:09 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
|
2020-06-10 19:13:09 +08:00
|
|
|
|
</CascadingValue>
|
|
|
|
|
</EditForm>
|
|
|
|
|
</Spin>
|