Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Jul 18, 2018
1 parent 4a18878 commit 2abc051
Show file tree
Hide file tree
Showing 58 changed files with 603 additions and 118 deletions.
131 changes: 125 additions & 6 deletions dist/vue-good-table.cjs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-good-table v2.10.0
* vue-good-table v2.11.0
* (c) 2018-present xaksis <[email protected]>
* https://github.com/xaksis/vue-good-table
* Released under the MIT License.
Expand Down Expand Up @@ -103,6 +103,87 @@ var def = {
}
};

var VgtPaginationPageInfo = {
render: function render() {
var _vm = this;

var _h = _vm.$createElement;

var _c = _vm._self._c || _h;

return _c('div', {
staticClass: "footer__navigation__page-info"
}, [_vm._v(" " + _vm._s(_vm.pageText) + " "), _c('input', {
staticClass: "footer__navigation__page-info__current-entry",
attrs: {
"type": "text"
},
domProps: {
"value": _vm.currentPage
},
on: {
"keyup": function keyup($event) {
if (!('button' in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
return null;
}

$event.stopPropagation();
return _vm.changePage($event);
}
}
}), _vm._v(" " + _vm._s(_vm.pageInfo) + " ")]);
},
staticRenderFns: [],
_scopeId: 'data-v-731a4dda',
name: 'VgtPaginationPageInfo',
props: {
currentPerPage: {
default: 10
},
currentPage: {
default: 1
},
totalRecords: {
default: 0
},
ofText: {
default: 'of',
type: String
},
pageText: {
default: 'page',
type: String
}
},
data: function data() {
return {};
},
computed: {
pageInfo: function pageInfo() {
return "".concat(this.ofText, " ").concat(this.lastPage);
},
lastPage: function lastPage() {
return Math.ceil(this.totalRecords / this.currentPerPage);
}
},
methods: {
changePage: function changePage(event) {
var value = parseInt(event.target.value, 10); //! invalid number

if (Number.isNaN(value) || value > this.lastPage || value < 1) {
event.target.value = this.currentPage;
return false;
} //* valid number


event.target.value = value;
this.$emit('page-changed', value);
}
},
mounted: function mounted() {},
components: {}
};

var VgtPagination = {
render: function render() {
var _vm = this;
Expand Down Expand Up @@ -175,7 +256,18 @@ var VgtPagination = {
'left': !_vm.rtl,
'right': _vm.rtl
}
}), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _c('div', {
}), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _vm.mode === 'pages' ? _c('pagination-page-info', {
attrs: {
"totalRecords": _vm.total,
"currentPerPage": _vm.currentPerPage,
"currentPage": _vm.currentPage,
"ofText": _vm.ofText,
"pageText": _vm.pageText
},
on: {
"page-changed": _vm.changePage
}
}) : _c('div', {
staticClass: "footer__navigation__info"
}, [_vm._v(_vm._s(_vm.paginatedInfo))]), _vm._v(" "), _c('a', {
staticClass: "footer__navigation__page-btn",
Expand All @@ -199,7 +291,7 @@ var VgtPagination = {
'right': !_vm.rtl,
'left': _vm.rtl
}
})])])]);
})])], 1)]);
},
staticRenderFns: [],
name: 'VgtPagination',
Expand All @@ -222,6 +314,9 @@ var VgtPagination = {
paginateDropdownAllowAll: {
default: true
},
mode: {
default: 'records'
},
// text options
nextText: {
default: 'Next'
Expand All @@ -235,6 +330,9 @@ var VgtPagination = {
ofText: {
default: 'of'
},
pageText: {
default: 'page'
},
allText: {
default: 'All'
}
Expand Down Expand Up @@ -291,7 +389,7 @@ var VgtPagination = {
// },
reset: function reset() {},
changePage: function changePage(pageNumber) {
if (pageNumber > 0 && this.total > this.currentPerPage * pageNumber) {
if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) {
this.currentPage = pageNumber;
this.pageChanged();
}
Expand Down Expand Up @@ -354,6 +452,9 @@ var VgtPagination = {
},
mounted: function mounted() {
this.handlePerPage();
},
components: {
'pagination-page-info': VgtPaginationPageInfo
}
};

Expand Down Expand Up @@ -838,12 +939,14 @@ var VueGoodTable = {
"perPage": _vm.perPage,
"rtl": _vm.rtl,
"total": _vm.totalRows || _vm.totalRowCount,
"mode": _vm.paginationMode,
"nextText": _vm.nextText,
"prevText": _vm.prevText,
"rowsPerPageText": _vm.rowsPerPageText,
"customRowsPerPageDropdown": _vm.customRowsPerPageDropdown,
"paginateDropdownAllowAll": _vm.paginateDropdownAllowAll,
"ofText": _vm.ofText,
"pageText": _vm.pageText,
"allText": _vm.allText
},
on: {
Expand Down Expand Up @@ -1051,12 +1154,14 @@ var VueGoodTable = {
"perPage": _vm.perPage,
"rtl": _vm.rtl,
"total": _vm.totalRows || _vm.totalRowCount,
"mode": _vm.paginationMode,
"nextText": _vm.nextText,
"prevText": _vm.prevText,
"rowsPerPageText": _vm.rowsPerPageText,
"customRowsPerPageDropdown": _vm.customRowsPerPageDropdown,
"paginateDropdownAllowAll": _vm.paginateDropdownAllowAll,
"ofText": _vm.ofText,
"pageText": _vm.pageText,
"allText": _vm.allText
},
on: {
Expand Down Expand Up @@ -1137,7 +1242,9 @@ var VueGoodTable = {
perPage: 10,
perPageDropdown: null,
position: 'bottom',
dropdownAllowAll: true
dropdownAllowAll: true,
mode: 'records' // or pages

};
}
},
Expand All @@ -1163,6 +1270,7 @@ var VueGoodTable = {
rowsPerPageText: 'Rows per page',
ofText: 'of',
allText: 'All',
pageText: 'page',
// internal select options
selectable: false,
selectOnCheckboxOnly: false,
Expand All @@ -1186,6 +1294,7 @@ var VueGoodTable = {
paginateOnBottom: true,
customRowsPerPageDropdown: [],
paginateDropdownAllowAll: true,
paginationMode: 'records',
currentPage: 1,
currentPerPage: 10,
sortColumn: -1,
Expand Down Expand Up @@ -1956,8 +2065,10 @@ var VueGoodTable = {
prevLabel = _this$paginationOptio.prevLabel,
rowsPerPageLabel = _this$paginationOptio.rowsPerPageLabel,
ofLabel = _this$paginationOptio.ofLabel,
pageLabel = _this$paginationOptio.pageLabel,
allLabel = _this$paginationOptio.allLabel,
setCurrentPage = _this$paginationOptio.setCurrentPage;
setCurrentPage = _this$paginationOptio.setCurrentPage,
mode = _this$paginationOptio.mode;

if (typeof enabled === 'boolean') {
this.paginate = enabled;
Expand All @@ -1984,6 +2095,10 @@ var VueGoodTable = {
this.paginateDropdownAllowAll = dropdownAllowAll;
}

if (typeof mode === 'string') {
this.paginationMode = mode;
}

if (typeof nextLabel === 'string') {
this.nextText = nextLabel;
}
Expand All @@ -2000,6 +2115,10 @@ var VueGoodTable = {
this.ofText = ofLabel;
}

if (typeof pageLabel === 'string') {
this.pageText = pageLabel;
}

if (typeof allLabel === 'string') {
this.allText = allLabel;
}
Expand Down
18 changes: 13 additions & 5 deletions dist/vue-good-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ table.vgt-table {
border-color: #409eff; }
.vgt-wrap__footer .footer__navigation {
font-size: 14px; }
.vgt-wrap__footer .footer__navigation__page-btn, .vgt-wrap__footer .footer__navigation__info {
.vgt-wrap__footer .footer__navigation__page-btn, .vgt-wrap__footer .footer__navigation__info, .vgt-wrap__footer .footer__navigation__page-info {
display: inline-block;
vertical-align: middle; }
.vgt-wrap__footer .footer__navigation__page-btn {
Expand Down Expand Up @@ -294,9 +294,16 @@ table.vgt-table {
.vgt-wrap__footer .footer__navigation__page-btn .chevron.right::after {
border-left: 6px solid #409eff;
margin-left: -3px; }
.vgt-wrap__footer .footer__navigation__info {
.vgt-wrap__footer .footer__navigation__info, .vgt-wrap__footer .footer__navigation__page-info {
display: inline-block;
color: #909399;
margin: 0px 16px; }
.vgt-wrap__footer .footer__navigation__page-info__current-entry {
width: 30px;
text-align: center;
display: inline-block;
margin: 0px 10px;
font-weight: bold; }

@media only screen and (max-width: 750px) {
/* on small screens hide the info */
Expand All @@ -313,7 +320,7 @@ table.vgt-table {
.vgt-table.nocturnal td {
border-bottom: 1px solid #435169;
color: #C7CED8; }
.vgt-table.nocturnal th.line-numbers {
.vgt-table.nocturnal th.line-numbers, .vgt-table.nocturnal th.vgt-checkbox-col {
color: #C7CED8;
border-right: 1px solid #435169;
background: linear-gradient(#2C394F, #2C394F); }
Expand Down Expand Up @@ -351,7 +358,7 @@ table.vgt-table {
border-right-color: #C7CED8; }
.vgt-wrap.nocturnal .vgt-wrap__footer .footer__navigation__page-btn.disabled .chevron.right:after, .vgt-wrap.nocturnal .vgt-wrap__footer .footer__navigation__page-btn.disabled:hover .chevron.right:after {
border-left-color: #C7CED8; }
.vgt-wrap.nocturnal .vgt-wrap__footer .footer__navigation__info {
.vgt-wrap.nocturnal .vgt-wrap__footer .footer__navigation__info, .vgt-wrap.nocturnal .vgt-wrap__footer .footer__navigation__page-info {
color: #8290A7; }

.vgt-wrap.nocturnal .vgt-global-search {
Expand Down Expand Up @@ -449,7 +456,7 @@ table.vgt-table {
border-right-color: #dae2f0; }
.vgt-wrap.black-rhino .vgt-wrap__footer .footer__navigation__page-btn.disabled .chevron.right:after, .vgt-wrap.black-rhino .vgt-wrap__footer .footer__navigation__page-btn.disabled:hover .chevron.right:after {
border-left-color: #dae2f0; }
.vgt-wrap.black-rhino .vgt-wrap__footer .footer__navigation__info {
.vgt-wrap.black-rhino .vgt-wrap__footer .footer__navigation__info, .vgt-wrap.black-rhino .vgt-wrap__footer .footer__navigation__page-info {
color: #dae2f0; }

.vgt-wrap.black-rhino .vgt-global-search {
Expand Down Expand Up @@ -502,5 +509,6 @@ table.vgt-table {






Loading

0 comments on commit 2abc051

Please sign in to comment.