mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-04 21:17:36 +08:00
9826983a8f
* fix(module: checkbox): passing disabled value to templated options from checkbox group * fix tests
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
@namespace AntDesign
|
|
@inherits AntInputComponentBase<string[]>
|
|
@using AntDesign.Internal;
|
|
|
|
<CascadingValue Value="null" Name="FormItem" TValue="IFormItem" IsFixed="@true">
|
|
<CascadingValue Value="this" IsFixed="@true">
|
|
<div class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref">
|
|
@if (MixedMode == CheckboxGroupMixedMode.ChildContentFirst)
|
|
@ChildContent
|
|
@if (Options.Value != null)
|
|
{
|
|
if (Options.IsT0)
|
|
{
|
|
@foreach (var option in Options.AsT0)
|
|
{
|
|
<Checkbox Disabled="option.Disabled || Disabled"
|
|
Checked="@option.Checked"
|
|
Label="@option.Value">
|
|
@option.Label
|
|
</Checkbox>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
@foreach (var option in Options.AsT1)
|
|
{
|
|
<Checkbox Disabled="Disabled"
|
|
Checked="@option.IsIn(_selectedValues)"
|
|
Label="@option">
|
|
@option
|
|
</Checkbox>
|
|
}
|
|
}
|
|
}
|
|
@if (MixedMode == CheckboxGroupMixedMode.OptionsFirst)
|
|
@ChildContent
|
|
</div>
|
|
</CascadingValue>
|
|
</CascadingValue>
|