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
6 changes: 3 additions & 3 deletions src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<PackageReference Include="BootstrapBlazor.Gantt" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.Holiday" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Html2Image" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="10.0.0-rc.2.1.2" />
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="9.0.6" />
<PackageReference Include="BootstrapBlazor.IconPark" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.ImageCropper" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.IP2Region" Version="9.0.4" />
Expand All @@ -66,7 +66,7 @@
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="9.0.6" />
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.Region" Version="9.0.8-beta01" />
<PackageReference Include="BootstrapBlazor.Region" Version="9.0.8" />
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.SmilesDrawer" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.4" />
Expand All @@ -75,7 +75,7 @@
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.7" />
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.7" />
<PackageReference Include="BootstrapBlazor.Tasks.Dashboard" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.UniverIcon" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.5" />
<PackageReference Include="BootstrapBlazor.Vditor" Version="9.0.0" />
Expand Down
14 changes: 14 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@
ShowDownloadButton="@_showDownloadButton" ShowZoomButton="@_showZoomButton" OnChange="@OnCardUpload"></CardUpload>
</DemoBlock>

<DemoBlock Title="@Localizer["UploadActionButtonTemplateTitle"]"
Introduction="@Localizer["UploadActionButtonTemplateIntro"]"
Name="ActionButtonTemplate">
<CardUpload TValue="string" IsMultiple="false" ShowDownloadButton="true" DefaultFileList="@DefaultFormatFileList.Take(1).ToList()"
OnChange="@OnCardUpload">
<BeforeActionButtonTemplate>
<Button Color="Color.Secondary" Icon="fa-solid fa-flag" OnClickWithoutRender="() => OnTest1Click(context)"></Button>
</BeforeActionButtonTemplate>
<ActionButtonTemplate>
<Button Color="Color.Secondary" Icon="fa-solid fa-home" OnClickWithoutRender="() => OnTest2Click(context)"></Button>
</ActionButtonTemplate>
</CardUpload>
</DemoBlock>

<DemoBlock Title="@Localizer["UploadFileIconTitle"]"
Introduction="@Localizer["UploadFileIconIntro"]"
Name="FileIcon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ private async Task OnCardUpload(UploadFile file)
}
}

private Task OnTest1Click(UploadFile file) => ToastService.Information("Action Button", $"{file.GetFileName()}");

private Task OnTest2Click(UploadFile file) => ToastService.Information("Action Button", $"{file.GetFileName()}");

private async Task SaveToFile(UploadFile file)
{
// Server Side 使用
Expand Down
4 changes: 3 additions & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3336,7 +3336,9 @@
"UploadsFileError": "The file is larger than 5M. Please reselect the file to upload.",
"UploadsSuccess": "File saved successfully",
"UploadsSaveFileError": "File save failed",
"UploadsWasmError": "In wasm mode, please call the api to save"
"UploadsWasmError": "In wasm mode, please call the api to save",
"UploadActionButtonTemplateTitle": "Custom action button",
"UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)."
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue: 'insert it before' should be 'inserting it before' to match the parallel structure with 'appending it to the end'.

Suggested change
"UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)."
"UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (inserting it before the default button)."

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backticks before <code> tags are unnecessary. Change `<code>ActionButtonTemplate</code>` to <code>ActionButtonTemplate</code> and `<code>BeforeActionButtonTemplate</code>` to <code>BeforeActionButtonTemplate</code>.

Suggested change
"UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)."
"UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the <code>ActionButtonTemplate</code> parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the <code>BeforeActionButtonTemplate</code> parameter (insert it before the default button)."

Copilot uses AI. Check for mistakes.
},
"BootstrapBlazor.Server.Components.Samples.UploadDrops": {
"UploadsTitle": "DropUpload",
Expand Down
4 changes: 3 additions & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3336,7 +3336,9 @@
"UploadsFileError": "文件大于 5M 请重新选择文件上传",
"UploadsSuccess": "文件保存成功",
"UploadsSaveFileError": "文件保存失败",
"UploadsWasmError": "wasm 模式请调用 api 进行保存"
"UploadsWasmError": "wasm 模式请调用 api 进行保存",
"UploadActionButtonTemplateTitle": "自定义操作按钮",
"UploadActionButtonTemplateIntro": "通过设置 <code>ActionButtonTemplate</code> 参数,来自定义卡片上的操作按钮(在默认按钮后面追加),通过设置 <code>BeforeActionButtonTemplate</code> 参数,来自定义卡片上的操作按钮(在默认按钮前面追加)"
},
"BootstrapBlazor.Server.Components.Samples.UploadDrops": {
"UploadsTitle": "DropUpload 拖拽上传组件",
Expand Down
Loading