svelte-common 6.2.7 → 6.3.1

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.2.7",
3
+ "version": "6.3.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,7 +52,7 @@
52
52
  "ava": "^5.3.1",
53
53
  "c8": "^8.0.0",
54
54
  "documentation": "^14.0.2",
55
- "mf-styling": "^2.1.0",
55
+ "mf-styling": "^3.0.0",
56
56
  "npm-pkgbuild": "^11.8.14",
57
57
  "semantic-release": "^21.0.7",
58
58
  "stylelint": "^15.10.1",
@@ -73,9 +73,15 @@ export class Pagination {
73
73
  * @param {number} n
74
74
  */
75
75
  set page(n) {
76
- if (this.#page !== n && n >= 1 && n <= this.numberOfPages) {
77
- this.#page = n;
78
- this.#subscriptions.forEach(subscription => subscription(this));
76
+ if(n < 0) {
77
+ n = this.numberOfPages + n + 1;
78
+ }
79
+
80
+ if (this.#page !== n) {
81
+ if (n >= 1 && n <= this.numberOfPages) {
82
+ this.#page = n;
83
+ this.#subscriptions.forEach(subscription => subscription(this));
84
+ }
79
85
  }
80
86
  }
81
87
 
@@ -157,6 +163,7 @@ export class Pagination {
157
163
 
158
164
  if (targetPage < 1 || targetPage > np) {
159
165
  a.ariaDisabled = "true";
166
+ a.tabIndex=-1;
160
167
  } else {
161
168
  if (targetPage === this.page) {
162
169
  a.ariaDisabled = "true";
@@ -165,6 +172,7 @@ export class Pagination {
165
172
  } else {
166
173
  a.onclick = e => {
167
174
  e.preventDefault();
175
+ e.stopPropagation();
168
176
  this.page = targetPage;
169
177
  };
170
178
  }
package/src/sorting.mjs CHANGED
@@ -110,11 +110,12 @@ export function sorter(sortBy, getters) {
110
110
  if (bv === undefined) {
111
111
  return rev;
112
112
  }
113
- if (av instanceof Date) {
114
- av = av.getTime();
113
+
114
+ if(av[Symbol.toPrimitive]) {
115
+ av = av[Symbol.toPrimitive]('number');
115
116
  }
116
- if (bv instanceof Date) {
117
- bv = bv.getTime();
117
+ if(bv[Symbol.toPrimitive]) {
118
+ bv = bv[Symbol.toPrimitive]('number');
118
119
  }
119
120
 
120
121
  return av > bv ? rev : av == bv ? 0 : -rev;