Skip to content

Commit

Permalink
Fix #1027 icon-pack prop for individual components
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy committed Oct 12, 2018
1 parent 1e36bdc commit 317ac96
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 37 deletions.
3 changes: 1 addition & 2 deletions src/components/dialog/Dialog.vue
Expand Up @@ -67,19 +67,18 @@
import Modal from '../modal/Modal'
import config from '../../utils/config'
import { removeElement } from '../../utils/helpers'
import BaseElementMixin from '../../utils/BaseElementMixin'
export default {
name: 'BDialog',
components: {
[Icon.name]: Icon
},
extends: Modal,
mixins: [BaseElementMixin],
props: {
title: String,
message: String,
icon: String,
iconPack: String,
hasIcon: Boolean,
type: {
type: String,
Expand Down
2 changes: 1 addition & 1 deletion src/components/message/Message.vue
Expand Up @@ -18,7 +18,7 @@
<div v-if="icon && hasIcon" class="media-left">
<b-icon
:icon="icon"
:icon-pack="iconPack"
:pack="iconPack"
:class="type"
both
:size="newIconSize"/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/notification/Notification.vue
Expand Up @@ -14,7 +14,7 @@
<div v-if="icon && hasIcon" class="media-left">
<b-icon
:icon="icon"
:icon-pack="iconPack"
:pack="iconPack"
both
size="is-large"/>
</div>
Expand Down
13 changes: 6 additions & 7 deletions src/components/pagination/Pagination.vue
Expand Up @@ -5,21 +5,21 @@
href="#"
class="pagination-previous"
:disabled="!hasPrev"
@click.prevent="prev" >
@click.prevent="prev">
<b-icon
icon="chevron-left"
:icon-pack="iconPack"
:pack="iconPack"
both/>
</a>
<a
role="button"
href="#"
class="pagination-next"
:disabled="!hasNext"
@click.prevent="next" >
@click.prevent="next">
<b-icon
icon="chevron-right"
:icon-pack="iconPack"
:pack="iconPack"
both/>
</a>
<ul class="pagination-list" v-if="!simple">
Expand Down Expand Up @@ -72,14 +72,12 @@

<script>
import Icon from '../icon/Icon'
import BaseElementMixin from '../../utils/BaseElementMixin'
export default {
name: 'BPagination',
components: {
[Icon.name]: Icon
},
mixins: [BaseElementMixin],
props: {
total: [Number, String],
perPage: {
Expand All @@ -93,7 +91,8 @@
size: String,
simple: Boolean,
rounded: Boolean,
order: String
order: String,
iconPack: String
},
computed: {
rootClasses() {
Expand Down
10 changes: 4 additions & 6 deletions src/components/table/Table.vue
Expand Up @@ -51,7 +51,7 @@
<b-icon
v-show="currentSortColumn === column"
icon="arrow-up"
:icon-pack="iconPack"
:pack="iconPack"
both
size="is-small"
:class="{ 'is-desc': !isAsc }"/>
Expand Down Expand Up @@ -80,7 +80,7 @@
@click.stop="toggleDetails(row)">
<b-icon
icon="chevron-right"
:icon-pack="iconPack"
:pack="iconPack"
both
:class="{'is-expanded': isVisibleDetailRow(row)}"/>
</a>
Expand Down Expand Up @@ -181,8 +181,6 @@
import TableMobileSort from './TableMobileSort'
import TableColumn from './TableColumn'
import BaseElementMixin from '../../utils/BaseElementMixin'
export default {
name: 'BTable',
components: {
Expand All @@ -192,7 +190,6 @@
[TableMobileSort.name]: TableMobileSort,
[TableColumn.name]: TableColumn
},
mixins: [BaseElementMixin],
props: {
data: {
type: Array,
Expand Down Expand Up @@ -261,7 +258,8 @@
total: {
type: [Number, String],
default: 0
}
},
iconPack: String
},
data() {
return {
Expand Down
4 changes: 1 addition & 3 deletions src/components/tabs/TabItem.vue
Expand Up @@ -7,14 +7,12 @@
</template>

<script>
import BaseElementMixin from '../../utils/BaseElementMixin'
export default {
name: 'BTabItem',
mixins: [BaseElementMixin],
props: {
label: String,
icon: String,
iconPack: String,
disabled: Boolean,
visible: {
type: Boolean,
Expand Down
12 changes: 0 additions & 12 deletions src/utils/BaseElementMixin.js

This file was deleted.

7 changes: 4 additions & 3 deletions src/utils/FormElementMixin.js
@@ -1,21 +1,22 @@
import BaseElementMixin from './BaseElementMixin'
import config from '../utils/config'

export default {
mixins: [BaseElementMixin],
props: {
size: String,
expanded: Boolean,
loading: Boolean,
rounded: Boolean,
icon: String,
iconPack: String,
// Native options to use in HTML5 validation
autocomplete: String,
maxlength: [Number, String]
},
data() {
return {
isValid: true,
isFocused: false
isFocused: false,
newIconPack: this.iconPack || config.defaultIconPack
}
},
computed: {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/MessageMixin.js
@@ -1,8 +1,6 @@
import Icon from '../components/icon/Icon'
import BaseElementMixin from './BaseElementMixin'

export default {
mixins: [BaseElementMixin],
components: {
[Icon.name]: Icon
},
Expand All @@ -19,6 +17,7 @@ export default {
type: String,
hasIcon: Boolean,
size: String,
iconPack: String,
iconSize: String,
autoClose: {
type: Boolean,
Expand Down

0 comments on commit 317ac96

Please sign in to comment.