svelte-common 6.10.23 → 6.10.25

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.
Files changed (2) hide show
  1. package/package.json +10 -10
  2. package/src/pagination.mjs +8 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.10.23",
3
+ "version": "6.10.25",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -50,27 +50,27 @@
50
50
  "dependencies": {
51
51
  "pacc": "^3.1.8",
52
52
  "svelte-command": "^2.0.1",
53
- "svelte-entitlement": "^1.2.83"
53
+ "svelte-entitlement": "^1.2.85"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@semantic-release/commit-analyzer": "^13.0.0",
57
57
  "@semantic-release/exec": "^6.0.3",
58
- "@semantic-release/github": "^10.0.6",
58
+ "@semantic-release/github": "^10.1.0",
59
59
  "@semantic-release/release-notes-generator": "^14.0.1",
60
60
  "@sveltejs/vite-plugin-svelte": "^3.1.1",
61
61
  "ava": "^6.1.3",
62
62
  "c8": "^10.1.2",
63
63
  "documentation": "^14.0.3",
64
64
  "mf-styling": "^3.1.6",
65
- "npm-pkgbuild": "^15.3.22",
65
+ "npm-pkgbuild": "^15.3.25",
66
66
  "semantic-release": "^24.0.0",
67
- "stylelint": "^16.6.1",
67
+ "stylelint": "^16.7.0",
68
68
  "stylelint-config-standard": "^36.0.1",
69
- "svelte": "^5.0.0-next.166",
70
- "testcafe": "^3.6.1",
71
- "typescript": "^5.5.2",
72
- "vite": "^5.3.2",
73
- "vite-plugin-compression2": "^1.1.1"
69
+ "svelte": "^5.0.0-next.184",
70
+ "testcafe": "^3.6.2",
71
+ "typescript": "^5.5.3",
72
+ "vite": "^5.3.3",
73
+ "vite-plugin-compression2": "^1.1.2"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "svelte": "^4.0.0 || ^5.0.0-next.0"
@@ -90,12 +90,17 @@ export class Pagination {
90
90
  * @param {number} n
91
91
  */
92
92
  set page(n) {
93
+ const numberOfPages = this.numberOfPages;
94
+
93
95
  if (n < 0) {
94
- n = this.numberOfPages + n + 1;
96
+ n = numberOfPages + n + 1;
97
+ } else {
98
+ if (n > numberOfPages) {
99
+ n = numberOfPages;
100
+ }
95
101
  }
96
-
97
102
  if (this.#page !== n) {
98
- if (n >= 1 && n <= this.numberOfPages) {
103
+ if (n >= 1 && n <= numberOfPages) {
99
104
  this.#page = n;
100
105
  this.fireSubscriptions();
101
106
  }