svelte-common 4.19.0 → 4.19.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/README.md +13 -0
- package/package.json +1 -1
- package/src/sorting.mjs +3 -3
package/README.md
CHANGED
|
@@ -34,6 +34,8 @@ or the [live example](https://arlac77.github.io/components/svelte-common/example
|
|
|
34
34
|
* [Parameters](#parameters-2)
|
|
35
35
|
* [sorter](#sorter)
|
|
36
36
|
* [Parameters](#parameters-3)
|
|
37
|
+
* [keyPrefixStore](#keyprefixstore)
|
|
38
|
+
* [Parameters](#parameters-4)
|
|
37
39
|
|
|
38
40
|
## initializeServiceWorker
|
|
39
41
|
|
|
@@ -79,6 +81,17 @@ Generate a sort function for a given sort-by set.
|
|
|
79
81
|
|
|
80
82
|
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** sorter
|
|
81
83
|
|
|
84
|
+
## keyPrefixStore
|
|
85
|
+
|
|
86
|
+
Create a store where all the object keys are prefixed.
|
|
87
|
+
|
|
88
|
+
### Parameters
|
|
89
|
+
|
|
90
|
+
* `store` **WriteableStore** 
|
|
91
|
+
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
92
|
+
|
|
93
|
+
Returns **WriteableStore** 
|
|
94
|
+
|
|
82
95
|
# install
|
|
83
96
|
|
|
84
97
|
With [npm](http://npmjs.org) do:
|
package/package.json
CHANGED
package/src/sorting.mjs
CHANGED
|
@@ -22,7 +22,7 @@ export function toggleOrderBy(orderBy) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Add sortable toggle button with img element to a node.
|
|
24
24
|
* Synchronizes store value with node "aria-sort" attribute.
|
|
25
|
-
* @param {Node}
|
|
25
|
+
* @param {Node} the header node
|
|
26
26
|
* @param {WritableStore} to keep in sync with sorting properties
|
|
27
27
|
*/
|
|
28
28
|
export function sortable(th, store) {
|
|
@@ -33,7 +33,7 @@ export function sortable(th, store) {
|
|
|
33
33
|
const button = document.createElement("button");
|
|
34
34
|
button.setAttribute("aria-label", `sortable ${th.id}`);
|
|
35
35
|
const img = document.createElement("img");
|
|
36
|
-
img.setAttribute("alt", "sorting order indicator");
|
|
36
|
+
//img.setAttribute("alt", "sorting order indicator");
|
|
37
37
|
|
|
38
38
|
button.appendChild(img);
|
|
39
39
|
|
|
@@ -53,7 +53,7 @@ export function sortable(th, store) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
if (sort
|
|
56
|
+
if (sort === SORT_NONE) {
|
|
57
57
|
delete orderBy[peer.id];
|
|
58
58
|
} else {
|
|
59
59
|
orderBy[peer.id] = sort;
|