fuma 0.1.28 → 0.1.30
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/form/formInput.d.ts +2 -0
- 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/InputRelation.svelte +2 -1
- package/dist/ui/input/InputRelation.svelte.d.ts +1 -0
- package/dist/ui/input/InputRelations.svelte +2 -1
- package/dist/ui/input/InputRelations.svelte.d.ts +1 -0
- package/dist/ui/input/RelationAfter.svelte +2 -1
- package/dist/ui/input/RelationAfter.svelte.d.ts +1 -0
- 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
|
|
|
@@ -29,6 +29,7 @@ export declare function relationProps<Item extends {
|
|
|
29
29
|
search: (q: string) => Promise<Item[]>;
|
|
30
30
|
createUrl?: string | undefined;
|
|
31
31
|
createTitle?: string | undefined;
|
|
32
|
+
createIcon?: string | undefined;
|
|
32
33
|
value?: Item | null | undefined;
|
|
33
34
|
error?: string | undefined;
|
|
34
35
|
placeholder?: string | undefined;
|
|
@@ -48,6 +49,7 @@ export declare function relationsProps<Item extends {
|
|
|
48
49
|
search: (q: string) => Promise<Item[]>;
|
|
49
50
|
createUrl?: string | undefined;
|
|
50
51
|
createTitle?: string | undefined;
|
|
52
|
+
createIcon?: string | undefined;
|
|
51
53
|
error?: string | undefined;
|
|
52
54
|
placeholder?: string | undefined;
|
|
53
55
|
flatMode?: boolean | undefined;
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ export let label = "";
|
|
|
9
9
|
export let search;
|
|
10
10
|
export let createUrl = "";
|
|
11
11
|
export let createTitle = "Nouveau";
|
|
12
|
+
export let createIcon = void 0;
|
|
12
13
|
let item = null;
|
|
13
14
|
export { item as value };
|
|
14
15
|
export let error = "";
|
|
@@ -80,7 +81,7 @@ async function handleBlur() {
|
|
|
80
81
|
size={1}
|
|
81
82
|
/>
|
|
82
83
|
|
|
83
|
-
<RelationAfter {isLoading} {createUrl} {createTitle} />
|
|
84
|
+
<RelationAfter {isLoading} {createUrl} {createTitle} {createIcon} />
|
|
84
85
|
</div>
|
|
85
86
|
<slot name="append" />
|
|
86
87
|
</div>
|
|
@@ -10,6 +10,7 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
10
10
|
search: (q: string) => Promise<RelationItem[]>;
|
|
11
11
|
createUrl?: string | undefined;
|
|
12
12
|
createTitle?: string | undefined;
|
|
13
|
+
createIcon?: string | undefined;
|
|
13
14
|
value?: RelationItem | null | undefined;
|
|
14
15
|
error?: string | undefined;
|
|
15
16
|
placeholder?: string | undefined;
|
|
@@ -10,6 +10,7 @@ export let label = "";
|
|
|
10
10
|
export let search;
|
|
11
11
|
export let createUrl = "";
|
|
12
12
|
export let createTitle = "";
|
|
13
|
+
export let createIcon = void 0;
|
|
13
14
|
export let error = "";
|
|
14
15
|
export let placeholder = "";
|
|
15
16
|
export let flatMode = false;
|
|
@@ -119,7 +120,7 @@ async function handleBlur() {
|
|
|
119
120
|
size={1}
|
|
120
121
|
/>
|
|
121
122
|
|
|
122
|
-
<RelationAfter {isLoading} {createUrl} {createTitle} />
|
|
123
|
+
<RelationAfter {isLoading} {createUrl} {createTitle} {createIcon} />
|
|
123
124
|
</div>
|
|
124
125
|
<slot name="append" />
|
|
125
126
|
</div>
|
|
@@ -9,6 +9,7 @@ declare class __sveltets_Render<RelationItem extends {
|
|
|
9
9
|
search: (q: string) => Promise<RelationItem[]>;
|
|
10
10
|
createUrl?: string | undefined;
|
|
11
11
|
createTitle?: string | undefined;
|
|
12
|
+
createIcon?: string | undefined;
|
|
12
13
|
error?: string | undefined;
|
|
13
14
|
placeholder?: string | undefined;
|
|
14
15
|
flatMode?: boolean | undefined;
|
|
@@ -5,6 +5,7 @@ import Icon from "../Icon.svelte";
|
|
|
5
5
|
export let isLoading;
|
|
6
6
|
export let createUrl = "";
|
|
7
7
|
export let createTitle = "";
|
|
8
|
+
export let createIcon = mdiPlus;
|
|
8
9
|
const dispatch = createEventDispatcher();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
@@ -20,6 +21,6 @@ const dispatch = createEventDispatcher();
|
|
|
20
21
|
|
|
21
22
|
{#if createUrl}
|
|
22
23
|
<a href={createUrl} class="btn btn-square btn-sm">
|
|
23
|
-
<Icon path={
|
|
24
|
+
<Icon path={createIcon} on:click={() => dispatch('create')} title={createTitle} />
|
|
24
25
|
</a>
|
|
25
26
|
{/if}
|
|
@@ -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;
|