wx-svelte-tasklist 2.3.0 → 2.4.0
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 +4 -4
- package/src/components/Layout.svelte +11 -3
- package/src/components/Task.svelte +3 -1
- package/whatsnew.md +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wx-svelte-tasklist",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Simple Svelte component for adding a task list section on a page",
|
|
5
5
|
"productTag": "tasklist",
|
|
6
6
|
"productTrial": false,
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://svar.dev/svelte/core/",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@svar-ui/tasklist-locales": "2.
|
|
36
|
+
"@svar-ui/tasklist-locales": "2.4.0",
|
|
37
37
|
"@svar-ui/lib-data-provider": "1.7.1",
|
|
38
|
-
"@svar-ui/svelte-core": "2.
|
|
39
|
-
"@svar-ui/lib-dom": "0.
|
|
38
|
+
"@svar-ui/svelte-core": "2.4.0",
|
|
39
|
+
"@svar-ui/lib-dom": "0.11.1",
|
|
40
40
|
"@svar-ui/lib-state": "1.9.6"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { getContext } from "svelte";
|
|
2
|
+
import { getContext, setContext } from "svelte";
|
|
3
3
|
import { Button } from "@svar-ui/svelte-core";
|
|
4
4
|
import { delegateClick } from "@svar-ui/lib-dom";
|
|
5
5
|
import { tempID } from "@svar-ui/lib-state";
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
const _ = getContext("wx-i18n").getGroup("tasklist");
|
|
11
11
|
|
|
12
|
+
//prevent associating Checkboxes with outer Field label
|
|
13
|
+
setContext("wx-input-id", null);
|
|
14
|
+
|
|
12
15
|
const data = $derived(rawData ?? []);
|
|
13
16
|
let edit = $state(null);
|
|
14
17
|
let editTask = $state(null);
|
|
@@ -85,8 +88,13 @@
|
|
|
85
88
|
remove(task.id);
|
|
86
89
|
}
|
|
87
90
|
} else {
|
|
88
|
-
if (content)
|
|
89
|
-
|
|
91
|
+
if (content) {
|
|
92
|
+
if (content !== task.content || status !== task.status) {
|
|
93
|
+
update(task.id, content, status);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
remove(task.id);
|
|
97
|
+
}
|
|
90
98
|
edit = null;
|
|
91
99
|
}
|
|
92
100
|
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
<div class="wx-task" class:wx-done={task.status}>
|
|
52
52
|
<div class="wx-checkbox-wrapper">
|
|
53
|
-
{#if edit === task.id}
|
|
53
|
+
{#if edit === task.id && task.id === -1}
|
|
54
54
|
<div class="wx-icon-add"><i class="wxi-plus"></i></div>
|
|
55
55
|
{:else}
|
|
56
56
|
<Checkbox onchange={handleStatus} value={task.status} />
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
|
|
77
77
|
<div class="wx-icon-close">
|
|
78
78
|
{#if !readonly && edit !== task.id}
|
|
79
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
80
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
79
81
|
<i class="wxi-close" onclick={() => onremove(task.id)}></i>
|
|
80
82
|
{/if}
|
|
81
83
|
</div>
|