fuma 0.1.28 → 0.1.29
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 +16 -11
- package/dist/ui/input/FormControl.svelte +2 -5
- package/dist/ui/input/FormControl.svelte.d.ts +2 -2
- package/dist/ui/input/InputBoolean.svelte +0 -4
- package/dist/ui/input/InputBoolean.svelte.d.ts +2 -4
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +1 -1
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +1 -1
- package/dist/ui/input/InputCombo.svelte.d.ts +1 -1
- package/dist/ui/input/InputPassword.svelte.d.ts +1 -1
- package/dist/ui/input/InputRadio.svelte.d.ts +1 -1
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +1 -1
- package/package.json +1 -1
package/dist/ui/Slot.svelte
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import {} from "svelte";
|
|
2
|
+
import { component } from "../index.js";
|
|
2
3
|
import Span from "./Span.svelte";
|
|
3
4
|
export let slot = void 0;
|
|
4
5
|
export let args = void 0;
|
|
5
6
|
function getComponentAndProps(_slot) {
|
|
7
|
+
if (typeof _slot === "function") {
|
|
8
|
+
if (isComponentType(_slot))
|
|
9
|
+
return { component: _slot, props: {} };
|
|
10
|
+
if (!args) {
|
|
11
|
+
console.error("args prop is required with slot as function");
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const result = _slot(args);
|
|
15
|
+
return getComponentAndProps(result);
|
|
16
|
+
}
|
|
6
17
|
if (typeof _slot === "object")
|
|
7
18
|
return _slot;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
const result = _slot(args);
|
|
15
|
-
if (typeof result === "string")
|
|
16
|
-
return component(Span, { content: result });
|
|
17
|
-
return result;
|
|
19
|
+
return component(Span, { content: _slot });
|
|
20
|
+
}
|
|
21
|
+
function isComponentType(fun) {
|
|
22
|
+
return !!fun.prototype?.constructor?.name;
|
|
18
23
|
}
|
|
19
24
|
</script>
|
|
20
25
|
|
|
@@ -41,14 +41,11 @@ onMount(() => {
|
|
|
41
41
|
class:flex-row-reverse={labelPosition === 'right'}
|
|
42
42
|
class:justify-end={labelPosition === 'right'}
|
|
43
43
|
>
|
|
44
|
-
{#if label
|
|
44
|
+
{#if label}
|
|
45
45
|
<label for="{prefixFor}{_key}" class="label cursor-pointer {classLabel}">
|
|
46
46
|
<span class="label-text">
|
|
47
|
-
<slot
|
|
48
|
-
<Slot slot={label} />
|
|
49
|
-
</slot>
|
|
47
|
+
<Slot slot={label} />
|
|
50
48
|
</span>
|
|
51
|
-
<slot name="label" />
|
|
52
49
|
<slot name="label_append" />
|
|
53
50
|
</label>
|
|
54
51
|
{/if}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type ComponentType } from 'svelte';
|
|
2
3
|
import type { ComponentAndProps } from '../../utils/index.js';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
class?: string | undefined;
|
|
6
7
|
classLabel?: string | undefined;
|
|
7
8
|
key?: string | undefined;
|
|
8
|
-
label?: string | ComponentAndProps | undefined;
|
|
9
|
+
label?: string | ComponentType | ComponentAndProps | undefined;
|
|
9
10
|
error?: string | undefined;
|
|
10
11
|
hint?: string | undefined;
|
|
11
12
|
prefix?: string | number | undefined;
|
|
@@ -17,7 +18,6 @@ declare const __propDef: {
|
|
|
17
18
|
[evt: string]: CustomEvent<any>;
|
|
18
19
|
};
|
|
19
20
|
slots: {
|
|
20
|
-
label: {};
|
|
21
21
|
label_append: {};
|
|
22
22
|
default: {
|
|
23
23
|
key: string;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("../../index.js").ComponentAndProps | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
9
9
|
error?: string | undefined;
|
|
10
10
|
hint?: string | undefined;
|
|
11
11
|
prefix?: string | number | undefined;
|
|
@@ -28,9 +28,7 @@ declare const __propDef: {
|
|
|
28
28
|
} & {
|
|
29
29
|
[evt: string]: CustomEvent<any>;
|
|
30
30
|
};
|
|
31
|
-
slots: {
|
|
32
|
-
label: {};
|
|
33
|
-
};
|
|
31
|
+
slots: {};
|
|
34
32
|
};
|
|
35
33
|
export type InputBooleanProps = typeof __propDef.props;
|
|
36
34
|
export type InputBooleanEvents = typeof __propDef.events;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("../../index.js").ComponentAndProps | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
9
9
|
error?: string | undefined;
|
|
10
10
|
hint?: string | undefined;
|
|
11
11
|
prefix?: string | number | undefined;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("../../utils/index.js").ComponentAndProps | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../utils/index.js").ComponentAndProps | undefined;
|
|
9
9
|
error?: string | undefined;
|
|
10
10
|
hint?: string | undefined;
|
|
11
11
|
prefix?: string | number | undefined;
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
class?: string | undefined;
|
|
9
9
|
classLabel?: string | undefined;
|
|
10
10
|
key?: string | undefined;
|
|
11
|
-
label?: string | import("../../index.js").ComponentAndProps | undefined;
|
|
11
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
12
12
|
error?: string | undefined;
|
|
13
13
|
hint?: string | undefined;
|
|
14
14
|
prefix?: string | number | undefined;
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
class?: string | undefined;
|
|
5
5
|
classLabel?: string | undefined;
|
|
6
6
|
key?: string | undefined;
|
|
7
|
-
label?: string | import("../../index.js").ComponentAndProps | undefined;
|
|
7
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
8
8
|
error?: string | undefined;
|
|
9
9
|
hint?: string | undefined;
|
|
10
10
|
prefix?: string | number | undefined;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("../../index.js").ComponentAndProps | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
9
9
|
error?: string | undefined;
|
|
10
10
|
hint?: string | undefined;
|
|
11
11
|
prefix?: string | number | undefined;
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
class?: string | undefined;
|
|
5
5
|
classLabel?: string | undefined;
|
|
6
6
|
key?: string | undefined;
|
|
7
|
-
label?: string | import("../../..").ComponentAndProps | undefined;
|
|
7
|
+
label?: string | import("svelte").ComponentType | import("../../..").ComponentAndProps | undefined;
|
|
8
8
|
error?: string | undefined;
|
|
9
9
|
hint?: string | undefined;
|
|
10
10
|
prefix?: string | number | undefined;
|