fuma 2.0.10 → 2.0.12
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.
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { FormControl, SelectorList } from './index.js'
|
|
12
12
|
import type { TippyProps } from '../../utils/tippy.js'
|
|
13
13
|
import RelationAfter from './RelationAfter.svelte'
|
|
14
|
+
import type { SnippetLike } from '../table/type.js'
|
|
14
15
|
|
|
15
16
|
export let key = Math.random().toString()
|
|
16
17
|
export let label = ''
|
|
@@ -26,8 +27,8 @@
|
|
|
26
27
|
export let dropdownProps: ComponentProps<DropDown> = {}
|
|
27
28
|
export let flatMode = false
|
|
28
29
|
export let noSlotItemWrapper = false
|
|
29
|
-
export let slotItem:
|
|
30
|
-
export let slotSuggestion:
|
|
30
|
+
export let slotItem: SnippetLike<[RelationItem]>
|
|
31
|
+
export let slotSuggestion: SnippetLike<[RelationItem]> = slotItem
|
|
31
32
|
export let input: HTMLInputAttributes | undefined = undefined
|
|
32
33
|
export let append: Snippet | undefined = undefined
|
|
33
34
|
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
<FormControl {key} {label} {error} class={klass}>
|
|
89
90
|
{#snippet children({ key })}
|
|
90
91
|
<div class="flex grow gap-2" class:hidden={item}>
|
|
91
|
-
<div class="input
|
|
92
|
+
<div class="input grow pr-2">
|
|
92
93
|
<input
|
|
93
94
|
type="text"
|
|
94
95
|
id={key}
|
|
@@ -112,14 +113,14 @@
|
|
|
112
113
|
{#if noSlotItemWrapper}
|
|
113
114
|
{@render slotItem(item)}
|
|
114
115
|
{:else}
|
|
115
|
-
<div class="
|
|
116
|
+
<div class="input h-auto min-h-10 grow items-start pt-2 pr-2">
|
|
116
117
|
<div class="grow">
|
|
117
118
|
{@render slotItem(item)}
|
|
118
119
|
</div>
|
|
119
120
|
<button
|
|
120
121
|
type="button"
|
|
121
122
|
on:click|stopPropagation={() => clear()}
|
|
122
|
-
class="btn btn-square btn-
|
|
123
|
+
class="btn btn-square btn-xs"
|
|
123
124
|
>
|
|
124
125
|
<Icon path={mdiClose} />
|
|
125
126
|
</button>
|
|
@@ -2,6 +2,7 @@ import { type ComponentProps, type Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
import { DropDown } from '../menu/index.js';
|
|
4
4
|
import type { TippyProps } from '../../utils/tippy.js';
|
|
5
|
+
import type { SnippetLike } from '../table/type.js';
|
|
5
6
|
declare class __sveltets_Render<RelationItem extends {
|
|
6
7
|
id: string | number;
|
|
7
8
|
}> {
|
|
@@ -19,8 +20,8 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
19
20
|
dropdownProps?: ComponentProps<DropDown>;
|
|
20
21
|
flatMode?: boolean;
|
|
21
22
|
noSlotItemWrapper?: boolean;
|
|
22
|
-
slotItem:
|
|
23
|
-
slotSuggestion?:
|
|
23
|
+
slotItem: SnippetLike<[RelationItem]>;
|
|
24
|
+
slotSuggestion?: SnippetLike<[RelationItem]> | undefined;
|
|
24
25
|
input?: HTMLInputAttributes | undefined;
|
|
25
26
|
append?: Snippet | undefined;
|
|
26
27
|
class?: string;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { FormControl, SelectorList } from './index.js'
|
|
13
13
|
import { DropDown } from '../menu/index.js'
|
|
14
14
|
import RelationAfter from './RelationAfter.svelte'
|
|
15
|
+
import type { SnippetLike } from '../table/type.js'
|
|
15
16
|
|
|
16
17
|
export let key = ''
|
|
17
18
|
export let label = ''
|
|
@@ -22,8 +23,8 @@
|
|
|
22
23
|
export let error = ''
|
|
23
24
|
export let placeholder = ''
|
|
24
25
|
export let flatMode = false
|
|
25
|
-
export let slotItem:
|
|
26
|
-
export let slotSuggestion:
|
|
26
|
+
export let slotItem: SnippetLike<[RelationItem]>
|
|
27
|
+
export let slotSuggestion: SnippetLike<[RelationItem]> = slotItem
|
|
27
28
|
export let input: HTMLInputAttributes | undefined = undefined
|
|
28
29
|
export let append: Snippet | undefined = undefined
|
|
29
30
|
|
|
@@ -102,11 +103,11 @@
|
|
|
102
103
|
{#each items || [] as item, index (item.id)}
|
|
103
104
|
<div
|
|
104
105
|
transition:slide|local={{ axis: 'x', duration: 200 }}
|
|
105
|
-
class="badge badge-outline badge-lg items-center
|
|
106
|
+
class="badge badge-outline badge-lg items-center pr-0 text-right whitespace-nowrap"
|
|
106
107
|
>
|
|
107
108
|
{@render slotItem(item)}
|
|
108
109
|
<div
|
|
109
|
-
class="btn btn-circle btn-ghost btn-xs
|
|
110
|
+
class="btn btn-circle btn-ghost btn-xs mr-[2px] ml-1 h-[18px] min-h-[18px] w-[18px]"
|
|
110
111
|
role="button"
|
|
111
112
|
tabindex="0"
|
|
112
113
|
on:click={() => remove(index)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
2
|
import { type Snippet } from 'svelte';
|
|
3
|
+
import type { SnippetLike } from '../table/type.js';
|
|
3
4
|
declare class __sveltets_Render<RelationItem extends {
|
|
4
5
|
id: string | number;
|
|
5
6
|
}> {
|
|
@@ -13,8 +14,8 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
13
14
|
error?: string;
|
|
14
15
|
placeholder?: string;
|
|
15
16
|
flatMode?: boolean;
|
|
16
|
-
slotItem:
|
|
17
|
-
slotSuggestion?:
|
|
17
|
+
slotItem: SnippetLike<[RelationItem]>;
|
|
18
|
+
slotSuggestion?: SnippetLike<[RelationItem]> | undefined;
|
|
18
19
|
input?: HTMLInputAttributes | undefined;
|
|
19
20
|
append?: Snippet | undefined;
|
|
20
21
|
class?: string;
|