Skip to content

Commit d4e13e8

Browse files
authored
doc(CardUpload): add ActionButtonTemplate parameter documentation (#7042)
* refactor: 更新依赖包 * chore: bump DriverJs 9.0.5 * doc: 增加文档注释
1 parent 70156e6 commit d4e13e8

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<PackageReference Include="BootstrapBlazor.Gantt" Version="9.0.2" />
4545
<PackageReference Include="BootstrapBlazor.Holiday" Version="9.0.1" />
4646
<PackageReference Include="BootstrapBlazor.Html2Image" Version="9.0.2" />
47-
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="10.0.0-rc.2.1.2" />
47+
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="9.0.6" />
4848
<PackageReference Include="BootstrapBlazor.IconPark" Version="9.0.3" />
4949
<PackageReference Include="BootstrapBlazor.ImageCropper" Version="9.0.3" />
5050
<PackageReference Include="BootstrapBlazor.IP2Region" Version="9.0.4" />
@@ -66,7 +66,7 @@
6666
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="9.0.6" />
6767
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.2" />
6868
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.2" />
69-
<PackageReference Include="BootstrapBlazor.Region" Version="9.0.8-beta01" />
69+
<PackageReference Include="BootstrapBlazor.Region" Version="9.0.8" />
7070
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.1" />
7171
<PackageReference Include="BootstrapBlazor.SmilesDrawer" Version="9.0.2" />
7272
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.4" />
@@ -75,7 +75,7 @@
7575
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.7" />
7676
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.7" />
7777
<PackageReference Include="BootstrapBlazor.Tasks.Dashboard" Version="9.0.0" />
78-
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.1" />
78+
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.2" />
7979
<PackageReference Include="BootstrapBlazor.UniverIcon" Version="9.0.1" />
8080
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.5" />
8181
<PackageReference Include="BootstrapBlazor.Vditor" Version="9.0.0" />

src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@
7272
ShowDownloadButton="@_showDownloadButton" ShowZoomButton="@_showZoomButton" OnChange="@OnCardUpload"></CardUpload>
7373
</DemoBlock>
7474

75+
<DemoBlock Title="@Localizer["UploadActionButtonTemplateTitle"]"
76+
Introduction="@Localizer["UploadActionButtonTemplateIntro"]"
77+
Name="ActionButtonTemplate">
78+
<CardUpload TValue="string" IsMultiple="false" ShowDownloadButton="true" DefaultFileList="@DefaultFormatFileList.Take(1).ToList()"
79+
OnChange="@OnCardUpload">
80+
<BeforeActionButtonTemplate>
81+
<Button Color="Color.Secondary" Icon="fa-solid fa-flag" OnClickWithoutRender="() => OnTest1Click(context)"></Button>
82+
</BeforeActionButtonTemplate>
83+
<ActionButtonTemplate>
84+
<Button Color="Color.Secondary" Icon="fa-solid fa-home" OnClickWithoutRender="() => OnTest2Click(context)"></Button>
85+
</ActionButtonTemplate>
86+
</CardUpload>
87+
</DemoBlock>
88+
7589
<DemoBlock Title="@Localizer["UploadFileIconTitle"]"
7690
Introduction="@Localizer["UploadFileIconIntro"]"
7791
Name="FileIcon">

src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ private async Task OnCardUpload(UploadFile file)
6262
}
6363
}
6464

65+
private Task OnTest1Click(UploadFile file) => ToastService.Information("Action Button", $"{file.GetFileName()}");
66+
67+
private Task OnTest2Click(UploadFile file) => ToastService.Information("Action Button", $"{file.GetFileName()}");
68+
6569
private async Task SaveToFile(UploadFile file)
6670
{
6771
// Server Side 使用

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3336,7 +3336,9 @@
33363336
"UploadsFileError": "The file is larger than 5M. Please reselect the file to upload.",
33373337
"UploadsSuccess": "File saved successfully",
33383338
"UploadsSaveFileError": "File save failed",
3339-
"UploadsWasmError": "In wasm mode, please call the api to save"
3339+
"UploadsWasmError": "In wasm mode, please call the api to save",
3340+
"UploadActionButtonTemplateTitle": "Custom action button",
3341+
"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)."
33403342
},
33413343
"BootstrapBlazor.Server.Components.Samples.UploadDrops": {
33423344
"UploadsTitle": "DropUpload",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3336,7 +3336,9 @@
33363336
"UploadsFileError": "文件大于 5M 请重新选择文件上传",
33373337
"UploadsSuccess": "文件保存成功",
33383338
"UploadsSaveFileError": "文件保存失败",
3339-
"UploadsWasmError": "wasm 模式请调用 api 进行保存"
3339+
"UploadsWasmError": "wasm 模式请调用 api 进行保存",
3340+
"UploadActionButtonTemplateTitle": "自定义操作按钮",
3341+
"UploadActionButtonTemplateIntro": "通过设置 <code>ActionButtonTemplate</code> 参数,来自定义卡片上的操作按钮(在默认按钮后面追加),通过设置 <code>BeforeActionButtonTemplate</code> 参数,来自定义卡片上的操作按钮(在默认按钮前面追加)"
33403342
},
33413343
"BootstrapBlazor.Server.Components.Samples.UploadDrops": {
33423344
"UploadsTitle": "DropUpload 拖拽上传组件",

0 commit comments

Comments
 (0)