fuma 2.0.20 → 2.0.22
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.
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
|
|
47
47
|
const dispatch = createEventDispatcher<{ input: { value: RelationItem | null } }>()
|
|
48
48
|
|
|
49
|
-
export
|
|
49
|
+
export function clear() {
|
|
50
50
|
searchValue = ''
|
|
51
51
|
item = null
|
|
52
52
|
dispatch('input', { value: item })
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
return {
|
|
54
|
+
focus: () => inputElement.focus()
|
|
55
|
+
}
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export async function select(index = focusIndex) {
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
dispatch('input', { value: item })
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
async function searchItems(searchValue = '') {
|
|
63
|
+
export async function searchItems(searchValue = '') {
|
|
63
64
|
try {
|
|
64
65
|
isLoading = true
|
|
65
66
|
isError = false
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
{:else}
|
|
116
117
|
<button
|
|
117
118
|
type="button"
|
|
118
|
-
on:click|stopPropagation={() => clear()}
|
|
119
|
+
on:click|stopPropagation={() => clear().focus()}
|
|
119
120
|
class="input h-auto min-h-10 w-full grow items-start pt-2 pr-2"
|
|
120
121
|
>
|
|
121
122
|
{@render slotItem(item)}
|
|
@@ -27,8 +27,11 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
27
27
|
class?: string;
|
|
28
28
|
classList?: string;
|
|
29
29
|
inputElement: HTMLInputElement;
|
|
30
|
-
clear?: (() =>
|
|
30
|
+
clear?: (() => {
|
|
31
|
+
focus: () => void;
|
|
32
|
+
}) | undefined;
|
|
31
33
|
select?: ((index?: number) => Promise<void>) | undefined;
|
|
34
|
+
searchItems?: ((searchValue?: string) => Promise<void>) | undefined;
|
|
32
35
|
};
|
|
33
36
|
events(): {
|
|
34
37
|
input: CustomEvent<{
|
|
@@ -40,8 +43,11 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
40
43
|
slots(): {};
|
|
41
44
|
bindings(): string;
|
|
42
45
|
exports(): {
|
|
43
|
-
clear: () =>
|
|
46
|
+
clear: () => {
|
|
47
|
+
focus: () => void;
|
|
48
|
+
};
|
|
44
49
|
select: (index?: number) => Promise<void>;
|
|
50
|
+
searchItems: (searchValue?: string) => Promise<void>;
|
|
45
51
|
};
|
|
46
52
|
}
|
|
47
53
|
interface $$IsomorphicComponent {
|