forked from epicmaxco/vuestic-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into preloader
- Loading branch information
Showing
34 changed files
with
782 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<template> | ||
<div> | ||
<div class="d-flex justify-content-between"> | ||
<filter-bar @filter="onFilterSet"></filter-bar> | ||
<items-per-page :options="itemsPerPage" | ||
:defaultPerPage="perPage" | ||
@items-per-page="onItemsPerPage"></items-per-page> | ||
</div> | ||
<div class="table-responsive"> | ||
<vuetable ref="vuetable" | ||
apiUrl="https://vuetable.ratiw.net/api/users" | ||
:fields="tableFields" | ||
:css="css.table" | ||
paginationPath="" | ||
:appendParams="moreParams" | ||
:perPage="perPage" | ||
@vuetable:pagination-data="onPaginationData" | ||
> | ||
</vuetable> | ||
<div class="d-flex justify-content-center mb-4"> | ||
<vuetable-pagination ref="pagination" | ||
:css="css.pagination" | ||
@vuetable-pagination:change-page="onChangePage"></vuetable-pagination> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Vuetable from 'vuetable-2/src/components/Vuetable' | ||
import VuetablePagination from 'vuetable-2/src/components/VuetablePagination' | ||
import FilterBar from './FilterBar.vue' | ||
import ItemsPerPage from './ItemsPerPage.vue' | ||
import Vue from 'vue' | ||
import VueEvents from 'vue-events' | ||
Vue.use(VueEvents) | ||
export default { | ||
name: 'data-table', | ||
components: { | ||
FilterBar, | ||
Vuetable, | ||
VuetablePagination, | ||
ItemsPerPage | ||
}, | ||
props: { | ||
apiUrl: { | ||
type: String, | ||
required: true | ||
}, | ||
tableFields: { | ||
type: Array, | ||
required: true | ||
}, | ||
itemsPerPage: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
data () { | ||
return { | ||
perPage: 6, | ||
colorClasses: {}, | ||
moreParams: {}, | ||
css: { | ||
table: { | ||
tableClass: 'table table-striped', | ||
ascendingIcon: 'entypo entypo-up-dir', | ||
descendingIcon: 'entypo entypo-down-dir' | ||
}, | ||
pagination: { | ||
wrapperClass: 'btn-group green-box-shadow', | ||
activeClass: 'focus', | ||
disabledClass: 'disabled', | ||
pageClass: 'btn btn-primary', | ||
linkClass: 'btn btn-primary', | ||
icons: { | ||
first: 'fa fa-angle-double-left', | ||
prev: 'fa fa-angle-left', | ||
next: 'fa fa-angle-right', | ||
last: 'fa fa-angle-double-right' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
mounted () { | ||
this.$events.$on('filter-set', eventData => this.onFilterSet(eventData)) | ||
this.$events.$on('items-per-page', eventData => this.onItemsPerPage(eventData)) | ||
}, | ||
methods: { | ||
onFilterSet (filterText) { | ||
this.moreParams = { | ||
'filter': filterText | ||
} | ||
Vue.nextTick(() => this.$refs.vuetable.refresh()) | ||
}, | ||
onItemsPerPage (itemsPerPageValue) { | ||
this.perPage = itemsPerPageValue | ||
Vue.nextTick(() => this.$refs.vuetable.refresh()) | ||
}, | ||
onPaginationData (paginationData) { | ||
this.$refs.pagination.setPaginationData(paginationData) | ||
}, | ||
onChangePage (page) { | ||
this.$refs.vuetable.changePage(page) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<div class="form-group with-icon-left"> | ||
<div class="input-group"> | ||
<input id="input-icon-left" name="input-icon-left" @keyup="doFilter()" v-model="filterText" required/> | ||
<i class="glyphicon glyphicon-search icon-left input-icon search-icon"></i> | ||
<label class="control-label" for="input-icon-left">Search</label><i class="bar"></i> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'filterBar', | ||
data () { | ||
return { | ||
filterText: '' | ||
} | ||
}, | ||
methods: { | ||
doFilter () { | ||
this.$emit('filter', this.filterText) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.search-icon { | ||
transform: rotate(90deg); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div class="form-group dropdown" v-dropdown.closeOnMenuClick> | ||
<button id="itemsPerPageBtn" class="btn btn-primary btn-sm dropdown-toggle" type="button" | ||
data-toggle="dropdown"> | ||
{{selected}} per page | ||
<i class="ion-chevron-down arrow-down"></i> | ||
</button> | ||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> | ||
<a class="dropdown-item" v-for="option in options" @click="selectedItemsPerPage(option.value)">{{option.value}} per page</a> | ||
</div> | ||
</div> | ||
|
||
</template> | ||
|
||
<script> | ||
import Dropdown from 'directives/Dropdown' | ||
export default { | ||
directives: { | ||
Dropdown | ||
}, | ||
props: { | ||
options: { | ||
type: Array, | ||
required: true | ||
}, | ||
defaultPerPage: { | ||
type: Number | ||
} | ||
}, | ||
data () { | ||
return { | ||
selected: this.defaultPerPage | ||
} | ||
}, | ||
methods: { | ||
selectedItemsPerPage (optionValue) { | ||
this.selected = optionValue | ||
this.$emit('items-per-page', this.selected) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "../../../sass/variables"; | ||
.btn.dropdown-toggle, .dropdown-menu { | ||
min-width: 13rem; | ||
max-width: 13rem; | ||
} | ||
.dropdown-item, .dropdown-toggle { | ||
text-transform: uppercase; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.