|
48 | 48 | <span class="@AppendClassString"><i class="@DropdownIcon"></i></span> |
49 | 49 | } |
50 | 50 | </div> |
51 | | - <div class="dropdown-menu"> |
52 | | - <div class="@SearchClassString"> |
53 | | - <input type="text" class="form-control search-text" autocomplete="off" value="@SearchText" aria-label="search" /> |
54 | | - <i class="@SearchIconString"></i> |
55 | | - <i class="@SearchLoadingIconString"></i> |
56 | | - </div> |
57 | | - @if (ShowToolbar) |
| 51 | + <div class="@DropdownMenuClassString"> |
| 52 | + @if (ShowSearch) |
58 | 53 | { |
59 | | - <div class="toolbar"> |
60 | | - @if (ShowDefaultButtons) |
61 | | - { |
62 | | - <DynamicElement TagName="button" type="button" class="btn" OnClick="SelectAll">@SelectAllText</DynamicElement> |
63 | | - <DynamicElement TagName="button" type="button" class="btn" OnClick="InvertSelect">@ReverseSelectText</DynamicElement> |
64 | | - <DynamicElement TagName="button" type="button" class="btn" OnClick="Clear">@ClearText</DynamicElement> |
65 | | - } |
66 | | - @ButtonTemplate |
| 54 | + <div class="dropdown-menu-search"> |
| 55 | + <input type="text" class="search-text form-control" autocomplete="off" value="@SearchText" aria-label="search" /> |
| 56 | + <i class="@SearchIconString"></i> |
| 57 | + <i class="@SearchLoadingIconString"></i> |
67 | 58 | </div> |
68 | 59 | } |
69 | | - @foreach (var itemGroup in Rows.GroupBy(i => i.GroupName)) |
| 60 | + @if (Rows.Count == 0) |
70 | 61 | { |
71 | | - if (!string.IsNullOrEmpty(itemGroup.Key)) |
72 | | - { |
73 | | - if (GroupItemTemplate != null) |
74 | | - { |
75 | | - @GroupItemTemplate(itemGroup.Key) |
76 | | - } |
77 | | - else |
| 62 | + <div class="dropdown-item">@NoSearchDataText</div> |
| 63 | + } |
| 64 | + else |
| 65 | + { |
| 66 | + <div class="dropdown-menu-body"> |
| 67 | + @if (ShowToolbar) |
78 | 68 | { |
79 | | - <Divider Text="@itemGroup.Key" /> |
80 | | - } |
81 | | - } |
82 | | - @foreach (var item in itemGroup) |
83 | | - { |
84 | | - <DynamicElement OnClick="() => ToggleRow(item.Value)" TriggerClick="@CheckCanTrigger(item)" class="@GetItemClassString(item)"> |
85 | | - <div class="multi-select-item"> |
86 | | - <div class="form-check"> |
87 | | - <input class="form-check-input" type="checkbox" disabled="@CheckCanSelect(item)" checked="@GetCheckedString(item)" /> |
88 | | - </div> |
89 | | - @if (ItemTemplate != null) |
| 69 | + <div class="toolbar"> |
| 70 | + @if (ShowDefaultButtons) |
90 | 71 | { |
91 | | - @ItemTemplate(item) |
| 72 | + <DynamicElement TagName="button" type="button" class="btn" OnClick="SelectAll">@SelectAllText</DynamicElement> |
| 73 | + <DynamicElement TagName="button" type="button" class="btn" OnClick="InvertSelect">@ReverseSelectText</DynamicElement> |
| 74 | + <DynamicElement TagName="button" type="button" class="btn" OnClick="Clear">@ClearText</DynamicElement> |
92 | 75 | } |
93 | | - else if (IsMarkupString) |
| 76 | + @ButtonTemplate |
| 77 | + </div> |
| 78 | + } |
| 79 | + @foreach (var itemGroup in Rows.GroupBy(i => i.GroupName)) |
| 80 | + { |
| 81 | + if (!string.IsNullOrEmpty(itemGroup.Key)) |
| 82 | + { |
| 83 | + if (GroupItemTemplate != null) |
94 | 84 | { |
95 | | - @((MarkupString)item.Text) |
| 85 | + @GroupItemTemplate(itemGroup.Key) |
96 | 86 | } |
97 | 87 | else |
98 | 88 | { |
99 | | - <span>@item.Text</span> |
| 89 | + <Divider Text="@itemGroup.Key" /> |
100 | 90 | } |
101 | | - </div> |
102 | | - </DynamicElement> |
103 | | - } |
104 | | - } |
105 | | - @if (Rows.Count == 0) |
106 | | - { |
107 | | - <div class="dropdown-item">@NoSearchDataText</div> |
| 91 | + } |
| 92 | + @foreach (var item in itemGroup) |
| 93 | + { |
| 94 | + <DynamicElement OnClick="() => ToggleRow(item.Value)" TriggerClick="@CheckCanTrigger(item)" class="@GetItemClassString(item)"> |
| 95 | + <div class="multi-select-item"> |
| 96 | + <div class="form-check"> |
| 97 | + <input class="form-check-input" type="checkbox" disabled="@CheckCanSelect(item)" checked="@GetCheckedString(item)" /> |
| 98 | + </div> |
| 99 | + @if (ItemTemplate != null) |
| 100 | + { |
| 101 | + @ItemTemplate(item) |
| 102 | + } |
| 103 | + else if (IsMarkupString) |
| 104 | + { |
| 105 | + @((MarkupString)item.Text) |
| 106 | + } |
| 107 | + else |
| 108 | + { |
| 109 | + <span>@item.Text</span> |
| 110 | + } |
| 111 | + </div> |
| 112 | + </DynamicElement> |
| 113 | + } |
| 114 | + } |
| 115 | + </div> |
108 | 116 | } |
109 | 117 | </div> |
110 | 118 | </div> |
0 commit comments