|
17 | 17 | { |
18 | 18 | string? tooltip = Tooltip ? (HeaderTooltip ?? Title) : null; |
19 | 19 |
|
20 | | - <FluentKeyCode Only="new[] { KeyCode.Ctrl, KeyCode.Enter }" OnKeyDown="HandleKeyDown" class="keycapture" style="width: 100%;" StopPropagation="true" @oncontextmenu="@(() => Grid.RemoveSortByColumnAsync(this))"> |
| 20 | + <FluentKeyCode Only="new[] { KeyCode.Ctrl, KeyCode.Enter }" OnKeyDown="HandleKeyDown" class="keycapture" style="width: 100%;" StopPropagation="true" @oncontextmenu="@(() => Grid.RemoveSortByColumnAsync(this))"> |
21 | 21 |
|
22 | 22 | @if (AnyColumnActionEnabled) |
23 | 23 | { |
|
96 | 96 | { |
97 | 97 | wdelta = "56px"; |
98 | 98 | } |
99 | | - |
100 | | - @if (Align == Align.Start || Align == Align.Center) |
101 | | - { |
102 | | - @if (Grid.ResizeType is not null) |
| 99 | + <div style="display: flex;"> |
| 100 | + @if (Align == Align.Start || Align == Align.Center) |
103 | 101 | { |
104 | | - @OptionsButton() |
105 | | - } |
106 | | - else |
107 | | - { |
108 | | - @if (ColumnOptions is not null) |
| 102 | + @if (Grid.ResizeType is not null) |
109 | 103 | { |
110 | | - @FilterButton() |
| 104 | + @OptionsButton() |
| 105 | + } |
| 106 | + else |
| 107 | + { |
| 108 | + @if (ColumnOptions is not null) |
| 109 | + { |
| 110 | + @FilterButton() |
| 111 | + } |
111 | 112 | } |
112 | 113 | } |
113 | | - } |
114 | 114 |
|
115 | | - @if (Sortable.HasValue ? Sortable.Value : IsSortableByDefault()) |
116 | | - { |
117 | | - <FluentKeyCode Only="new [] { KeyCode.Ctrl, KeyCode.Enter}" OnKeyDown="HandleKeyDown" class="keycapture" style="width: 100%;" StopPropagation="true" @oncontextmenu="@(() => Grid.RemoveSortByColumnAsync(this))"> |
118 | | - <FluentButton Appearance="Appearance.Stealth" Class="col-sort-button" Style="@($"width: calc(100% - {wdelta});")" @onclick="@(() => Grid.SortByColumnAsync(this))" aria-label="@tooltip" title="@tooltip"> |
| 115 | + @if (Sortable.HasValue ? Sortable.Value : IsSortableByDefault()) |
| 116 | + { |
| 117 | + <FluentKeyCode Only="new[] { KeyCode.Ctrl, KeyCode.Enter }" OnKeyDown="HandleKeyDown" class="keycapture" style="width: 100%;" StopPropagation="true" @oncontextmenu="@(() => Grid.RemoveSortByColumnAsync(this))"> |
| 118 | + <FluentButton Appearance="Appearance.Stealth" Class="col-sort-button" Style="@($"width: calc(100% - {wdelta});")" @onclick="@(() => Grid.SortByColumnAsync(this))" aria-label="@tooltip" title="@tooltip"> |
119 | 119 | <div class="col-title-text" title="@tooltip">@Title</div> |
120 | 120 |
|
121 | | - @if (Grid.SortByAscending.HasValue && IsActiveSortColumn) |
122 | | - { |
123 | | - if (Grid.SortByAscending == true) |
| 121 | + @if (Grid.SortByAscending.HasValue && IsActiveSortColumn) |
124 | 122 | { |
125 | | - <FluentIcon Value="@(new CoreIcons.Regular.Size20.ArrowSortUp())" Slot="end" Style="opacity: 0.5;" /> |
| 123 | + if (Grid.SortByAscending == true) |
| 124 | + { |
| 125 | + <FluentIcon Value="@(new CoreIcons.Regular.Size20.ArrowSortUp())" Slot="end" Style="opacity: 0.5;" /> |
| 126 | + } |
| 127 | + else |
| 128 | + { |
| 129 | + <FluentIcon Value="@(new CoreIcons.Regular.Size20.ArrowSortDown())" Slot="end" Style="opacity: 0.5;" /> |
| 130 | + } |
126 | 131 | } |
127 | | - else |
| 132 | + @if (ColumnOptions is not null && Filtered.GetValueOrDefault() && Grid.ResizeType is not null) |
128 | 133 | { |
129 | | - <FluentIcon Value="@(new CoreIcons.Regular.Size20.ArrowSortDown())" Slot="end" Style="opacity: 0.5;" /> |
| 134 | + <FluentIcon Value="@(new CoreIcons.Regular.Size20.Filter())" Slot="end" Style="opacity: 0.5;" /> |
130 | 135 | } |
131 | | - } |
132 | | - @if (ColumnOptions is not null && Filtered.GetValueOrDefault() && Grid.ResizeType is not null) |
133 | | - { |
134 | | - <FluentIcon Value="@(new CoreIcons.Regular.Size20.Filter())" Slot="end" Style="opacity: 0.5;" /> |
135 | | - } |
136 | 136 | </FluentButton> |
137 | | - </FluentKeyCode> |
138 | | - } |
139 | | - else |
140 | | - { |
141 | | - <div class="col-title" style="@($"width: calc(100% - {wdelta});")"> |
142 | | - <div class="col-title-text" title="@tooltip" >@Title |
143 | | - @if (ColumnOptions is not null && Filtered.GetValueOrDefault() && Grid.ResizeType.HasValue ) |
144 | | - { |
145 | | - <span style="padding: 0 5px;"> |
146 | | - <FluentIcon Value="@(new CoreIcons.Regular.Size20.Filter())" Slot="end" Style="opacity: 0.5;" /> |
147 | | - </span> |
148 | | - } |
149 | | - </div> |
150 | | - </div> |
151 | | - } |
152 | | - |
153 | | - @if (Align == Align.End) |
154 | | - { |
155 | | - @if (Grid.ResizeType is not null) |
156 | | - { |
157 | | - @OptionsButton() |
| 137 | + </FluentKeyCode> |
158 | 138 | } |
159 | 139 | else |
160 | 140 | { |
161 | | - @if (ColumnOptions is not null) |
| 141 | + <div class="col-title" style="@($"width: calc(100% - {wdelta});")"> |
| 142 | + <div class="col-title-text" title="@tooltip"> |
| 143 | + @Title |
| 144 | + @if (ColumnOptions is not null && Filtered.GetValueOrDefault() && Grid.ResizeType.HasValue) |
| 145 | + { |
| 146 | + <span style="padding: 0 5px;"> |
| 147 | + <FluentIcon Value="@(new CoreIcons.Regular.Size20.Filter())" Slot="end" Style="opacity: 0.5;" /> |
| 148 | + </span> |
| 149 | + } |
| 150 | + </div> |
| 151 | + </div> |
| 152 | + } |
| 153 | + |
| 154 | + @if (Align == Align.End) |
| 155 | + { |
| 156 | + @if (Grid.ResizeType is not null) |
162 | 157 | { |
163 | | - @FilterButton() |
| 158 | + @OptionsButton() |
| 159 | + } |
| 160 | + else |
| 161 | + { |
| 162 | + @if (ColumnOptions is not null) |
| 163 | + { |
| 164 | + @FilterButton() |
| 165 | + } |
164 | 166 | } |
165 | 167 | } |
166 | | - } |
| 168 | + </div> |
167 | 169 |
|
168 | 170 | } |
169 | 171 | } |
|
181 | 183 | { |
182 | 184 | return |
183 | 185 | @<FluentButton Appearance="Appearance.Stealth" class="col-options-button" @onclick="@(() => Grid.ShowColumnOptionsAsync(this))" aria-label="Filter this column"> |
184 | | - <FluentIcon Value="@(new CoreIcons.Regular.Size20.ChevronDown())" Color="Color.Neutral" Width="20px" Style="opacity: 0.5;" /> |
185 | | - </FluentButton>; |
| 186 | + <FluentIcon Value="@(new CoreIcons.Regular.Size20.ChevronDown())" Color="Color.Neutral" Width="20px" Style="opacity: 0.5;" /> |
| 187 | + </FluentButton>; |
186 | 188 | } |
187 | 189 |
|
188 | 190 | private RenderFragment FilterButton() |
189 | 191 | { |
190 | 192 | return |
191 | 193 | @<FluentButton Appearance="Appearance.Stealth" class="col-options-button" @onclick="@(() => Grid.ShowColumnOptionsAsync(this))" aria-label="Filter this column"> |
192 | | - @if (Filtered.GetValueOrDefault()) |
193 | | - { |
| 194 | + @if (Filtered.GetValueOrDefault()) |
| 195 | + { |
194 | 196 | <FluentIcon Value="@(new CoreIcons.Regular.Size20.FilterDismiss())" /> |
195 | | - } |
196 | | - else |
197 | | - { |
| 197 | + } |
| 198 | + else |
| 199 | + { |
198 | 200 | <FluentIcon Value="@(new CoreIcons.Regular.Size20.Filter())" /> |
199 | | - } |
| 201 | + } |
200 | 202 |
|
201 | | - </FluentButton>; |
| 203 | + </FluentButton>; |
202 | 204 | } |
203 | 205 | } |
0 commit comments