svelte-common 4.15.1 → 4.16.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 +3 -3
- package/src/filter.mjs +9 -0
- package/src/index.svelte +2 -0
- package/src/sorting.mjs +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@semantic-release/exec": "^6.0.3",
|
|
41
41
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
42
42
|
"@sveltejs/vite-plugin-svelte": "^1.0.2",
|
|
43
|
-
"ava": "^4.3.
|
|
43
|
+
"ava": "^4.3.3",
|
|
44
44
|
"documentation": "^14.0.0",
|
|
45
|
-
"mf-styling": "^1.
|
|
45
|
+
"mf-styling": "^1.7.3",
|
|
46
46
|
"npm-pkgbuild": "^10.14.8",
|
|
47
47
|
"semantic-release": "^19.0.5",
|
|
48
48
|
"stylelint": "^14.11.0",
|
package/src/filter.mjs
ADDED
package/src/index.svelte
CHANGED
package/src/sorting.mjs
CHANGED
|
@@ -20,20 +20,21 @@ export function toggleOrderBy(orderBy) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Add sortable toggle button to a node.
|
|
23
|
+
* Add sortable toggle button with img element to a node.
|
|
24
24
|
* Synchronizes store value with node "aria-sort" attribute.
|
|
25
25
|
* @param {Node} th header node
|
|
26
26
|
* @param {WritableStore} to keep in sync with sorting properties
|
|
27
27
|
*/
|
|
28
28
|
export function sortable(th, store) {
|
|
29
|
-
|
|
30
|
-
const img = document.createElement("img");
|
|
31
|
-
button.appendChild(img);
|
|
32
|
-
|
|
29
|
+
|
|
33
30
|
store.subscribe(orderBy =>
|
|
34
31
|
th.setAttribute("aria-sort", orderBy[th.id] || SORT_NONE)
|
|
35
32
|
);
|
|
36
33
|
|
|
34
|
+
const button = document.createElement("button");
|
|
35
|
+
const img = document.createElement("img");
|
|
36
|
+
button.appendChild(img);
|
|
37
|
+
|
|
37
38
|
button.onclick = () => {
|
|
38
39
|
const orderBy = {};
|
|
39
40
|
|