-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
232 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
BlazingCoffee/Client/Pages/SalesReports/SalesExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Linq; | ||
using BlazingCoffee.Shared.Models; | ||
using Telerik.Blazor.Components; | ||
using Telerik.DataSource; | ||
|
||
namespace BlazingCoffee.Client.Pages.SalesReports | ||
{ | ||
public static class SalesExtensions | ||
{ | ||
public static FilterDescriptor TransactionDateFilters(this GridState<Sale> gridState, | ||
Func<FilterDescriptor, bool> predicate) => | ||
gridState.FilterDescriptors | ||
.OfType<FilterDescriptor>() | ||
.Where(f=> f.Member == "TransactionDate") | ||
.First(predicate); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@namespace BlazingCoffee.Client.Shared | ||
@inject IJSRuntime js | ||
|
||
<TelerikDropDownList Id="theme" | ||
Data="Themes" | ||
TextField="ThemeText" | ||
ValueField="ThemeValue" | ||
Value="@SelectedTheme" | ||
ValueChanged="@( (string v) => HandleThemeSelected(v) )" /> | ||
|
||
@code { | ||
|
||
string SelectedTheme; | ||
|
||
IEnumerable<ThemeSetting> Themes => new List<ThemeSetting> { | ||
new ThemeSetting { ThemeText = "Auto (default)", ThemeValue = "auto" }, | ||
new ThemeSetting { ThemeText = "Light", ThemeValue = "main" }, | ||
new ThemeSetting { ThemeText = "Dark", ThemeValue = "main-dark" } | ||
}; | ||
|
||
async Task HandleThemeSelected(string value) | ||
{ | ||
await js.InvokeVoidAsync("themeChooser.setTheme", value); | ||
SelectedTheme = value; | ||
} | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
var theme = await js.InvokeAsync<string>("themeChooser.getTheme"); | ||
SelectedTheme = string.IsNullOrEmpty(theme) ? "auto" : theme; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace BlazingCoffee.Client.Shared | ||
{ | ||
public class ThemeSetting | ||
{ | ||
public string ThemeText { get; set; } | ||
public string ThemeValue { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.