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: 1 addition & 0 deletions exclusion.dic
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ Validata
Validatable
Totp
Vditor
univer
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,70 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// UniverSheet 组件
/// <para lang="zh">UniverSheet 组件</para>
/// <para lang="en">UniverSheet component</para>
/// </summary>
public partial class UniverSheet
{
/// <summary>
/// 获得/设置 插件集合 默认 null 未设置
/// <para lang="zh">获得/设置 插件集合 默认 null 未设置</para>
/// <para lang="en">Gets or sets the plugin collection. Default is null.</para>
/// </summary>
[Parameter]
public Dictionary<string, string>? Plugins { get; set; }

/// <summary>
/// 获得/设置 主题颜色 默认 null 未设置 可设置为 greenTheme
/// <para lang="zh">获得/设置 主题颜色 默认 null 未设置 可设置为 greenTheme</para>
/// <para lang="en">Gets or sets the theme color. Default is null. Can be set to greenTheme.</para>
/// </summary>
[Parameter]
public string? Theme { get; set; }

/// <summary>
/// 获得/设置 是否为暗黑模式 默认 null 未设置 自动
/// <para lang="zh">获得/设置 是否为暗黑模式 默认 null 未设置 自动</para>
/// <para lang="en">Gets or sets whether dark mode is enabled. Default is null (auto).</para>
/// </summary>
[Parameter]
public bool? IsDarkMode { get; set; }

/// <summary>
/// 获得/设置 语言 默认 null 未设置
/// <para lang="zh">获得/设置 语言 默认 null 未设置</para>
/// <para lang="en">Gets or sets the language. Default is null.</para>
/// </summary>
[Parameter]
public string? Lang { get; set; }

/// <summary>
/// 获得/设置 设置工具栏样式 默认 default 未设置
/// <para lang="zh">获得/设置 工具栏样式 默认 default 未设置</para>
/// <para lang="en">Gets or sets the ribbon toolbar style. Default is default.</para>
/// </summary>
[Parameter]
public UniverSheetRibbonType RibbonType { get; set; }

/// <summary>
/// 获得/设置 需要传递的数据
/// <para lang="zh">获得/设置 需要传递的数据</para>
/// <para lang="en">Gets or sets the data to pass.</para>
/// </summary>
[Parameter]
public UniverSheetData? Data { get; set; }

/// <summary>
/// 获得/设置 是否显示加载遮罩 默认 true 显示遮罩
/// <para lang="zh">获得/设置 是否显示加载遮罩 默认 true 显示遮罩</para>
/// <para lang="en">Gets or sets whether to show loading mask. Default is true.</para>
/// </summary>
[Parameter]
public bool ShowLoading { get; set; } = true;

/// <summary>
/// 获得/设置 正在加载显示文本 默认 null 未设置读取资源文件
/// <para lang="zh">获得/设置 正在加载显示文本 默认 null 未设置读取资源文件</para>
/// <para lang="en">Gets or sets the loading display text. Default is null, reads from resource file.</para>
/// </summary>
[Parameter]
public string? LoadingText { get; set; }

/// <summary>
/// 获得/设置 Frame 加载页面传递过来的数据
/// <para lang="zh">获得/设置 Frame 加载页面传递过来的数据回调方法</para>
/// <para lang="en">Gets or sets the callback for data posted from the Frame loaded page.</para>
/// </summary>
[Parameter]
public Func<UniverSheetData?, Task<UniverSheetData?>>? OnPostDataAsync { get; set; }
Expand Down Expand Up @@ -115,7 +125,6 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, new
{
Theme,
Expand All @@ -127,32 +136,33 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
});

/// <summary>
/// 推送数据方法
/// <para lang="zh">推送数据方法</para>
/// <para lang="en">Pushes data to the sheet.</para>
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public Task<UniverSheetData?> PushDataAsync(UniverSheetData? data) => InvokeAsync<UniverSheetData>("execute", Id, data);

/// <summary>
/// 由 JavaScript 调用
/// <para lang="zh">由 JavaScript 调用</para>
/// <para lang="en">Called by JavaScript.</para>
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[JSInvokable]
public async Task<UniverSheetData?> TriggerPostData(UniverSheetData data) => OnPostDataAsync == null
? null
: await OnPostDataAsync(data);

/// <summary>
/// 获得/设置 页面加载完毕后回调方法
/// <para lang="zh">获得/设置 页面加载完毕后回调方法</para>
/// <para lang="en">Gets or sets the callback method after page loading is complete.</para>
/// </summary>
[Parameter]
public Func<Task>? OnReadyAsync { get; set; }

/// <summary>
/// 由 JavaScript 调用
/// <para lang="zh">由 JavaScript 调用</para>
/// <para lang="en">Called by JavaScript.</para>
/// </summary>
/// <returns></returns>
[JSInvokable]
public async Task TriggerReadyAsync()
{
Expand Down