Skip to content

Commit 523dada

Browse files
authored
doc(Icons): add click to copy to clipboard function (#5566)
* refactor: 更新基类 * doc: 更新多语言资源文件 * refactor: 更改基类名称
1 parent 6ece18b commit 523dada

File tree

10 files changed

+21
-18
lines changed

10 files changed

+21
-18
lines changed

src/BootstrapBlazor.Server/Components/Samples/Icons/AntDesign/AntDesignIcons.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/ant-design-icon"
22
@inject IStringLocalizer<AntDesignIcons> Localizer
3-
@inherits BootstrapIcon
3+
@inherits BootstrapIconBase
44

55
<h3>@Localizer["AntDesignIconTitle"]</h3>
66

src/BootstrapBlazor.Server/Components/Samples/Icons/BootstrapIcon.razor.cs renamed to src/BootstrapBlazor.Server/Components/Samples/Icons/BootstrapIconBase.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace BootstrapBlazor.Server.Components.Samples.Icons;
88
/// <summary>
99
/// Icon component base class
1010
/// </summary>
11-
[JSModuleAutoLoader("Samples/Icons/BootstrapIcon.razor.js")]
12-
public partial class BootstrapIcon
11+
[JSModuleAutoLoader("Samples/Icons/BootstrapIconBase.razor.js")]
12+
public partial class BootstrapIconBase
1313
{
1414

1515
}

src/BootstrapBlazor.Server/Components/Samples/Icons/BootstrapIcon.razor.js renamed to src/BootstrapBlazor.Server/Components/Samples/Icons/BootstrapIconBase.razor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Data from '../../../_content/BootstrapBlazor/modules/data.js';
22
import EventHandler from '../../../_content/BootstrapBlazor/modules/event-handler.js';
33
import { copy } from '../../../_content/BootstrapBlazor/modules/utility.js';
4+
45
export function init(id) {
56
const el = document.getElementById(id);
67
const tooltips = [];
@@ -23,7 +24,9 @@ export function init(id) {
2324
tooltip.setContent({ '.tooltip-inner': 'Copy' });
2425
const handler = setTimeout(() => {
2526
clearTimeout(handler);
26-
tooltip.setContent({ '.tooltip-inner': div.getAttribute('data-bs-original-title') });
27+
tooltip.setContent({
28+
'.tooltip-inner': div.getAttribute('data-bs-original-title')
29+
});
2730
}, 1000);
2831
});
2932
Data.set(id, {

src/BootstrapBlazor.Server/Components/Samples/Icons/ElementIcon/ElementIcons.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/element-icon"
22
@inject IStringLocalizer<ElementIcons> Localizer
3-
@inherits BootstrapIcon
3+
@inherits BootstrapIconBase
44

55
<h3>@Localizer["ElementIconTitle"]</h3>
66

src/BootstrapBlazor.Server/Components/Samples/Icons/IconPark/IconParks.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/icon-park"
22
@inject IStringLocalizer<IconParks> Localizer
3-
@inherits BootstrapIcon
3+
@inherits BootstrapIconBase
44

55
<h3>@Localizer["IconParkTitle"]</h3>
66

src/BootstrapBlazor.Server/Components/Samples/Icons/OctIcon/OctIcons.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/oct-icon"
22
@inject IStringLocalizer<OctIcons> Localizer
3-
@inherits BootstrapIcon
3+
@inherits BootstrapIconBase
44

55
<h3>@Localizer["OctIconTitle"]</h3>
66

src/BootstrapBlazor.Server/Components/Samples/Icons/UniverIcon/UniverIcons.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/univer-icon"
22
@inject IStringLocalizer<UniverIcons> Localizer
3-
@inherits BootstrapIcon
3+
@inherits BootstrapIconBase
44

55
<h3>@Localizer["UniverIconTitle"]</h3>
66

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6729,7 +6729,7 @@
67296729
"P1": "Extending the Component Package by Reference",
67306730
"P2": "After adding the stylesheet file link open icon"
67316731
},
6732-
"BootstrapBlazor.Server.Components.Samples.Icons.ElementIcons": {
6732+
"BootstrapBlazor.Server.Components.Samples.Icons.ElementIcon.ElementIcons": {
67336733
"ElementIconTitle": "Element-plus Icons",
67346734
"ElementIconDescription": "Free, high quality, open source icon library",
67356735
"CopiedTooltipText": "Copied",
@@ -6755,7 +6755,7 @@
67556755
"P1": "Extending the Component Package by Reference",
67566756
"P2": "After adding the stylesheet file link open icon"
67576757
},
6758-
"BootstrapBlazor.Server.Components.Samples.Icons.IconParks": {
6758+
"BootstrapBlazor.Server.Components.Samples.Icons.IconPark.IconParks": {
67596759
"IconParkTitle": "ByteDance Svg Icon Lib",
67606760
"IconParkDescription": "It has covered all platforms of ByteDance commercial product series and has been introduced and used by 12 platforms as the underlying code, ensuring the uniformity of icon style and cognition.",
67616761
"CopiedTooltipText": "Copied",
@@ -6764,7 +6764,7 @@
67646764
"P3": "Please copy the following code segement",
67656765
"Icons": "For icon list, please visit <a href=\"https://iconpark.oceanengine.com/official\" target=\"_blank\">[portal]</a>"
67666766
},
6767-
"BootstrapBlazor.Server.Components.Samples.Icons.AntDesignIcons": {
6767+
"BootstrapBlazor.Server.Components.Samples.Icons.AntDesign.AntDesignIcons": {
67686768
"AntDesignIconTitle": "AntDesign Svg Icon Lib",
67696769
"AntDesignIconDescription": "Semantic vector graphics.",
67706770
"CopiedTooltipText": "Copied",
@@ -6773,7 +6773,7 @@
67736773
"P3": "Please copy the following code segement",
67746774
"Icons": "For icon list, please visit <a href=\"https://ant.design/components/icon\" target=\"_blank\">[portal]</a>"
67756775
},
6776-
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcons": {
6776+
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcon.OctIcons": {
67776777
"OctIconTitle": "Oct Svg Icon Lib",
67786778
"OctIconDescription": "A scalable set of icons handcrafted with <3 by GitHub",
67796779
"CopiedTooltipText": "Copied",
@@ -6782,7 +6782,7 @@
67826782
"P3": "Please copy the following code segement",
67836783
"Icons": "For icon list, please visit <a href=\"https://primer.style/foundations/icons\" target=\"_blank\">[portal]</a>"
67846784
},
6785-
"BootstrapBlazor.Server.Components.Samples.Icons.UniverIcons": {
6785+
"BootstrapBlazor.Server.Components.Samples.Icons.UniverIcon.UniverIcons": {
67866786
"UniverIconTitle": "Univer Svg Icon Lib",
67876787
"UniverIconDescription": "Icons used by Univer",
67886788
"CopiedTooltipText": "Copied",

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6729,7 +6729,7 @@
67296729
"P1": "通过引用扩展组件包",
67306730
"P2": "后添加样式表文件链接开启图标"
67316731
},
6732-
"BootstrapBlazor.Server.Components.Samples.Icons.ElementIcons": {
6732+
"BootstrapBlazor.Server.Components.Samples.Icons.ElementIcon.ElementIcons": {
67336733
"ElementIconTitle": "饿了么图标库",
67346734
"ElementIconDescription": "饿了么免费开源图标库",
67356735
"CopiedTooltipText": "拷贝成功",
@@ -6755,7 +6755,7 @@
67556755
"P1": "通过引用扩展组件包",
67566756
"P2": "后添加样式表文件链接开启图标"
67576757
},
6758-
"BootstrapBlazor.Server.Components.Samples.Icons.IconParks": {
6758+
"BootstrapBlazor.Server.Components.Samples.Icons.IconPark.IconParks": {
67596759
"IconParkTitle": "字节跳动图标库",
67606760
"IconParkDescription": "已覆盖字节跳动商业化产品系所有平台,并被12个平台作为底层代码引入使用,保证了图标样式与认知的统一性",
67616761
"CopiedTooltipText": "拷贝成功",
@@ -6764,7 +6764,7 @@
67646764
"P3": "请拷贝下方样式即可",
67656765
"Icons": "图标列表请通过 <a href=\"https://iconpark.oceanengine.com/official\" target=\"_blank\">[传送门]</a> 查看"
67666766
},
6767-
"BootstrapBlazor.Server.Components.Samples.Icons.AntDesignIcons": {
6767+
"BootstrapBlazor.Server.Components.Samples.Icons.AntDesign.AntDesignIcons": {
67686768
"AntDesignIconTitle": "蚂蚁图标库",
67696769
"AntDesignIconDescription": "语义化的矢量图形",
67706770
"CopiedTooltipText": "拷贝成功",
@@ -6773,7 +6773,7 @@
67736773
"P3": "请拷贝下方样式即可",
67746774
"Icons": "图标列表请通过 <a href=\"https://ant.design/components/icon\" target=\"_blank\">[传送门]</a> 查看"
67756775
},
6776-
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcons": {
6776+
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcon.OctIcons": {
67776777
"OctIconTitle": "Github 图标库",
67786778
"OctIconDescription": "Primer is a set of guidelines, principles, and patterns for designing and building UI at GitHub.",
67796779
"CopiedTooltipText": "拷贝成功",
@@ -6782,7 +6782,7 @@
67826782
"P3": "请拷贝下方样式即可",
67836783
"Icons": "图标列表请通过 <a href=\"https://primer.style/foundations/icons\" target=\"_blank\">[传送门]</a> 查看"
67846784
},
6785-
"BootstrapBlazor.Server.Components.Samples.Icons.UniverIcons": {
6785+
"BootstrapBlazor.Server.Components.Samples.Icons.UniverIcon.UniverIcons": {
67866786
"UniverIconTitle": "Univer Icon 图标库",
67876787
"UniverIconDescription": "Icons used by Univer",
67886788
"CopiedTooltipText": "拷贝成功",

0 commit comments

Comments
 (0)