svelte-common 6.15.5 → 6.15.7

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.5",
3
+ "version": "6.15.7",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -55,21 +55,21 @@
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.3.3",
58
+ "@semantic-release/github": "^10.3.4",
59
59
  "@semantic-release/release-notes-generator": "^14.0.1",
60
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.32",
66
- "semantic-release": "^24.1.0",
65
+ "npm-pkgbuild": "^15.3.33",
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.244",
69
+ "svelte": "^5.0.0-next.251",
70
70
  "testcafe": "^3.6.2",
71
71
  "typescript": "^5.6.2",
72
- "vite": "^5.4.3",
72
+ "vite": "^5.4.6",
73
73
  "vite-plugin-compression2": "^1.3.0"
74
74
  },
75
75
  "peerDependencies": {
@@ -268,16 +268,17 @@ export class Pagination {
268
268
  items.push(a);
269
269
  };
270
270
 
271
- add("<<", 1, "First Page");
272
- add("<", this.page - 1, "Previous Page");
271
+ if (np > 1) {
272
+ add("<<", 1, "First Page");
273
+ add("<", this.page - 1, "Previous Page");
273
274
 
274
- for (const n of navigationItems(np, this.page)) {
275
- add(String(n), n);
276
- }
277
-
278
- add(">", this.page + 1, "Next Page");
279
- add(">>", np, "Last Page");
275
+ for (const n of navigationItems(np, this.page)) {
276
+ add(String(n), n);
277
+ }
280
278
 
279
+ add(">", this.page + 1, "Next Page");
280
+ add(">>", np, "Last Page");
281
+ }
281
282
  nav.replaceChildren(...items);
282
283
  });
283
284
 
package/src/sorting.mjs CHANGED
@@ -27,11 +27,13 @@ export function toggleOrderBy(orderBy) {
27
27
  /**
28
28
  * Add sortable toggle button to a th node.
29
29
  * Synchronizes store value with the nodes "aria-sort" attribute.
30
- * @param {Element} th the header node
30
+ * Usable as svelte action function.
31
+ * @param {Element} th the header element
31
32
  * @param {writable} store keep in sync with sorting properties
33
+ * @return {Object} with destroy function
32
34
  */
33
35
  export function sortable(th, store) {
34
- const unsubscribe = store.subscribe(orderBy =>
36
+ const destroy = store.subscribe(orderBy =>
35
37
  th.setAttribute(ARIA_SORT, orderBy[th.id] || SORT_NONE)
36
38
  );
37
39
 
@@ -67,9 +69,7 @@ export function sortable(th, store) {
67
69
  th.appendChild(button);
68
70
 
69
71
  return {
70
- destroy() {
71
- unsubscribe();
72
- }
72
+ destroy
73
73
  };
74
74
  }
75
75
 
@@ -8,12 +8,12 @@ export function toggleOrderBy(orderBy?: string | null): string;
8
8
  /**
9
9
  * Add sortable toggle button to a th node.
10
10
  * Synchronizes store value with the nodes "aria-sort" attribute.
11
- * @param {Element} th the header node
11
+ * Usable as svelte action function.
12
+ * @param {Element} th the header element
12
13
  * @param {writable} store keep in sync with sorting properties
14
+ * @return {Object} with destroy function
13
15
  */
14
- export function sortable(th: Element, store: typeof writable): {
15
- destroy(): void;
16
- };
16
+ export function sortable(th: Element, store: typeof writable): any;
17
17
  /**
18
18
  * Generate a sort function for a given sort-by set.
19
19
  * @param {Object|undefined} [sortBy]