Skip to content

Commit a3bf221

Browse files
authored
feat(UniverSheet): add RibbonType parameter (#855)
* feat(UniverSheet): add RibbonType parameter * chore: bump version 10.0.3
1 parent 6fb0e57 commit a3bf221

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

src/components/BootstrapBlazor.UniverSheet/BootstrapBlazor.UniverSheet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>10.0.2</Version>
4+
<Version>10.0.3</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public partial class UniverSheet
3030
[Parameter]
3131
public string? Lang { get; set; }
3232

33+
/// <summary>
34+
/// 获得/设置 设置工具栏样式 默认 default 未设置
35+
/// </summary>
36+
[Parameter]
37+
public UniverSheetRibbonType RibbonType { get; set; }
38+
3339
/// <summary>
3440
/// 获得/设置 需要传递的数据
3541
/// </summary>
@@ -87,7 +93,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
8793
/// <inheritdoc/>
8894
/// </summary>
8995
/// <returns></returns>
90-
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { Theme, Lang, Plugins, Data });
96+
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new { Theme, Lang, Plugins, Data, RibbonType = RibbonType.ToDescriptionString() });
9197

9298
/// <summary>
9399
/// 推送数据方法

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ export async function init(id, invoke, options) {
88
return;
99
}
1010

11-
const { theme, lang, plugins, data } = options;
11+
const { theme, lang, plugins, data, ribbonType } = options;
1212
const univerSheet = {
1313
el,
1414
invoke,
1515
data,
1616
plugins,
1717
theme,
18-
lang
18+
lang,
19+
ribbonType
1920
};
2021

2122
await createUniverSheetAsync(univerSheet);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone
4+
5+
using System.ComponentModel;
6+
7+
namespace BootstrapBlazor.Components;
8+
9+
/// <summary>
10+
/// UniverSheet 工具栏样式枚举
11+
/// </summary>
12+
public enum UniverSheetRibbonType
13+
{
14+
/// <summary>
15+
/// 默认样式
16+
/// </summary>
17+
[Description("default")]
18+
Default,
19+
20+
/// <summary>
21+
/// 经典样式
22+
/// </summary>
23+
[Description("classic")]
24+
Classic,
25+
26+
/// <summary>
27+
/// 简单样式
28+
/// </summary>
29+
[Description("simple")]
30+
Simple
31+
}

0 commit comments

Comments
 (0)