quasar-ui-sellmate-ui-kit 3.2.12 → 3.2.13
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/dist/index.common.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.min.css +1 -1
- package/dist/index.rtl.css +1 -1
- package/dist/index.rtl.min.css +1 -1
- package/dist/index.umd.js +29 -20
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/components/SPagination.vue +27 -18
package/package.json
CHANGED
|
@@ -129,31 +129,40 @@
|
|
|
129
129
|
paginationInfo.value.startPage = 1;
|
|
130
130
|
paginationInfo.value.currentPage = 1;
|
|
131
131
|
} else if (val === 'goLeft') {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
paginationInfo.value.startPage = 1;
|
|
136
|
-
}
|
|
137
|
-
if (paginationInfo.value.currentPage > 1) {
|
|
138
|
-
paginationInfo.value.currentPage -= 1;
|
|
132
|
+
const newPage = Math.max(1, paginationInfo.value.currentPage - 1);
|
|
133
|
+
paginationInfo.value.currentPage = newPage;
|
|
134
|
+
if (newPage < paginationInfo.value.startPage) {
|
|
135
|
+
paginationInfo.value.startPage = Math.max(1, newPage - props.perPage + 1);
|
|
139
136
|
}
|
|
140
137
|
} else if (val === 'goRight') {
|
|
141
|
-
|
|
142
|
-
paginationInfo.value.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
const newPage = Math.min(
|
|
139
|
+
paginationInfo.value.currentPage + 1,
|
|
140
|
+
paginationInfo.value.lastPage,
|
|
141
|
+
);
|
|
142
|
+
paginationInfo.value.currentPage = newPage;
|
|
143
|
+
if (newPage > paginationInfo.value.startPage + props.perPage - 1) {
|
|
144
|
+
paginationInfo.value.startPage = Math.max(
|
|
145
|
+
1,
|
|
146
|
+
paginationInfo.value.startPage + props.perPage,
|
|
147
|
+
);
|
|
146
148
|
}
|
|
147
149
|
} else if (val === 'goLast') {
|
|
148
|
-
if (paginationInfo.value.lastPage % props.perPage !== 0) {
|
|
149
|
-
paginationInfo.value.startPage =
|
|
150
|
-
paginationInfo.value.lastPage - (paginationInfo.value.lastPage % props.perPage) + 1;
|
|
151
|
-
} else {
|
|
152
|
-
paginationInfo.value.startPage = paginationInfo.value.lastPage - props.perPage + 1;
|
|
153
|
-
}
|
|
154
150
|
paginationInfo.value.currentPage = paginationInfo.value.lastPage;
|
|
151
|
+
paginationInfo.value.startPage = Math.max(
|
|
152
|
+
1,
|
|
153
|
+
paginationInfo.value.lastPage - props.perPage + 1,
|
|
154
|
+
);
|
|
155
155
|
} else {
|
|
156
156
|
paginationInfo.value.currentPage = val;
|
|
157
|
+
if (
|
|
158
|
+
val < paginationInfo.value.startPage ||
|
|
159
|
+
val > paginationInfo.value.startPage + props.perPage - 1
|
|
160
|
+
) {
|
|
161
|
+
paginationInfo.value.startPage = Math.max(
|
|
162
|
+
1,
|
|
163
|
+
Math.floor((val - 1) / props.perPage) * props.perPage + 1,
|
|
164
|
+
);
|
|
165
|
+
}
|
|
157
166
|
}
|
|
158
167
|
emit('update:modelValue', paginationInfo.value.currentPage);
|
|
159
168
|
}
|