Skip to content

Commit 10db77b

Browse files
authored
doc(Tab): update context menu documentation (#5741)
* doc: 更新 Tab 文档 * doc: Layout 文档更新
1 parent 378e17b commit 10db77b

File tree

5 files changed

+155
-5
lines changed

5 files changed

+155
-5
lines changed

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,70 @@ private AttributeItem[] GetAttributes() =>
209209
Type = "string?",
210210
ValueList = " — ",
211211
DefaultValue = " — "
212+
},
213+
new()
214+
{
215+
Name = nameof(BootstrapBlazor.Components.Layout.ShowTabContextMenu),
216+
Description = Localizer["Layouts_ShowTabContextMenu"],
217+
Type = "bool",
218+
ValueList = "true|false",
219+
DefaultValue = "false"
220+
},
221+
new()
222+
{
223+
Name = nameof(BootstrapBlazor.Components.Layout.BeforeTabContextMenuTemplate),
224+
Description = Localizer["Layouts_BeforeTabContextMenuTemplate"],
225+
Type = "RenderFragment",
226+
ValueList = " — ",
227+
DefaultValue = " — "
228+
},
229+
new()
230+
{
231+
Name = nameof(BootstrapBlazor.Components.Layout.TabContextMenuTemplate),
232+
Description = Localizer["Layouts_TabContextMenuTemplate"],
233+
Type = "RenderFragment",
234+
ValueList = " — ",
235+
DefaultValue = " — "
236+
},
237+
new()
238+
{
239+
Name = nameof(BootstrapBlazor.Components.Layout.TabContextMenuRefreshIcon),
240+
Description = Localizer["Layouts_TabContextMenuRefreshIcon"],
241+
Type = "string?",
242+
ValueList = " — ",
243+
DefaultValue = " — "
244+
},
245+
new()
246+
{
247+
Name = nameof(BootstrapBlazor.Components.Layout.TabContextMenuCloseIcon),
248+
Description = Localizer["Layouts_TabContextMenuCloseIcon"],
249+
Type = "string?",
250+
ValueList = " — ",
251+
DefaultValue = " — "
252+
},
253+
new()
254+
{
255+
Name = nameof(BootstrapBlazor.Components.Layout.TabContextMenuCloseOtherIcon),
256+
Description = Localizer["Layouts_TabContextMenuCloseOtherIcon"],
257+
Type = "string?",
258+
ValueList = " — ",
259+
DefaultValue = " — "
260+
},
261+
new()
262+
{
263+
Name = nameof(BootstrapBlazor.Components.Layout.TabContextMenuCloseAllIcon),
264+
Description = Localizer["Layouts_TabContextMenuCloseAllIcon"],
265+
Type = "string?",
266+
ValueList = " — ",
267+
DefaultValue = " — "
268+
},
269+
new()
270+
{
271+
Name = nameof(BootstrapBlazor.Components.Layout.OnBeforeShowContextMenu),
272+
Description = Localizer["Layouts_OnBeforeShowContextMenu"],
273+
Type = "Func<TabItem, Task<bool>>",
274+
ValueList = " — ",
275+
DefaultValue = " — "
212276
}
213277
];
214278
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ private void Navigation()
500500
<section ignore>
501501
<p>@((MarkupString)Localizer["TabsContextMenuDesc"].Value)</p>
502502
</section>
503-
<Tab IsCard="true" ShowClose="true" TabStyle="TabStyle.Chrome" ShowToolbar="true" ShowContextMenu="true">
503+
<Tab IsCard="true" ShowClose="true" TabStyle="TabStyle.Chrome" ShowToolbar="true" ShowContextMenu="true" ShowContextMenuFullScreen="true">
504504
<TabItem Text="@Localizer["TabItem1Text"]" Icon="fa-solid fa-user">
505505
<div>@Localizer["TabItem1Content"]</div>
506506
<Counter></Counter>

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,62 @@ private AttributeItem[] GetAttributes() =>
452452
Type = "string?",
453453
ValueList = " — ",
454454
DefaultValue = " — "
455+
},
456+
new()
457+
{
458+
Name = nameof(Tab.ShowContextMenu),
459+
Description = Localizer["AttributeShowContextMenu"].Value,
460+
Type = "bool",
461+
ValueList = "true|false",
462+
DefaultValue = "true"
463+
},
464+
new()
465+
{
466+
Name = nameof(Tab.ContextMenuRefreshIcon),
467+
Description = Localizer["AttributeContextMenuRefreshIcon"].Value,
468+
Type = "string?",
469+
ValueList = " — ",
470+
DefaultValue = " — "
471+
},
472+
new()
473+
{
474+
Name = nameof(Tab.ContextMenuCloseIcon),
475+
Description = Localizer["AttributeContextMenuCloseIcon"].Value,
476+
Type = "string?",
477+
ValueList = " — ",
478+
DefaultValue = " — "
479+
},
480+
new()
481+
{
482+
Name = nameof(Tab.ContextMenuCloseOtherIcon),
483+
Description = Localizer["AttributeContextMenuCloseOtherIcon"].Value,
484+
Type = "string?",
485+
ValueList = " — ",
486+
DefaultValue = " — "
487+
},
488+
new()
489+
{
490+
Name = nameof(Tab.ContextMenuCloseAllIcon),
491+
Description = Localizer["AttributeContextMenuCloseAllIcon"].Value,
492+
Type = "string?",
493+
ValueList = " — ",
494+
DefaultValue = " — "
495+
},
496+
new()
497+
{
498+
Name = nameof(Tab.ContextMenuFullScreenIcon),
499+
Description = Localizer["AttributeContextMenuFullScreenIcon"].Value,
500+
Type = "string?",
501+
ValueList = " — ",
502+
DefaultValue = " — "
503+
},
504+
new()
505+
{
506+
Name = nameof(Tab.OnBeforeShowContextMenu),
507+
Description = Localizer["AttributeOnBeforeShowContextMenu"].Value,
508+
Type = "Func<TabItem, Task<bool>>",
509+
ValueList = " — ",
510+
DefaultValue = " — "
455511
}
456512
];
457513

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,15 @@
14431443
"LayoutsAppTips6": "In this example, a scroll bar appears after clicking the menu on the left to expand",
14441444
"LayoutsAppTips7": "The available area in the right panel is all by default, which is suitable for layouts with <code>Tab</code> components. In this example, for the sake of beauty, the <code>Main</code> template has a built-in <code>div</code > And set the style to <code>style='padding: 1rem;'</code>",
14451445
"LayoutsAppTips8": "In this example, if the scroll bar does not appear after clicking the left menu to expand, the height of the parent container will be expanded",
1446-
"LayoutsAppTips9": "Please refer to <a href='/tab'>Tab component</a> for practical examples of using <code>Layout</code> component and <code>Tab</code> component together"
1446+
"LayoutsAppTips9": "Please refer to <a href='/tab'>Tab component</a> for practical examples of using <code>Layout</code> component and <code>Tab</code> component together",
1447+
"ShowTabContextMenu": "whether enable tab context menu",
1448+
"BeforeTabContextMenuTemplate": "the template of before tab context menu",
1449+
"TabContextMenuTemplate": "the template of tab context menu",
1450+
"TabContextMenuRefreshIcon": "the icon of tab item context menu refresh button",
1451+
"TabContextMenuCloseIcon": "the icon of tab item context menu close button",
1452+
"TabContextMenuCloseOtherIcon": "the icon of tab item context menu close other button",
1453+
"TabContextMenuCloseAllIcon": "the icon of tab item context menu close all button",
1454+
"OnBeforeShowContextMenu": "before popup context menu callback"
14471455
},
14481456
"BootstrapBlazor.Server.Components.Samples.Footers": {
14491457
"FootersTitle": "Footer",
@@ -2139,7 +2147,14 @@
21392147
"ContextCloseAll": "Close All Tabs",
21402148
"TabsContextMenuTitle": "TabItem Context Menu",
21412149
"TabsContextMenuIntro": "Use the built-in <code>ContextMenuZone</code> component to pop up a custom context menu when you right-click a tab item",
2142-
"TabsContextMenuDesc": "The disabled tab can be set by setting the <code>OnBeforeShowContextMenu</code> callback method to control whether the right-click menu is displayed according to the return value. If it is not set, the right-click menu is also displayed for the disabled tab"
2150+
"TabsContextMenuDesc": "The disabled tab can be set by setting the <code>OnBeforeShowContextMenu</code> callback method to control whether the right-click menu is displayed according to the return value. If it is not set, the right-click menu is also displayed for the disabled tab",
2151+
"AttributeShowContextMenu": "whether enable tab context menu",
2152+
"AttributeContextMenuRefreshIcon": "the icon of tab item context menu refresh button",
2153+
"AttributeContextMenuCloseIcon": "the icon of tab item context menu close button",
2154+
"AttributeContextMenuCloseOtherIcon": "the icon of tab item context menu close other button",
2155+
"AttributeContextMenuCloseAllIcon": "the icon of tab item context menu close all button",
2156+
"AttributeContextMenuFullScreenIcon": "the icon of tab item context menu full screen button",
2157+
"AttributeOnBeforeShowContextMenu": "before popup context menu callback"
21432158
},
21442159
"BootstrapBlazor.Server.Components.Components.DemoTabItem": {
21452160
"Info": "Reset the title of this <code>TabItem</code> by click the button",

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,15 @@
14431443
"LayoutsAppTips6": "本例点击左侧菜单展开后出现滚动条",
14441444
"LayoutsAppTips7": "右侧面板中可用区域默认为全部,适用于带 <code>Tab</code> 组件的布局,本例中为了美观 <code>Main</code> 模板中内置了一个 <code>div</code> 并且设置样式为 <code>style='padding: 1rem;'</code>",
14451445
"LayoutsAppTips8": "本例点击左侧菜单展开后不出现滚动条会撑开父容器高度",
1446-
"LayoutsAppTips9": " <code>Layout</code> 组件与 <code>Tab</code> 组件配合使用实战示例请参阅 <a href='/tab'>Tab 组件</a>"
1446+
"LayoutsAppTips9": " <code>Layout</code> 组件与 <code>Tab</code> 组件配合使用实战示例请参阅 <a href='/tab'>Tab 组件</a>",
1447+
"ShowTabContextMenu": "是否显示右键菜单",
1448+
"BeforeTabContextMenuTemplate": "前面右键菜单模板",
1449+
"TabContextMenuTemplate": "右键菜单后续模板",
1450+
"TabContextMenuRefreshIcon": "右键菜单刷新按钮图标",
1451+
"TabContextMenuCloseIcon": "右键菜单关闭按钮图标",
1452+
"TabContextMenuCloseOtherIcon": "右键菜单关闭其他按钮图标",
1453+
"TabContextMenuCloseAllIcon": "右键菜单关闭全部按钮图标",
1454+
"OnBeforeShowContextMenu": "右键菜单弹出前回调方法"
14471455
},
14481456
"BootstrapBlazor.Server.Components.Samples.Footers": {
14491457
"FootersTitle": "Footer 页脚组件",
@@ -2139,7 +2147,14 @@
21392147
"ContextCloseAll": "关闭全部",
21402148
"TabsContextMenuTitle": "右键菜单",
21412149
"TabsContextMenuIntro": "通过内置 <code>ContextMenuZone</code> 组件,点击标签页右键时弹窗自定义右键菜单",
2142-
"TabsContextMenuDesc": "被禁用的标签页可以通过设置 <code>OnBeforeShowContextMenu</code> 回调方法根据返回值控制右键菜单是否显示,未设置时禁用标签页也显示右键菜单"
2150+
"TabsContextMenuDesc": "被禁用的标签页可以通过设置 <code>OnBeforeShowContextMenu</code> 回调方法根据返回值控制右键菜单是否显示,未设置时禁用标签页也显示右键菜单",
2151+
"AttributeShowContextMenu": "是否显示右键菜单",
2152+
"AttributeContextMenuRefreshIcon": "右键菜单刷新按钮图标",
2153+
"AttributeContextMenuCloseIcon": "右键菜单关闭按钮图标",
2154+
"AttributeContextMenuCloseOtherIcon": "右键菜单关闭其他按钮图标",
2155+
"AttributeContextMenuCloseAllIcon": "右键菜单关闭全部按钮图标",
2156+
"AttributeContextMenuFullScreenIcon": "右键菜单全屏按钮图标",
2157+
"AttributeOnBeforeShowContextMenu": "右键菜单弹出前回调方法"
21432158
},
21442159
"BootstrapBlazor.Server.Components.Components.DemoTabItem": {
21452160
"Info": "点击下方按钮,本 <code>TabItem</code> 标题更改为当前分钟与秒",

0 commit comments

Comments
 (0)