Skip to content
Permalink
Browse files

feat(tabs): remove deprecations (#3863)

  • Loading branch information...
jackmu95 authored and tmorehouse committed Aug 13, 2019
1 parent 249efd9 commit 0edac49addf497c9012566c9517c26f2139e0d02
Showing with 6 additions and 42 deletions.
  1. +0 −4 src/components/tabs/README.md
  2. +0 −4 src/components/tabs/package.json
  3. +1 −18 src/components/tabs/tab.js
  4. +5 −16 src/components/tabs/tabs.js
@@ -197,8 +197,6 @@ Visually move the tab controls to the bottom by setting the prop `end`.
tab pane is the same height and fits completely within the visible viewport, otherwise the user
will need to scroll up to read the start of the tabbed content.

**Note:** _the `bottom` prop has been deprecated in favor of the `end` prop._

## Vertical tabs

Have the tab controls placed on the lefthand side by setting the `vertical` prop to `true`. Vertical
@@ -312,8 +310,6 @@ Use the `tabs-start` slot to place extra tab buttons before the content tab butt
**Note:** extra (contentless) tab buttons should be a `<b-nav-item>` or have a root element of
`<li>` and class `nav-item` for proper rendering and semantic markup.

**DEPRECATION:** The `tabs` slot has been deprecated. please use the `tabs-end` slot instead.

## Add custom content to tab title

If you want to add custom content to tab title, like HTML code, icons, or another non-interactive
@@ -43,10 +43,6 @@
"name": "tabs-end",
"description": "Additional tab buttons without tab content placed after content tab buttons"
},
{
"name": "tabs",
"description": "Deprecated. Use 'tabs-end' instead. Additional tab buttons without tab content."
},
{
"name": "empty",
"description": "Renders this slot if no tabs are present"
@@ -2,9 +2,6 @@ import Vue from '../../utils/vue'
import idMixin from '../../mixins/id'
import normalizeSlotMixin from '../../mixins/normalize-slot'
import BVTransition from '../../utils/bv-transition'
import warn from '../../utils/warn'

const DEPRECATED_MSG = 'Setting prop "href" is deprecated. Use the <b-nav> component instead.'

// @vue/component
export const BTab = /*#__PURE__*/ Vue.extend({
@@ -60,16 +57,6 @@ export const BTab = /*#__PURE__*/ Vue.extend({
type: Boolean,
default: false
},
href: {
// This should be deprecated, as tabs are not navigation (URL) based
// <b-nav> + <b-card> + <router-view>/<nuxt-child> should be used instead
// We don't support router-links here
type: String,
default: '#',
// `deprecated` -> Don't use this prop
// `deprecation` -> Refers to a change in prop usage
deprecated: DEPRECATED_MSG
},
lazy: {
type: Boolean,
default: false
@@ -118,6 +105,7 @@ export const BTab = /*#__PURE__*/ Vue.extend({
// If activated post mount
this.activate()
} else {
/* istanbul ignore next */
if (!this.deactivate()) {
// Tab couldn't be deactivated, so we reset the synced active prop
// Deactivation will fail if no other tabs to activate
@@ -140,11 +128,6 @@ export const BTab = /*#__PURE__*/ Vue.extend({
this.registerTab()
// Initially show on mount if active and not disabled
this.show = this.localActive
// Deprecate use of `href` prop
if (this.href && this.href !== '#') {
/* istanbul ignore next */
warn(`b-tab: ${DEPRECATED_MSG}`)
}
},
updated() {
// Force the tab button content to update (since slots are not reactive)
@@ -109,10 +109,7 @@ const BTabButtonHelper = /*#__PURE__*/ Vue.extend({
// Apply <b-tabs> `activeNavItemClass` styles when the tab is active
this.tab.localActive ? this.bvTabs.activeNavItemClass : null
],
props: {
href: this.tab.href, // To be deprecated to always be '#'
disabled: this.tab.disabled
},
props: { disabled: this.tab.disabled },
attrs: {
role: 'tab',
id: this.id,
@@ -165,10 +162,6 @@ export const BTabs = /*#__PURE__*/ Vue.extend({
type: Boolean,
default: false
},
bottom: {
type: Boolean,
default: false
},
end: {
// Synonym for 'bottom'
type: Boolean,
@@ -650,20 +643,16 @@ export const BTabs = /*#__PURE__*/ Vue.extend({
small: this.small
}
},
[
this.normalizeSlot('tabs-start') || h(false),
buttons,
this.normalizeSlot('tabs-end') || this.normalizeSlot('tabs') || h(false)
]
[this.normalizeSlot('tabs-start') || h(), buttons, this.normalizeSlot('tabs-end') || h()]
)
nav = h(
'div',
{
key: 'bv-tabs-nav',
class: [
{
'card-header': this.card && !this.vertical && !(this.end || this.bottom),
'card-footer': this.card && !this.vertical && (this.end || this.bottom),
'card-header': this.card && !this.vertical && !this.end,
'card-footer': this.card && !this.vertical && this.end,
'col-auto': this.vertical
},
this.navWrapperClass
@@ -705,7 +694,7 @@ export const BTabs = /*#__PURE__*/ Vue.extend({
},
attrs: { id: this.safeId() }
},
[this.end || this.bottom ? content : h(), [nav], this.end || this.bottom ? h() : content]
[this.end ? content : h(), [nav], this.end ? h() : content]
)
}
})

0 comments on commit 0edac49

Please sign in to comment.
You can’t perform that action at this time.