fuma 2.0.23 → 2.0.24

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.
@@ -45,20 +45,24 @@
45
45
  let searchValue = ''
46
46
 
47
47
  const dispatch = createEventDispatcher<{
48
- input: { value: RelationItem | null; focus: () => void }
48
+ input: { value: RelationItem | null }
49
49
  }>()
50
50
 
51
51
  export async function clear() {
52
52
  searchValue = ''
53
53
  item = null
54
- dispatch('input', { value: item, focus: () => inputElement.focus() })
54
+ dispatch('input', { value: item })
55
55
  await tick()
56
56
  inputElement.focus()
57
57
  }
58
58
 
59
59
  export async function select(index = focusIndex) {
60
60
  item = proposedItems[index]
61
- dispatch('input', { value: item, focus: () => inputElement.focus() })
61
+ dispatch('input', { value: item })
62
+ }
63
+
64
+ export function focus() {
65
+ inputElement.focus()
62
66
  }
63
67
 
64
68
  export async function searchItems(searchValue = '') {
@@ -29,12 +29,12 @@ declare class __sveltets_Render<RelationItem extends {
29
29
  inputElement: HTMLInputElement;
30
30
  clear?: (() => Promise<void>) | undefined;
31
31
  select?: ((index?: number) => Promise<void>) | undefined;
32
+ focus?: (() => void) | undefined;
32
33
  searchItems?: ((searchValue?: string) => Promise<void>) | undefined;
33
34
  };
34
35
  events(): {
35
36
  input: CustomEvent<{
36
37
  value: RelationItem | null;
37
- focus: () => void;
38
38
  }>;
39
39
  } & {
40
40
  [evt: string]: CustomEvent<any>;
@@ -44,6 +44,7 @@ declare class __sveltets_Render<RelationItem extends {
44
44
  exports(): {
45
45
  clear: () => Promise<void>;
46
46
  select: (index?: number) => Promise<void>;
47
+ focus: () => void;
47
48
  searchItems: (searchValue?: string) => Promise<void>;
48
49
  };
49
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",