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
8 changes: 8 additions & 0 deletions docs/userGuide/syntax/tabs.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
</tab>
<tab header="Disabled second tab :x:" disabled>
</tab>
<tab header="Tab not printed" class="d-print-none">
This tab will not be printed.
</tab>
<tab-group header="Third tab group :milky_way:">
<tab header="Stars :star:">
Some stuff about stars ...
Expand Down Expand Up @@ -44,6 +47,11 @@ Name | Type | Default | Description
header | `String` | `null` | Tab Group title.
disabled | `Boolean` | `false` | Whether Tab Group is clickable and can be activated.

<box type="info">

Tabs, tab group and individual tab can be omitted during printing by adding bootstrap's display property `class="d-print-none"` to the respective components.
</box>

<span id="short" class="d-none">

```html
Expand Down
19 changes: 14 additions & 5 deletions packages/vue-components/src/Tab.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<template>
<div
v-show="show"
role="tabpanel"
class="tab-pane active printable-tab-pane d-print-block"
:class="{hide:!show}"
class="tab-pane active printable-tab-pane"
:class="{'tab-pane-hide': !show}"
>
<div class="nav-tabs printable-tab-header d-none d-print-flex">
<div class="nav-tabs printable-tab-header">
<div ref="header" class="nav-link active">
<slot name="header"></slot>
</div>
Expand Down Expand Up @@ -79,13 +78,22 @@ export default {
},
};
</script>
<style>
<style scoped>
.tab-pane > hr {
margin: 0;
}

.tab-pane-hide {
display: none;
}

.printable-tab-header {
display: none;
}

@media print {
.printable-tab-header {
display: flex;
margin-bottom: 15px;
border-bottom: 1px solid #dee2e6;
}
Expand All @@ -95,6 +103,7 @@ export default {
}

.printable-tab-pane {
display: block;
padding: 10px;
}
}
Expand Down
7 changes: 6 additions & 1 deletion packages/vue-components/src/TabGroup.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="printable-tab-group">
<div ref="header" class="printable-tab-group-header d-none d-print-block">
<div ref="header" class="printable-tab-group-header">
<slot name="header"></slot>
</div>
<slot></slot>
Expand Down Expand Up @@ -72,6 +72,10 @@ export default {
margin-bottom: 15px;
}

.printable-tab-group-header {
display: none;
}

@media print {
.printable-tab-group {
border: 1px solid #dee2e6;
Expand All @@ -81,6 +85,7 @@ export default {
}

.printable-tab-group-header {
display: block;
margin-bottom: 10px;
text-decoration: underline;
}
Expand Down