Skip to content

Commit e85020b

Browse files
authored
Merge branch 'dev' into patch-1
2 parents 3c2f375 + d52ce0b commit e85020b

File tree

17 files changed

+23548
-2516
lines changed

17 files changed

+23548
-2516
lines changed

.bundlewatch.config.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
"files": [
33
{
44
"path": "./dist/bootstrap-vue-icons.js",
5-
"maxSize": "75 kB"
5+
"maxSize": "105 kB"
66
},
77
{
88
"path": "./dist/bootstrap-vue-icons.min.js",
9-
"maxSize": "70 kB"
9+
"maxSize": "100 kB"
1010
},
1111
{
1212
"path": "./dist/bootstrap-vue-icons.common.js",
13-
"maxSize": "80 kB"
13+
"maxSize": "110 kB"
1414
},
1515
{
1616
"path": "./dist/bootstrap-vue-icons.common.min.js",
17-
"maxSize": "75 kB"
17+
"maxSize": "105 kB"
1818
},
1919
{
2020
"path": "./dist/bootstrap-vue-icons.esm.js",
21-
"maxSize": "80 kB"
21+
"maxSize": "110 kB"
2222
},
2323
{
2424
"path": "./dist/bootstrap-vue-icons.esm.min.js",
25-
"maxSize": "75 kB"
25+
"maxSize": "105 kB"
2626
},
2727
{
2828
"path": "./dist/bootstrap-vue-icons.css",
@@ -42,19 +42,19 @@
4242
},
4343
{
4444
"path": "./dist/bootstrap-vue.common.js",
45-
"maxSize": "275 kB"
45+
"maxSize": "305 kB"
4646
},
4747
{
4848
"path": "./dist/bootstrap-vue.common.min.js",
49-
"maxSize": "165 kB"
49+
"maxSize": "190 kB"
5050
},
5151
{
5252
"path": "./dist/bootstrap-vue.esm.js",
53-
"maxSize": "270 kB"
53+
"maxSize": "300 kB"
5454
},
5555
{
5656
"path": "./dist/bootstrap-vue.esm.min.js",
57-
"maxSize": "160 kB"
57+
"maxSize": "190 kB"
5858
},
5959
{
6060
"path": "./dist/bootstrap-vue.css",

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,36 @@
9494
"vue-functional-data-merge": "^3.1.0"
9595
},
9696
"devDependencies": {
97-
"@babel/cli": "^7.10.3",
98-
"@babel/core": "^7.10.3",
99-
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
100-
"@babel/plugin-transform-runtime": "^7.10.3",
101-
"@babel/preset-env": "^7.10.3",
102-
"@babel/standalone": "^7.10.3",
97+
"@babel/cli": "^7.10.5",
98+
"@babel/core": "^7.10.5",
99+
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
100+
"@babel/plugin-transform-runtime": "^7.10.5",
101+
"@babel/preset-env": "^7.10.4",
102+
"@babel/standalone": "^7.10.5",
103103
"@nuxtjs/google-analytics": "^2.3.0",
104104
"@nuxtjs/pwa": "^3.0.0-beta.20",
105105
"@nuxtjs/robots": "^2.4.2",
106106
"@nuxtjs/sitemap": "^2.4.0",
107-
"@testing-library/jest-dom": "^5.11.0",
107+
"@testing-library/jest-dom": "^5.11.1",
108108
"@vue/test-utils": "^1.0.3",
109-
"autoprefixer": "^9.8.4",
109+
"autoprefixer": "^9.8.5",
110110
"babel-core": "^7.0.0-bridge.0",
111111
"babel-eslint": "^10.1.0",
112112
"babel-jest": "^26.1.0",
113113
"babel-plugin-istanbul": "^6.0.0",
114-
"bootstrap-icons": "^1.0.0-alpha4",
114+
"bootstrap-icons": "^1.0.0-alpha5",
115115
"bundlewatch": "^0.2.7",
116116
"clean-css-cli": "^4.3.0",
117117
"codemirror": "^5.55.0",
118118
"codesandbox": "^2.1.16",
119119
"core-js": ">=2.6.5 <3.0.0",
120120
"cross-env": "^7.0.2",
121-
"eslint": "^7.3.1",
121+
"eslint": "^7.4.0",
122122
"eslint-config-prettier": "^6.11.0",
123123
"eslint-config-standard": "^14.1.1",
124124
"eslint-config-vue": "^2.0.2",
125-
"eslint-plugin-import": "^2.21.2",
126-
"eslint-plugin-jest": "^23.17.1",
125+
"eslint-plugin-import": "^2.22.0",
126+
"eslint-plugin-jest": "^23.18.0",
127127
"eslint-plugin-markdown": "^1.0.2",
128128
"eslint-plugin-node": "^11.1.0",
129129
"eslint-plugin-prettier": "^3.1.4",
@@ -138,22 +138,22 @@
138138
"jest": "^26.1.0",
139139
"lint-staged": "^10.2.11",
140140
"loader-utils": "^2.0.0",
141-
"lodash": "^4.17.15",
142-
"marked": "^1.1.0",
141+
"lodash": "^4.17.19",
142+
"marked": "^1.1.1",
143143
"node-sass": "^4.14.1",
144-
"nuxt": "^2.13.1",
144+
"nuxt": "^2.13.3",
145145
"postcss-cli": "^7.1.1",
146146
"prettier": "1.14.3",
147147
"require-context": "^1.1.0",
148-
"rollup": "^2.18.0",
148+
"rollup": "^2.21.0",
149149
"rollup-plugin-babel": "^4.4.0",
150150
"rollup-plugin-commonjs": "^10.1.0",
151151
"rollup-plugin-node-resolve": "^5.2.0",
152-
"sass-loader": "^8.0.2",
153-
"standard-version": "^8.0.0",
152+
"sass-loader": "^9.0.2",
153+
"standard-version": "^8.0.2",
154154
"terser": "^4.8.0",
155155
"vue": "^2.6.11",
156-
"vue-jest": "^3.0.5",
156+
"vue-jest": "^3.0.6",
157157
"vue-router": "^3.3.4",
158158
"vue-server-renderer": "^2.6.11",
159159
"vue-template-compiler": "^2.6.11"

src/components/avatar/avatar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const BAvatar = /*#__PURE__*/ Vue.extend({
202202
} = this
203203
const link = !button && isLink(this)
204204
const tag = button ? BButton : link ? BLink : 'span'
205-
const alt = this.alt || null
205+
const alt = this.alt
206206
const ariaLabel = this.ariaLabel || null
207207

208208
let $content = null

src/components/avatar/avatar.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,34 @@ describe('avatar', () => {
317317

318318
wrapper2.destroy()
319319
})
320+
321+
it('should render `alt` attribute if `alt` prop is empty string', async () => {
322+
const wrapper = mount(BAvatar, {
323+
propsData: {
324+
src: '/foo/bar',
325+
alt: ''
326+
}
327+
})
328+
expect(wrapper.vm).toBeDefined()
329+
expect(wrapper.find('img').exists()).toBe(true)
330+
expect(wrapper.find('img').attributes('src')).toEqual('/foo/bar')
331+
expect(wrapper.find('img').attributes('alt')).toEqual('')
332+
333+
wrapper.destroy()
334+
})
335+
336+
it('should not render `alt` attribute if `alt` prop is null', async () => {
337+
const wrapper = mount(BAvatar, {
338+
propsData: {
339+
src: '/foo/bar',
340+
alt: null
341+
}
342+
})
343+
expect(wrapper.vm).toBeDefined()
344+
expect(wrapper.find('img').exists()).toBe(true)
345+
expect(wrapper.find('img').attributes('src')).toEqual('/foo/bar')
346+
expect(wrapper.find('img').attributes('alt')).not.toBeDefined()
347+
348+
wrapper.destroy()
349+
})
320350
})

src/components/card/card-img-lazy.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,22 @@ describe('card-image', () => {
154154
wrapper.destroy()
155155
})
156156

157+
it('has attribute alt when prop `alt` is empty', async () => {
158+
const wrapper = mount(BCardImgLazy, {
159+
context: {
160+
props: {
161+
src: 'https://picsum.photos/600/300/?image=25',
162+
alt: ''
163+
}
164+
}
165+
})
166+
167+
expect(wrapper.attributes('alt')).toBeDefined()
168+
expect(wrapper.attributes('alt')).toBe('')
169+
170+
wrapper.destroy()
171+
})
172+
157173
it('has attribute width when prop width set', async () => {
158174
const wrapper = mount(BCardImgLazy, {
159175
context: {

src/components/card/card-img.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const props = {
77
required: true
88
},
99
alt: {
10-
type: String
11-
// default: null
10+
type: String,
11+
default: null
1212
},
1313
top: {
1414
type: Boolean,
@@ -69,7 +69,7 @@ export const BCardImg = /*#__PURE__*/ Vue.extend({
6969
class: [baseClass],
7070
attrs: {
7171
src: props.src || null,
72-
alt: props.alt || null,
72+
alt: props.alt,
7373
height: props.height || null,
7474
width: props.width || null
7575
}

src/components/card/card-img.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ describe('card-image', () => {
158158
wrapper.destroy()
159159
})
160160

161+
it('has attribute alt when prop `alt` is empty', async () => {
162+
const wrapper = mount(BCardImg, {
163+
context: {
164+
props: {
165+
src: 'https://picsum.photos/600/300/?image=25',
166+
alt: ''
167+
}
168+
}
169+
})
170+
171+
expect(wrapper.attributes('alt')).toBeDefined()
172+
expect(wrapper.attributes('alt')).toBe('')
173+
174+
wrapper.destroy()
175+
})
176+
161177
it('has attribute width when prop width set', async () => {
162178
const wrapper = mount(BCardImg, {
163179
context: {

src/components/form-tags/form-tags.js

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ import identity from '../../utils/identity'
66
import looseEqual from '../../utils/loose-equal'
77
import { arrayIncludes, concat } from '../../utils/array'
88
import { getComponentConfig } from '../../utils/config'
9-
import { attemptBlur, attemptFocus, matches, requestAF, select } from '../../utils/dom'
9+
import {
10+
attemptBlur,
11+
attemptFocus,
12+
closest,
13+
isActiveElement,
14+
matches,
15+
requestAF,
16+
select
17+
} from '../../utils/dom'
1018
import { isEvent, isFunction, isString } from '../../utils/inspect'
1119
import { escapeRegExp, toString, trim, trimLeft } from '../../utils/string'
1220
import idMixin from '../../mixins/id'
@@ -178,6 +186,12 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
178186
type: Boolean,
179187
default: false
180188
},
189+
ignoreInputFocusSelector: {
190+
// Disable the input focus behavior when clicking
191+
// on element matching the selector (or selectors)
192+
type: [Array, String],
193+
default: () => ['.b-form-tag', 'button', 'input', 'select']
194+
},
181195
value: {
182196
// The v-model prop
183197
type: Array,
@@ -245,6 +259,13 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
245259
const joiner = this.computedSeparator.charAt(0)
246260
return joiner !== ' ' ? `${joiner} ` : joiner
247261
},
262+
computeIgnoreInputFocusSelector() {
263+
// Normalize to an single selector with selectors separated by `,`
264+
return concat(this.ignoreInputFocusSelector)
265+
.filter(identity)
266+
.join(',')
267+
.trim()
268+
},
248269
disableAddButton() {
249270
// If 'Add' button should be disabled
250271
// If the input contains at least one tag that can
@@ -416,7 +437,13 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
416437
},
417438
// --- Wrapper event handlers ---
418439
onClick(evt) {
419-
if (!this.disabled && isEvent(evt) && evt.target === evt.currentTarget) {
440+
const ignoreFocusSelector = this.computeIgnoreInputFocusSelector
441+
const { target } = evt
442+
if (
443+
!this.disabled &&
444+
!isActiveElement(target) &&
445+
(!ignoreFocusSelector || !closest(ignoreFocusSelector, target, true))
446+
) {
420447
this.$nextTick(() => {
421448
this.focus()
422449
})
@@ -630,8 +657,7 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
630657
staticClass: 'list-unstyled mt-n1 mb-0 d-flex flex-wrap align-items-center',
631658
attrs: { id: tagListId }
632659
},
633-
// `concat()` is faster than array spread when args are known to be arrays
634-
concat($tags, $field)
660+
[$tags, $field]
635661
)
636662

637663
// Assemble the feedback
@@ -792,12 +818,12 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
792818
'aria-describedby': this.safeId('_selected_')
793819
},
794820
on: {
821+
click: this.onClick,
795822
focusin: this.onFocusin,
796-
focusout: this.onFocusout,
797-
click: this.onClick
823+
focusout: this.onFocusout
798824
}
799825
},
800-
concat($output, $removed, $content, $hidden)
826+
[$output, $removed, $content, $hidden]
801827
)
802828
}
803829
})

src/components/form-tags/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
{
111111
"prop": "noOuterFocus",
112112
"description": "When set, disables the focus styling of the component root element"
113+
},
114+
{
115+
"prop": "ignoreInputFocusSelector",
116+
"version": "2.16.0",
117+
"description": "Ignore certain elements from the click to focus input routine, specified by css selector(s)"
113118
}
114119
],
115120
"slots": [

src/components/image/img.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const props = {
3333
// default: null
3434
},
3535
alt: {
36-
type: String
37-
// default: null
36+
type: String,
37+
default: null
3838
},
3939
width: {
4040
type: [Number, String]
@@ -153,7 +153,7 @@ export const BImg = /*#__PURE__*/ Vue.extend({
153153
mergeData(data, {
154154
attrs: {
155155
src: src,
156-
alt: props.alt || null,
156+
alt: props.alt,
157157
width: width ? toString(width) : null,
158158
height: height ? toString(height) : null,
159159
srcset: srcset || null,

0 commit comments

Comments
 (0)