1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _extends from 'babel-runtime/helpers/extends';
import PropTypes from '../_util/vue-types';
import VcSelect from '../select';
import MiniSelect from './MiniSelect';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import { getOptionProps } from '../_util/props-util';
import VcPagination from '../vc-pagination';
import Icon from '../icon';
export var PaginationProps = function PaginationProps() {
return {
total: PropTypes.number,
defaultCurrent: PropTypes.number,
current: PropTypes.number,
defaultPageSize: PropTypes.number,
pageSize: PropTypes.number,
hideOnSinglePage: PropTypes.bool,
showSizeChanger: PropTypes.bool,
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
buildOptionText: PropTypes.func,
showSizeChange: PropTypes.func,
showQuickJumper: PropTypes.bool,
showTotal: PropTypes.any,
size: PropTypes.string,
simple: PropTypes.bool,
locale: PropTypes.object,
prefixCls: PropTypes.string,
selectPrefixCls: PropTypes.string,
itemRender: PropTypes.any,
role: PropTypes.string
};
};
export var PaginationConfig = function PaginationConfig() {
return _extends({}, PaginationProps(), {
position: PropTypes.oneOf(['top', 'bottom', 'both'])
});
};
export default {
name: 'APagination',
model: {
prop: 'current',
event: 'change.current'
},
props: _extends({}, PaginationProps(), {
prefixCls: PropTypes.string.def('ant-pagination'),
selectPrefixCls: PropTypes.string.def('ant-select')
}),
methods: {
getIconsProps: function getIconsProps() {
var h = this.$createElement;
var prefixCls = this.$props.prefixCls;
var prevIcon = h(
'a',
{ 'class': prefixCls + '-item-link' },
[h(Icon, {
attrs: { type: 'left' }
})]
);
var nextIcon = h(
'a',
{ 'class': prefixCls + '-item-link' },
[h(Icon, {
attrs: { type: 'right' }
})]
);
var jumpPrevIcon = h(
'a',
{ 'class': prefixCls + '-item-link' },
[h(
'div',
{ 'class': prefixCls + '-item-container' },
[h(Icon, { 'class': prefixCls + '-item-link-icon', attrs: { type: 'double-left' }
}), h(
'span',
{ 'class': prefixCls + '-item-ellipsis' },
['\u2022\u2022\u2022']
)]
)]
);
var jumpNextIcon = h(
'a',
{ 'class': prefixCls + '-item-link' },
[h(
'div',
{ 'class': prefixCls + '-item-container' },
[h(Icon, { 'class': prefixCls + '-item-link-icon', attrs: { type: 'double-right' }
}), h(
'span',
{ 'class': prefixCls + '-item-ellipsis' },
['\u2022\u2022\u2022']
)]
)]
);
return {
prevIcon: prevIcon,
nextIcon: nextIcon,
jumpPrevIcon: jumpPrevIcon,
jumpNextIcon: jumpNextIcon
};
},
renderPagination: function renderPagination(contextLocale) {
var h = this.$createElement;
var _getOptionProps = getOptionProps(this),
buildOptionText = _getOptionProps.buildOptionText,
size = _getOptionProps.size,
customLocale = _getOptionProps.locale,
restProps = _objectWithoutProperties(_getOptionProps, ['buildOptionText', 'size', 'locale']);
var isSmall = size === 'small';
var paginationProps = {
props: _extends({}, restProps, this.getIconsProps(), {
selectComponentClass: isSmall ? MiniSelect : VcSelect,
locale: _extends({}, contextLocale, customLocale),
buildOptionText: buildOptionText || this.$scopedSlots.buildOptionText
}),
'class': {
mini: isSmall
},
on: this.$listeners
};
return h(VcPagination, paginationProps);
}
},
render: function render() {
var h = arguments[0];
return h(LocaleReceiver, {
attrs: { componentName: 'Pagination' },
scopedSlots: { 'default': this.renderPagination } });
}
};