File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
src/LoreSoft.Blazor.Controls Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1515 <h5 class =" toolbar-title-text" >@Title </h5 >
1616 }
1717 </div >
18+ @if (ShowFilterWarning && CurrentGrid .IsFilterActive ())
19+ {
20+ <div class =" toolbar-filter-warning" title =" Results are filtered. Click the filter icon to clear." >
21+ @FilterWarning
22+ </div >
23+ }
1824 @if (ShowSearch )
1925 {
2026 <div class =" toolbar-search-box" >
Original file line number Diff line number Diff line change @@ -142,6 +142,21 @@ public DataGridToolbar()
142142 [ Parameter ]
143143 public bool ShowColumnPicker { get ; set ; } = true ;
144144
145+ /// <summary>
146+ /// Gets or sets a value indicating whether the filter warning indicator is displayed in the toolbar.
147+ /// When true, the <see cref="FilterWarning"/> content is shown whenever the DataGrid has an active filter applied.
148+ /// </summary>
149+ [ Parameter ]
150+ public bool ShowFilterWarning { get ; set ; } = true ;
151+
152+ /// <summary>
153+ /// Gets or sets the content rendered as the active-filter warning indicator.
154+ /// Displayed when <see cref="ShowFilterWarning"/> is <c>true</c> and the DataGrid has an active filter.
155+ /// Defaults to a <c>"* Filter Applied *"</c> text node.
156+ /// </summary>
157+ [ Parameter ]
158+ public RenderFragment ? FilterWarning { get ; set ; } = builder => builder . AddContent ( 0 , "* Filter Applied *" ) ;
159+
145160 /// <summary>
146161 /// Gets the current <see cref="DataGrid{TItem}"/> instance in use by the toolbar.
147162 /// This property is derived from either the <see cref="DataGrid"/> parameter or the
Original file line number Diff line number Diff line change 3131 white-space : nowrap;
3232}
3333
34+ .data-toolbar .toolbar-filter-warning {
35+ font-size : .80rem ;
36+ font-style : italic;
37+ margin : .5rem ;
38+ opacity : .75 ;
39+ }
40+
3441.data-toolbar select ,
3542.data-toolbar button ,
3643.data-toolbar input ,
125132 .data-toolbar .toolbar-search-box {
126133 width : 100% ;
127134 }
135+
128136 .data-toolbar .toolbar-control {
129137 width : 100% ;
130138 }
You can’t perform that action at this time.
0 commit comments