Skip to content

Commit b301822

Browse files
authored
feat(b-form-group): remove deprecated prop horizontal and breakpoint (bootstrap-vue#3879)
1 parent 8784f31 commit b301822

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

src/components/form-group/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,11 @@ of the width of the rendered row (handy if you have custom Bootstrap with an odd
110110
<!-- b-form-group-horizontal.vue -->
111111
```
112112

113-
**Deprecation warning:** The props `horizontal` and `breakpoint` have been deprecated in favour of
114-
using the `label-cols` and `label-cols-{breakpoint}` props.
115-
116113
### Label size
117114

118115
You can control the label text size match the size of your form input(s) via the optional
119116
`label-size` prop. Values can be `'sm'` or `'lg'` for small or large label, respectively. Sizes work
120-
for both `horizontal` and non-horizontal form groups.
117+
for both horizontal and non-horizontal form groups.
121118

122119
```html
123120
<div>

src/components/form-group/form-group.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Utils
22
import memoize from '../../utils/memoize'
33
import upperFirst from '../../utils/upper-first'
4-
import warn from '../../utils/warn'
54
import { arrayIncludes } from '../../utils/array'
65
import { getBreakpointsUpCached } from '../../utils/config'
76
import { select, selectAll, isVisible, setAttr, removeAttr, getAttr } from '../../utils/dom'
@@ -25,9 +24,6 @@ const NAME = 'BFormGroup'
2524
// Selector for finding first input in the form-group
2625
const SELECTOR = 'input:not([disabled]),textarea:not([disabled]),select:not([disabled])'
2726

28-
const DEPRECATED_MSG =
29-
'Props "horizontal" and "breakpoint" are deprecated. Use "label-cols(-{breakpoint})" props instead.'
30-
3127
// Render helper functions (here rather than polluting the instance with more methods)
3228
const renderInvalidFeedback = (h, ctx) => {
3329
const content = ctx.normalizeSlot('invalid-feedback') || ctx.invalidFeedback
@@ -235,18 +231,6 @@ const generateProps = () => {
235231
disabled: {
236232
type: Boolean,
237233
default: false
238-
},
239-
horizontal: {
240-
// Deprecated
241-
type: Boolean,
242-
default: false,
243-
deprecated: DEPRECATED_MSG
244-
},
245-
breakpoint: {
246-
// Deprecated (ignored if horizontal is not true)
247-
type: String,
248-
default: null, // legacy value 'sm',
249-
deprecated: DEPRECATED_MSG
250234
}
251235
}
252236
}
@@ -268,18 +252,6 @@ export const BFormGroup = {
268252
computed: {
269253
labelColProps() {
270254
const props = {}
271-
/* istanbul ignore next: deprecated */
272-
if (this.horizontal) {
273-
// Deprecated setting of horizontal/breakpoint props
274-
/* istanbul ignore next */
275-
warn(`b-form-group: ${DEPRECATED_MSG}`)
276-
// Legacy default is breakpoint sm and cols 3
277-
const bp = this.breakpoint || getBreakpointsUpCached()[1] // 'sm'
278-
const cols = parseInt(this.labelCols, 10) || 3
279-
props[bp] = cols > 0 ? cols : 3
280-
// We then return the single breakpoint prop for legacy compatibility
281-
return props
282-
}
283255
getBreakpointsUpCached().forEach(breakpoint => {
284256
// Grab the value if the label column breakpoint prop
285257
let propVal = this[makePropName(breakpoint, 'labelCols')]

0 commit comments

Comments
 (0)