svelte-common 6.15.4 → 6.15.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.15.4",
3
+ "version": "6.15.6",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -55,22 +55,22 @@
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.1.7",
58
+ "@semantic-release/github": "^10.3.3",
59
59
  "@semantic-release/release-notes-generator": "^14.0.1",
60
- "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
60
+ "@sveltejs/vite-plugin-svelte": "^4.0.0-next.7",
61
61
  "ava": "^6.1.3",
62
62
  "c8": "^10.1.2",
63
63
  "documentation": "^14.0.3",
64
64
  "mf-styling": "^3.1.9",
65
- "npm-pkgbuild": "^15.3.30",
66
- "semantic-release": "^24.1.0",
65
+ "npm-pkgbuild": "^15.3.32",
66
+ "semantic-release": "^24.1.1",
67
67
  "stylelint": "^16.9.0",
68
68
  "stylelint-config-standard": "^36.0.1",
69
- "svelte": "^5.0.0-next.241",
69
+ "svelte": "^5.0.0-next.244",
70
70
  "testcafe": "^3.6.2",
71
- "typescript": "^5.5.4",
72
- "vite": "^5.4.2",
73
- "vite-plugin-compression2": "^1.2.0"
71
+ "typescript": "^5.6.2",
72
+ "vite": "^5.4.4",
73
+ "vite-plugin-compression2": "^1.3.0"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "svelte": "^5.0.0-next.0"
@@ -109,12 +109,15 @@ export class Pagination {
109
109
  }
110
110
 
111
111
  set itemsPerPage(n) {
112
- this.#itemsPerPage = n;
113
- this.fireSubscriptions();
112
+ if (this.#itemsPerPage != n) {
113
+ this.#itemsPerPage = n;
114
+ this.fireSubscriptions();
115
+ }
114
116
  }
115
117
 
116
118
  /**
117
- * Set current page
119
+ * Set current page.
120
+ * First page has number 1.
118
121
  * @param {number} n
119
122
  */
120
123
  set page(n) {
@@ -265,16 +268,17 @@ export class Pagination {
265
268
  items.push(a);
266
269
  };
267
270
 
268
- add("<<", 1, "First Page");
269
- add("<", this.page - 1, "Previous Page");
270
-
271
- for (const n of navigationItems(np, this.page)) {
272
- add(String(n), n);
273
- }
271
+ if (np > 1) {
272
+ add("<<", 1, "First Page");
273
+ add("<", this.page - 1, "Previous Page");
274
274
 
275
- add(">", this.page + 1, "Next Page");
276
- add(">>", np, "Last Page");
275
+ for (const n of navigationItems(np, this.page)) {
276
+ add(String(n), n);
277
+ }
277
278
 
279
+ add(">", this.page + 1, "Next Page");
280
+ add(">>", np, "Last Page");
281
+ }
278
282
  nav.replaceChildren(...items);
279
283
  });
280
284
 
@@ -302,8 +306,7 @@ export function* navigationItems(
302
306
  ) {
303
307
  const edge = 2;
304
308
  const side = 1;
305
- const step =
306
- numberOfPages >= 80 ? Math.floor(numberOfPages / 10) : undefined;
309
+ const step = numberOfPages >= 80 ? Math.floor(numberOfPages / 10) : undefined;
307
310
 
308
311
  for (let n = 1; n <= numberOfPages; n++) {
309
312
  if (
@@ -30,7 +30,8 @@ export class Pagination {
30
30
  */
31
31
  recalibrateCurrentPage(): void;
32
32
  /**
33
- * Set current page
33
+ * Set current page.
34
+ * First page has number 1.
34
35
  * @param {number} n
35
36
  */
36
37
  set page(n: number);
@@ -68,6 +69,6 @@ export class Pagination {
68
69
  * @see https://a11y-style-guide.com/style-guide/section-navigation.html#kssref-navigation-pagination
69
70
  */
70
71
  get pageNavigationElement(): HTMLElement;
71
- [Symbol.iterator](): Generator<any, void, undefined>;
72
+ [Symbol.iterator](): Generator<any, void, unknown>;
72
73
  #private;
73
74
  }