svelte-common 4.19.18 → 4.19.20
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 +22 -9
- package/package.json +4 -4
- package/src/components/Tabs.svelte +3 -3
- package/src/util.mjs +11 -2
package/README.md
CHANGED
|
@@ -26,16 +26,29 @@ or the [live example](https://arlac77.github.io/components/svelte-common/example
|
|
|
26
26
|
|
|
27
27
|
### Table of Contents
|
|
28
28
|
|
|
29
|
-
* [
|
|
29
|
+
* [filter](#filter)
|
|
30
30
|
* [Parameters](#parameters)
|
|
31
|
-
* [
|
|
31
|
+
* [initializeServiceWorker](#initializeserviceworker)
|
|
32
32
|
* [Parameters](#parameters-1)
|
|
33
|
-
* [
|
|
33
|
+
* [toggleOrderBy](#toggleorderby)
|
|
34
34
|
* [Parameters](#parameters-2)
|
|
35
|
-
* [
|
|
35
|
+
* [sortable](#sortable)
|
|
36
36
|
* [Parameters](#parameters-3)
|
|
37
|
-
* [
|
|
37
|
+
* [sorter](#sorter)
|
|
38
38
|
* [Parameters](#parameters-4)
|
|
39
|
+
* [keyPrefixStore](#keyprefixstore)
|
|
40
|
+
* [Parameters](#parameters-5)
|
|
41
|
+
|
|
42
|
+
## filter
|
|
43
|
+
|
|
44
|
+
Generate filter function
|
|
45
|
+
|
|
46
|
+
### Parameters
|
|
47
|
+
|
|
48
|
+
* `filterBy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
49
|
+
* `getters` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
|
|
50
|
+
|
|
51
|
+
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** 
|
|
39
52
|
|
|
40
53
|
## initializeServiceWorker
|
|
41
54
|
|
|
@@ -62,7 +75,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
62
75
|
## sortable
|
|
63
76
|
|
|
64
77
|
Add sortable toggle button to a th node.
|
|
65
|
-
Synchronizes store value with
|
|
78
|
+
Synchronizes store value with the nodes "aria-sort" attribute.
|
|
66
79
|
|
|
67
80
|
### Parameters
|
|
68
81
|
|
|
@@ -86,12 +99,12 @@ Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference
|
|
|
86
99
|
|
|
87
100
|
Create a derived store where all the object keys are prefixed.
|
|
88
101
|
|
|
89
|
-
{ a: 1, b: 2 } -> {
|
|
102
|
+
{ a: 1, b: 2 } -> { foo_a: 1 foo_b: 2 } // prefix: foo_
|
|
90
103
|
|
|
91
104
|
### Parameters
|
|
92
105
|
|
|
93
|
-
* `store` **WriteableStore
|
|
94
|
-
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
106
|
+
* `store` **WriteableStore** we derive from
|
|
107
|
+
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** for each key
|
|
95
108
|
|
|
96
109
|
Returns **WriteableStore** 
|
|
97
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"svelte-command": "^1.1.24",
|
|
36
|
-
"svelte-entitlement": "^1.2.
|
|
36
|
+
"svelte-entitlement": "^1.2.38"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@sveltejs/vite-plugin-svelte": "^1.3.1",
|
|
43
43
|
"ava": "^5.1.0",
|
|
44
44
|
"documentation": "^14.0.0",
|
|
45
|
-
"mf-styling": "^1.7.
|
|
45
|
+
"mf-styling": "^1.7.27",
|
|
46
46
|
"npm-pkgbuild": "^10.15.17",
|
|
47
47
|
"semantic-release": "^19.0.5",
|
|
48
48
|
"stylelint": "^14.15.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
[
|
|
78
78
|
"@semantic-release/exec",
|
|
79
79
|
{
|
|
80
|
-
"publishCmd": "npx npm-pkgbuild --available --continue"
|
|
80
|
+
"publishCmd": "npx npm-pkgbuild --available --continue --publish dist"
|
|
81
81
|
}
|
|
82
82
|
],
|
|
83
83
|
[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
|
|
4
|
-
const tabs = { tab: {}};
|
|
4
|
+
const tabs = { tab: {} };
|
|
5
5
|
|
|
6
6
|
setContext("TABS", tabs);
|
|
7
7
|
</script>
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
<slot />
|
|
10
10
|
|
|
11
11
|
{#each Object.entries(tabs.tab) as t}
|
|
12
|
-
{t[0]}
|
|
13
|
-
<svelte:component this={t[1].header}/>
|
|
12
|
+
{t[0]}
|
|
13
|
+
<svelte:component this={t[1].header} />
|
|
14
14
|
{/each}
|
package/src/util.mjs
CHANGED
|
@@ -131,14 +131,23 @@ export function keyPrefixStore(store, prefix) {
|
|
|
131
131
|
return {
|
|
132
132
|
set: object => {
|
|
133
133
|
subscribeMyself();
|
|
134
|
+
|
|
135
|
+
for(const [k,v] of Object.entries(forwardObject)) {
|
|
136
|
+
if(k.startsWith(prefix)) {
|
|
137
|
+
delete forwardObject[k];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
134
141
|
store.set(
|
|
135
142
|
Object.assign(
|
|
136
143
|
forwardObject,
|
|
137
144
|
Object.fromEntries(
|
|
138
|
-
Object.entries(object)
|
|
145
|
+
Object.entries(object)
|
|
146
|
+
.map(([k, v]) => [prefix + k, v])
|
|
139
147
|
)
|
|
140
148
|
)
|
|
141
|
-
);
|
|
149
|
+
);
|
|
150
|
+
},
|
|
142
151
|
|
|
143
152
|
subscribe: s => {
|
|
144
153
|
subscriptions.add(s);
|