v-page 3.4.0 → 3.5.0
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 +10 -12
- package/dist/types/PaginationBar.d.ts +142 -0
- package/dist/types/PaginationCore.d.ts +9 -0
- package/dist/types/constants.d.ts +8 -0
- package/dist/types/helper.d.ts +3 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/language.d.ts +4 -0
- package/dist/types/types.d.ts +51 -0
- package/dist/v-page.cjs +2 -0
- package/dist/v-page.js +166 -166
- package/package.json +53 -33
- package/dist/v-page.umd.cjs +0 -2
- package/types/index.d.ts +0 -135
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A simple pagination bar for vue3, including size Menu, i18n support features
|
|
4
4
|
|
|
5
|
-
<img src="
|
|
5
|
+
<img src="./examples/snapshot.png" alt="v-page" height="80">
|
|
6
|
+
<!--  -->
|
|
6
7
|
|
|
7
8
|
If you are using vue `2.x` version, please use [v-page 2.x](https://github.com/TerryZ/v-page/tree/dev-vue-2) version instead
|
|
8
9
|
|
|
@@ -32,17 +33,18 @@ yarn add v-page
|
|
|
32
33
|
pnpm add v-page
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
Include and install plugin in your
|
|
36
|
+
Include and install plugin in your project
|
|
36
37
|
|
|
37
|
-
```
|
|
38
|
+
```ts
|
|
38
39
|
import { createApp } from 'vue'
|
|
39
40
|
import App from './app.vue'
|
|
40
|
-
import
|
|
41
|
+
import PaginationPlugin from 'v-page'
|
|
41
42
|
|
|
42
43
|
const app = createApp(App)
|
|
43
44
|
// install component globally
|
|
44
|
-
app.use(
|
|
45
|
+
app.use(PaginationPlugin, {
|
|
45
46
|
// globally config options
|
|
47
|
+
language: 'cn'
|
|
46
48
|
})
|
|
47
49
|
app.mount('#app')
|
|
48
50
|
```
|
|
@@ -63,21 +65,17 @@ import { PaginationBar } from 'v-page'
|
|
|
63
65
|
|
|
64
66
|
```vue
|
|
65
67
|
<template>
|
|
66
|
-
<PaginationBar
|
|
67
|
-
v-model="pageNumber"
|
|
68
|
-
:total-row="totalRow"
|
|
69
|
-
@change="paginationChange"
|
|
70
|
-
/>
|
|
68
|
+
<PaginationBar v-model="pageNumber" :total-row="totalRow" @change="paginationChange" />
|
|
71
69
|
</template>
|
|
72
70
|
|
|
73
|
-
<script setup lang=
|
|
71
|
+
<script setup lang="ts">
|
|
74
72
|
import { ref } from 'vue'
|
|
75
73
|
import { PaginationBar, type PageInfo } from 'v-page'
|
|
76
74
|
// set default page to 3
|
|
77
75
|
const pageNumber = ref<number>(3)
|
|
78
76
|
const totalRow = ref<number>(100)
|
|
79
77
|
// respond for pagination change
|
|
80
|
-
function paginationChange
|
|
78
|
+
function paginationChange(data: PageInfo) {
|
|
81
79
|
console.log(data) // { pageNumber: 1, pageSize: 10, totalPage: 10 }
|
|
82
80
|
}
|
|
83
81
|
</script>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { SlotsType, PropType } from 'vue';
|
|
2
|
+
import { LanguageKey, AlignDirection, PageInfo, PageSlotData } from './types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
pageSize: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
totalRow: {
|
|
13
|
+
type: NumberConstructor;
|
|
14
|
+
default: number;
|
|
15
|
+
};
|
|
16
|
+
language: {
|
|
17
|
+
type: PropType<LanguageKey>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Pagination alignment direction
|
|
22
|
+
* `left`, `center` and `right`(default)
|
|
23
|
+
*/
|
|
24
|
+
align: {
|
|
25
|
+
type: PropType<AlignDirection>;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
/** Page size list */
|
|
29
|
+
pageSizeMenu: {
|
|
30
|
+
type: PropType<number[]>;
|
|
31
|
+
default: () => number[];
|
|
32
|
+
};
|
|
33
|
+
disabled: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
/** Round style page number button */
|
|
38
|
+
circle: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
border: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Display all records
|
|
48
|
+
*
|
|
49
|
+
* will add `all` option in page size list
|
|
50
|
+
* and the page size will be 0
|
|
51
|
+
*/
|
|
52
|
+
displayAll: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
/** Hide pagination when only have one page */
|
|
57
|
+
hideOnSinglePage: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
default: boolean;
|
|
60
|
+
};
|
|
61
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
62
|
+
'update:modelValue': (value: number) => boolean;
|
|
63
|
+
'update:pageSize': (value: number) => boolean;
|
|
64
|
+
change: (pageInfo: PageInfo) => boolean;
|
|
65
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
66
|
+
modelValue: {
|
|
67
|
+
type: NumberConstructor;
|
|
68
|
+
default: number;
|
|
69
|
+
};
|
|
70
|
+
pageSize: {
|
|
71
|
+
type: NumberConstructor;
|
|
72
|
+
default: number;
|
|
73
|
+
};
|
|
74
|
+
totalRow: {
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
default: number;
|
|
77
|
+
};
|
|
78
|
+
language: {
|
|
79
|
+
type: PropType<LanguageKey>;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Pagination alignment direction
|
|
84
|
+
* `left`, `center` and `right`(default)
|
|
85
|
+
*/
|
|
86
|
+
align: {
|
|
87
|
+
type: PropType<AlignDirection>;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
90
|
+
/** Page size list */
|
|
91
|
+
pageSizeMenu: {
|
|
92
|
+
type: PropType<number[]>;
|
|
93
|
+
default: () => number[];
|
|
94
|
+
};
|
|
95
|
+
disabled: {
|
|
96
|
+
type: BooleanConstructor;
|
|
97
|
+
default: boolean;
|
|
98
|
+
};
|
|
99
|
+
/** Round style page number button */
|
|
100
|
+
circle: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: boolean;
|
|
103
|
+
};
|
|
104
|
+
border: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Display all records
|
|
110
|
+
*
|
|
111
|
+
* will add `all` option in page size list
|
|
112
|
+
* and the page size will be 0
|
|
113
|
+
*/
|
|
114
|
+
displayAll: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
|
+
/** Hide pagination when only have one page */
|
|
119
|
+
hideOnSinglePage: {
|
|
120
|
+
type: BooleanConstructor;
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
123
|
+
}>> & Readonly<{
|
|
124
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
125
|
+
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
126
|
+
onChange?: ((pageInfo: PageInfo) => any) | undefined;
|
|
127
|
+
}>, {
|
|
128
|
+
pageSize: number;
|
|
129
|
+
disabled: boolean;
|
|
130
|
+
displayAll: boolean;
|
|
131
|
+
totalRow: number;
|
|
132
|
+
circle: boolean;
|
|
133
|
+
modelValue: number;
|
|
134
|
+
language: LanguageKey;
|
|
135
|
+
align: AlignDirection;
|
|
136
|
+
pageSizeMenu: number[];
|
|
137
|
+
border: boolean;
|
|
138
|
+
hideOnSinglePage: boolean;
|
|
139
|
+
}, SlotsType<{
|
|
140
|
+
default: PageSlotData;
|
|
141
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
142
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SetupContext } from 'vue';
|
|
2
|
+
export declare function PaginationPageSizes(): import("vue/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function PaginationInfo(): import("vue/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function PaginationPanel(props: unknown, { slots }: SetupContext): import("vue/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function PaginationPageNumbers(): import("vue/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function PaginationFirstPage(): import("vue/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function PaginationPreviousPage(): import("vue/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function PaginationNextPage(): import("vue/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function PaginationLastPage(): import("vue/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const FIRST = 1;
|
|
2
|
+
export declare const DEFAULT_PAGE_NUMBER_SIZE = 5;
|
|
3
|
+
export declare const DEFAULT_PAGE_SIZE = 10;
|
|
4
|
+
export declare const DEFAULT_PAGE_SIZE_MENU: number[];
|
|
5
|
+
export declare const ALL_RECORD_PAGE_SIZE = 0;
|
|
6
|
+
export declare const ALIGN_LEFT: string, ALIGN_CENTER: string, ALIGN_RIGHT: string;
|
|
7
|
+
export declare const keyInternal: unique symbol;
|
|
8
|
+
export declare const keyOptions: unique symbol;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as PaginationBar } from './PaginationBar';
|
|
2
|
+
import { LanguageKey, PaginationGlobalOptions } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './PaginationCore';
|
|
5
|
+
declare const PaginationPlugin: import('vue').ObjectPlugin<[(PaginationGlobalOptions | undefined)?]>, setLanguage: (language?: LanguageKey) => void;
|
|
6
|
+
export { PaginationBar, setLanguage };
|
|
7
|
+
export default PaginationPlugin;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
export type LanguageKey = 'cn' | 'en' | 'de' | 'jp' | 'pt';
|
|
3
|
+
export type AlignDirection = 'left' | 'center' | 'right';
|
|
4
|
+
export interface LanguageRecord {
|
|
5
|
+
pageLength: string;
|
|
6
|
+
pageInfo: string;
|
|
7
|
+
first: string;
|
|
8
|
+
last: string;
|
|
9
|
+
all: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PaginationGlobalOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Component language
|
|
14
|
+
*/
|
|
15
|
+
language?: LanguageKey;
|
|
16
|
+
/**
|
|
17
|
+
* Register component globally
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
register?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface LinkProps {
|
|
23
|
+
classes?: (string | Record<string, boolean>)[];
|
|
24
|
+
pageNumberValue?: number;
|
|
25
|
+
name: string | number;
|
|
26
|
+
}
|
|
27
|
+
export interface PaginationProvided {
|
|
28
|
+
lang: ComputedRef<LanguageRecord>;
|
|
29
|
+
pageSize: Ref<number>;
|
|
30
|
+
totalRow: Ref<number>;
|
|
31
|
+
displayAll: Ref<boolean>;
|
|
32
|
+
disabled: Ref<boolean>;
|
|
33
|
+
sizeList: ComputedRef<number[]>;
|
|
34
|
+
pageNumbers: ComputedRef<number[]>;
|
|
35
|
+
isFirst: ComputedRef<boolean>;
|
|
36
|
+
isLast: ComputedRef<boolean>;
|
|
37
|
+
current: Ref<number>;
|
|
38
|
+
totalPage: ComputedRef<number>;
|
|
39
|
+
changePageNumber: (pNumber: number) => void;
|
|
40
|
+
changePageSize: (val: number) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare interface PageInfo {
|
|
43
|
+
pageNumber: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
totalPage: number;
|
|
46
|
+
}
|
|
47
|
+
export declare interface PageSlotData extends PageInfo {
|
|
48
|
+
totalRow: number;
|
|
49
|
+
isFirst: boolean;
|
|
50
|
+
isLast: boolean;
|
|
51
|
+
}
|
package/dist/v-page.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".v-pagination{display:flex;justify-content:flex-start;box-sizing:border-box}.v-pagination--right{justify-content:flex-end}.v-pagination--center{justify-content:center}.v-pagination.v-pagination--disabled a,.v-pagination.v-pagination--disabled select{color:#ddd!important}.v-pagination.v-pagination--disabled .v-pagination__item a{cursor:default!important}.v-pagination.v-pagination--disabled .v-pagination__item a:hover{background-color:transparent}.v-pagination.v-pagination--disabled.v-pagination--border ul{background-color:#fafafa}.v-pagination.v-pagination--circle .v-pagination__item a{border-radius:50rem;border:1px solid transparent;min-height:30px;min-width:30px;padding:0 .6rem;display:flex;align-items:center;justify-content:center}.v-pagination.v-pagination--circle .v-pagination__item a:hover{border:1px solid #f7f7f7}.v-pagination.v-pagination--circle .v-pagination__item.disabled a:hover{border:1px solid transparent}.v-pagination.v-pagination--circle .v-pagination__item.active a{border:1px solid #ddd!important;background-color:transparent!important;box-shadow:0 1px 3px #0000001a}.v-pagination ul{margin:0;padding:0;display:flex}.v-pagination ul li{list-style:none;display:flex}.v-pagination ul li a{padding:.3rem .6rem;text-decoration:none;line-height:1.3;font-size:14px;margin:0;outline:0;color:#333;border-radius:.5rem;display:inline-flex;align-items:center;cursor:default}.v-pagination ul li.v-pagination__list a,.v-pagination ul li.v-pagination__info a{color:#888}.v-pagination ul li.active a,.v-pagination ul li.disabled a{cursor:default!important}.v-pagination ul li.v-pagination__item a:hover{background-color:#f7f7f7;color:#000;cursor:pointer}.v-pagination ul li.active a{background-color:#eee!important;color:#aaa}.v-pagination ul li.active a:hover{color:#aaa}.v-pagination ul li.disabled a{color:#ddd!important}.v-pagination ul li.disabled a:hover{background-color:transparent}.v-pagination ul li select{width:auto!important;font-size:12px;padding:0;outline:0;margin:0 0 0 5px;border:1px solid #ccc;color:#333;border-radius:.3rem}.v-pagination.v-pagination--border ul{box-shadow:0 1px 2px #0000000d;border-radius:.5rem}.v-pagination.v-pagination--border ul li a{border:1px solid #DEE2E6;border-left:0;border-radius:0}.v-pagination.v-pagination--border ul li:first-child>a{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem;border-left:1px solid #DEE2E6}.v-pagination.v-pagination--border ul li:last-child>a{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.v-pagination.v-pagination--border ul li.active a{color:#aaa;background-color:#eee}")),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=1,H=5,S=10,z=[S,20,50,100],y=0,[ue,oe,J]=["left","center","right"],d=Symbol("pagination-internal"),R=Symbol("pagination-options"),[K,f,Q,W,X]=["cn","en","de","jp","pt"],E={[K]:{pageLength:"每页记录数",pageInfo:"第 #pageNumber#/#totalPage# 页(共#totalRow#条记录)",first:"首页",last:"尾页",all:"全部"},[f]:{pageLength:"Per page",pageInfo:"Page #pageNumber#/#totalPage# (total #totalRow# records)",first:"First",last:"Last",all:"All"},[Q]:{pageLength:"Seitenlänge",pageInfo:"Aktuell #pageNumber#/#totalPage# (gesamt #totalRow# Aufzeichnungen)",first:"Zuerst",last:"Letzte",all:"Alle"},[W]:{pageLength:"ページごとの記録数",pageInfo:"現在の第 #pageNumber#/#totalPage# ページ(全部で #totalRow# 条の記録)",first:"トップページ",last:"尾のページ",all:"すべて"},[X]:{pageLength:"Resultados por página",pageInfo:"#pageNumber#/#totalPage# (total de #totalRow#)",first:"Início",last:"Fim",all:"Todos"}};function Y(a,t,n){if(t<=n)return r;const u=Math.floor(n/2),l=t-n+1,s=a-u;return s<r?r:s>l?l:s}function $(a,t,n){const u=Y(a,t,n);return Array.from({length:n}).map((l,s)=>u+s).filter(l=>l>=r&&l<=t)}function ee(a=f){const t=String(a).toLowerCase();return E[Object.hasOwn(E,t)?t:f]}function j(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!e.isVNode(a)}function b(a,{slots:t}){return e.createVNode("a",{href:"javascript:void(0)"},[t?.default?.()])}function P({classes:a,pageNumberValue:t,name:n}){const{changePageNumber:u}=e.inject(d);return e.createVNode("li",{class:["v-pagination__item",...a]},[e.createVNode(b,{onClick:()=>u(t)},j(n)?n:{default:()=>[n]})])}function F(){const{lang:a,sizeList:t,pageSize:n,disabled:u,displayAll:l,changePageSize:s}=e.inject(d),p=()=>e.createVNode(e.Fragment,null,[t.value.map(o=>e.createVNode("option",{key:o,value:o,selected:n.value===o},[o]))]),g=()=>l.value?e.createVNode("option",{value:y,selected:n.value===y},[a.value.all]):null,V=o=>{const N=o.target;s(Number(N.value))};return e.createVNode("li",{class:"v-pagination__list"},[e.createVNode(b,null,{default:()=>[e.createVNode("span",null,[a.value.pageLength]),e.createVNode("select",{disabled:u.value,onChange:V},[e.createVNode(p,null,null),e.createVNode(g,null,null)])]})])}function w(){const{lang:a,current:t,totalPage:n,totalRow:u}=e.inject(d),l=a.value.pageInfo.replace("#pageNumber#",String(t.value)).replace("#totalPage#",String(n.value)).replace("#totalRow#",String(u.value));return e.createVNode("li",{class:"v-pagination__info"},[e.createVNode(b,null,j(l)?l:{default:()=>[l]})])}function ae(a,{slots:t}){return e.createVNode("li",{class:"v-pagination__slot"},[e.createVNode(b,null,{default:()=>[t?.default?.()]})])}function O(){const{pageNumbers:a,current:t}=e.inject(d);return e.createVNode(e.Fragment,null,[a.value.map(n=>e.createVNode(P,{key:n,classes:[{active:n===t.value}],pageNumberValue:n,name:n},null))])}function B(){const{isFirst:a,lang:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__first",{disabled:a.value}],pageNumberValue:r,name:t.value.first},null)}function M(){const{isFirst:a,current:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__previous",{disabled:a.value}],pageNumberValue:t.value-1,name:"«"},null)}function T(){const{isLast:a,current:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__next",{disabled:a.value}],pageNumberValue:t.value+1,name:"»"},null)}function C(){const{isLast:a,totalPage:t,lang:n}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__last",{disabled:a.value}],pageNumberValue:t.value,name:n.value.last},null)}const L=e.defineComponent({name:"PaginationBar",props:{modelValue:{type:Number,default:0},pageSize:{type:Number,default:S},totalRow:{type:Number,default:0},language:{type:String,default:f},align:{type:String,default:J},pageSizeMenu:{type:[Array],default:()=>z},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},border:{type:Boolean,default:!1},displayAll:{type:Boolean,default:!1},hideOnSinglePage:{type:Boolean,default:!1}},emits:{"update:modelValue":a=>typeof a=="number","update:pageSize":a=>typeof a=="number",change:a=>typeof a<"u"},slots:Object,setup(a,{emit:t,slots:n}){const{pageSizeMenu:u,totalRow:l,displayAll:s,disabled:p}=e.toRefs(a),g=e.ref(0),V=e.ref(H),o=e.ref(a.pageSize??S),N=e.inject(R,e.ref("")),k=()=>a.language!==f?a.language:N.value?N.value:f,G=e.computed(()=>ee(k())),D=e.computed(()=>{const i=Array.from(Array.isArray(u.value)&&u.value.length>0?u.value:z);return o.value!==0&&!i.includes(o.value)&&i.push(o.value),i.sort((v,q)=>v-q)}),c=e.computed(()=>o.value===y?r:Math.ceil(l.value/o.value)),x=e.computed(()=>$(g.value,c.value,V.value)),U=e.computed(()=>({"v-pagination":!0,"v-pagination--right":a.align==="right","v-pagination--center":a.align==="center","v-pagination--disabled":p.value,"v-pagination--border":a.border,"v-pagination--circle":!a.border&&a.circle})),_=e.computed(()=>g.value===r),h=e.computed(()=>g.value===c.value);e.watch(()=>a.modelValue,m),e.watch(()=>a.pageSize,A);function m(i=r){if(p.value||typeof i!="number")return;let v=i<r?r:i;i>c.value&&c.value>0&&(v=c.value),v!==g.value&&(g.value=v,t("update:modelValue",g.value),I())}function A(i){if(typeof i=="number"&&!(i<0)&&i!==o.value){if(o.value=i,t("update:pageSize",o.value),g.value===r)return I();m(r)}}function I(){t("change",{pageNumber:g.value,pageSize:Number(o.value),totalPage:c.value})}function Z(){return n.default?e.createVNode("ul",null,[n.default({pageNumber:g.value,pageSize:o.value,totalPage:c.value,totalRow:l.value,isFirst:_.value,isLast:h.value})]):e.createVNode("ul",null,[e.createVNode(F,null,null),e.createVNode(w,null,null),e.createVNode(B,null,null),e.createVNode(M,null,null),e.createVNode(O,null,null),e.createVNode(T,null,null),e.createVNode(C,null,null)])}return e.onMounted(()=>m(a.modelValue||r)),e.provide(d,{lang:G,pageSize:o,sizeList:D,pageNumbers:x,isFirst:_,isLast:h,current:g,totalPage:c,changePageNumber:m,changePageSize:A,totalRow:l,displayAll:s,disabled:p}),()=>a.hideOnSinglePage&&c.value<=1?null:e.createVNode("div",{class:U.value},[e.createVNode(Z,null,null)])}}),te=()=>{const a=e.ref(f),t={install(u,l){u.provide(R,a),l?.language&&n(l.language),l?.register&&u.component(L.name,L)}},n=u=>{a.value=u||f};return{PaginationPlugin:t,setLanguage:n}},{PaginationPlugin:ne,setLanguage:le}=te();exports.PaginationBar=L;exports.PaginationFirstPage=B;exports.PaginationInfo=w;exports.PaginationLastPage=C;exports.PaginationNextPage=T;exports.PaginationPageNumbers=O;exports.PaginationPageSizes=F;exports.PaginationPanel=ae;exports.PaginationPreviousPage=M;exports.default=ne;exports.setLanguage=le;
|
package/dist/v-page.js
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".v-pagination{display:flex;justify-content:flex-start;box-sizing:border-box}.v-pagination--right{justify-content:flex-end}.v-pagination--center{justify-content:center}.v-pagination.v-pagination--disabled a,.v-pagination.v-pagination--disabled select{color:#ddd!important}.v-pagination.v-pagination--disabled .v-pagination__item a{cursor:default!important}.v-pagination.v-pagination--disabled .v-pagination__item a:hover{background-color:transparent}.v-pagination.v-pagination--disabled.v-pagination--border ul{background-color:#fafafa}.v-pagination.v-pagination--circle .v-pagination__item a{border-radius:50rem;border:1px solid transparent;min-height:30px;min-width:30px;padding:0 .6rem;display:flex;align-items:center;justify-content:center}.v-pagination.v-pagination--circle .v-pagination__item a:hover{border:1px solid #f7f7f7}.v-pagination.v-pagination--circle .v-pagination__item.disabled a:hover{border:1px solid transparent}.v-pagination.v-pagination--circle .v-pagination__item.active a{border:1px solid #ddd!important;background-color:transparent!important;box-shadow:0 1px 3px #0000001a}.v-pagination ul{margin:0;padding:0;display:flex}.v-pagination ul li{list-style:none;display:flex}.v-pagination ul li a{padding:.3rem .6rem;text-decoration:none;line-height:1.3;font-size:14px;margin:0;outline:0;color:#333;border-radius:.5rem;display:inline-flex;align-items:center;cursor:default}.v-pagination ul li.v-pagination__list a,.v-pagination ul li.v-pagination__info a{color:#888}.v-pagination ul li.active a,.v-pagination ul li.disabled a{cursor:default!important}.v-pagination ul li.v-pagination__item a:hover{background-color:#f7f7f7;color:#000;cursor:pointer}.v-pagination ul li.active a{background-color:#eee!important;color:#aaa}.v-pagination ul li.active a:hover{color:#aaa}.v-pagination ul li.disabled a{color:#ddd!important}.v-pagination ul li.disabled a:hover{background-color:transparent}.v-pagination ul li select{width:auto!important;font-size:12px;padding:0;outline:0;margin:0 0 0 5px;border:1px solid #ccc;color:#333;border-radius:.3rem}.v-pagination.v-pagination--border ul{box-shadow:0 1px 2px #0000000d;border-radius:.5rem}.v-pagination.v-pagination--border ul li a{border:1px solid #DEE2E6;border-left:0;border-radius:0}.v-pagination.v-pagination--border ul li:first-child>a{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem;border-left:1px solid #DEE2E6}.v-pagination.v-pagination--border ul li:last-child>a{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.v-pagination.v-pagination--border ul li.active a{color:#aaa;background-color:#eee}")),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
import { inject as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
S,
|
|
6
|
-
J,
|
|
7
|
-
q,
|
|
8
|
-
K
|
|
9
|
-
] = ["cn", "en", "de", "jp", "pt"], B = {
|
|
10
|
-
[H]: {
|
|
2
|
+
import { inject as f, createVNode as t, Fragment as B, isVNode as Z, defineComponent as H, toRefs as J, ref as b, computed as d, watch as w, onMounted as K, provide as q } from "vue";
|
|
3
|
+
const r = 1, Q = 5, _ = 10, F = [_, 20, 50, 100], A = 0, [pe, ve, W] = ["left", "center", "right"], p = /* @__PURE__ */ Symbol("pagination-internal"), C = /* @__PURE__ */ Symbol("pagination-options"), [X, v, Y, $, ee] = ["cn", "en", "de", "jp", "pt"], O = {
|
|
4
|
+
[X]: {
|
|
11
5
|
pageLength: "每页记录数",
|
|
12
6
|
pageInfo: "第 #pageNumber#/#totalPage# 页(共#totalRow#条记录)",
|
|
13
7
|
first: "首页",
|
|
14
8
|
last: "尾页",
|
|
15
9
|
all: "全部"
|
|
16
10
|
},
|
|
17
|
-
[
|
|
11
|
+
[v]: {
|
|
18
12
|
pageLength: "Per page",
|
|
19
13
|
pageInfo: "Page #pageNumber#/#totalPage# (total #totalRow# records)",
|
|
20
14
|
first: "First",
|
|
21
15
|
last: "Last",
|
|
22
16
|
all: "All"
|
|
23
17
|
},
|
|
24
|
-
[
|
|
18
|
+
[Y]: {
|
|
25
19
|
pageLength: "Seitenlänge",
|
|
26
20
|
pageInfo: "Aktuell #pageNumber#/#totalPage# (gesamt #totalRow# Aufzeichnungen)",
|
|
27
21
|
first: "Zuerst",
|
|
28
22
|
last: "Letzte",
|
|
29
23
|
all: "Alle"
|
|
30
24
|
},
|
|
31
|
-
[
|
|
25
|
+
[$]: {
|
|
32
26
|
pageLength: "ページごとの記録数",
|
|
33
27
|
pageInfo: "現在の第 #pageNumber#/#totalPage# ページ(全部で #totalRow# 条の記録)",
|
|
34
28
|
first: "トップページ",
|
|
35
29
|
last: "尾のページ",
|
|
36
30
|
all: "すべて"
|
|
37
31
|
},
|
|
38
|
-
[
|
|
32
|
+
[ee]: {
|
|
39
33
|
pageLength: "Resultados por página",
|
|
40
34
|
pageInfo: "#pageNumber#/#totalPage# (total de #totalRow#)",
|
|
41
35
|
first: "Início",
|
|
@@ -43,125 +37,128 @@ const s = 1, U = 5, L = 10, V = [L, 20, 50, 100], A = 0, [ie, oe, Z] = ["left",
|
|
|
43
37
|
all: "Todos"
|
|
44
38
|
}
|
|
45
39
|
};
|
|
46
|
-
function
|
|
47
|
-
if (a <=
|
|
48
|
-
const
|
|
49
|
-
return
|
|
40
|
+
function ae(e, a, n) {
|
|
41
|
+
if (a <= n) return r;
|
|
42
|
+
const u = Math.floor(n / 2), l = a - n + 1, s = e - u;
|
|
43
|
+
return s < r ? r : s > l ? l : s;
|
|
50
44
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
return Array.from({ length:
|
|
45
|
+
function te(e, a, n) {
|
|
46
|
+
const u = ae(e, a, n);
|
|
47
|
+
return Array.from({ length: n }).map((l, s) => u + s).filter((l) => l >= r && l <= a);
|
|
54
48
|
}
|
|
55
|
-
function
|
|
49
|
+
function ne(e = v) {
|
|
56
50
|
const a = String(e).toLowerCase();
|
|
57
|
-
return
|
|
51
|
+
return O[Object.hasOwn(O, a) ? a : v];
|
|
58
52
|
}
|
|
59
|
-
function
|
|
60
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
53
|
+
function T(e) {
|
|
54
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Z(e);
|
|
61
55
|
}
|
|
62
|
-
function
|
|
56
|
+
function L(e, {
|
|
63
57
|
slots: a
|
|
64
58
|
}) {
|
|
65
|
-
return
|
|
59
|
+
return t("a", {
|
|
66
60
|
href: "javascript:void(0)"
|
|
67
61
|
}, [a?.default?.()]);
|
|
68
62
|
}
|
|
69
|
-
function
|
|
63
|
+
function y({
|
|
70
64
|
classes: e,
|
|
71
65
|
pageNumberValue: a,
|
|
72
|
-
name:
|
|
66
|
+
name: n
|
|
73
67
|
}) {
|
|
74
68
|
const {
|
|
75
|
-
changePageNumber:
|
|
76
|
-
} =
|
|
77
|
-
return
|
|
69
|
+
changePageNumber: u
|
|
70
|
+
} = f(p);
|
|
71
|
+
return t("li", {
|
|
78
72
|
class: ["v-pagination__item", ...e]
|
|
79
|
-
}, [
|
|
80
|
-
onClick: () =>
|
|
81
|
-
},
|
|
82
|
-
default: () => [
|
|
73
|
+
}, [t(L, {
|
|
74
|
+
onClick: () => u(a)
|
|
75
|
+
}, T(n) ? n : {
|
|
76
|
+
default: () => [n]
|
|
83
77
|
})]);
|
|
84
78
|
}
|
|
85
|
-
function
|
|
79
|
+
function le() {
|
|
86
80
|
const {
|
|
87
81
|
lang: e,
|
|
88
82
|
sizeList: a,
|
|
89
|
-
pageSize:
|
|
90
|
-
disabled:
|
|
91
|
-
displayAll:
|
|
92
|
-
changePageSize:
|
|
93
|
-
} =
|
|
94
|
-
key:
|
|
95
|
-
value:
|
|
96
|
-
selected:
|
|
97
|
-
}, [
|
|
83
|
+
pageSize: n,
|
|
84
|
+
disabled: u,
|
|
85
|
+
displayAll: l,
|
|
86
|
+
changePageSize: s
|
|
87
|
+
} = f(p), P = () => t(B, null, [a.value.map((i) => t("option", {
|
|
88
|
+
key: i,
|
|
89
|
+
value: i,
|
|
90
|
+
selected: n.value === i
|
|
91
|
+
}, [i]))]), g = () => l.value ? t("option", {
|
|
98
92
|
value: A,
|
|
99
|
-
selected:
|
|
100
|
-
}, [e.all]) : null
|
|
101
|
-
|
|
93
|
+
selected: n.value === A
|
|
94
|
+
}, [e.value.all]) : null, N = (i) => {
|
|
95
|
+
const S = i.target;
|
|
96
|
+
s(Number(S.value));
|
|
97
|
+
};
|
|
98
|
+
return t("li", {
|
|
102
99
|
class: "v-pagination__list"
|
|
103
|
-
}, [
|
|
104
|
-
default: () => [
|
|
105
|
-
disabled:
|
|
106
|
-
onChange:
|
|
107
|
-
}, [
|
|
100
|
+
}, [t(L, null, {
|
|
101
|
+
default: () => [t("span", null, [e.value.pageLength]), t("select", {
|
|
102
|
+
disabled: u.value,
|
|
103
|
+
onChange: N
|
|
104
|
+
}, [t(P, null, null), t(g, null, null)])]
|
|
108
105
|
})]);
|
|
109
106
|
}
|
|
110
|
-
function
|
|
107
|
+
function ue() {
|
|
111
108
|
const {
|
|
112
109
|
lang: e,
|
|
113
110
|
current: a,
|
|
114
|
-
totalPage:
|
|
115
|
-
totalRow:
|
|
116
|
-
} =
|
|
117
|
-
return
|
|
111
|
+
totalPage: n,
|
|
112
|
+
totalRow: u
|
|
113
|
+
} = f(p), l = e.value.pageInfo.replace("#pageNumber#", String(a.value)).replace("#totalPage#", String(n.value)).replace("#totalRow#", String(u.value));
|
|
114
|
+
return t("li", {
|
|
118
115
|
class: "v-pagination__info"
|
|
119
|
-
}, [
|
|
120
|
-
default: () => [
|
|
116
|
+
}, [t(L, null, T(l) ? l : {
|
|
117
|
+
default: () => [l]
|
|
121
118
|
})]);
|
|
122
119
|
}
|
|
123
|
-
function
|
|
120
|
+
function de(e, {
|
|
124
121
|
slots: a
|
|
125
122
|
}) {
|
|
126
|
-
return
|
|
123
|
+
return t("li", {
|
|
127
124
|
class: "v-pagination__slot"
|
|
128
|
-
}, [
|
|
125
|
+
}, [t(L, null, {
|
|
129
126
|
default: () => [a?.default?.()]
|
|
130
127
|
})]);
|
|
131
128
|
}
|
|
132
|
-
function
|
|
129
|
+
function ie() {
|
|
133
130
|
const {
|
|
134
131
|
pageNumbers: e,
|
|
135
132
|
current: a
|
|
136
|
-
} =
|
|
137
|
-
return e.value.map((
|
|
138
|
-
key:
|
|
133
|
+
} = f(p);
|
|
134
|
+
return t(B, null, [e.value.map((n) => t(y, {
|
|
135
|
+
key: n,
|
|
139
136
|
classes: [{
|
|
140
|
-
active:
|
|
137
|
+
active: n === a.value
|
|
141
138
|
}],
|
|
142
|
-
pageNumberValue:
|
|
143
|
-
name:
|
|
144
|
-
}, null));
|
|
139
|
+
pageNumberValue: n,
|
|
140
|
+
name: n
|
|
141
|
+
}, null))]);
|
|
145
142
|
}
|
|
146
|
-
function
|
|
143
|
+
function oe() {
|
|
147
144
|
const {
|
|
148
145
|
isFirst: e,
|
|
149
146
|
lang: a
|
|
150
|
-
} =
|
|
151
|
-
return
|
|
147
|
+
} = f(p);
|
|
148
|
+
return t(y, {
|
|
152
149
|
classes: ["v-pagination__first", {
|
|
153
150
|
disabled: e.value
|
|
154
151
|
}],
|
|
155
|
-
pageNumberValue:
|
|
156
|
-
name: a.first
|
|
152
|
+
pageNumberValue: r,
|
|
153
|
+
name: a.value.first
|
|
157
154
|
}, null);
|
|
158
155
|
}
|
|
159
|
-
function
|
|
156
|
+
function re() {
|
|
160
157
|
const {
|
|
161
158
|
isFirst: e,
|
|
162
159
|
current: a
|
|
163
|
-
} =
|
|
164
|
-
return
|
|
160
|
+
} = f(p);
|
|
161
|
+
return t(y, {
|
|
165
162
|
classes: ["v-pagination__previous", {
|
|
166
163
|
disabled: e.value
|
|
167
164
|
}],
|
|
@@ -169,12 +166,12 @@ function te() {
|
|
|
169
166
|
name: "«"
|
|
170
167
|
}, null);
|
|
171
168
|
}
|
|
172
|
-
function
|
|
169
|
+
function ge() {
|
|
173
170
|
const {
|
|
174
171
|
isLast: e,
|
|
175
172
|
current: a
|
|
176
|
-
} =
|
|
177
|
-
return
|
|
173
|
+
} = f(p);
|
|
174
|
+
return t(y, {
|
|
178
175
|
classes: ["v-pagination__next", {
|
|
179
176
|
disabled: e.value
|
|
180
177
|
}],
|
|
@@ -182,21 +179,21 @@ function ne() {
|
|
|
182
179
|
name: "»"
|
|
183
180
|
}, null);
|
|
184
181
|
}
|
|
185
|
-
function
|
|
182
|
+
function se() {
|
|
186
183
|
const {
|
|
187
184
|
isLast: e,
|
|
188
185
|
totalPage: a,
|
|
189
|
-
lang:
|
|
190
|
-
} =
|
|
191
|
-
return
|
|
186
|
+
lang: n
|
|
187
|
+
} = f(p);
|
|
188
|
+
return t(y, {
|
|
192
189
|
classes: ["v-pagination__last", {
|
|
193
190
|
disabled: e.value
|
|
194
191
|
}],
|
|
195
192
|
pageNumberValue: a.value,
|
|
196
|
-
name:
|
|
193
|
+
name: n.value.last
|
|
197
194
|
}, null);
|
|
198
195
|
}
|
|
199
|
-
const
|
|
196
|
+
const V = /* @__PURE__ */ H({
|
|
200
197
|
name: "PaginationBar",
|
|
201
198
|
props: {
|
|
202
199
|
modelValue: {
|
|
@@ -205,7 +202,7 @@ const N = /* @__PURE__ */ G({
|
|
|
205
202
|
},
|
|
206
203
|
pageSize: {
|
|
207
204
|
type: Number,
|
|
208
|
-
default:
|
|
205
|
+
default: _
|
|
209
206
|
},
|
|
210
207
|
totalRow: {
|
|
211
208
|
type: Number,
|
|
@@ -213,7 +210,7 @@ const N = /* @__PURE__ */ G({
|
|
|
213
210
|
},
|
|
214
211
|
language: {
|
|
215
212
|
type: String,
|
|
216
|
-
default:
|
|
213
|
+
default: v
|
|
217
214
|
},
|
|
218
215
|
/**
|
|
219
216
|
* Pagination alignment direction
|
|
@@ -221,12 +218,12 @@ const N = /* @__PURE__ */ G({
|
|
|
221
218
|
*/
|
|
222
219
|
align: {
|
|
223
220
|
type: String,
|
|
224
|
-
default:
|
|
221
|
+
default: W
|
|
225
222
|
},
|
|
226
223
|
/** Page size list */
|
|
227
224
|
pageSizeMenu: {
|
|
228
225
|
type: [Array],
|
|
229
|
-
default: () =>
|
|
226
|
+
default: () => F
|
|
230
227
|
},
|
|
231
228
|
disabled: {
|
|
232
229
|
type: Boolean,
|
|
@@ -257,97 +254,100 @@ const N = /* @__PURE__ */ G({
|
|
|
257
254
|
default: !1
|
|
258
255
|
}
|
|
259
256
|
},
|
|
260
|
-
emits:
|
|
257
|
+
emits: {
|
|
258
|
+
"update:modelValue": (e) => typeof e == "number",
|
|
259
|
+
"update:pageSize": (e) => typeof e == "number",
|
|
260
|
+
change: (e) => typeof e < "u"
|
|
261
|
+
},
|
|
262
|
+
slots: Object,
|
|
261
263
|
setup(e, {
|
|
262
264
|
emit: a,
|
|
263
|
-
slots:
|
|
265
|
+
slots: n
|
|
264
266
|
}) {
|
|
265
267
|
const {
|
|
266
|
-
pageSizeMenu:
|
|
267
|
-
totalRow:
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
pageSizeMenu: u,
|
|
269
|
+
totalRow: l,
|
|
270
|
+
displayAll: s,
|
|
271
|
+
disabled: P
|
|
272
|
+
} = J(e), g = b(0), N = b(Q), i = b(e.pageSize ?? _), S = f(C, b("")), j = () => e.language !== v ? e.language : S.value ? S.value : v, k = d(() => ne(j())), G = d(() => {
|
|
273
|
+
const o = Array.from(Array.isArray(u.value) && u.value.length > 0 ? u.value : F);
|
|
274
|
+
return i.value !== 0 && !o.includes(i.value) && o.push(i.value), o.sort((m, U) => m - U);
|
|
275
|
+
}), c = d(() => i.value === A ? r : Math.ceil(l.value / i.value)), M = d(() => te(g.value, c.value, N.value)), D = d(() => ({
|
|
272
276
|
"v-pagination": !0,
|
|
273
277
|
"v-pagination--right": e.align === "right",
|
|
274
278
|
"v-pagination--center": e.align === "center",
|
|
275
|
-
"v-pagination--disabled":
|
|
279
|
+
"v-pagination--disabled": P.value,
|
|
276
280
|
"v-pagination--border": e.border,
|
|
277
281
|
"v-pagination--circle": !e.border && e.circle
|
|
278
|
-
})),
|
|
279
|
-
|
|
280
|
-
function
|
|
281
|
-
if (
|
|
282
|
-
let
|
|
283
|
-
|
|
282
|
+
})), E = d(() => g.value === r), I = d(() => g.value === c.value);
|
|
283
|
+
w(() => e.modelValue, h), w(() => e.pageSize, R);
|
|
284
|
+
function h(o = r) {
|
|
285
|
+
if (P.value || typeof o != "number") return;
|
|
286
|
+
let m = o < r ? r : o;
|
|
287
|
+
o > c.value && c.value > 0 && (m = c.value), m !== g.value && (g.value = m, a("update:modelValue", g.value), z());
|
|
284
288
|
}
|
|
285
|
-
function R(
|
|
286
|
-
if (typeof
|
|
287
|
-
if (
|
|
288
|
-
return
|
|
289
|
-
|
|
289
|
+
function R(o) {
|
|
290
|
+
if (typeof o == "number" && !(o < 0) && o !== i.value) {
|
|
291
|
+
if (i.value = o, a("update:pageSize", i.value), g.value === r)
|
|
292
|
+
return z();
|
|
293
|
+
h(r);
|
|
290
294
|
}
|
|
291
295
|
}
|
|
292
|
-
function
|
|
296
|
+
function z() {
|
|
293
297
|
a("change", {
|
|
294
|
-
pageNumber:
|
|
295
|
-
pageSize: Number(
|
|
296
|
-
totalPage:
|
|
298
|
+
pageNumber: g.value,
|
|
299
|
+
pageSize: Number(i.value),
|
|
300
|
+
totalPage: c.value
|
|
297
301
|
});
|
|
298
302
|
}
|
|
299
|
-
function
|
|
300
|
-
return
|
|
301
|
-
pageNumber:
|
|
302
|
-
pageSize:
|
|
303
|
-
totalPage:
|
|
304
|
-
totalRow:
|
|
305
|
-
isFirst:
|
|
306
|
-
isLast:
|
|
307
|
-
}) :
|
|
303
|
+
function x() {
|
|
304
|
+
return n.default ? t("ul", null, [n.default({
|
|
305
|
+
pageNumber: g.value,
|
|
306
|
+
pageSize: i.value,
|
|
307
|
+
totalPage: c.value,
|
|
308
|
+
totalRow: l.value,
|
|
309
|
+
isFirst: E.value,
|
|
310
|
+
isLast: I.value
|
|
311
|
+
})]) : t("ul", null, [t(le, null, null), t(ue, null, null), t(oe, null, null), t(re, null, null), t(ie, null, null), t(ge, null, null), t(se, null, null)]);
|
|
308
312
|
}
|
|
309
|
-
return
|
|
310
|
-
lang:
|
|
311
|
-
pageSize:
|
|
312
|
-
sizeList:
|
|
313
|
-
pageNumbers:
|
|
314
|
-
isFirst:
|
|
315
|
-
isLast:
|
|
316
|
-
current:
|
|
317
|
-
totalPage:
|
|
318
|
-
changePageNumber:
|
|
313
|
+
return K(() => h(e.modelValue || r)), q(p, {
|
|
314
|
+
lang: k,
|
|
315
|
+
pageSize: i,
|
|
316
|
+
sizeList: G,
|
|
317
|
+
pageNumbers: M,
|
|
318
|
+
isFirst: E,
|
|
319
|
+
isLast: I,
|
|
320
|
+
current: g,
|
|
321
|
+
totalPage: c,
|
|
322
|
+
changePageNumber: h,
|
|
319
323
|
changePageSize: R,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
+
totalRow: l,
|
|
325
|
+
displayAll: s,
|
|
326
|
+
disabled: P
|
|
327
|
+
}), () => e.hideOnSinglePage && c.value <= 1 ? null : t("div", {
|
|
328
|
+
class: D.value
|
|
329
|
+
}, [t(x, null, null)]);
|
|
324
330
|
}
|
|
325
|
-
})
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
last: g,
|
|
336
|
-
pageSizeMenu: P
|
|
337
|
-
} = a;
|
|
338
|
-
i && (t.language.default = i), u && (t.align.default = u), typeof l == "boolean" && (t.info.default = l), typeof p == "boolean" && (t.border.default = p), typeof o == "boolean" && (t.pageNumber.default = o), typeof c == "boolean" && (t.first.default = c), typeof g == "boolean" && (t.last.default = g), typeof P < "u" && (t.pageSizeMenu.default = P);
|
|
339
|
-
}
|
|
340
|
-
e.component(N.name, N);
|
|
341
|
-
};
|
|
331
|
+
}), ce = () => {
|
|
332
|
+
const e = b(v), a = {
|
|
333
|
+
install(u, l) {
|
|
334
|
+
u.provide(C, e), l?.language && n(l.language), l?.register && u.component(V.name, V);
|
|
335
|
+
}
|
|
336
|
+
}, n = (u) => {
|
|
337
|
+
e.value = u || v;
|
|
338
|
+
};
|
|
339
|
+
return { PaginationPlugin: a, setLanguage: n };
|
|
340
|
+
}, { PaginationPlugin: Pe, setLanguage: me } = ce();
|
|
342
341
|
export {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
342
|
+
V as PaginationBar,
|
|
343
|
+
oe as PaginationFirstPage,
|
|
344
|
+
ue as PaginationInfo,
|
|
345
|
+
se as PaginationLastPage,
|
|
346
|
+
ge as PaginationNextPage,
|
|
347
|
+
ie as PaginationPageNumbers,
|
|
348
|
+
le as PaginationPageSizes,
|
|
349
|
+
de as PaginationPanel,
|
|
350
|
+
re as PaginationPreviousPage,
|
|
351
|
+
Pe as default,
|
|
352
|
+
me as setLanguage
|
|
353
353
|
};
|
package/package.json
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-page",
|
|
3
3
|
"description": "A simple pagination bar",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.5.0",
|
|
5
5
|
"author": "TerryZ <terry5@foxmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
|
-
"./dist"
|
|
9
|
-
"./types"
|
|
8
|
+
"./dist"
|
|
10
9
|
],
|
|
11
|
-
"
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/v-page.cjs",
|
|
12
14
|
"module": "./dist/v-page.js",
|
|
13
15
|
"exports": {
|
|
14
16
|
".": {
|
|
15
17
|
"import": {
|
|
16
|
-
"types": "./types/index.d.ts",
|
|
18
|
+
"types": "./dist/types/index.d.ts",
|
|
17
19
|
"default": "./dist/v-page.js"
|
|
18
20
|
},
|
|
19
|
-
"require": "./dist/v-page.
|
|
21
|
+
"require": "./dist/v-page.cjs"
|
|
20
22
|
},
|
|
21
23
|
"./types": {
|
|
22
24
|
"import": {
|
|
23
|
-
"types": "./types/index.d.ts"
|
|
25
|
+
"types": "./dist/types/index.d.ts"
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
"typings": "./types/index.d.ts",
|
|
29
|
+
"typings": "./dist/types/index.d.ts",
|
|
28
30
|
"license": "MIT",
|
|
29
|
-
"packageManager": "pnpm@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"coverage": "vitest run --coverage",
|
|
36
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
|
37
|
-
},
|
|
31
|
+
"packageManager": "pnpm@10.27.0",
|
|
32
|
+
"browserslist": [
|
|
33
|
+
"> 1%",
|
|
34
|
+
"last 2 versions",
|
|
35
|
+
"not dead"
|
|
36
|
+
],
|
|
38
37
|
"repository": {
|
|
39
38
|
"type": "git",
|
|
40
39
|
"url": "git+https://github.com/TerryZ/v-page.git"
|
|
@@ -47,29 +46,50 @@
|
|
|
47
46
|
"page",
|
|
48
47
|
"pagination"
|
|
49
48
|
],
|
|
50
|
-
"
|
|
51
|
-
"
|
|
49
|
+
"scripts": {
|
|
50
|
+
"dev": "vite",
|
|
51
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
52
|
+
"preview": "vite preview",
|
|
53
|
+
"test:unit": "vitest",
|
|
54
|
+
"build-only": "vite build",
|
|
55
|
+
"type-check": "vue-tsc --build",
|
|
56
|
+
"lint": "eslint . --fix --cache",
|
|
57
|
+
"coverage": "vitest run --coverage",
|
|
58
|
+
"format": "prettier --write --experimental-cli src/"
|
|
52
59
|
},
|
|
53
60
|
"dependencies": {
|
|
54
|
-
"vue": "^3.5.
|
|
61
|
+
"vue": "^3.5.16"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"vue": "^3.5.0"
|
|
55
65
|
},
|
|
56
66
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
67
|
+
"@tsconfig/node24": "^24.0.3",
|
|
68
|
+
"@types/jsdom": "^27.0.0",
|
|
69
|
+
"@types/node": "^24.10.4",
|
|
70
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
71
|
+
"@vitejs/plugin-vue-jsx": "^5.1.3",
|
|
72
|
+
"@vitest/eslint-plugin": "^1.6.4",
|
|
73
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
74
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
75
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
62
76
|
"@vue/test-utils": "^2.4.6",
|
|
77
|
+
"@vue/tsconfig": "^0.8.1",
|
|
63
78
|
"bootstrap": "^5.3.8",
|
|
64
|
-
"eslint": "^
|
|
65
|
-
"eslint-plugin-vue": "
|
|
79
|
+
"eslint": "^9.39.2",
|
|
80
|
+
"eslint-plugin-vue": "~10.6.2",
|
|
81
|
+
"jiti": "^2.6.1",
|
|
82
|
+
"jsdom": "^27.3.0",
|
|
83
|
+
"npm-run-all2": "^8.0.4",
|
|
84
|
+
"prettier": "3.7.4",
|
|
85
|
+
"sass": "^1.97.1",
|
|
66
86
|
"postcss": "^8.5.6",
|
|
67
87
|
"autoprefixer": "^10.4.21",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"typescript": "^5.9.3",
|
|
71
|
-
"vite": "^7.1.9",
|
|
88
|
+
"typescript": "~5.8.3",
|
|
89
|
+
"vite": "^7.3.0",
|
|
72
90
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
73
|
-
"
|
|
91
|
+
"vite-plugin-dts": "^4.5.4",
|
|
92
|
+
"vitest": "^4.0.16",
|
|
93
|
+
"vue-tsc": "^3.2.1"
|
|
74
94
|
}
|
|
75
|
-
}
|
|
95
|
+
}
|
package/dist/v-page.umd.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".v-pagination{display:flex;justify-content:flex-start;box-sizing:border-box}.v-pagination--right{justify-content:flex-end}.v-pagination--center{justify-content:center}.v-pagination.v-pagination--disabled a,.v-pagination.v-pagination--disabled select{color:#ddd!important}.v-pagination.v-pagination--disabled .v-pagination__item a{cursor:default!important}.v-pagination.v-pagination--disabled .v-pagination__item a:hover{background-color:transparent}.v-pagination.v-pagination--disabled.v-pagination--border ul{background-color:#fafafa}.v-pagination.v-pagination--circle .v-pagination__item a{border-radius:50rem;border:1px solid transparent;min-height:30px;min-width:30px;padding:0 .6rem;display:flex;align-items:center;justify-content:center}.v-pagination.v-pagination--circle .v-pagination__item a:hover{border:1px solid #f7f7f7}.v-pagination.v-pagination--circle .v-pagination__item.disabled a:hover{border:1px solid transparent}.v-pagination.v-pagination--circle .v-pagination__item.active a{border:1px solid #ddd!important;background-color:transparent!important;box-shadow:0 1px 3px #0000001a}.v-pagination ul{margin:0;padding:0;display:flex}.v-pagination ul li{list-style:none;display:flex}.v-pagination ul li a{padding:.3rem .6rem;text-decoration:none;line-height:1.3;font-size:14px;margin:0;outline:0;color:#333;border-radius:.5rem;display:inline-flex;align-items:center;cursor:default}.v-pagination ul li.v-pagination__list a,.v-pagination ul li.v-pagination__info a{color:#888}.v-pagination ul li.active a,.v-pagination ul li.disabled a{cursor:default!important}.v-pagination ul li.v-pagination__item a:hover{background-color:#f7f7f7;color:#000;cursor:pointer}.v-pagination ul li.active a{background-color:#eee!important;color:#aaa}.v-pagination ul li.active a:hover{color:#aaa}.v-pagination ul li.disabled a{color:#ddd!important}.v-pagination ul li.disabled a:hover{background-color:transparent}.v-pagination ul li select{width:auto!important;font-size:12px;padding:0;outline:0;margin:0 0 0 5px;border:1px solid #ccc;color:#333;border-radius:.3rem}.v-pagination.v-pagination--border ul{box-shadow:0 1px 2px #0000000d;border-radius:.5rem}.v-pagination.v-pagination--border ul li a{border:1px solid #DEE2E6;border-left:0;border-radius:0}.v-pagination.v-pagination--border ul li:first-child>a{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem;border-left:1px solid #DEE2E6}.v-pagination.v-pagination--border ul li:last-child>a{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.v-pagination.v-pagination--border ul li.active a{color:#aaa;background-color:#eee}")),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.VPage={},o.Vue))})(this,(function(o,e){"use strict";const y=[10,20,50,100],_=0,[Y,$,M]=["left","center","right"],d=Symbol("pagination"),[G,m,O,D,U]=["cn","en","de","jp","pt"],I={[G]:{pageLength:"每页记录数",pageInfo:"第 #pageNumber#/#totalPage# 页(共#totalRow#条记录)",first:"首页",last:"尾页",all:"全部"},[m]:{pageLength:"Per page",pageInfo:"Page #pageNumber#/#totalPage# (total #totalRow# records)",first:"First",last:"Last",all:"All"},[O]:{pageLength:"Seitenlänge",pageInfo:"Aktuell #pageNumber#/#totalPage# (gesamt #totalRow# Aufzeichnungen)",first:"Zuerst",last:"Letzte",all:"Alle"},[D]:{pageLength:"ページごとの記録数",pageInfo:"現在の第 #pageNumber#/#totalPage# ページ(全部で #totalRow# 条の記録)",first:"トップページ",last:"尾のページ",all:"すべて"},[U]:{pageLength:"Resultados por página",pageInfo:"#pageNumber#/#totalPage# (total de #totalRow#)",first:"Início",last:"Fim",all:"Todos"}};function Z(a,t,n){if(t<=n)return 1;const r=Math.floor(n/2),i=t-n+1,l=a-r;return l<1?1:l>i?i:l}function C(a,t,n){const r=Z(a,t,n);return Array.from({length:n}).map((i,l)=>r+l).filter(i=>i>=1&&i<=t)}function k(a=m){const t=String(a).toLowerCase();return I[Object.hasOwn(I,t)?t:m]}function h(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!e.isVNode(a)}function b(a,{slots:t}){return e.createVNode("a",{href:"javascript:void(0)"},[t?.default?.()])}function P({classes:a,pageNumberValue:t,name:n}){const{changePageNumber:r}=e.inject(d);return e.createVNode("li",{class:["v-pagination__item",...a]},[e.createVNode(b,{onClick:()=>r(t)},h(n)?n:{default:()=>[n]})])}function R(){const{lang:a,sizeList:t,pageSize:n,disabled:r,displayAll:i,changePageSize:l}=e.inject(d),p=()=>t.value.map(s=>e.createVNode("option",{key:s,value:s,selected:n.value===s},[s])),u=()=>i.value?e.createVNode("option",{value:_,selected:n.value===_},[a.all]):null;return e.createVNode("li",{class:"v-pagination__list"},[e.createVNode(b,null,{default:()=>[e.createVNode("span",null,[a.pageLength]),e.createVNode("select",{disabled:r.value,onChange:s=>l(Number(s.target.value))},[e.createVNode(p,null,null),e.createVNode(u,null,null)])]})])}function A(){const{lang:a,current:t,totalPage:n,totalRow:r}=e.inject(d),i=a.pageInfo.replace("#pageNumber#",t.value).replace("#totalPage#",n.value).replace("#totalRow#",r.value);return e.createVNode("li",{class:"v-pagination__info"},[e.createVNode(b,null,h(i)?i:{default:()=>[i]})])}function q(a,{slots:t}){return e.createVNode("li",{class:"v-pagination__slot"},[e.createVNode(b,null,{default:()=>[t?.default?.()]})])}function E(){const{pageNumbers:a,current:t}=e.inject(d);return a.value.map(n=>e.createVNode(P,{key:n,classes:[{active:n===t.value}],pageNumberValue:n,name:n},null))}function L(){const{isFirst:a,lang:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__first",{disabled:a.value}],pageNumberValue:1,name:t.first},null)}function F(){const{isFirst:a,current:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__previous",{disabled:a.value}],pageNumberValue:t.value-1,name:"«"},null)}function T(){const{isLast:a,current:t}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__next",{disabled:a.value}],pageNumberValue:t.value+1,name:"»"},null)}function z(){const{isLast:a,totalPage:t,lang:n}=e.inject(d);return e.createVNode(P,{classes:["v-pagination__last",{disabled:a.value}],pageNumberValue:t.value,name:n.last},null)}const f=e.defineComponent({name:"PaginationBar",props:{modelValue:{type:Number,default:0},pageSize:{type:Number,default:10},totalRow:{type:Number,default:0},language:{type:String,default:m},align:{type:String,default:M},pageSizeMenu:{type:[Array],default:()=>y},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},border:{type:Boolean,default:!1},displayAll:{type:Boolean,default:!1},hideOnSinglePage:{type:Boolean,default:!1}},emits:["update:modelValue","update:pageSize","change"],setup(a,{emit:t,slots:n}){const{pageSizeMenu:r,totalRow:i}=e.toRefs(a),l=e.ref(0),p=e.ref(5),u=e.ref(a.pageSize??10),s=e.computed(()=>{const g=Array.from(Array.isArray(r.value)&&r.value.length>0?r.value:y);return u.value!==0&&!g.includes(u.value)&&g.push(u.value),g.sort((N,K)=>N-K)}),c=e.computed(()=>u.value===_?1:Math.ceil(i.value/u.value)),S=e.computed(()=>C(l.value,c.value,p.value)),H=e.computed(()=>({"v-pagination":!0,"v-pagination--right":a.align==="right","v-pagination--center":a.align==="center","v-pagination--disabled":a.disabled,"v-pagination--border":a.border,"v-pagination--circle":!a.border&&a.circle})),j=e.computed(()=>l.value===1),v=e.computed(()=>l.value===c.value);e.watch(()=>a.modelValue,V),e.watch(()=>a.pageSize,w);function V(g=1){if(a.disabled||typeof g!="number")return;let N=g<1?1:g;g>c.value&&c.value>0&&(N=c.value),N!==l.value&&(l.value=N,t("update:modelValue",l.value),B())}function w(g){if(typeof g=="number"&&!(g<0)&&g!==u.value){if(u.value=g,t("update:pageSize",u.value),l.value===1)return B();V(1)}}function B(){t("change",{pageNumber:l.value,pageSize:Number(u.value),totalPage:c.value})}function J(){return n.default?n.default({pageNumber:l.value,pageSize:u.value,totalPage:c.value,totalRow:i.value,isFirst:j.value,isLast:v.value}):e.createVNode(e.Fragment,null,[e.createVNode(R,null,null),e.createVNode(A,null,null),e.createVNode(L,null,null),e.createVNode(F,null,null),e.createVNode(E,null,null),e.createVNode(T,null,null),e.createVNode(z,null,null)])}return e.onMounted(()=>V(a.modelValue||1)),e.provide(d,{lang:k(a.language),pageSize:u,sizeList:s,pageNumbers:S,isFirst:j,isLast:v,current:l,totalPage:c,changePageNumber:V,changePageSize:w,...e.toRefs(a)}),()=>a.hideOnSinglePage&&c.value<=1?null:e.createVNode("div",{class:H.value},[e.createVNode("ul",null,[e.createVNode(J,null,null)])])}});f.install=(a,t={})=>{if(Object.keys(t).length){const{props:n}=f,{language:r,align:i,info:l,border:p,pageNumber:u,first:s,last:c,pageSizeMenu:S}=t;r&&(n.language.default=r),i&&(n.align.default=i),typeof l=="boolean"&&(n.info.default=l),typeof p=="boolean"&&(n.border.default=p),typeof u=="boolean"&&(n.pageNumber.default=u),typeof s=="boolean"&&(n.first.default=s),typeof c=="boolean"&&(n.last.default=c),typeof S<"u"&&(n.pageSizeMenu.default=S)}a.component(f.name,f)},o.PaginationBar=f,o.PaginationFirstPage=L,o.PaginationInfo=A,o.PaginationLastPage=z,o.PaginationNextPage=T,o.PaginationPageNumbers=E,o.PaginationPageSizes=R,o.PaginationPanel=q,o.PaginationPreviousPage=F,o.default=f,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/types/index.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AllowedComponentProps,
|
|
3
|
-
ComponentCustomProps,
|
|
4
|
-
VNodeProps,
|
|
5
|
-
VNode
|
|
6
|
-
} from 'vue'
|
|
7
|
-
|
|
8
|
-
export declare interface PageInfo {
|
|
9
|
-
pageNumber: number
|
|
10
|
-
pageSize: number
|
|
11
|
-
totalPage: number
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export declare interface PageSlotData {
|
|
15
|
-
pageNumber: number
|
|
16
|
-
pageSize: number
|
|
17
|
-
totalPage: number
|
|
18
|
-
totalRow: number
|
|
19
|
-
isFirst: boolean
|
|
20
|
-
isLast: boolean
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Pagination plugin for Vue
|
|
25
|
-
*/
|
|
26
|
-
declare interface PaginationProps {
|
|
27
|
-
/**
|
|
28
|
-
* The number of current page
|
|
29
|
-
*/
|
|
30
|
-
modelValue?: number
|
|
31
|
-
/**
|
|
32
|
-
* The number of total record
|
|
33
|
-
*/
|
|
34
|
-
totalRow: number
|
|
35
|
-
/**
|
|
36
|
-
* The number of page size
|
|
37
|
-
* @default 10
|
|
38
|
-
*/
|
|
39
|
-
pageSize?: number
|
|
40
|
-
/**
|
|
41
|
-
* v-page language
|
|
42
|
-
* @default `en`
|
|
43
|
-
*/
|
|
44
|
-
language?: 'cn' | 'en' | 'de' | 'jp' | 'pt'
|
|
45
|
-
/**
|
|
46
|
-
* Page size list
|
|
47
|
-
* @default [10, 20, 50, 100]
|
|
48
|
-
*/
|
|
49
|
-
pageSizeMenu?: number[]
|
|
50
|
-
/**
|
|
51
|
-
* Alignment direction
|
|
52
|
-
* @default `right`
|
|
53
|
-
*/
|
|
54
|
-
align?: 'left' | 'right' | 'center'
|
|
55
|
-
/**
|
|
56
|
-
* Disabled the pagination
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
disabled?: boolean
|
|
60
|
-
/**
|
|
61
|
-
* Whether to display the border
|
|
62
|
-
* @default true
|
|
63
|
-
*/
|
|
64
|
-
border?: boolean
|
|
65
|
-
/**
|
|
66
|
-
* Round style page number button
|
|
67
|
-
* @default false
|
|
68
|
-
*/
|
|
69
|
-
circle?: boolean
|
|
70
|
-
/**
|
|
71
|
-
* Whether add `All` item in page length list
|
|
72
|
-
* @default false
|
|
73
|
-
*/
|
|
74
|
-
displayAll?: boolean
|
|
75
|
-
/**
|
|
76
|
-
* Hide pagination when only have one page
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
hideOnSinglePage?: boolean
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** Update pageNumber value */
|
|
83
|
-
type EmitUpdateModelValue = (event: "update:modelValue", value: number) => void
|
|
84
|
-
/** Update pageSize value */
|
|
85
|
-
type EmitUpdatePageSize = (event: "update:pageSize", value: number) => void
|
|
86
|
-
/** The event respond pageNumber or pageSize change */
|
|
87
|
-
type EmitChange = (event: "change", value: PageInfo) => void
|
|
88
|
-
|
|
89
|
-
type ComponentProps = AllowedComponentProps & ComponentCustomProps & VNodeProps
|
|
90
|
-
|
|
91
|
-
declare interface PaginationBar {
|
|
92
|
-
new (): {
|
|
93
|
-
$props: ComponentProps & PaginationProps
|
|
94
|
-
$emit: EmitUpdateModelValue & EmitUpdatePageSize & EmitChange
|
|
95
|
-
$slots: {
|
|
96
|
-
default?: (defaultSlotData: PageSlotData) => VNode[]
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
declare interface PaginationComponent {
|
|
101
|
-
new (): {
|
|
102
|
-
$props: ComponentProps
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
declare interface PaginationPanel {
|
|
106
|
-
new (): {
|
|
107
|
-
$props: ComponentProps
|
|
108
|
-
$slots: {
|
|
109
|
-
default?: () => VNode[]
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
declare const PaginationBar: PaginationBar
|
|
114
|
-
declare const PaginationPageSizes: PaginationComponent
|
|
115
|
-
declare const PaginationInfo: PaginationComponent
|
|
116
|
-
declare const PaginationPageNumbers: PaginationComponent
|
|
117
|
-
declare const PaginationFirstPage: PaginationComponent
|
|
118
|
-
declare const PaginationPreviousPage: PaginationComponent
|
|
119
|
-
declare const PaginationNextPage: PaginationComponent
|
|
120
|
-
declare const PaginationLastPage: PaginationComponent
|
|
121
|
-
declare const PaginationPanel: PaginationPanel
|
|
122
|
-
|
|
123
|
-
export {
|
|
124
|
-
PaginationBar,
|
|
125
|
-
PaginationPageSizes,
|
|
126
|
-
PaginationInfo,
|
|
127
|
-
PaginationPageNumbers,
|
|
128
|
-
PaginationFirstPage,
|
|
129
|
-
PaginationPreviousPage,
|
|
130
|
-
PaginationNextPage,
|
|
131
|
-
PaginationLastPage,
|
|
132
|
-
PaginationPanel
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export default PaginationBar
|