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
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="BootstrapBlazor.Chart" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Dock" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.DockView" Version="9.1.1" />
<PackageReference Include="BootstrapBlazor.DockView" Version="9.1.3" />
<PackageReference Include="BootstrapBlazor.DriverJs" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.ElementIcon" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.FileViewer" Version="9.0.0" />
Expand Down Expand Up @@ -65,7 +65,7 @@
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.1" />
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.UniverIcon" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.0-beta07" />
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.0-beta09" />
<PackageReference Include="BootstrapBlazor.VideoPlayer" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.WinBox" Version="9.0.7" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Routing;
Expand All @@ -12,31 +11,31 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// BootstrapBlazorAuthorizeView 组件
/// BootstrapBlazorAuthorizeView component
/// </summary>
public class BootstrapBlazorAuthorizeView : ComponentBase
{
/// <summary>
/// 获得/设置 路由关联上下文
/// Gets or sets the type associated with the route. default is null
/// </summary>
[Parameter]
[NotNull]
public Type? Type { get; set; }

/// <summary>
/// 获得/设置 路由关联上下文
/// Gets or sets the parameters associated with the route. default is null
/// </summary>
[Parameter]
public IReadOnlyDictionary<string, object>? Parameters { get; set; }

/// <summary>
/// 获得/设置 NotAuthorized 模板
/// Gets or sets the template to display when the user is not authorized. default is null
/// </summary>
[Parameter]
public RenderFragment? NotAuthorized { get; set; }

/// <summary>
/// The resource to which access is being controlled.
/// Gets or sets the resource to which access is being controlled. default is null
/// </summary>
[Parameter]
public object? Resource { get; set; }
Expand All @@ -56,7 +55,7 @@ public class BootstrapBlazorAuthorizeView : ComponentBase
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
/// <returns>A task that represents the asynchronous operation.</returns>
protected override async Task OnInitializedAsync()
{
Authorized = Type == null || await Type.IsAuthorizedAsync(ServiceProvider, AuthenticationState, Resource);
Expand All @@ -65,10 +64,9 @@ protected override async Task OnInitializedAsync()
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <param name="builder"></param>
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
// 判断是否开启权限
// Check if authorization is enabled
if (Authorized && Type != null)
{
var index = 0;
Expand Down
38 changes: 19 additions & 19 deletions src/BootstrapBlazor/Components/Tab/TabItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,87 +6,87 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// TabItem 组件基类
/// TabItem component
/// </summary>
public class TabItem : ComponentBase
{
/// <summary>
/// 获得/设置 文本文字
/// Gets or sets the text. Default is null
/// </summary>
[Parameter]
public string? Text { get; set; }

/// <summary>
/// 获得/设置 TabItem Header 模板
/// Gets or sets the TabItem Header template. Default is null
/// </summary>
[Parameter]
public RenderFragment<TabItem>? HeaderTemplate { get; set; }

/// <summary>
/// 获得/设置 请求地址
/// Gets or sets the request URL. Default is null
/// </summary>
[Parameter]
[NotNull]
public string? Url { get; set; }

/// <summary>
/// 获得/设置 当前状态是否激活
/// Gets or sets whether the current state is active. Default is false
/// </summary>
[Parameter]
public bool IsActive { get; set; }

/// <summary>
/// 获得/设置 当前状态是否 禁用 默认 false
/// Gets or sets whether the current state is disabled, default is false
/// </summary>
[Parameter]
public bool IsDisabled { get; set; }

/// <summary>
/// 获得/设置 当前 TabItem 是否可关闭 默认为 true 可关闭
/// Gets or sets whether the current TabItem is closable, default is true
/// </summary>
[Parameter]
public bool Closable { get; set; } = true;

/// <summary>
/// 获得/设置 当前 TabItem 是否始终加载 此参数作用于设置 <see cref="Tab.IsLazyLoadTabItem"/> 默认 false
/// Gets or sets whether the current TabItem is always loaded, this parameter is used to set <see cref="Tab.IsLazyLoadTabItem"/>, default is false
/// </summary>
[Parameter]
public bool AlwaysLoad { get; set; }

/// <summary>
/// 获得/设置 自定义样式名
/// Gets or sets the custom CSS class. Default is null
/// </summary>
[Parameter]
public string? CssClass { get; set; }

/// <summary>
/// 获得/设置 图标字符串
/// Gets or sets the icon string. Default is null
/// </summary>
[Parameter]
public string? Icon { get; set; }

/// <summary>
/// 获得/设置 是否显示全屏按钮 默认 true
/// Gets or sets whether to show the full screen button, default is true
/// </summary>
[Parameter]
public bool ShowFullScreen { get; set; } = true;

/// <summary>
/// 获得/设置 组件内容
/// Gets or sets the component content. Default is null
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }

/// <summary>
/// 获得/设置 所属 Tab 实例
/// Gets or sets the associated Tab instance
/// </summary>
[CascadingParameter]
protected internal Tab? TabSet { get; set; }

private string? LastText { get; set; }

/// <summary>
/// OnInitialized 方法
/// <inheritdoc/>
/// </summary>
protected override void OnInitialized()
{
Expand All @@ -110,13 +110,13 @@ protected override void OnParametersSet()
}

/// <summary>
/// 设置是否被选中方法
/// Method to set whether it is active
/// </summary>
/// <param name="active"></param>
public void SetActive(bool active) => IsActive = active;

/// <summary>
/// 设置是否被禁用
/// Method to set whether it is disabled
/// </summary>
/// <param name="disabled"></param>
public void SetDisabled(bool disabled)
Expand All @@ -125,13 +125,13 @@ public void SetDisabled(bool disabled)
}

/// <summary>
/// 设置是否被禁用
/// Method to set whether it is disabled without rendering
/// </summary>
/// <param name="disabled"></param>
internal void SetDisabledWithoutRender(bool disabled) => IsDisabled = disabled;

/// <summary>
/// 重新设置标签文字等参数
/// Method to reset the tab text and other parameters
/// </summary>
/// <param name="text"></param>
/// <param name="icon"></param>
Expand All @@ -155,7 +155,7 @@ public void SetHeader(string text, string? icon = null, bool? closable = null)
}

/// <summary>
/// 通过指定参数集合获取 TabItem 实例
/// Gets a TabItem instance by specifying a set of parameters
/// </summary>
/// <param name="parameters"></param>
/// <returns></returns>
Expand Down
14 changes: 7 additions & 7 deletions src/BootstrapBlazor/Components/Tab/TabLink.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@
namespace BootstrapBlazor.Components;

/// <summary>
///
/// Represents a link within a tab component.
/// </summary>
public sealed partial class TabLink
{
/// <summary>
/// 获得/设置 文本文字
/// Gets or sets the text of the link. Default is null
/// </summary>
[Parameter]
public string? Text { get; set; }

/// <summary>
/// 获得/设置 请求地址
/// Gets or sets the URL of the link. Default is null
/// </summary>
[Parameter]
public string? Url { get; set; }

/// <summary>
/// 获得/设置 图标字符串
/// Gets or sets the icon of the link. Default is null
/// </summary>
[Parameter]
public string? Icon { get; set; }

/// <summary>
/// 获得/设置 当前 TabItem 是否可关闭 默认为 true 可关闭
/// Gets or sets a value indicating whether the tab item is closable. Default is true.
/// </summary>
[Parameter]
public bool Closable { get; set; } = true;

/// <summary>
/// 点击组件时回调此委托方法 默认为空
/// Gets or sets the callback method when the link is clicked. Default is null.
/// </summary>
[Parameter]
public Func<Task>? OnClick { get; set; }
Expand All @@ -45,7 +45,7 @@ public sealed partial class TabLink
private TabItemTextOptions? TabItemOptions { get; set; }

/// <summary>
/// 获得/设置 组件内容
/// Gets or sets the content of the component. Default is null
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
Expand Down