8000 feat(b-nav, b-nav-item-dropdown): remove deprecated slot and props (#… · shashankgaurav17/bootstrap-vue@21fab35 · GitHub
[go: up one dir, main page]

Skip to content

Commit 21fab35

Browse files
jacobmllr95tmorehouse
authored andcommitted
feat(b-nav, b-nav-item-dropdown): remove deprecated slot and props (bootstrap-vue#3867)
1 parent 90c299c commit 21fab35

File tree

5 files changed

+6
-103
lines changed

5 files changed

+6
-103
lines changed

src/components/nav/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,6 @@ shown. When there are a large number of dropdowns rendered on the same page, per
223223
impacted due to larger overall memory utilization. You can instruct `<b-nav-item-dropdown>` to
224224
render the menu contents only when it is shown by setting the `lazy` prop to true.
225225

226-
## Using in navbar
227-
228-
Prop `is-nav-bar` has been deprecated and will be removed in a future release.
229-
230226
## Tabbed local content s 10000 upport
231227

232228
See the [`<b-tabs>`](/docs/components/tabs) component for creating tabbable panes of local content

src/components/nav/nav-item-dropdown.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,7 @@ import { BLink } from '../link/link'
99

1010
// -- Constants --
1111

12-
export const props = {
13-
...pluckProps(['menuClass', 'toggleClass', 'noCaret', 'role'], BDropdownProps),
14-
extraMenuClasses: {
15-
type: String,
16-
default: '',
17-
// `deprecated` -> Don't use this prop
18-
// `deprecation` -> Refers to a change in prop usage
19-
deprecated: 'Setting prop "extra-menu-classes" is deprecated. Use "menu-class" prop instead.'
20-
},
21-
extraToggleClasses: {
22-
type: String,
23-
default: '',
24-
// `deprecated` -> Don't use this prop
25-
// `deprecation` -> Refers to a change in prop usage
26-
deprecated:
27-
'Setting prop "extra-toggle-classes" is deprecated. Use "toggle-class" prop instead.'
28-
}
29-
}
12+
export const props = pluckProps(['menuClass', 'toggleClass', 'noCaret', 'role'], BDropdownProps)
3013

3114
// @vue/component
3215
export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
@@ -43,7 +26,6 @@ export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
4326
},
4427
menuClasses() {
4528
return [
46-
this.extraMenuClasses, // Deprecated
4729
this.menuClass,
4830
{
4931
'dropdown-menu-right': this.right,
@@ -52,13 +34,7 @@ export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
5234
]
5335
},
5436
toggleClasses() {
55-
return [
56-
this.extraToggleClasses, // Deprecated
57-
this.toggleClass,
58-
{
59-
'dropdown-toggle-no-caret': this.noCaret
60-
}
61-
]
37+
return [this.toggleClass, { 'dropdown-toggle-no-caret': this.noCaret }]
6238
}
6339
},
6440
render(h) {

src/components/nav/nav.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { mergeData } from 'vue-functional-data-merge'
33

44
// -- Constants --
55

6-
const DEPRECATED_MSG =
7-
'Setting prop "is-nav-bar" is deprecated. Use the <b-navbar-nav> component instead.'
8-
96
export const props = {
107
tag: {
118
type: String,
@@ -38,13 +35,6 @@ export const props = {
3835
small: {
3936
type: Boolean,
4037
default: false
41-
},
42-
isNavBar: {
43-
type: Boolean,
44-
default: false,
45-
// `deprecated` -> Don't use this prop
46-
// `deprecation` -> Refers to a change in prop usage
47-
deprecated: DEPRECATED_MSG
4838
}
4939
}
5040

@@ -65,12 +55,11 @@ export const BNav = /*#__PURE__*/ Vue.extend({
6555
return h(
6656
props.tag,
6757
mergeData(data, {
58+
staticClass: 'nav',
6859
class: {
69-
nav: !props.isNavBar,
70-
'navbar-nav': props.isNavBar,
71-
'nav-tabs': props.tabs && !props.isNavBar,
72-
'nav-pills': props.pills && !props.isNavBar,
73-
'flex-column': props.vertical && !props.isNavBar,
60+
'nav-tabs': props.tabs,
61+
'nav-pills': props.pills,
62+
'flex-column': props.vertical,
7463
'nav-fill': !props.vertical && props.fill,
7564
'nav-justified': !props.vertical && props.justified,
7665
[computeJustifyContent(props.align)]: !props.vertical && props.align,

src/components/nav/nav.spec.js

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ describe('nav', () => {
3737
expect(wrapper.text()).toBe('foobar')
3838
})
3939

40-
it('supports "is-navbar-nav" mode', async () => {
41-
const wrapper = mount(BNav, {
42-
propsData: {
43-
isNavBar: true
44-
}
45-
})
46-
47-
expect(wrapper.is('ul')).toBe(true)
48-
expect(wrapper.classes()).toContain('navbar-nav')
49-
expect(wrapper.classes().length).toBe(1)
50-
expect(wrapper.text()).toBe('')
51-
})
52-
5340
it('applies pill style', async () => {
5441
const wrapper = mount(BNav, {
5542
propsData: {
@@ -64,20 +51,6 @@ describe('nav', () => {
6451
expect(wrapper.text()).toBe('')
6552
})
6653

67-
it("doesn't apply pill style when in 'is-navbar-nav' mode", async () => {
68-
const wrapper = mount(BNav, {
69-
propsData: {
70-
pills: true,
71-
isNavBar: true
72-
}
73-
})
74-
75-
expect(wrapper.is('ul')).toBe(true)
76-
expect(wrapper.classes()).toContain('navbar-nav')
77-
expect(wrapper.classes().length).toBe(1)
78-
expect(wrapper.text()).toBe('')
79-
})
80-
8154
it('applies tab style', async () => {
8255
const wrapper = mount(BNav, {
8356
propsData: {
@@ -92,20 +65,6 @@ describe('nav', () => {
9265
expect(wrapper.text()).toBe('')
9366
})
9467

95-
it("doesn't apply tab style when in 'is-navbar-nav' mode", async () => {
96-
const wrapper = mount(BNav, {
97-
propsData: {
98-
tabs: true,
99-
isNavBar: true
100-
}
101-
})
102-
103-
expect(wrapper.is('ul')).toBe(true)
104-
expect(wrapper.classes()).toContain('navbar-nav')
105-
expect(wrapper.classes().length).toBe(1)
106-
expect(wrapper.text()).toBe('')
107-
})
108-
10968
it('applies vertical style', async () => {
11069
const wrapper = mount(BNav, {
11170
propsData: {
@@ -120,20 +79,6 @@ describe('nav', () => {
12079
expect(wrapper.text()).toBe('')
12180
})
12281

123-
it("doesn't apply vertical style when in 'is-navbar-nav' mode", async () => {
124-
const wrapper = mount(BNav, {
125-
propsData: {
126-
vertical: true,
127-
isNavBar: true
128-
}
129-
})
130-
131-
expect(wrapper.is('ul')).toBe(true)
132-
expect(wrapper.classes()).toContain('navbar-nav')
133-
expect(wrapper.classes().length).toBe(1)
134-
expect(wrapper.text()).toBe('')
135-
})
136-
13782
it('applies justify style when justified', async () => {
13883
const wrapper = mount(BNav, {
13984
propsData: {

src/components/navbar/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ securely aligned.
158158
- `<b-nav-item-dropdown>` for navbar dropdown menus
159159
- `<b-nav-form>` for adding simple forms to the navbar.
160160

161-
**Note:** _The use of `<b-nav is-nav-bar>` inside a `<b-navbar>` has been deprecated. Use component
162-
`<b-navbar-nav>` instead._
163-
164161
### `<b-nav-item>`
165162

166163
`<b-nav-item>` is the primary link (and `<router-link>`) component. Providing a `to` prop value will

0 commit comments

Comments
 (0)
0