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 .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ module.exports = {
Vue: true
},
rules: {
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false
}
],
'spaced-comment': 'off', // needed to ignore `/*#__PURE__*/` comments
'vue/html-self-closing': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion docs/common-props.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"description": "Sets the 'placeholder' attribute value on the form control"
},
"readonly": {
"description": "Sets the 'readonly' attribute on hte form control"
"description": "Sets the 'readonly' attribute on the form control"
},
"plaintext": {
"description": "Set the form control as readonly and renders the control to look like plain text (no borders)"
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/reference/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ In your `nuxt.config.js` file, add the following to your build section:
```js
module.exports = {
build: {
extend(config, ctx) {
extend(config) {
const vueLoader = config.module.rules.find(rule => rule.loader === 'vue-loader')
vueLoader.options.transformAssetUrls = {
video: ['src', 'poster'],
Expand Down
2 changes: 1 addition & 1 deletion docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ renderer.blockquote = function(text) {

// Bootstrap v4 table support for markdown renderer
const originalTable = renderer.table
renderer.table = function(header, body) {
renderer.table = function() {
let table = originalTable.apply(this, arguments)
table = table
.replace('<table>', '<table class="b-table table table-bordered table-striped bv-docs-table">')
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/play.vue
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,15 @@ export default {
// appData watcher
this.contentUnWatch = this.$watch(
'appData',
(newVal, oldVal) => {
() => {
this.run()
},
{ deep: true }
)
// Javascript watcher
this.jsUnWatch = this.$watch(
() => this.js.trim(),
(newVal, oldVal) => {
() => {
this.compileJs()
},
{ immediate: true }
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const destroyVM = (name, vm) => {
;[...document.querySelectorAll(`.vue-example-${name}`)].forEach(removeNode)
}

const processExamples = (el, binding, vnode, oldVnode) => {
const processExamples = (el, binding, vnode) => {
if (vnode.context.$options.beforeDestroy) {
vnode.context.$options.beforeDestroy = []
.concat(vnode.context.$options.beforeDestroy)
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const makeTOC = (readme, meta = null) => {
// Filter out un-matched values
.filter(v => Array.isArray(v))
// Create TOC structure
.forEach(([value, tag, id, content]) => {
.forEach(([, tag, id, content]) => {
const href = `#${stripQuotes(id)}`
const label = stripHTML(content)
if (tag === 'h2') {
Expand Down
2 changes: 1 addition & 1 deletion nuxt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = function nuxtBootstrapVue(moduleOptions = {}) {
if (!usePretranspiled) {
// Use bootstrap-vue source code for smaller prod builds
// by aliasing 'bootstrap-vue' to the source files
this.extendBuild((config, { isServer }) => {
this.extendBuild(config => {
if (!config.resolve.alias) {
config.resolve.alias = {}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = ctx => ({
module.exports = () => ({
map: {
inline: false,
annotation: true,
Expand Down
4 changes: 2 additions & 2 deletions src/components/button-toolbar/button-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const BButtonToolbar = /*#__PURE__*/ Vue.extend({
setItemFocus(item) {
item && item.focus && item.focus()
},
focusFirst(evt) {
focusFirst() {
const items = this.getItems()
this.setItemFocus(items[0])
},
Expand All @@ -81,7 +81,7 @@ export const BButtonToolbar = /*#__PURE__*/ Vue.extend({
this.setItemFocus(items[0])
}
},
focusLast(evt) {
focusLast() {
const items = this.getItems().reverse()
this.setItemFocus(items[0])
},
Expand Down
9 changes: 3 additions & 6 deletions src/components/button-toolbar/button-toolbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ describe('button-toolbar', () => {
const App = Vue.extend({
render(h) {
return h(BButtonToolbar, { props: { keyNav: true } }, [
h(BButtonGroup, {}, [h(BButton, {}, 'a'), h(BButton, {}, 'b')]),
h(BButtonGroup, {}, [
h(BButton, { props: { disabled: true } }, 'c'),
h(BButton, {}, 'd')
]),
h(BButtonGroup, {}, [h(BButton, {}, 'e'), h(BButton, {}, 'f')])
h(BButtonGroup, [h(BButton, 'a'), h(BButton, 'b')]),
h(BButtonGroup, [h(BButton, { props: { disabled: true } }, 'c'), h(BButton, 'd')]),
h(BButtonGroup, [h(BButton, 'e'), h(BButton, 'f')])
])
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/button-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const BButtonClose = /*#__PURE__*/ Vue.extend({
name: NAME,
functional: true,
props,
render(h, { props, data, listeners, slots, scopedSlots }) {
render(h, { props, data, slots, scopedSlots }) {
const $slots = slots()
const $scopedSlots = scopedSlots || {}

Expand Down
2 changes: 1 addition & 1 deletion src/components/button/button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('button', () => {
disabled: true
},
listeners: {
click: e => {
click: () => {
called++
}
}
Expand Down
25 changes: 10 additions & 15 deletions src/components/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ import KeyCodes from '../../utils/key-codes'
import noop from '../../utils/noop'
import observeDom from '../../utils/observe-dom'
import { getComponentConfig } from '../../utils/config'
import {
selectAll,
reflow,
addClass,
removeClass,
setAttr,
eventOn,
eventOff
} from '../../utils/dom'
import { selectAll, reflow, addClass, removeClass, setAttr } from '../../utils/dom'
import { isBrowser, hasTouchSupport, hasPointerEventSupport } from '../../utils/env'
import { EVENT_OPTIONS_NO_CAPTURE, eventOn, eventOff } from '../../utils/events'
import { isUndefined } from '../../utils/inspect'
import { toInteger } from '../../utils/number'
import idMixin from '../../mixins/id'
Expand Down Expand Up @@ -55,8 +48,6 @@ const TransitionEndEvents = {
transition: 'transitionend'
}

const EventOptions = { passive: true, capture: false }

// Return the browser specific transitionEnd event name
const getTransitionEndEvent = el => {
for (const name in TransitionEndEvents) {
Expand Down Expand Up @@ -308,7 +299,7 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
}
},
// Restart auto rotate slides when focus/hover leaves the carousel
restart(evt) /* istanbul ignore next: difficult to test */ {
restart() /* istanbul ignore next: difficult to test */ {
if (!this.$el.contains(document.activeElement)) {
this.start()
}
Expand Down Expand Up @@ -350,15 +341,17 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
// Transition End handler
let called = false
/* istanbul ignore next: difficult to test */
const onceTransEnd = evt => {
const onceTransEnd = () => {
if (called) {
return
}
called = true
/* istanbul ignore if: transition events cant be tested in JSDOM */
if (this.transitionEndEvent) {
const events = this.transitionEndEvent.split(/\s+/)
events.forEach(evt => eventOff(currentSlide, evt, onceTransEnd, EventOptions))
events.forEach(evt =>
eventOff(currentSlide, evt, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE)
)
}
this._animationTimeout = null
removeClass(nextSlide, dirClass)
Expand All @@ -380,7 +373,9 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
/* istanbul ignore if: transition events cant be tested in JSDOM */
if (this.transitionEndEvent) {
const events = this.transitionEndEvent.split(/\s+/)
events.forEach(event => eventOn(currentSlide, event, onceTransEnd, EventOptions))
events.forEach(event =>
eventOn(currentSlide, event, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE)
)
}
// Fallback to setTimeout()
this._animationTimeout = setTimeout(onceTransEnd, TRANS_DURATION)
Expand Down
8 changes: 4 additions & 4 deletions src/components/carousel/carousel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const appDef = {
}
},
[
h(BCarouselSlide, {}, 'slide 1'),
h(BCarouselSlide, {}, 'slide 2'),
h(BCarouselSlide, {}, 'slide 3'),
h(BCarouselSlide, {}, 'slide 4')
h(BCarouselSlide, 'slide 1'),
h(BCarouselSlide, 'slide 2'),
h(BCarouselSlide, 'slide 3'),
h(BCarouselSlide, 'slide 4')
]
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/carousel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
{
"prop": "noHoverPause",
"description": "When set, disables the pausing of hte slide show when the current slide is hovered"
"description": "When set, disables the pausing of the slide show when the current slide is hovered"
},
{
"prop": "interval",
Expand Down
32 changes: 10 additions & 22 deletions src/components/collapse/collapse.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import Vue from '../../utils/vue'
import { isBrowser } from '../../utils/env'
import { addClass, hasClass, removeClass, closest, matches, getCS } from '../../utils/dom'
import { EVENT_OPTIONS_NO_CAPTURE, eventOnOff } from '../../utils/events'
import { BVCollapse } from '../../utils/bv-collapse'
import idMixin from '../../mixins/id'
import listenOnRootMixin from '../../mixins/listen-on-root'
import normalizeSlotMixin from '../../mixins/normalize-slot'
import { isBrowser } from '../../utils/env'
import { BVCollapse } from '../../utils/bv-collapse'
import {
addClass,
hasClass,
removeClass,
closest,
matches,
getCS,
eventOn,
eventOff
} from '../../utils/dom'

// Events we emit on $root
const EVENT_STATE = 'bv::collapse::state'
Expand All @@ -26,9 +18,6 @@ const EVENT_STATE_SYNC = 'bv::collapse::sync::state'
const EVENT_TOGGLE = 'bv::toggle::collapse'
const EVENT_STATE_REQUEST = 'bv::request::collapse::state'

// Event listener options
const EventOptions = { passive: true, capture: false }

// @vue/component
export const BCollapse = /*#__PURE__*/ Vue.extend({
name: 'BCollapse',
Expand Down Expand Up @@ -137,28 +126,27 @@ export const BCollapse = /*#__PURE__*/ Vue.extend({
},
methods: {
setWindowEvents(on) {
const method = on ? eventOn : eventOff
method(window, 'resize', this.handleResize, EventOptions)
method(window, 'orientationchange', this.handleResize, EventOptions)
eventOnOff(on, window, 'resize', this.handleResize, EVENT_OPTIONS_NO_CAPTURE)
eventOnOff(on, window, 'orientationchange', this.handleResize, EVENT_OPTIONS_NO_CAPTURE)
},
toggle() {
this.show = !this.show
},
onEnter(el) {
onEnter() {
this.transitioning = true
// This should be moved out so we can add cancellable events
this.$emit('show')
},
onAfterEnter(el) {
onAfterEnter() {
this.transitioning = false
this.$emit('shown')
},
onLeave(el) {
onLeave() {
this.transitioning = true
// This should be moved out so we can add cancellable events
this.$emit('hide')
},
onAfterLeave(el) {
onAfterLeave() {
this.transitioning = false
this.$emit('hidden')
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/collapse/collapse.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ describe('collapse', () => {
const localVue = CreateLocalVue()
const App = localVue.extend({
render(h) {
return h('div', {}, [
return h('div', [
// JSDOM supports getComputedStyle when using stylesheets (non responsive)
// https://github.com/jsdom/jsdom/blob/master/Changelog.md#030
h('style', { attrs: { type: 'text/css' } }, '.collapse:not(.show) { display: none; }'),
Expand Down Expand Up @@ -471,7 +471,7 @@ describe('collapse', () => {
const localVue = CreateLocalVue()
const App = localVue.extend({
render(h) {
return h('div', {}, [
return h('div', [
// JSDOM supports getComputedStyle when using stylesheets (non responsive)
// Although it appears to be picky about CSS definition ordering
// https://github.com/jsdom/jsdom/blob/master/Changelog.md#030
Expand Down
2 changes: 1 addition & 1 deletion src/components/collapse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"props": [
{
"prop": "isNav",
"description": "When set, signifies that hte collapse is bart of a navbar, enabling certain features for navbar support"
"description": "When set, signifies that the collapse is bart of a navbar, enabling certain features for navbar support"
},
{
"prop": "accordion",
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-item.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('dropdown-item', () => {
const App = localVue.extend({
router,
render(h) {
return h('ul', {}, [
return h('ul', [
// router-link
h(BDropdownItem, { props: { to: '/a' } }, ['to-a']),
// regular link
Expand Down
4 changes: 2 additions & 2 deletions src/components/dropdown/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ describe('dropdown', () => {
const App = localVue.extend({
render(h) {
return h('div', { attrs: { id: 'container' } }, [
h(BDropdown, { props: { id: 'test' } }, [h(BDropdownItem, {}, 'item')]),
h(BDropdown, { props: { id: 'test' } }, [h(BDropdownItem, 'item')]),
h('input', { attrs: { id: 'input' } })
])
}
Expand Down Expand Up @@ -666,7 +666,7 @@ describe('dropdown', () => {
const localVue = new CreateLocalVue()
const App = localVue.extend({
render(h) {
return h('div', {}, [
return h('div', [
h(BDropdown, { props: { id: 'test' } }, [
h(BDropdownItem, { attrs: { id: 'item-1' } }, 'item'),
h(BDropdownItem, { attrs: { id: 'item-2' } }, 'item'),
Expand Down
4 changes: 2 additions & 2 deletions src/components/form-checkbox/form-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export const BFormCheckbox = /*#__PURE__*/ Vue.extend({
}
},
watch: {
computedLocalChecked(newVal, oldVal) {
computedLocalChecked(newVal) {
this.$emit('input', newVal)
if (this.$refs && this.$refs.input) {
this.$emit('update:indeterminate', this.$refs.input.indeterminate)
}
},
indeterminate(newVal, oldVal) {
indeterminate(newVal) {
this.setIndeterminate(newVal)
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/form-group/form-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export const BFormGroup = {
return h(
isFieldset ? 'fieldset' : isHorizontal ? BFormRow : 'div',
data,
isHorizontal && isFieldset ? [h(BFormRow, {}, [label, content])] : [label, content]
isHorizontal && isFieldset ? [h(BFormRow, [label, content])] : [label, content]
)
}
}
Loading