v-page 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -93
- package/dist/v-page.js +1 -1
- package/dist/v-page.js.map +1 -1
- package/package.json +72 -65
- package/types/index.d.ts +62 -0
- package/.babelrc +0 -6
- package/.circleci/config.yml +0 -40
- package/.editorconfig +0 -9
- package/src/Page.js +0 -214
- package/src/index.js +0 -32
- package/src/language.js +0 -34
- package/src/page.sass +0 -116
- package/tests/unit/setup.js +0 -8
- package/tests/unit/v-page.spec.js +0 -49
- package/webpack.config.js +0 -118
package/README.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
# [v-page](https://terryz.github.io/vue/#/page) · [](https://circleci.com/gh/TerryZ/v-page) [](https://codecov.io/gh/TerryZ/v-page) [](https://www.npmjs.com/package/v-page) [](https://mit-license.org/) [](https://www.npmjs.com/package/v-page) [](https://standardjs.com)
|
|
2
|
-
|
|
3
|
-
A simple pagination bar, including
|
|
4
|
-
|
|
5
|
-
<img src="https://terryz.github.io/image/v-page/v-page.png" alt="v-page" height="54px">
|
|
6
|
-
|
|
7
|
-
## Examples and Documentation
|
|
8
|
-
|
|
9
|
-
Live Examples on [CodePen](https://codepen.io/terry05/pen/yjZYLR), more exmaples and documentation please visit below sites
|
|
10
|
-
|
|
11
|
-
- [English site](https://terryz.github.io/vue/#/page)
|
|
12
|
-
- [国内站点](https://terryz.gitee.io/vue/#/page)
|
|
13
|
-
|
|
14
|
-
The jQuery version: [bPage](https://github.com/TerryZ/bPage)
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
<a href="https://nodei.co/npm/v-page/"><img src="https://nodei.co/npm/v-page.png"></a>
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
npm i -S v-page
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Include and install plugin in your `main.js` file.
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
// add component in global scope as plugin
|
|
28
|
-
import Vue from 'vue'
|
|
29
|
-
import Page from 'v-page'
|
|
30
|
-
Vue.use(Page, {
|
|
31
|
-
global config options
|
|
32
|
-
})
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
You also can use `v-page` in local component
|
|
36
|
-
|
|
37
|
-
```vue
|
|
38
|
-
<template>
|
|
39
|
-
<v-page></v-page>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script>
|
|
43
|
-
import {
|
|
44
|
-
export default {
|
|
45
|
-
components: {
|
|
46
|
-
'v-page':
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
</script>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
53
|
-
|
|
54
|
-
```vue
|
|
55
|
-
<template>
|
|
56
|
-
<v-page
|
|
57
|
-
:total-row="totalRow"
|
|
58
|
-
@page-change="pageChange"
|
|
59
|
-
></v-page>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<script>
|
|
63
|
-
export default {
|
|
64
|
-
data () {
|
|
65
|
-
return {
|
|
66
|
-
totalRow: 100 // required option
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
methods: {
|
|
70
|
-
// receive page info change callback
|
|
71
|
-
pageChange (pInfo) {
|
|
72
|
-
console.log(pInfo) // { pageNumber: 1, pageSize: 10 }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Vue plugin series
|
|
80
|
-
|
|
81
|
-
| Plugin | Status | Description |
|
|
82
|
-
| :---------------- | :-- | :-- |
|
|
83
|
-
| [v-page](https://github.com/TerryZ/v-page) | [](https://www.npmjs.com/package/v-page) | A simple pagination bar, including length Menu, i18n support |
|
|
84
|
-
| [v-dialogs](https://github.com/TerryZ/v-dialogs) | [](https://www.npmjs.com/package/v-dialogs) | A simple and powerful dialog, including Modal, Alert, Mask and Toast modes |
|
|
85
|
-
| [v-tablegrid](https://github.com/TerryZ/v-tablegrid) | [](https://www.npmjs.com/package/v-tablegrid) | A simpler to use and practical datatable |
|
|
86
|
-
| [v-uploader](https://github.com/TerryZ/v-uploader) | [](https://www.npmjs.com/package/v-uploader) | A Vue2 plugin to make files upload simple and easier, <br>you can drag files or select file in dialog to upload |
|
|
87
|
-
| [v-ztree](https://github.com/TerryZ/v-ztree) | [](https://www.npmjs.com/package/v-ztree) | A simple tree for Vue2, support single or multiple(check) select tree, <br>and support server side data |
|
|
88
|
-
| [v-gallery](https://github.com/TerryZ/v-gallery) | [](https://www.npmjs.com/package/v-gallery) | A Vue2 plugin make browsing images in gallery |
|
|
89
|
-
| [v-region](https://github.com/TerryZ/v-region) | [](https://www.npmjs.com/package/v-region) | A simple region selector, provide Chinese administrative division data |
|
|
90
|
-
| [v-selectpage](https://github.com/TerryZ/v-selectpage) | [](https://www.npmjs.com/package/v-selectpage) | A powerful selector for Vue2, list or table view of pagination, <br>use tags for multiple selection, i18n and server side resources supports |
|
|
91
|
-
| [v-suggest](https://github.com/TerryZ/v-suggest) | [](https://www.npmjs.com/package/v-suggest) | A Vue2 plugin for input suggestions by autocomplete |
|
|
92
|
-
| [v-playback](https://github.com/TerryZ/v-playback) | [](https://www.npmjs.com/package/v-playback) | A Vue2 plugin to make video play easier |
|
|
93
|
-
| [v-selectmenu](https://github.com/TerryZ/v-selectmenu) | [](https://www.npmjs.com/package/v-selectmenu) | A simple, easier and highly customized menu solution |
|
|
1
|
+
# [v-page](https://terryz.github.io/vue/#/page) · [](https://circleci.com/gh/TerryZ/v-page) [](https://codecov.io/gh/TerryZ/v-page) [](https://www.npmjs.com/package/v-page) [](https://mit-license.org/) [](https://www.npmjs.com/package/v-page) [](https://standardjs.com)
|
|
2
|
+
|
|
3
|
+
A simple pagination bar, including size Menu, i18n support, based on **Vue2**
|
|
4
|
+
|
|
5
|
+
<img src="https://terryz.github.io/image/v-page/v-page.png" alt="v-page" height="54px">
|
|
6
|
+
|
|
7
|
+
## Examples and Documentation
|
|
8
|
+
|
|
9
|
+
Live Examples on [CodePen](https://codepen.io/terry05/pen/yjZYLR), more exmaples and documentation please visit below sites
|
|
10
|
+
|
|
11
|
+
- [English site](https://terryz.github.io/vue/#/page)
|
|
12
|
+
- [国内站点](https://terryz.gitee.io/vue/#/page)
|
|
13
|
+
|
|
14
|
+
The jQuery version: [bPage](https://github.com/TerryZ/bPage)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
<a href="https://nodei.co/npm/v-page/"><img src="https://nodei.co/npm/v-page.png"></a>
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i -S v-page
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Include and install plugin in your `main.js` file.
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// add component in global scope as plugin
|
|
28
|
+
import Vue from 'vue'
|
|
29
|
+
import Page from 'v-page'
|
|
30
|
+
Vue.use(Page, {
|
|
31
|
+
global config options
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You also can use `v-page` in local component
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<template>
|
|
39
|
+
<v-page></v-page>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import { Page } from 'v-page'
|
|
44
|
+
export default {
|
|
45
|
+
components: {
|
|
46
|
+
'v-page': Page
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<template>
|
|
56
|
+
<v-page
|
|
57
|
+
:total-row="totalRow"
|
|
58
|
+
@page-change="pageChange"
|
|
59
|
+
></v-page>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
export default {
|
|
64
|
+
data () {
|
|
65
|
+
return {
|
|
66
|
+
totalRow: 100 // required option
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
// receive page info change callback
|
|
71
|
+
pageChange (pInfo) {
|
|
72
|
+
console.log(pInfo) // { pageNumber: 1, pageSize: 10 }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Vue plugin series
|
|
80
|
+
|
|
81
|
+
| Plugin | Status | Description |
|
|
82
|
+
| :---------------- | :-- | :-- |
|
|
83
|
+
| [v-page](https://github.com/TerryZ/v-page) | [](https://www.npmjs.com/package/v-page) | A simple pagination bar, including length Menu, i18n support |
|
|
84
|
+
| [v-dialogs](https://github.com/TerryZ/v-dialogs) | [](https://www.npmjs.com/package/v-dialogs) | A simple and powerful dialog, including Modal, Alert, Mask and Toast modes |
|
|
85
|
+
| [v-tablegrid](https://github.com/TerryZ/v-tablegrid) | [](https://www.npmjs.com/package/v-tablegrid) | A simpler to use and practical datatable |
|
|
86
|
+
| [v-uploader](https://github.com/TerryZ/v-uploader) | [](https://www.npmjs.com/package/v-uploader) | A Vue2 plugin to make files upload simple and easier, <br>you can drag files or select file in dialog to upload |
|
|
87
|
+
| [v-ztree](https://github.com/TerryZ/v-ztree) | [](https://www.npmjs.com/package/v-ztree) | A simple tree for Vue2, support single or multiple(check) select tree, <br>and support server side data |
|
|
88
|
+
| [v-gallery](https://github.com/TerryZ/v-gallery) | [](https://www.npmjs.com/package/v-gallery) | A Vue2 plugin make browsing images in gallery |
|
|
89
|
+
| [v-region](https://github.com/TerryZ/v-region) | [](https://www.npmjs.com/package/v-region) | A simple region selector, provide Chinese administrative division data |
|
|
90
|
+
| [v-selectpage](https://github.com/TerryZ/v-selectpage) | [](https://www.npmjs.com/package/v-selectpage) | A powerful selector for Vue2, list or table view of pagination, <br>use tags for multiple selection, i18n and server side resources supports |
|
|
91
|
+
| [v-suggest](https://github.com/TerryZ/v-suggest) | [](https://www.npmjs.com/package/v-suggest) | A Vue2 plugin for input suggestions by autocomplete |
|
|
92
|
+
| [v-playback](https://github.com/TerryZ/v-playback) | [](https://www.npmjs.com/package/v-playback) | A Vue2 plugin to make video play easier |
|
|
93
|
+
| [v-selectmenu](https://github.com/TerryZ/v-selectmenu) | [](https://www.npmjs.com/package/v-selectmenu) | A simple, easier and highly customized menu solution |
|
package/dist/v-page.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vPage",[],t):"object"==typeof exports?exports.vPage=t():e.vPage=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(a){if(i[a])return i[a].exports;var n=i[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,a){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;var a=i(1),n=function(e){return e&&e.__esModule?e:{default:e}}(a),o={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.keys(t).length){var i=n.default.props,a=t.language,o=t.align,r=t.info,s=t.border,l=t.pageNumber,u=t.first,d=t.last,p=t.pageSizeMenu;a&&(i.language.default=a),o&&(i.align.default=o),"boolean"==typeof r&&(i.info.default=r),"boolean"==typeof s&&(i.border.default=s),"boolean"==typeof l&&(i.pageNumber.default=l),"boolean"==typeof u&&(i.first.default=u),"boolean"==typeof d&&(i.last.default=d),void 0!==p&&(i.pageSizeMenu.default=p)}e.component(n.default.name,n.default)}};t.Page=n.default,t.default=o},function(e,t,i){"use strict";function a(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e};i(2);var o=i(7),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.default={name:"v-page",props:{value:{type:Number,default:0},totalRow:{type:Number,default:0},pageSizeMenu:{type:[Boolean,Array],default:function(){return[10,20,50,100]}},language:{type:String,default:"cn"},align:{type:String,default:"right"},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!0},info:{type:Boolean,default:!0},pageNumber:{type:Boolean,default:!0},first:{type:Boolean,default:!0},last:{type:Boolean,default:!0}},data:function(){return{pageSize:!1===this.pageSizeMenu?10:this.pageSizeMenu[0],lastPageSize:-1,current:0,pageNumberSize:5,i18n:r.default[this.language]||r.default.cn}},computed:{totalPage:function(){return Math.ceil(this.totalRow/this.pageSize)},pageNumbers:function(){var e=this.current,t=this.pageNumberSize,i=this.totalPage,a=Math.floor(t/2),n=e-a;return Array.apply(null,{length:t}).map(function(e,t){return n+t}).filter(function(e){return e>0&&e<=i})},pageInfo:function(){return this.i18n.pageInfo.replace("#pageNumber#",this.current).replace("#totalPage#",this.totalPage).replace("#totalRow#",this.totalRow)},classes:function(){return{"v-pagination--no-border":!this.border,"v-pagination--right":"right"===this.align,"v-pagination--center":"center"===this.align,"v-pagination--disabled":this.disabled}},isFirst:function(){return 1===this.current},isLast:function(){return this.current===this.totalPage}},watch:{value:function(e){"number"==typeof e&&e>0&&this.goPage(e,!1)}},render:function(e){var t=this,i=[];Array.isArray(this.pageSizeMenu)&&this.pageSizeMenu.length&&i.push(e("li",{class:"v-pagination__list"},[e("a",[e("span",this.i18n.pageLength),e("select",{attrs:{disabled:this.disabled},on:{change:function(e){e.srcElement&&e.srcElement.value&&(t.pageSize=Number(e.srcElement.value)),t.goPage()}}},this.pageSizeMenu.map(function(t){return e("option",{attrs:{value:t}},t)}))])])),this.info&&i.push(e("li",{class:"v-pagination__info"},[e("a",this.pageInfo)]));var o=function(i,a,n){return e("li",{class:i},[e("a",{attrs:{href:"javascript:void(0)"},on:{click:function(){return t.goPage(a)}}},n)])};return this.first&&i.push(o({disabled:this.isFirst},1,this.i18n.first)),i.push(o({disabled:this.isFirst},this.current-1,this.i18n.previous)),this.pageNumber&&i.push.apply(i,a(this.pageNumbers.map(function(e){return o({active:e===t.current},e,e)}))),i.push(o({disabled:this.isLast},this.current+1,this.i18n.next)),this.last&&i.push(o({disabled:this.isLast},this.totalPage,this.i18n.last)),e("div",{class:n({"v-pagination":!0},this.classes)},[e("ul",i)])},methods:{goPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.disabled&&"number"==typeof e){var i=e<1?1:e;e>this.totalPage&&this.totalPage>0&&(i=this.totalPage),i===this.current&&this.pageSize===this.lastPageSize||(this.current=i,t&&this.$emit("input",this.current),this.lastPageSize=this.pageSize,this.change())}},reload:function(){this.change()},change:function(){this.$emit("page-change",{pageNumber:this.current,pageSize:Number(this.pageSize)})}},mounted:function(){this.goPage(this.value?this.value:1)}}},function(e,t,i){var a=i(3);"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);i(5)("f316fa44",a,!0,{})},function(e,t,i){t=e.exports=i(4)(!1),t.push([e.i,"div.v-pagination{margin:0;display:block}div.v-pagination.v-pagination--right{text-align:right}div.v-pagination.v-pagination--center{text-align:center}div.v-pagination.v-pagination--disabled li a{color:#999;cursor:default}div.v-pagination.v-pagination--disabled li a:hover{color:#999;background-color:#fff;box-shadow:none;z-index:auto}div.v-pagination.v-pagination--disabled li.active a{background-color:#f6f6f6}div.v-pagination>ul{display:inline-block;list-style:none;margin:0;padding:0;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,.05);-ms-box-shadow:0 1px 2px rgba(0,0,0,.05);-o-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}div.v-pagination>ul>li{text-align:center;margin:0;display:inline}div.v-pagination>ul>li>a{margin:0 0 0 -1px;position:relative;border:1px solid #dee2e6;padding:6px 12px;line-height:1.43;box-shadow:none;background-color:#fff;font-size:14px;display:inline-block;text-decoration:none;color:#333;-webkit-transition:all .5s cubic-bezier(.175,.885,.32,1);-moz-transition:all .5s cubic-bezier(.175,.885,.32,1);-ms-transition:all .5s cubic-bezier(.175,.885,.32,1);-o-transition:all .5s cubic-bezier(.175,.885,.32,1);transition:all .5s cubic-bezier(.175,.885,.32,1)}div.v-pagination>ul>li>a:hover{z-index:2;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-ms-box-shadow:0 0 8px rgba(0,0,0,.2);-o-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2)}div.v-pagination>ul>li.disabled>a,div.v-pagination>ul>li.v-pagination__info>a,div.v-pagination>ul>li.v-pagination__list>a{color:#999;cursor:default}div.v-pagination>ul>li.disabled>a:hover,div.v-pagination>ul>li.v-pagination__info>a:hover,div.v-pagination>ul>li.v-pagination__list>a:hover{color:#999;background-color:#fff;box-shadow:none;z-index:auto}div.v-pagination>ul>li.active>a{cursor:default;color:#999;background-color:#eee}div.v-pagination>ul>li.active>a:hover{box-shadow:none;z-index:auto}div.v-pagination>ul>li:first-child>a{border-left-width:1px;-webkit-border-bottom-left-radius:2px;-moz-border-bottom-left-radius:2px;-ms-border-bottom-left-radius:2px;-o-border-bottom-left-radius:2px;border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;-moz-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-o-border-top-left-radius:2px;border-top-left-radius:2px}div.v-pagination>ul>li:last-child>a{-webkit-border-top-right-radius:2px;-moz-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-o-border-top-right-radius:2px;border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-moz-border-bottom-right-radius:2px;-ms-border-bottom-right-radius:2px;-o-border-bottom-right-radius:2px;border-bottom-right-radius:2px}div.v-pagination>ul>li.v-pagination__list select{margin-left:5px;width:auto!important;font-size:12px;padding:0;border:1px solid #ccc;color:#333;outline:0}div.v-pagination>ul>li.v-pagination__list select:hover{-webkit-box-shadow:0 0 2px rgba(0,0,0,.2);-moz-box-shadow:0 0 2px rgba(0,0,0,.2);-ms-box-shadow:0 0 2px rgba(0,0,0,.2);-o-box-shadow:0 0 2px rgba(0,0,0,.2);box-shadow:0 0 2px rgba(0,0,0,.2)}div.v-pagination>ul>li.v-pagination__list select[disabled]{color:#999}div.v-pagination.v-pagination--no-border>ul{box-shadow:none}div.v-pagination.v-pagination--no-border>ul>li:not(.active):not(.disabled):not(.v-pagination__info):not(.v-pagination__list) a:hover{box-shadow:none;z-index:auto;background-color:#ddd}div.v-pagination.v-pagination--no-border>ul>li.active a{background-color:#f6f6f6;color:#aaa}div.v-pagination.v-pagination--no-border>ul>li>a{border:0}div.v-pagination.v-pagination--no-border>ul>li>a:hover{z-index:auto}",""])},function(e,t){function i(e,t){var i=e[1]||"",n=e[3];if(!n)return i;if(t&&"function"==typeof btoa){var o=a(n);return[i].concat(n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"})).concat([o]).join("\n")}return[i].join("\n")}function a(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var a=i(t,e);return t[2]?"@media "+t[2]+"{"+a+"}":a}).join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var a={},n=0;n<this.length;n++){var o=this[n][0];"number"==typeof o&&(a[o]=!0)}for(n=0;n<e.length;n++){var r=e[n];"number"==typeof r[0]&&a[r[0]]||(i&&!r[2]?r[2]=i:i&&(r[2]="("+r[2]+") and ("+i+")"),t.push(r))}},t}},function(e,t,i){function a(e){for(var t=0;t<e.length;t++){var i=e[t],a=d[i.id];if(a){a.refs++;for(var n=0;n<a.parts.length;n++)a.parts[n](i.parts[n]);for(;n<i.parts.length;n++)a.parts.push(o(i.parts[n]));a.parts.length>i.parts.length&&(a.parts.length=i.parts.length)}else{for(var r=[],n=0;n<i.parts.length;n++)r.push(o(i.parts[n]));d[i.id]={id:i.id,refs:1,parts:r}}}}function n(){var e=document.createElement("style");return e.type="text/css",p.appendChild(e),e}function o(e){var t,i,a=document.querySelector("style["+b+'~="'+e.id+'"]');if(a){if(c)return h;a.parentNode.removeChild(a)}if(x){var o=f++;a=g||(g=n()),t=r.bind(null,a,o,!1),i=r.bind(null,a,o,!0)}else a=n(),t=s.bind(null,a),i=function(){a.parentNode.removeChild(a)};return t(e),function(a){if(a){if(a.css===e.css&&a.media===e.media&&a.sourceMap===e.sourceMap)return;t(e=a)}else i()}}function r(e,t,i,a){var n=i?"":a.css;if(e.styleSheet)e.styleSheet.cssText=m(t,n);else{var o=document.createTextNode(n),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o)}}function s(e,t){var i=t.css,a=t.media,n=t.sourceMap;if(a&&e.setAttribute("media",a),v.ssrId&&e.setAttribute(b,t.id),n&&(i+="\n/*# sourceURL="+n.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u=i(6),d={},p=l&&(document.head||document.getElementsByTagName("head")[0]),g=null,f=0,c=!1,h=function(){},v=null,b="data-vue-ssr-id",x="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,i,n){c=i,v=n||{};var o=u(e,t);return a(o),function(t){for(var i=[],n=0;n<o.length;n++){var r=o[n],s=d[r.id];s.refs--,i.push(s)}t?(o=u(e,t),a(o)):o=[];for(var n=0;n<i.length;n++){var s=i[n];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete d[s.id]}}}};var m=function(){var e=[];return function(t,i){return e[t]=i,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t){for(var i=[],a={},n=0;n<t.length;n++){var o=t[n],r=o[0],s=o[1],l=o[2],u=o[3],d={id:e+":"+n,css:s,media:l,sourceMap:u};a[r]?a[r].parts.push(d):i.push(a[r]={id:r,parts:[d]})}return i}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={cn:{pageLength:"每页记录数 ",pageInfo:"当前显示第 #pageNumber# / #totalPage# 页(共#totalRow#条记录)",first:"首页",previous:"«",next:"»",last:"尾页"},en:{pageLength:"Page length ",pageInfo:"Current #pageNumber# / #totalPage# (total #totalRow# records)",first:"First",previous:"«",next:"»",last:"Last"},de:{pageLength:"Seitenlänge ",pageInfo:"Aktuell #pageNumber# / #totalPage# (gesamt #totalRow# Aufzeichnungen)",first:"Zuerst",previous:"«",next:"»",last:"Letzte"},jp:{pageLength:"ページごとの記録数",pageInfo:"現在の第 #pageNumber# / #totalPage# ページ(全部で #totalRow# 条の記録)",first:"トップページ",previous:"«",next:"»",last:"尾のページ"}}}])});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vPage",[],t):"object"==typeof exports?exports.vPage=t():e.vPage=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(a[i])return a[i].exports;var n=a[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var a={};return t.m=e,t.c=a,t.d=function(e,a,i){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=0)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;var i=a(1),n=function(e){return e&&e.__esModule?e:{default:e}}(i);n.default.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.keys(t).length){var a=n.default.props,i=t.language,o=t.align,r=t.info,s=t.border,u=t.pageNumber,l=t.first,d=t.last,p=t.pageSizeMenu;i&&(a.language.default=i),o&&(a.align.default=o),"boolean"==typeof r&&(a.info.default=r),"boolean"==typeof s&&(a.border.default=s),"boolean"==typeof u&&(a.pageNumber.default=u),"boolean"==typeof l&&(a.first.default=l),"boolean"==typeof d&&(a.last.default=d),void 0!==p&&(a.pageSizeMenu.default=p)}e.component(n.default.name,n.default)},t.Page=n.default,t.default=n.default},function(e,t,a){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t];return a}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0}),a(2);var n=a(7),o=function(e){return e&&e.__esModule?e:{default:e}}(n),r=a(8);t.default={name:"v-page",props:{value:{type:Number,default:0},totalRow:{type:Number,default:0},language:{type:String,default:"cn"},pageSizeMenu:{type:[Boolean,Array],default:function(){return r.defaultPageSizeMenu}},align:{type:String,default:"right"},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!0},info:{type:Boolean,default:!0},pageNumber:{type:Boolean,default:!0},first:{type:Boolean,default:!0},last:{type:Boolean,default:!0}},data:function(){return{current:0,pageSize:!1===this.pageSizeMenu?r.defaultPageSize:this.pageSizeMenu[0],pageNumberSize:r.defaultPageNumberSize,i18n:o.default[this.language]||o.default.cn,lastPageSize:-1}},computed:{totalPage:function(){return Math.ceil(this.totalRow/this.pageSize)},pageNumbers:function(){var e=this.current,t=this.pageNumberSize,a=this.totalPage,i=(0,r.getPageNumberStart)(e,a,t);return Array.apply(null,{length:t}).map(function(e,t){return i+t}).filter(function(e){return e>=r.FIRST&&e<=a})},pageInfo:function(){return this.i18n.pageInfo.replace("#pageNumber#",this.current).replace("#totalPage#",this.totalPage).replace("#totalRow#",this.totalRow)},classes:function(){return{"v-pagination":!0,"v-pagination--no-border":!this.border,"v-pagination--right":"right"===this.align,"v-pagination--center":"center"===this.align,"v-pagination--disabled":this.disabled}},isFirst:function(){return this.current===r.FIRST},isLast:function(){return this.current===this.totalPage}},watch:{value:function(e){"number"==typeof e&&e>0&&this.goPage(e,!1)}},render:function(e){var t=this,a=this.pageNumberGenerator,n=this.current,o=this.i18n,s=this.isFirst,u=this.isLast,l=[];if(Array.isArray(this.pageSizeMenu)&&this.pageSizeMenu.length&&l.push(e("li",{class:"v-pagination__list"},[e("a",[e("span",o.pageLength),e("select",{attrs:{disabled:this.disabled},on:{change:function(e){t.pageSize=Number(e.srcElement.value),t.goPage()}}},this.pageSizeMenu.map(function(t){return e("option",{attrs:{value:t}},t)}))])])),this.info&&l.push(e("li",{class:"v-pagination__info"},[e("a",this.pageInfo)])),this.first){var d={"v-pagination__first":!0,disabled:s};l.push(a(d,r.FIRST,o.first))}var p={"v-pagination__previous":!0,disabled:s};l.push(a(p,n-1,o.previous)),this.pageNumber&&l.push.apply(l,i(this.pageNumbers.map(function(e){return a({active:e===n},e,e)})));var g={"v-pagination__next":!0,disabled:u};if(l.push(a(g,n+1,o.next)),this.last){var f={"v-pagination__last":!0,disabled:u};l.push(a(f,this.totalPage,o.last))}return e("div",{class:this.classes},[e("ul",l)])},methods:{goPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.FIRST,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.disabled&&"number"==typeof e){var a=e<r.FIRST?r.FIRST:e;e>this.totalPage&&this.totalPage>0&&(a=this.totalPage),a===this.current&&this.pageSize===this.lastPageSize||(this.current=a,t&&this.$emit("input",this.current),this.lastPageSize=this.pageSize,this.change())}},reload:function(){this.change()},change:function(){this.$emit("page-change",{pageNumber:this.current,pageSize:Number(this.pageSize)})},pageNumberGenerator:function(e,t,a){var i=this,n={attrs:{href:"javascript:void(0)"},on:{click:function(){return i.goPage(t)}}};return this.$createElement("li",{class:e},[this.$createElement("a",n,a)])}},mounted:function(){this.goPage(this.value||r.FIRST)}}},function(e,t,a){var i=a(3);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var n=a(5).default;n("271f52e6",i,!0,{})},function(e,t,a){t=e.exports=a(4)(!1),t.push([e.i,"div.v-pagination{margin:0;display:block}div.v-pagination.v-pagination--right{text-align:right}div.v-pagination.v-pagination--center{text-align:center}div.v-pagination.v-pagination--disabled li a{color:#999;cursor:default}div.v-pagination.v-pagination--disabled li a:hover{color:#999;background-color:#fff;box-shadow:none;z-index:auto}div.v-pagination.v-pagination--disabled li.active a{background-color:#f6f6f6}div.v-pagination>ul{display:inline-block;list-style:none;margin:0;padding:0;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,.05);-ms-box-shadow:0 1px 2px rgba(0,0,0,.05);-o-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}div.v-pagination>ul>li{text-align:center;margin:0;display:inline}div.v-pagination>ul>li>a{margin:0 0 0 -1px;outline:none;position:relative;border:1px solid #dee2e6;padding:6px 12px;line-height:1.43;box-shadow:none;background-color:#fff;font-size:14px;display:inline-block;text-decoration:none;color:#333;-webkit-transition:all .5s cubic-bezier(.175,.885,.32,1);-moz-transition:all .5s cubic-bezier(.175,.885,.32,1);-ms-transition:all .5s cubic-bezier(.175,.885,.32,1);-o-transition:all .5s cubic-bezier(.175,.885,.32,1);transition:all .5s cubic-bezier(.175,.885,.32,1)}div.v-pagination>ul>li>a:hover{z-index:2;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-ms-box-shadow:0 0 8px rgba(0,0,0,.2);-o-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2)}div.v-pagination>ul>li.disabled>a,div.v-pagination>ul>li.v-pagination__info>a,div.v-pagination>ul>li.v-pagination__list>a{color:#999;cursor:default}div.v-pagination>ul>li.disabled>a:hover,div.v-pagination>ul>li.v-pagination__info>a:hover,div.v-pagination>ul>li.v-pagination__list>a:hover{color:#999;background-color:#fff;box-shadow:none;z-index:auto}div.v-pagination>ul>li.active>a{cursor:default;color:#999;background-color:#eee}div.v-pagination>ul>li.active>a:hover{box-shadow:none;z-index:auto}div.v-pagination>ul>li:first-child>a{border-left-width:1px;-webkit-border-bottom-left-radius:2px;-moz-border-bottom-left-radius:2px;-ms-border-bottom-left-radius:2px;-o-border-bottom-left-radius:2px;border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;-moz-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-o-border-top-left-radius:2px;border-top-left-radius:2px}div.v-pagination>ul>li:last-child>a{-webkit-border-top-right-radius:2px;-moz-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-o-border-top-right-radius:2px;border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-moz-border-bottom-right-radius:2px;-ms-border-bottom-right-radius:2px;-o-border-bottom-right-radius:2px;border-bottom-right-radius:2px}div.v-pagination>ul>li.v-pagination__list select{margin-left:5px;width:auto!important;font-size:12px;padding:0;border:1px solid #ccc;color:#333;outline:0}div.v-pagination>ul>li.v-pagination__list select:hover{-webkit-box-shadow:0 0 2px rgba(0,0,0,.2);-moz-box-shadow:0 0 2px rgba(0,0,0,.2);-ms-box-shadow:0 0 2px rgba(0,0,0,.2);-o-box-shadow:0 0 2px rgba(0,0,0,.2);box-shadow:0 0 2px rgba(0,0,0,.2)}div.v-pagination>ul>li.v-pagination__list select[disabled]{color:#999}div.v-pagination.v-pagination--no-border>ul{box-shadow:none}div.v-pagination.v-pagination--no-border>ul>li:not(.active):not(.disabled):not(.v-pagination__info):not(.v-pagination__list) a:hover{box-shadow:none;z-index:auto;background-color:#ddd}div.v-pagination.v-pagination--no-border>ul>li.active a{background-color:#f6f6f6;color:#aaa}div.v-pagination.v-pagination--no-border>ul>li>a{border:0}div.v-pagination.v-pagination--no-border>ul>li>a:hover{z-index:auto}",""])},function(e,t){function a(e,t){var a=e[1]||"",n=e[3];if(!n)return a;if(t&&"function"==typeof btoa){var o=i(n);return[a].concat(n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"})).concat([o]).join("\n")}return[a].join("\n")}function i(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=a(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,a){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},n=0;n<this.length;n++){var o=this[n][0];"number"==typeof o&&(i[o]=!0)}for(n=0;n<e.length;n++){var r=e[n];"number"==typeof r[0]&&i[r[0]]||(a&&!r[2]?r[2]=a:a&&(r[2]="("+r[2]+") and ("+a+")"),t.push(r))}},t}},function(e,t,a){"use strict";function i(e,t,a,i){v=a,b=i||{};var o=Object(l.a)(e,t);return n(o),function(t){for(var a=[],i=0;i<o.length;i++){var r=o[i],s=p[r.id];s.refs--,a.push(s)}t?(o=Object(l.a)(e,t),n(o)):o=[];for(var i=0;i<a.length;i++){var s=a[i];if(0===s.refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete p[s.id]}}}}function n(e){for(var t=0;t<e.length;t++){var a=e[t],i=p[a.id];if(i){i.refs++;for(var n=0;n<i.parts.length;n++)i.parts[n](a.parts[n]);for(;n<a.parts.length;n++)i.parts.push(r(a.parts[n]));i.parts.length>a.parts.length&&(i.parts.length=a.parts.length)}else{for(var o=[],n=0;n<a.parts.length;n++)o.push(r(a.parts[n]));p[a.id]={id:a.id,refs:1,parts:o}}}}function o(){var e=document.createElement("style");return e.type="text/css",g.appendChild(e),e}function r(e){var t,a,i=document.querySelector("style["+m+'~="'+e.id+'"]');if(i){if(v)return h;i.parentNode.removeChild(i)}if(x){var n=c++;i=f||(f=o()),t=s.bind(null,i,n,!1),a=s.bind(null,i,n,!0)}else i=o(),t=u.bind(null,i),a=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else a()}}function s(e,t,a,i){var n=a?"":i.css;if(e.styleSheet)e.styleSheet.cssText=y(t,n);else{var o=document.createTextNode(n),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o)}}function u(e,t){var a=t.css,i=t.media,n=t.sourceMap;if(i&&e.setAttribute("media",i),b.ssrId&&e.setAttribute(m,t.id),n&&(a+="\n/*# sourceURL="+n.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var l=a(6),d="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!d)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var p={},g=d&&(document.head||document.getElementsByTagName("head")[0]),f=null,c=0,v=!1,h=function(){},b=null,m="data-vue-ssr-id",x="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase()),y=function(){var e=[];return function(t,a){return e[t]=a,e.filter(Boolean).join("\n")}}()},function(e,t,a){"use strict";function i(e,t){for(var a=[],i={},n=0;n<t.length;n++){var o=t[n],r=o[0],s=o[1],u=o[2],l=o[3],d={id:e+":"+n,css:s,media:u,sourceMap:l};i[r]?i[r].parts.push(d):a.push(i[r]={id:r,parts:[d]})}return a}t.a=i},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={cn:{pageLength:"每页记录数 ",pageInfo:"当前显示第 #pageNumber# / #totalPage# 页(共#totalRow#条记录)",first:"首页",previous:"«",next:"»",last:"尾页"},en:{pageLength:"Page length ",pageInfo:"Current #pageNumber# / #totalPage# (total #totalRow# records)",first:"First",previous:"«",next:"»",last:"Last"},de:{pageLength:"Seitenlänge ",pageInfo:"Aktuell #pageNumber# / #totalPage# (gesamt #totalRow# Aufzeichnungen)",first:"Zuerst",previous:"«",next:"»",last:"Letzte"},jp:{pageLength:"ページごとの記録数",pageInfo:"現在の第 #pageNumber# / #totalPage# ページ(全部で #totalRow# 条の記録)",first:"トップページ",previous:"«",next:"»",last:"尾のページ"},pt:{pageLength:"Resultados por página ",pageInfo:"#pageNumber# / #totalPage# (total de #totalRow#)",first:"Início",previous:"<",next:">",last:"Fim"}}},function(e,t,a){"use strict";function i(e,t,a){if(t<=a)return n;var i=Math.floor(a/2),o=t-a+1,r=e-i;return r<n?n:r>o?o:r}Object.defineProperty(t,"__esModule",{value:!0}),t.getPageNumberStart=i;var n=t.FIRST=1,o=(t.defaultPageNumberSize=5,t.defaultPageSize=10);t.defaultPageSizeMenu=[o,20,50,100]}])});
|
|
2
2
|
//# sourceMappingURL=v-page.js.map
|