|
63 | 63 | @code { |
64 | 64 | private RenderFragment<TreeViewItem<TItem>> RenderTreeRow => item => |
65 | 65 | @<div @key="item" class="@GetContentClassString(item)" data-bb-tree-view-index="@Rows.IndexOf(item)" @oncontextmenu="e => OnContextMenu(e, item)" @oncontextmenu:preventDefault="IsPreventDefault" @ontouchstart="e => OnTouchStart(e, item)" @ontouchend="OnTouchEnd" style="@GetTreeRowStyle(item)"> |
66 | | - <DynamicElement TagName="i" class="@GetCaretClassString(item)" TriggerClick="CanTriggerClickNode(item)" OnClick="() => OnToggleNodeAsync(item, true)"></DynamicElement> |
67 | | - <i class="@NodeLoadingClassString"></i> |
68 | | - @if (ShowCheckbox) |
69 | | - { |
70 | | - <Checkbox Value="@item" IsDisabled="GetItemDisabledState(item)" |
71 | | - SkipValidate="true" ShowLabel="false" ShowAfterLabel="false" |
72 | | - State="@item.CheckedState" OnStateChanged="(state, v) => OnCheckStateChanged(item, state)" |
73 | | - OnBeforeStateChanged="@(MaxSelectedCount > 0 ? state => OnBeforeStateChangedCallback(item, state) : null)" ></Checkbox> |
74 | | - } |
75 | | - <DynamicElement class="@GetNodeClassString(item)" TriggerClick="TriggerNodeLabel(item)" OnClick="() => OnClick(item)"> |
76 | | - @if (ShowIcon) |
77 | | - { |
78 | | - <i class="@GetIconClassString(item)"></i> |
79 | | - } |
80 | | - @if (item.Template == null) |
81 | | - { |
82 | | - <span class="@GetItemTextClassString(item)">@item.Text</span> |
83 | | - } |
84 | | - else |
| 66 | + <div class="tree-content-header"></div> |
| 67 | + <div class="tree-content-body"> |
| 68 | + <DynamicElement TagName="i" class="@GetCaretClassString(item)" TriggerClick="CanTriggerClickNode(item)" OnClick="() => OnToggleNodeAsync(item, true)"></DynamicElement> |
| 69 | + <i class="@NodeLoadingClassString"></i> |
| 70 | + @if (ShowCheckbox) |
85 | 71 | { |
86 | | - @item.Template(item.Value) |
| 72 | + <Checkbox Value="@item" IsDisabled="GetItemDisabledState(item)" |
| 73 | + SkipValidate="true" ShowLabel="false" ShowAfterLabel="false" |
| 74 | + State="@item.CheckedState" OnStateChanged="(state, v) => OnCheckStateChanged(item, state)" |
| 75 | + OnBeforeStateChanged="@(MaxSelectedCount > 0 ? state => OnBeforeStateChangedCallback(item, state) : null)" ></Checkbox> |
87 | 76 | } |
88 | | - </DynamicElement> |
| 77 | + <DynamicElement class="@GetNodeClassString(item)" TriggerClick="TriggerNodeLabel(item)" OnClick="() => OnClick(item)"> |
| 78 | + @if (ShowIcon) |
| 79 | + { |
| 80 | + <i class="@GetIconClassString(item)"></i> |
| 81 | + } |
| 82 | + @if (item.Template == null) |
| 83 | + { |
| 84 | + <span class="@GetItemTextClassString(item)">@item.Text</span> |
| 85 | + } |
| 86 | + else |
| 87 | + { |
| 88 | + @item.Template(item.Value) |
| 89 | + } |
| 90 | + </DynamicElement> |
| 91 | + </div> |
89 | 92 | </div>; |
90 | 93 | } |
0 commit comments