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 src/BootstrapBlazor.Server/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
]
},
"BootstrapBlazorOptions": {
"IsPopover": false,
"ToastDelay": 4000,
"MessageDelay": 4000,
"SwalDelay": 4000,
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor.Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"EnableLocalStorage": false
},
"BootstrapBlazorOptions": {
"IsPopover": false,
"ToastDelay": 4000,
"MessageDelay": 4000,
"SwalDelay": 4000,
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.11.2-beta01</Version>
<Version>9.11.2-beta02</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ public abstract class PopoverCompleteBase<TValue> : BootstrapInputBase<TValue>,
[NotNull]
public string? ClearIcon { get; set; }

/// <summary>
/// <see cref="BootstrapBlazorOptions"/> 配置类实例
/// </summary>
[Inject]
[NotNull]
protected IOptions<BootstrapBlazorOptions>? BootstrapBlazorOptions { get; set; }

/// <summary>
/// 获得 是否跳过 ESC 按键字符串
/// </summary>
Expand Down Expand Up @@ -171,6 +178,7 @@ protected override void OnParametersSet()
ClearIcon ??= IconTheme.GetIconByKey(ComponentIcons.InputClearIcon);

Offset ??= "[0, 6]";
IsPopover |= BootstrapBlazorOptions.Value.IsPopover;
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions src/BootstrapBlazor/Components/Select/PopoverSelectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public abstract class PopoverSelectBase<TValue> : PopoverDropdownBase<TValue>
[Parameter]
public string? Offset { get; set; }

/// <summary>
/// <see cref="BootstrapBlazorOptions"/> 配置类实例
/// </summary>
[Inject]
[NotNull]
protected IOptions<BootstrapBlazorOptions>? BootstrapBlazorOptions { get; set; }

/// <summary>
/// data-bs-toggle 值
/// </summary>
Expand All @@ -41,5 +48,6 @@ protected override void OnParametersSet()
base.OnParametersSet();

Offset ??= "[0, 10]";
IsPopover |= BootstrapBlazorOptions.Value.IsPopover;
}
}
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Select/SimpleSelectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace BootstrapBlazor.Components;
public abstract class SimpleSelectBase<TValue> : SelectBase<TValue>
{
/// <summary>
/// Gets virtualize component instrance
/// Gets virtualize component instance
/// </summary>
[NotNull]
protected Virtualize<SelectedItem>? _virtualizeElement = default;
Expand Down
5 changes: 5 additions & 0 deletions src/BootstrapBlazor/Options/BootstrapBlazorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public class BootstrapBlazorOptions : IOptions<BootstrapBlazorOptions>
/// </summary>
public bool IsMemorialMode { get; set; }

/// <summary>
/// 获得/设置 <see cref="Select{TValue}"/> 等组件是否将 <see cref="IsPopover"/> 参数默认值更改为 true 默认 false
/// </summary>
public bool IsPopover { get; set; }

BootstrapBlazorOptions IOptions<BootstrapBlazorOptions>.Value => this;

/// <summary>
Expand Down
Loading