fuma 0.1.6 → 0.1.7
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/dist/ui/Slot.svelte
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import { component } from "../index.js";
|
|
2
|
+
import Span from "./Span.svelte";
|
|
3
|
+
export let slot = void 0;
|
|
2
4
|
export let args = void 0;
|
|
3
5
|
function getComponentAndProps(_slot) {
|
|
4
6
|
if (typeof _slot === "object")
|
|
5
7
|
return _slot;
|
|
8
|
+
if (typeof _slot === "string")
|
|
9
|
+
return component(Span, { content: _slot });
|
|
6
10
|
if (!args) {
|
|
7
11
|
console.error("args prop is required with slot as function");
|
|
8
12
|
return null;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
const result = _slot(args);
|
|
15
|
+
if (typeof result === "string")
|
|
16
|
+
return component(Span, { content: result });
|
|
17
|
+
return result;
|
|
11
18
|
}
|
|
12
19
|
</script>
|
|
13
20
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type SpanProps = typeof __propDef.props;
|
|
12
|
+
export type SpanEvents = typeof __propDef.events;
|
|
13
|
+
export type SpanSlots = typeof __propDef.slots;
|
|
14
|
+
export default class Span extends SvelteComponent<SpanProps, SpanEvents, SpanSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -15,8 +15,8 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
15
15
|
placeholder?: string | undefined;
|
|
16
16
|
tippyProps?: Partial<TippyProps> | undefined;
|
|
17
17
|
flatMode?: boolean | undefined;
|
|
18
|
-
slotItem?: ((item: RelationItem) => ComponentAndProps) | null | undefined;
|
|
19
|
-
slotSuggestion?: ((item: RelationItem) => ComponentAndProps) | null | undefined;
|
|
18
|
+
slotItem?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
|
|
19
|
+
slotSuggestion?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
|
|
20
20
|
class?: string | undefined;
|
|
21
21
|
classList?: string | undefined;
|
|
22
22
|
clear?: (() => Promise<void>) | undefined;
|
|
@@ -12,8 +12,8 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
12
12
|
error?: string | undefined;
|
|
13
13
|
placeholder?: string | undefined;
|
|
14
14
|
flatMode?: boolean | undefined;
|
|
15
|
-
slotItem?: ((item: RelationItem) => ComponentAndProps) | null | undefined;
|
|
16
|
-
slotSuggestion?: ((item: RelationItem) => ComponentAndProps) | null | undefined;
|
|
15
|
+
slotItem?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
|
|
16
|
+
slotSuggestion?: ((item: RelationItem) => string | ComponentAndProps) | null | undefined;
|
|
17
17
|
class?: string | undefined;
|
|
18
18
|
classList?: string | undefined;
|
|
19
19
|
items?: RelationItem[] | null | undefined;
|
package/dist/utils/component.js
CHANGED