Skip to content

Commit 2a38e1b

Browse files
committed
Merge branch 'master'
Conflicts: components/popover.vue
2 parents 3101ba9 + 5234a86 commit 2a38e1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3740
-2140
lines changed

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
docs
2-
examples
1+
docs

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# Bootstrap Vue
22
[Twitter Bootstrap 4](https://v4-alpha.getbootstrap.com/) components for [Vue.js 2](https://vuejs.org/)
33

4-
[![CircleCI branch](https://img.shields.io/circleci/project/github/bootstrap-vue/bootstrap-vue/master.svg?style=flat-square)](https://circleci.com/projects/gh/bootstrap-vue)
5-
[![npm](https://img.shields.io/npm/dt/bootstrap-vue.svg?style=flat-square)](https://www.npmjs.com/package/bootstrap-vue)
6-
[![npm](https://img.shields.io/npm/v/bootstrap-vue.svg?style=flat-square)](https://www.npmjs.com/package/bootstrap-vue)
7-
[![npm](https://img.shields.io/npm/l/bootstrap-vue.svg?style=flat-square)](https://www.npmjs.com/package/bootstrap-vue)
8-
9-
[![npm](https://img.shields.io/badge/bootstrap-4.0.0--alpha.6-800080.svg?style=flat-square)](https://www.npmjs.com/package/bootstrap-vue)
10-
[![npm](https://img.shields.io/badge/vue.js-2.1.10-green.svg?style=flat-swuare)](https://www.npmjs.com/package/bootstrap-vue)
11-
12-
<p align="center"><img src="https://github.com/bootstrap-vue/bootstrap-vue/raw/master/banner.png"></p>
4+
<p align="center">
5+
<img src="https://github.com/bootstrap-vue/bootstrap-vue/raw/master/banner.png" width="200px">
6+
<br>
7+
<img alt="" src="https://img.shields.io/circleci/project/github/bootstrap-vue/bootstrap-vue/master.svg">
8+
<img alt="" src="https://img.shields.io/npm/dt/bootstrap-vue.svg">
9+
<img alt="" src="https://img.shields.io/npm/v/bootstrap-vue.svg">
10+
<img alt="" src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg">
11+
<a href="https://www.codacy.com/app/pi0/bootstrap-vue?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=bootstrap-vue/bootstrap-vue&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/efdefff98c8848a9b6038b164f10acc6"/></a>
12+
<img alt="" src="https://img.shields.io/badge/bootstrap-4.0.0--alpha.6-800080.svg">
13+
<img alt="" src="https://img.shields.io/badge/vue.js-2.1.10-green.svg">
14+
</p>
1315

1416
# Getting started
1517
Please head to [Official Docs Website](https://bootstrap-vue.github.io) for setup guide, examples and documentation.
1618

1719
# Current included stable components
1820

19-
- [Alerts](https://bootstrap-vue.github.io/docs/components/alerts)
21+
- [Alerts](https://bootstrap-vue.github.io/docs/components/alerts) **New features**
2022
- [Breadcrumb](https://bootstrap-vue.github.io/docs/components/breadcrumb)
2123
- [Buttons](https://bootstrap-vue.github.io/docs/components/buttons)
2224
- [Button group](https://bootstrap-vue.github.io/docs/components/button-group)
@@ -26,10 +28,10 @@ Please head to [Official Docs Website](https://bootstrap-vue.github.io) for setu
2628
- [Form Checkbox](https://bootstrap-vue.github.io/docs/components/form-checkbox)
2729
- [Form Select](https://bootstrap-vue.github.io/docs/components/form-select)
2830
- [Nav](https://bootstrap-vue.github.io/docs/components/nav)
29-
- [NavBar](https://bootstrap-vue.github.io/docs/components/navbar)
31+
- [NavBar](https://bootstrap-vue.github.io/docs/components/navbar) **New features**
3032
- [Pagination](https://bootstrap-vue.github.io/docs/components/pagination)
31-
- [Popover](https://bootstrap-vue.github.io/docs/components/popover)
32-
- [Tables](https://bootstrap-vue.github.io/docs/components/tables) (with pagination and custom rendering support)
33+
- [Popover](https://bootstrap-vue.github.io/docs/components/popover) **New features**
34+
- [Tables](https://bootstrap-vue.github.io/docs/components/tables) **New features**
3335

3436
Additionally, [many more components](https://github.com/bootstrap-vue/bootstrap-vue/tree/master/components) are available, but they are still under development. If you really need to use them, feel free to experiment and submit pull requests to benefit other users of this package.
3537

banner.png

100644100755
-17.1 KB
Loading

circle.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
machine:
22
environment:
3-
YARN_VERSION: 0.18.1
3+
YARN_VERSION: 0.20.0
44
PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
55
node:
66
version: 6
@@ -20,17 +20,15 @@ dependencies:
2020
compile:
2121
override:
2222
- yarn build
23-
# - cp -rv build/* $CIRCLE_ARTIFACTS
2423

2524
test:
2625
override:
27-
- echo "test"
26+
- yarn test
2827

2928
deployment:
3029
release:
3130
tag: /v[0-9]+(\.[0-9]+)*/
3231
commands:
33-
- yarn docs-deploy
32+
# - yarn docs-deploy
3433
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
3534
- npm publish
36-

components/alert.vue

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@
1717
export default {
1818
data() {
1919
return {
20-
localShow: this.show
20+
countDownTimerId: null,
21+
dismissed: false
22+
};
23+
},
24+
computed: {
25+
classObject() {
26+
return ['alert', this.alertState, this.dismissible ? 'alert-dismissible' : ''];
27+
},
28+
alertState() {
29+
return !this.state || this.state === `default` ? `alert-success` : `alert-${this.state}`;
30+
},
31+
localShow() {
32+
return !this.dismissed && (this.countDownTimerId || this.show);
2133
}
2234
},
2335
props: {
24-
show: {
25-
type: Boolean,
26-
default: false
27-
},
2836
state: {
2937
type: String,
3038
default: 'info'
@@ -33,49 +41,52 @@
3341
type: Boolean,
3442
default: false
3543
},
36-
dismissAfterSeconds: {
37-
type: Number,
38-
default: null
39-
},
40-
},
41-
computed: {
42-
classObject() {
43-
return ['alert', this.alertState, this.dismissible ? 'alert-dismissible' : '']
44-
},
45-
alertState() {
46-
return !this.state || this.state === `default` ? `alert-success` : `alert-${this.state}`
47-
},
44+
show: {
45+
type: [Boolean, Number],
46+
default: false
47+
}
4848
},
4949
watch: {
50-
show: function (newValue, oldValue) {
51-
if (this.dismissAfterSeconds && newValue == true && oldValue == false) {
52-
this.dismissCounter();
53-
}
50+
show() {
51+
this.showChanged();
5452
}
5553
},
56-
mounted(){
57-
if (this.dismissAfterSeconds) {
58-
this.dismissCounter();
59-
}
54+
mounted() {
55+
this.showChanged();
6056
},
6157
methods: {
6258
dismiss() {
63-
this.localShow = false;
64-
this.$emit('dismissed')
59+
this.dismissed = true;
60+
this.$emit('dismissed');
61+
this.clearCounter();
62+
},
63+
clearCounter() {
64+
if (this.countDownTimerId) {
65+
clearInterval(this.countDownTimerId);
66+
}
6567
},
66-
dismissCounter(){
67-
let dismissCountDown = this.dismissAfterSeconds;
68+
showChanged() {
69+
// Reset dismiss status
70+
this.dismissed = false;
71+
72+
// No timer for boolean values
73+
if (this.show === true || this.show === false || this.show === null) {
74+
return;
75+
}
76+
77+
let dismissCountDown = this.show;
6878
this.$emit('dismiss-count-down', dismissCountDown);
69-
let intId = setInterval(() => {
70-
if (dismissCountDown < 2 || !this.show) {
71-
if (this.show) this.dismiss();
72-
clearInterval(intId);
73-
} else {
74-
dismissCountDown--;
75-
this.$emit('dismiss-count-down', dismissCountDown);
79+
80+
// Start counter
81+
this.clearCounter();
82+
this.countDownTimerId = setInterval(() => {
83+
if (dismissCountDown < 2) {
84+
return this.dismiss();
7685
}
86+
dismissCountDown--;
87+
this.$emit('dismiss-count-down', dismissCountDown);
7788
}, 1000);
7889
}
7990
}
80-
}
91+
};
8192
</script>

components/badge.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
return !this.variant || this.variant === `default` ? `badge-default` : `badge-${this.variant}`;
1313
},
1414
badgeType() {
15-
return !this.type ? `` : `badge-${this.type}`;
15+
return this.type ? `badge-${this.type}` : '';
1616
},
17-
badgePill(){
17+
badgePill() {
1818
return this.pill ? 'badge-pill' : '';
1919
}
2020
},
@@ -32,5 +32,5 @@
3232
default: false
3333
}
3434
}
35-
}
35+
};
3636
</script>

components/breadcrumb.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
type: Array,
2020
default: () => [],
2121
required: true
22-
},
22+
}
2323
},
2424
methods: {
25-
onclick: function (item) {
25+
onclick(item) {
2626
this.$emit('click', item);
27-
},
28-
},
29-
}
27+
}
28+
}
29+
};
3030
</script>

components/button-checkbox.vue

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="btn-group" data-toggle="buttons">
3-
<label :class="classObject" v-for="(item,index) in list">
3+
<label :class="['btn', btnVariant, btnSize, checked(index) ? 'active' : '']" v-for="(item,index) in list">
44
<input type="checkbox"
55
:value="item.value"
66
autocomplete="off"
@@ -16,15 +16,12 @@
1616
export default {
1717
replace: true,
1818
computed: {
19-
classObject(){
20-
return ['btn', btnVariant, btnSize, checked(index) ? 'active' : ''];
21-
},
2219
btnVariant() {
23-
return !this.variant || this.variant === `default` ? `btn-secondary` : `btn-${this.variant}`
20+
return !this.variant || this.variant === `default` ? `btn-secondary` : `btn-${this.variant}`;
2421
},
2522
btnSize() {
26-
return !this.size || this.size === `default` ? `` : `btn-${this.size}`
27-
},
23+
return !this.size || this.size === `default` ? `` : `btn-${this.size}`;
24+
}
2825
},
2926
props: {
3027
list: {
@@ -34,7 +31,7 @@
3431
},
3532
model: {
3633
type: Array,
37-
default: [],
34+
default: []
3835
},
3936
size: {
4037
type: String,
@@ -47,22 +44,24 @@
4744
returnObject: {
4845
type: Boolean,
4946
default: false
50-
},
47+
}
5148
},
5249
methods: {
5350
checked(index) {
54-
if (!this.list) return false;
51+
if (!this.list) {
52+
return false;
53+
}
5554
let result = false;
5655
if (this.returnObject) {
5756
for (let i = 0; i < this.model.length; i++) {
5857
if (this.model[i].value === this.list[index].value) {
59-
result = true
58+
result = true;
6059
}
6160
}
6261
} else {
63-
result = this.model.indexOf(this.list[index].value) !== -1
62+
result = this.model.indexOf(this.list[index].value) !== -1;
6463
}
65-
return result
64+
return result;
6665
}
6766
},
6867
watch: {
@@ -90,21 +89,18 @@
9089
},
9190
mounted() {
9291
// handle initial selection
93-
this.list.forEach((item) => {
92+
this.list.forEach(item => {
9493
if (this.returnObject) {
95-
this.model.forEach((modelItem) => {
94+
this.model.forEach(modelItem => {
9695
if (modelItem.value === item.value
9796
) {
98-
item.checked = true
97+
item.checked = true;
9998
}
100-
})
101-
}
102-
else {
103-
if (this.model.indexOf(item.value) !== -1) {
104-
item.checked = true
105-
}
99+
});
100+
} else if (this.model.indexOf(item.value) !== -1) {
101+
item.checked = true;
106102
}
107-
})
103+
});
108104
}
109-
}
105+
};
110106
</script>

components/button-group.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script>
88
export default {
99
computed: {
10-
classObject(){
10+
classObject() {
1111
return [
1212
'btn-' + (this.toolbar ? 'toolbar' : 'group'),
1313
this.vertical ? 'btn-group-vertical' : '',
@@ -27,7 +27,7 @@
2727
size: {
2828
type: String,
2929
default: null
30-
},
31-
},
32-
}
30+
}
31+
}
32+
};
3333
</script>

0 commit comments

Comments
 (0)