feat(OnScreenKeyboard): update base class to fix script error (#4325)

* doc: 更新示例

* chore: 更新依赖包
This commit is contained in:
Argo Zhang 2024-09-18 21:00:46 +08:00 committed by GitHub
parent 06059918e5
commit 752796712f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 34 deletions

View File

@ -54,7 +54,7 @@
<PackageReference Include="BootstrapBlazor.Middleware" Version="8.0.0" />
<PackageReference Include="BootstrapBlazor.MindMap" Version="8.0.7" />
<PackageReference Include="BootstrapBlazor.MouseFollower" Version="8.0.0" />
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="8.0.3" />
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="8.0.4" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="8.0.4" />
<PackageReference Include="BootstrapBlazor.Player" Version="8.0.0-beta05" />
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="8.0.2" />

View File

@ -3,9 +3,7 @@
<h3>@Localizer["OnScreenKeyboardsTitle"]</h3>
<div> ... </div>
@* <PackageTips Name="BootstrapBlazor.OnScreenKeyboard" />
<PackageTips Name="BootstrapBlazor.OnScreenKeyboard" />
<p><b>@Localizer["OnScreenKeyboardsBasicTitle"]</b></p>
<div class="code-label">Razor</div>
@ -71,14 +69,14 @@
Introduction=""
Name="App">
<p>@Localizer["OnScreenKeyboardsAppDescription"]</p>
<OnScreenKeyboard ClassName="virtualkeyboardbb" Option="AppOption" />
<div class="form-control textarea-demo"> @BindValue</div>
<p>BootstrapInput</p>
<BootstrapInput class="virtualkeyboardbb" data-kioskboard-specialcharacters="true" placeholder="BootstrapInput" @bind-Value="@BindValue" />
<p>BootstrapPassword</p>
<BootstrapPassword class="virtualkeyboardbb" data-kioskboard-specialcharacters="true" placeholder="BootstrapPassword" @bind-Value="@BindValue" />
<p>Textarea</p>
<Textarea class="virtualkeyboardbb" data-kioskboard-specialcharacters="true" placeholder="Textarea" rows="4" @bind-Value="@BindValue" />
<Textarea class="virtualkeyboardbb" data-kioskboard-specialcharacters="true" placeholder="Textarea" rows="4" @bind-Value="@BindValue" />
<OnScreenKeyboard ClassName="virtualkeyboardbb" Option="AppOption" />
</DemoBlock>
<Tips class="mt-3">
@ -90,31 +88,4 @@
<AttributeTable Items="@GetKeyboardOptionAttributes()" Title="KeyboardOption" />
<AttributeTable Items="@GetKeyboardEnumAttributes()" Title="KeyboardEnum" /> *@
@code {
static KeyboardOption CustomerOption => new()
{
KeyboardSpecialcharacters = KeyboardSpecialcharacters.europe
};
static KeyboardOption SpecialcharactersOption => new()
{
CustomerKeyboardSpecialcharacters = new string[] { "中", "国", "女", "足", "牛啊" }
};
static KeyboardOption Option => new()
{
keysFontFamily = "Barlow",
keysFontWeight = "500",
Theme = KeyboardTheme.dark,
};
string BindValue { get; set; } = "virtualkeyboard";
static KeyboardOption AppOption => new()
{
autoScroll = true
};
}
<AttributeTable Items="@GetKeyboardEnumAttributes()" Title="KeyboardEnum" />

View File

@ -12,6 +12,30 @@ public sealed partial class OnScreenKeyboards
private static readonly Dictionary<string, string> Keys1 = new() { { "0", "L" }, { "1", "O" } };
private static readonly Dictionary<string, string> Keys2 = new() { { "0", "V" }, { "1", "E" } };
static KeyboardOption CustomerOption => new()
{
KeyboardSpecialcharacters = KeyboardSpecialcharacters.europe
};
static KeyboardOption SpecialcharactersOption => new()
{
CustomerKeyboardSpecialcharacters = new string[] { "中", "国", "女", "足", "牛啊" }
};
static KeyboardOption Option => new()
{
keysFontFamily = "Barlow",
keysFontWeight = "500",
Theme = KeyboardTheme.dark,
};
string BindValue { get; set; } = "virtualkeyboard";
static KeyboardOption AppOption => new()
{
autoScroll = true
};
/// <summary>
/// 获得属性方法
/// </summary>