< Summary

Information
Class: UIBlazor.Components.Details
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Components/Details.razor
Tag: 71_26091983037
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 36
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 12
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
BuildRenderTree(...)0%4260%
get_Text()100%210%
get_Icon()100%210%
get_ChildContent()100%210%
get_IsExpanded()100%210%
get_IsRounded()100%210%
get_AdditionalAttributes()100%210%
get_CustomClass()0%4260%
Toggle()100%210%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Components/Details.razor

#LineLine coverage
 1<div class="custom-details @(IsExpanded ? "is-expanded" : "") @(IsRounded ? "is-rounded" : "") @CustomClass">
 2    <div class="header" @onclick="Toggle">
 3        <div class="header-left">
 04            @if (!string.IsNullOrEmpty(Icon))
 5            {
 6                <i class="@Icon icon-spacing"></i>
 7            }
 08            @Text
 9        </div>
 10        <span class="arrow">▼</span>
 11    </div>
 12    <div class="content-wrapper">
 13        <div class="content-inner">
 014            @ChildContent
 15        </div>
 16    </div>
 17</div>
 18
 19@code {
 020    [Parameter] public string Text { get; set; } = string.Empty;
 021    [Parameter] public string? Icon { get; set; }
 022    [Parameter] public RenderFragment ChildContent { get; set; } = null!;
 023    [Parameter] public bool IsExpanded { get; set; }
 024    [Parameter] public bool IsRounded { get; set; }
 25
 26    // Позволяет передавать любые другие атрибуты RadzenSwitch (напр. Title, TabIndex)
 27    [Parameter(CaptureUnmatchedValues = true)]
 028    public Dictionary<string, object>? AdditionalAttributes { get; set; }
 29
 30    // Извлекаем строку класса, если она есть
 031    private string CustomClass => AdditionalAttributes?.ContainsKey("class") == true
 032                                      ? AdditionalAttributes["class"].ToString() ?? ""
 033                                      : "";
 34
 035    private void Toggle() => IsExpanded = !IsExpanded;
 36}