| | | 1 | | using Microsoft.AspNetCore.Components; |
| | | 2 | | using Microsoft.Extensions.Logging; |
| | | 3 | | using Microsoft.FluentUI.AspNetCore.Components; |
| | | 4 | | using Microsoft.FluentUI.AspNetCore.Components.Extensions; |
| | | 5 | | using Utility.Infrastructure; |
| | | 6 | | |
| | | 7 | | namespace Utility.Components; |
| | | 8 | | |
| | | 9 | | public partial class SiteSettingsPanel |
| | | 10 | | { |
| | | 11 | | private FluentDesignTheme? _theme; |
| | | 12 | | |
| | | 13 | | [Inject] |
| | 0 | 14 | | public required ILogger<SiteSettingsPanel> Logger { get; set; } |
| | | 15 | | |
| | | 16 | | [Inject] |
| | 0 | 17 | | public required CacheStorageAccessor CacheStorageAccessor { get; set; } |
| | | 18 | | |
| | | 19 | | [Inject] |
| | 0 | 20 | | public required GlobalState GlobalState { get; set; } |
| | | 21 | | |
| | 0 | 22 | | public DesignThemeModes Mode { get; set; } |
| | | 23 | | |
| | 0 | 24 | | public OfficeColor? OfficeColor { get; set; } |
| | | 25 | | |
| | 0 | 26 | | public LocalizationDirection? Direction { get; set; } |
| | | 27 | | |
| | 0 | 28 | | private static IEnumerable<DesignThemeModes> AllModes => Enum.GetValues<DesignThemeModes>(); |
| | | 29 | | |
| | | 30 | | private static IEnumerable<OfficeColor?> AllOfficeColors |
| | | 31 | | { |
| | | 32 | | get |
| | 0 | 33 | | { |
| | 0 | 34 | | return Enum.GetValues<OfficeColor>().Select(i => (OfficeColor?)i); |
| | 0 | 35 | | } |
| | | 36 | | } |
| | | 37 | | |
| | | 38 | | private static string? GetCustomColor(OfficeColor? color) |
| | 0 | 39 | | { |
| | 0 | 40 | | return color switch |
| | 0 | 41 | | { |
| | 0 | 42 | | null => OfficeColorUtilities.GetRandom(true).ToAttributeValue(), |
| | 0 | 43 | | Microsoft.FluentUI.AspNetCore.Components.OfficeColor.Default => "#036ac4", |
| | 0 | 44 | | _ => color.ToAttributeValue(), |
| | 0 | 45 | | }; |
| | | 46 | | |
| | 0 | 47 | | } |
| | | 48 | | } |