svelte-common 6.6.1 → 6.6.2
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/package.json +3 -3
- package/src/pagination.mjs +13 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"stylelint": "^15.10.2",
|
|
59
59
|
"stylelint-config-standard": "^34.0.0",
|
|
60
60
|
"svelte": "^4.2.0",
|
|
61
|
-
"testcafe": "^3.
|
|
61
|
+
"testcafe": "^3.2.0",
|
|
62
62
|
"vite": "^4.4.9",
|
|
63
63
|
"vite-plugin-compression2": "^0.10.3"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
66
|
"mf-hosting-cloudflare": "^1.0.5",
|
|
67
|
-
"mf-hosting-frontend": "^2.0.
|
|
67
|
+
"mf-hosting-frontend": "^2.0.2"
|
|
68
68
|
},
|
|
69
69
|
"repository": {
|
|
70
70
|
"type": "git",
|
package/src/pagination.mjs
CHANGED
|
@@ -237,33 +237,22 @@ export function* navigationItems(
|
|
|
237
237
|
currentPage,
|
|
238
238
|
numberOfItems = 7
|
|
239
239
|
) {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
for (let n = 1; n <= numberOfPages; n++) {
|
|
253
|
-
if (
|
|
254
|
-
n <= j.edge ||
|
|
255
|
-
n > numberOfPages - j.edge ||
|
|
256
|
-
n % j.step === 0 ||
|
|
257
|
-
(n < currentPage + j.side && n > currentPage - j.side)
|
|
258
|
-
) {
|
|
259
|
-
yield n;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
break;
|
|
240
|
+
const edge = 2;
|
|
241
|
+
const side = 1;
|
|
242
|
+
const step = numberOfPages >= 100 ? Math.floor(numberOfPages / 10) : undefined;
|
|
243
|
+
|
|
244
|
+
for (let n = 1; n <= numberOfPages; n++) {
|
|
245
|
+
if (
|
|
246
|
+
n <= edge ||
|
|
247
|
+
n > numberOfPages - edge ||
|
|
248
|
+
n % step === 0 ||
|
|
249
|
+
(n < currentPage + side && n > currentPage - side)
|
|
250
|
+
) {
|
|
251
|
+
yield n;
|
|
263
252
|
}
|
|
264
253
|
}
|
|
265
254
|
|
|
266
|
-
/*
|
|
255
|
+
/*
|
|
267
256
|
const pageJumps = [
|
|
268
257
|
{ maxPages: 10, stepping: [1] },
|
|
269
258
|
{ maxPages: 100, stepping: [1, 10] },
|