Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<PackageReference Include="BootstrapBlazor.BootstrapIcon.Extensions" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Chart" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.CodeEditor" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Dock" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.DockView" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.DriverJs" Version="9.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
border-radius: var(--bs-border-radius);
overflow: hidden;
direction: ltr;
width: 100%;
}

.pre-code:not(:last-child) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</Select>
</div>
<div class="col-12">
<CodeEditor Value="@Code" Language="@Language" Theme="@Theme" OnValueChanged="OnValueChanged" />
</div>
<div class="col-12">
<ConsoleLogger @ref="Logger"></ConsoleLogger>
<Pre>&lt;CodeEditor Value="@@Code" Language="@@Language" Theme="@@Theme" OnValueChanged="OnValueChanged" /&gt;</Pre>
</div>
</div>
</DemoBlock>
Expand Down
89 changes: 38 additions & 51 deletions src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace BootstrapBlazor.Server.Components.Samples;
/// </summary>
public partial class CodeEditors
{
[NotNull]
private ConsoleLogger? Logger { get; set; }

[NotNull]
private string? Code { get; set; }

Expand Down Expand Up @@ -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")
Expand All @@ -105,45 +93,44 @@ private Task OnThemeSelectedItemChanged(SelectedItem item)
return Task.CompletedTask;
}

private IEnumerable<AttributeItem> GetAttributeItems()
private static List<AttributeItem> GetAttributeItems()
{
return new List<AttributeItem>()
{
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<string?>",
DefaultValue = "-",
Description = Localizer["ValueChanged"]
},
new AttributeItem()
{
Name = nameof(CodeEditor.OnValueChanged),
Type = "Func<string?,Task>",
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<string?>",
// DefaultValue = "-",
// Description = Localizer["ValueChanged"]
//},
//new()
//{
// Name = nameof(CodeEditor.OnValueChanged),
// Type = "Func<string?,Task>",
// DefaultValue = "-",
// Description = Localizer["ValueChanged"]
//}
];
}
}
Loading