From 49142c1070a947331d69e0a6e9bc45fa229ff5aa Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 22 Dec 2024 15:43:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?style:=20=E5=A2=9E=E5=8A=A0=20100%=20?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Server.csproj | 1 - .../Components/Components/Pre.razor.css | 1 + .../Components/Samples/CodeEditors.razor | 5 +- .../Components/Samples/CodeEditors.razor.cs | 89 ++++++++----------- 4 files changed, 40 insertions(+), 56 deletions(-) diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index 1702ed7eaec..cf7e4eaa349 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -31,7 +31,6 @@ - diff --git a/src/BootstrapBlazor.Server/Components/Components/Pre.razor.css b/src/BootstrapBlazor.Server/Components/Components/Pre.razor.css index 219a0ccbaf3..2ccdc79e512 100644 --- a/src/BootstrapBlazor.Server/Components/Components/Pre.razor.css +++ b/src/BootstrapBlazor.Server/Components/Components/Pre.razor.css @@ -4,6 +4,7 @@ border-radius: var(--bs-border-radius); overflow: hidden; direction: ltr; + width: 100%; } .pre-code:not(:last-child) { diff --git a/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor b/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor index d58dd892c60..a425770f0b3 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor @@ -27,10 +27,7 @@
- -
-
- +
<CodeEditor Value="@@Code" Language="@@Language" Theme="@@Theme" OnValueChanged="OnValueChanged" />
diff --git a/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs index c7b32b9cb36..21ec91d26e6 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs @@ -10,9 +10,6 @@ namespace BootstrapBlazor.Server.Components.Samples; /// public partial class CodeEditors { - [NotNull] - private ConsoleLogger? Logger { get; set; } - [NotNull] private string? Code { get; set; } @@ -76,15 +73,6 @@ void Main() return Task.CompletedTask; } - private Task OnValueChanged(string? value) - { - if (!string.IsNullOrEmpty(value)) - { - Logger.Log(value); - } - return Task.CompletedTask; - } - private Task OnThemeSelectedItemChanged(SelectedItem item) { if (item.Value == "vs-dark") @@ -105,45 +93,44 @@ private Task OnThemeSelectedItemChanged(SelectedItem item) return Task.CompletedTask; } - private IEnumerable GetAttributeItems() + private static List GetAttributeItems() { - return new List() - { - new AttributeItem() - { - Name = nameof(CodeEditor.Value), - Type = "string", - DefaultValue = "-", - Description = Localizer["Value"] - }, - new AttributeItem() - { - Name = nameof(CodeEditor.Theme), - Type = "string", - DefaultValue = "vs", - Description = Localizer["Theme"] - }, - new AttributeItem() - { - Name = nameof(CodeEditor.Language), - Type = "string", - DefaultValue = "csharp", - Description = Localizer["Language"] - }, - new AttributeItem() - { - Name = nameof(CodeEditor.ValueChanged), - Type = "EventCallback", - DefaultValue = "-", - Description = Localizer["ValueChanged"] - }, - new AttributeItem() - { - Name = nameof(CodeEditor.OnValueChanged), - Type = "Func", - DefaultValue = "-", - Description = Localizer["ValueChanged"] - }, - }; + return [ + //new() + //{ + // Name = nameof(CodeEditor.Value), + // Type = "string", + // DefaultValue = "-", + // Description = Localizer["Value"] + //}, + //new() + //{ + // Name = nameof(CodeEditor.Theme), + // Type = "string", + // DefaultValue = "vs", + // Description = Localizer["Theme"] + //}, + //new() + //{ + // Name = nameof(CodeEditor.Language), + // Type = "string", + // DefaultValue = "csharp", + // Description = Localizer["Language"] + //}, + //new() + //{ + // Name = nameof(CodeEditor.ValueChanged), + // Type = "EventCallback", + // DefaultValue = "-", + // Description = Localizer["ValueChanged"] + //}, + //new() + //{ + // Name = nameof(CodeEditor.OnValueChanged), + // Type = "Func", + // DefaultValue = "-", + // Description = Localizer["ValueChanged"] + //} + ]; } } From f4d14e2b39428a9b9a491c3cd153ba947ae0579c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 22 Dec 2024 16:24:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"style:=20=E5=A2=9E=E5=8A=A0=20100?= =?UTF-8?q?%=20=E5=AE=BD=E5=BA=A6=E6=A0=B7=E5=BC=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 49142c1070a947331d69e0a6e9bc45fa229ff5aa. --- src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index cf7e4eaa349..1702ed7eaec 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -31,6 +31,7 @@ + From ef35792dc45a097be70dc2a578a261292689085c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 22 Dec 2024 16:25:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20CodeEditor?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: j4587698 <24642446+j4587698@users.noreply.github.com> --- src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index 1702ed7eaec..cf7e4eaa349 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -31,7 +31,6 @@ -