fuma 1.0.11 → 1.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.
- package/README.md +1 -1
- package/dist/action/list/index.d.ts +0 -2
- package/dist/action/list/index.js +0 -1
- package/dist/action/list/trigger.d.ts +1 -7
- package/dist/action/list/trigger.js +2 -2
- package/dist/ui/button/ButtonCopy.svelte +1 -1
- package/dist/ui/drawer/Drawer.svelte +1 -1
- package/dist/ui/form/Form.svelte +5 -6
- package/dist/ui/form/Form.svelte.d.ts +0 -1
- package/dist/ui/form/FormInput.svelte.d.ts +8 -14
- package/dist/ui/form/FormSection.svelte +1 -1
- package/dist/ui/form/formInput.d.ts +4 -7
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/input/FormControl.svelte +8 -14
- package/dist/ui/input/FormControl.svelte.d.ts +10 -5
- package/dist/ui/input/InputBoolean.svelte +14 -16
- package/dist/ui/input/InputBoolean.svelte.d.ts +1 -2
- package/dist/ui/input/InputCheckboxs.svelte +14 -15
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +1 -2
- package/dist/ui/input/InputCheckboxsMenu.svelte +12 -13
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +1 -2
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +1 -1
- package/dist/ui/input/InputCombo.svelte +31 -33
- package/dist/ui/input/InputCombo.svelte.d.ts +1 -2
- package/dist/ui/input/InputDate.svelte +12 -14
- package/dist/ui/input/InputDateTime.svelte +12 -14
- package/dist/ui/input/InputNumber.svelte +17 -18
- package/dist/ui/input/InputNumber.svelte.d.ts +5 -1
- package/dist/ui/input/InputPassword.svelte +13 -15
- package/dist/ui/input/InputPassword.svelte.d.ts +1 -2
- package/dist/ui/input/InputRadio.svelte +14 -15
- package/dist/ui/input/InputRadio.svelte.d.ts +1 -2
- package/dist/ui/input/InputRelation.svelte +51 -52
- package/dist/ui/input/InputRelation.svelte.d.ts +18 -12
- package/dist/ui/input/InputRelations.svelte +18 -11
- package/dist/ui/input/InputRelations.svelte.d.ts +18 -11
- package/dist/ui/input/InputSearch.svelte +1 -1
- package/dist/ui/input/InputSelect.svelte +18 -20
- package/dist/ui/input/InputText.svelte +21 -21
- package/dist/ui/input/InputText.svelte.d.ts +3 -0
- package/dist/ui/input/InputTextarea.svelte +13 -14
- package/dist/ui/input/InputTextarea.svelte.d.ts +5 -1
- package/dist/ui/input/InputTime.svelte +12 -14
- package/dist/ui/input/SelectorList.svelte +1 -1
- package/dist/ui/input/SelectorList.svelte.d.ts +5 -5
- package/dist/ui/input/textRich/InputTextRich.svelte +9 -11
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +1 -2
- package/dist/ui/input/textRich/ToolMarkColor.svelte +1 -1
- package/dist/ui/input/textRich/ToolsBar.svelte +2 -2
- package/dist/ui/login/Login.svelte +1 -1
- package/dist/ui/mode/ToggleMode.svelte +3 -14
- package/dist/ui/mode/ToggleMode.svelte.d.ts +0 -2
- package/dist/ui/range/RangePicker.svelte +1 -1
- package/dist/ui/slot/Slot.svelte +52 -0
- package/dist/ui/slot/Slot.svelte.d.ts +22 -0
- package/dist/ui/slot/Span.svelte +5 -0
- package/dist/ui/slot/Span.svelte.d.ts +16 -0
- package/dist/ui/slot/index.d.ts +1 -0
- package/dist/ui/slot/index.js +1 -0
- package/package.json +34 -34
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ px prisma init --datasource-provider mysql
|
|
|
25
25
|
mkdir -p ./src/lib/server
|
|
26
26
|
source="https://raw.githubusercontent.com/peufo/fuma/main"
|
|
27
27
|
curl "$source/prisma/schema.prisma" -o ./prisma/schema.prisma
|
|
28
|
-
curl "$source/src/lib/
|
|
28
|
+
curl "$source/src/lib/server/prisma.ts" -o ./src/lib/server/prisma.ts
|
|
29
29
|
|
|
30
30
|
echo "DATABASE_URL=\"mysql://$mysql_username@localhost:3306/$project_name\"" > .env
|
|
31
31
|
cp .env .env.example
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { mouseDragTrigger, touchDragTrigger, scrollTrigger } from './trigger.js';
|
|
2
1
|
export declare const CLASSNAME_LIST = "editable-list";
|
|
3
2
|
export declare const CLASSNAME_DRAG_ACTIVE = "drag-active";
|
|
4
3
|
export declare const CLASSNAME_PLACEHOLDER = "item-placeholder";
|
|
5
|
-
export { mouseDragTrigger, touchDragTrigger, scrollTrigger };
|
|
6
4
|
export interface ListEditableOptions<Type = unknown> {
|
|
7
5
|
onDragStart?: () => void;
|
|
8
6
|
onDragMove?: () => void;
|
|
@@ -3,7 +3,6 @@ import { mouseDragTrigger, touchDragTrigger, scrollTrigger } from './trigger.js'
|
|
|
3
3
|
export const CLASSNAME_LIST = 'editable-list';
|
|
4
4
|
export const CLASSNAME_DRAG_ACTIVE = 'drag-active';
|
|
5
5
|
export const CLASSNAME_PLACEHOLDER = 'item-placeholder';
|
|
6
|
-
export { mouseDragTrigger, touchDragTrigger, scrollTrigger };
|
|
7
6
|
export function listEditable(node, options = {}) {
|
|
8
7
|
const { dragElementsSelector } = options;
|
|
9
8
|
node.classList.add(CLASSNAME_LIST);
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { DragHandler } from './handlers.js';
|
|
2
|
-
type Handler = {
|
|
3
|
-
start: (event: MouseEvent) => unknown;
|
|
4
|
-
move: (event: MouseEvent) => unknown;
|
|
5
|
-
end: (event: MouseEvent) => unknown;
|
|
6
|
-
};
|
|
7
2
|
/** Gestion du cycle de vie des évènements de la souris */
|
|
8
|
-
export declare function mouseDragTrigger(element: HTMLElement, handler:
|
|
3
|
+
export declare function mouseDragTrigger(element: HTMLElement, handler: DragHandler): {
|
|
9
4
|
destroy(): void;
|
|
10
5
|
};
|
|
11
6
|
/** Gestion du cycle de vie des évènements de l'écran tactile */
|
|
@@ -15,4 +10,3 @@ export declare function touchDragTrigger(element: HTMLElement, handler: DragHand
|
|
|
15
10
|
export declare function scrollTrigger(handler: DragHandler, scrollContainer: Element): {
|
|
16
11
|
destroy(): void;
|
|
17
12
|
};
|
|
18
|
-
export {};
|
|
@@ -6,9 +6,9 @@ export function mouseDragTrigger(element, handler) {
|
|
|
6
6
|
document.addEventListener('mousemove', handler.move);
|
|
7
7
|
document.addEventListener('mouseup', endHandler, { once: true });
|
|
8
8
|
}
|
|
9
|
-
function endHandler(
|
|
9
|
+
function endHandler() {
|
|
10
10
|
document.removeEventListener('mousemove', handler.move);
|
|
11
|
-
handler.end(
|
|
11
|
+
handler.end();
|
|
12
12
|
}
|
|
13
13
|
function stopPropagation(event) {
|
|
14
14
|
event.stopPropagation();
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<div class="relative">
|
|
38
38
|
{#if isLoading}
|
|
39
|
-
<span class="loading loading-spinner absolute left-1 top-1 scale-125 opacity-25"
|
|
39
|
+
<span class="loading loading-spinner absolute left-1 top-1 scale-125 opacity-25" />
|
|
40
40
|
{/if}
|
|
41
41
|
<button
|
|
42
42
|
class="{klass} btn btn-sm {label ? '' : 'btn-square'}"
|
package/dist/ui/form/Form.svelte
CHANGED
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
export let actionCreate = '_create'
|
|
42
42
|
export let actionDelete = '_delete'
|
|
43
43
|
export let actionUpdate = '_update'
|
|
44
|
-
export let disabled = false
|
|
45
44
|
|
|
46
45
|
/** Ignore actionCreate, actionDelete and actionUpdate */
|
|
47
46
|
export let simpleAction = false
|
|
@@ -116,12 +115,12 @@
|
|
|
116
115
|
use:enhance
|
|
117
116
|
on:input={handleInput}
|
|
118
117
|
>
|
|
119
|
-
<slot />
|
|
120
|
-
|
|
121
118
|
{#if data?.id}
|
|
122
119
|
<input type="hidden" name="id" value={data.id} />
|
|
123
120
|
{/if}
|
|
124
121
|
|
|
122
|
+
<slot />
|
|
123
|
+
|
|
125
124
|
{#each fields as groupFields, groupIndex}
|
|
126
125
|
{@const section = sections[groupIndex] || {}}
|
|
127
126
|
{#if !getBoolean(section?.hide)(data)}
|
|
@@ -156,12 +155,12 @@
|
|
|
156
155
|
sticky col-span-full mt-2 flex flex-row-reverse gap-2 border-t py-4 backdrop-blur-sm
|
|
157
156
|
"
|
|
158
157
|
>
|
|
159
|
-
<button class="btn btn-primary"
|
|
160
|
-
<div class="grow"
|
|
158
|
+
<button class="btn btn-primary"> Valider </button>
|
|
159
|
+
<div class="grow" />
|
|
161
160
|
{#if !simpleAction && data.id && actionDelete}
|
|
162
161
|
{@const formaction = `${action}${actionDelete}`}
|
|
163
162
|
<slot name="delete" {formaction}>
|
|
164
|
-
<ButtonDelete {formaction}
|
|
163
|
+
<ButtonDelete {formaction}>Supprimer</ButtonDelete>
|
|
165
164
|
</slot>
|
|
166
165
|
{/if}
|
|
167
166
|
</div>
|
|
@@ -15,7 +15,6 @@ declare class __sveltets_Render<Shape extends z.ZodRawShape, ReturnData extends
|
|
|
15
15
|
actionCreate?: string | undefined;
|
|
16
16
|
actionDelete?: string | undefined;
|
|
17
17
|
actionUpdate?: string | undefined;
|
|
18
|
-
disabled?: boolean | undefined;
|
|
19
18
|
/** Ignore actionCreate, actionDelete and actionUpdate */ simpleAction?: boolean | undefined;
|
|
20
19
|
options?: UseFormOptions<ReturnData> | undefined;
|
|
21
20
|
data?: Nullable<Data> | undefined;
|
|
@@ -42,11 +42,9 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
42
42
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
43
43
|
} | undefined;
|
|
44
44
|
flatMode?: boolean | undefined;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
slotSuggestion?: import("svelte").Snippet<[any]> | undefined;
|
|
45
|
+
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
46
|
+
slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
48
47
|
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
49
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
50
48
|
class?: string | undefined;
|
|
51
49
|
classList?: string | undefined;
|
|
52
50
|
clear?: (() => Promise<void>) | undefined;
|
|
@@ -67,10 +65,9 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
67
65
|
error?: string | undefined;
|
|
68
66
|
placeholder?: string | undefined;
|
|
69
67
|
flatMode?: boolean | undefined;
|
|
70
|
-
slotItem: import("
|
|
71
|
-
slotSuggestion?: import("
|
|
68
|
+
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
69
|
+
slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
72
70
|
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
73
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
74
71
|
class?: string | undefined;
|
|
75
72
|
classList?: string | undefined;
|
|
76
73
|
value?: any[] | null | undefined;
|
|
@@ -123,11 +120,9 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
123
120
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
124
121
|
} | undefined;
|
|
125
122
|
flatMode?: boolean | undefined;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
slotSuggestion?: import("svelte").Snippet<[any]> | undefined;
|
|
123
|
+
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
124
|
+
slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
129
125
|
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
130
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
131
126
|
class?: string | undefined;
|
|
132
127
|
classList?: string | undefined;
|
|
133
128
|
clear?: (() => Promise<void>) | undefined;
|
|
@@ -148,10 +143,9 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
148
143
|
error?: string | undefined;
|
|
149
144
|
placeholder?: string | undefined;
|
|
150
145
|
flatMode?: boolean | undefined;
|
|
151
|
-
slotItem: import("
|
|
152
|
-
slotSuggestion?: import("
|
|
146
|
+
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
147
|
+
slotSuggestion?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
153
148
|
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
154
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
155
149
|
class?: string | undefined;
|
|
156
150
|
classList?: string | undefined;
|
|
157
151
|
value?: any[] | null | undefined;
|
|
@@ -63,11 +63,9 @@ export declare function relationProps<Item extends {
|
|
|
63
63
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
64
64
|
} | undefined;
|
|
65
65
|
flatMode?: boolean | undefined;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
slotSuggestion?: import("svelte").Snippet<[Item]> | undefined;
|
|
66
|
+
slotItem?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
|
|
67
|
+
slotSuggestion?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
|
|
69
68
|
input?: import("svelte/elements").HTMLInputAttributes | undefined;
|
|
70
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
71
69
|
class?: string | undefined;
|
|
72
70
|
classList?: string | undefined;
|
|
73
71
|
clear?: (() => Promise<void>) | undefined;
|
|
@@ -84,10 +82,9 @@ export declare function relationsProps<Item extends {
|
|
|
84
82
|
error?: string | undefined;
|
|
85
83
|
placeholder?: string | undefined;
|
|
86
84
|
flatMode?: boolean | undefined;
|
|
87
|
-
slotItem: import("
|
|
88
|
-
slotSuggestion?: import("
|
|
85
|
+
slotItem?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
|
|
86
|
+
slotSuggestion?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
|
|
89
87
|
input?: import("svelte/elements").HTMLInputAttributes | undefined;
|
|
90
|
-
append?: import("svelte").Snippet<[]> | undefined;
|
|
91
88
|
class?: string | undefined;
|
|
92
89
|
classList?: string | undefined;
|
|
93
90
|
value?: Item[] | null | undefined;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './dialog/index.js';
|
|
|
11
11
|
export * from './placeholder/index.js';
|
|
12
12
|
export * from './icon/index.js';
|
|
13
13
|
export * from './login/index.js';
|
|
14
|
+
export * from './slot/index.js';
|
|
14
15
|
export * from './pagination/index.js';
|
|
15
16
|
export * from './mode/index.js';
|
|
16
17
|
export * from './badge/index.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export * from './dialog/index.js';
|
|
|
11
11
|
export * from './placeholder/index.js';
|
|
12
12
|
export * from './icon/index.js';
|
|
13
13
|
export * from './login/index.js';
|
|
14
|
+
export * from './slot/index.js';
|
|
14
15
|
export * from './pagination/index.js';
|
|
15
16
|
export * from './mode/index.js';
|
|
16
17
|
export * from './badge/index.js';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { slide } from 'svelte/transition'
|
|
3
|
-
import { onMount, type
|
|
3
|
+
import { onMount, type ComponentType } from 'svelte'
|
|
4
4
|
import { formContext } from '../../validation/form.js'
|
|
5
|
+
import type { ComponentAndProps } from '../../utils/index.js'
|
|
6
|
+
import { Slot } from '../index.js'
|
|
5
7
|
|
|
6
8
|
let klass = ''
|
|
7
9
|
export { klass as class }
|
|
8
10
|
export let classLabel = ''
|
|
9
11
|
export let key = ''
|
|
10
|
-
export let label:
|
|
11
|
-
export let labelAppend: Snippet | null = null
|
|
12
|
+
export let label: ComponentAndProps | ComponentType | string = ''
|
|
12
13
|
export let error = ''
|
|
13
14
|
export let hint = ''
|
|
14
15
|
export let prefix: string | number = ''
|
|
15
16
|
export let prefixFor: string | number = ''
|
|
16
17
|
export let enhanceDisabled = false
|
|
17
18
|
export let labelPosition: LabelPosition = 'top'
|
|
18
|
-
export let children: Snippet<[{ key: string }]> | undefined = undefined
|
|
19
19
|
|
|
20
20
|
type LabelPosition = 'top' | 'left' | 'right'
|
|
21
21
|
|
|
@@ -50,20 +50,14 @@
|
|
|
50
50
|
{#if label}
|
|
51
51
|
<label for="{prefixFor}{_key}" class="label cursor-pointer {classLabel}">
|
|
52
52
|
<span class="label-text">
|
|
53
|
-
{
|
|
54
|
-
{label}
|
|
55
|
-
{:else}
|
|
56
|
-
{@render label()}
|
|
57
|
-
{/if}
|
|
53
|
+
<Slot slot={label} />
|
|
58
54
|
</span>
|
|
59
|
-
|
|
60
|
-
{@render labelAppend()}
|
|
61
|
-
{/if}
|
|
55
|
+
<slot name="label_append" />
|
|
62
56
|
</label>
|
|
63
57
|
{/if}
|
|
64
|
-
</div>
|
|
65
58
|
|
|
66
|
-
|
|
59
|
+
<slot key={_key} />
|
|
60
|
+
</div>
|
|
67
61
|
|
|
68
62
|
{#if error}
|
|
69
63
|
<label for="{prefixFor}{_key}" class="label" transition:slide>
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ComponentType } from 'svelte';
|
|
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 |
|
|
9
|
-
labelAppend?: Snippet<[]> | null | undefined;
|
|
9
|
+
label?: string | ComponentType | ComponentAndProps | undefined;
|
|
10
10
|
error?: string | undefined;
|
|
11
11
|
hint?: string | undefined;
|
|
12
12
|
prefix?: string | number | undefined;
|
|
13
13
|
prefixFor?: string | number | undefined;
|
|
14
14
|
enhanceDisabled?: boolean | undefined;
|
|
15
15
|
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
16
|
-
children?: Snippet<[{
|
|
16
|
+
children?: import("svelte").Snippet<[{
|
|
17
17
|
key: string;
|
|
18
18
|
}]> | undefined;
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
21
21
|
[evt: string]: CustomEvent<any>;
|
|
22
22
|
};
|
|
23
|
-
slots: {
|
|
23
|
+
slots: {
|
|
24
|
+
label_append: {};
|
|
25
|
+
default: {
|
|
26
|
+
key: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
24
29
|
};
|
|
25
30
|
export type FormControlProps = typeof __propDef.props;
|
|
26
31
|
export type FormControlEvents = typeof __propDef.events;
|
|
@@ -13,21 +13,19 @@
|
|
|
13
13
|
const dispatch = createEventDispatcher<{ change: boolean }>()
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<FormControl {...$$restProps} class="">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/>
|
|
16
|
+
<FormControl {...$$restProps} let:key class="">
|
|
17
|
+
<input
|
|
18
|
+
bind:this={inputElement}
|
|
19
|
+
bind:checked={value}
|
|
20
|
+
use:bindCheckedWithParams={{ bindEnable: bindWithParams }}
|
|
21
|
+
on:input={({ currentTarget: { checked } }) => dispatch('change', checked)}
|
|
22
|
+
on:focus
|
|
23
|
+
on:blur
|
|
24
|
+
type="checkbox"
|
|
25
|
+
id={key}
|
|
26
|
+
class="checkbox ml-1"
|
|
27
|
+
{...input}
|
|
28
|
+
/>
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
{/snippet}
|
|
30
|
+
<input type="hidden" name={key} value="{USE_COERCE_BOOLEAN}{value}" />
|
|
33
31
|
</FormControl>
|
|
@@ -5,8 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("svelte").
|
|
9
|
-
labelAppend?: import("svelte").Snippet<[]> | null | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
10
9
|
error?: string | undefined;
|
|
11
10
|
hint?: string | undefined;
|
|
12
11
|
prefix?: string | number | undefined;
|
|
@@ -34,25 +34,24 @@
|
|
|
34
34
|
{#each _options as option, index}
|
|
35
35
|
<FormControl
|
|
36
36
|
{...props}
|
|
37
|
+
let:key
|
|
37
38
|
label={option.label}
|
|
38
39
|
prefixFor={index}
|
|
39
40
|
class="flex-row-reverse items-center justify-end gap-2"
|
|
40
41
|
>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/>
|
|
55
|
-
{/snippet}
|
|
42
|
+
<input
|
|
43
|
+
bind:group={value}
|
|
44
|
+
on:change
|
|
45
|
+
on:input
|
|
46
|
+
on:focus
|
|
47
|
+
on:blur
|
|
48
|
+
value={option.value}
|
|
49
|
+
type="checkbox"
|
|
50
|
+
name={key}
|
|
51
|
+
id="{index}{key}"
|
|
52
|
+
class="checkbox"
|
|
53
|
+
{...input}
|
|
54
|
+
/>
|
|
56
55
|
</FormControl>
|
|
57
56
|
{/each}
|
|
58
57
|
</div>
|
|
@@ -5,8 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("svelte").
|
|
9
|
-
labelAppend?: import("svelte").Snippet<[]> | null | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../index.js").ComponentAndProps | undefined;
|
|
10
9
|
error?: string | undefined;
|
|
11
10
|
hint?: string | undefined;
|
|
12
11
|
prefix?: string | number | undefined;
|
|
@@ -81,23 +81,22 @@
|
|
|
81
81
|
{#each _options as option, index (option.value)}
|
|
82
82
|
<FormControl
|
|
83
83
|
{...props}
|
|
84
|
+
let:key
|
|
84
85
|
label={option.label}
|
|
85
86
|
prefixFor={index}
|
|
86
87
|
class="flex-row-reverse items-center justify-end gap-2 whitespace-nowrap"
|
|
87
88
|
>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/>
|
|
100
|
-
{/snippet}
|
|
89
|
+
<input
|
|
90
|
+
bind:group={value}
|
|
91
|
+
on:input
|
|
92
|
+
on:focus
|
|
93
|
+
on:blur
|
|
94
|
+
value={option.value}
|
|
95
|
+
type="checkbox"
|
|
96
|
+
id="{index}{key}"
|
|
97
|
+
class="checkbox"
|
|
98
|
+
{...input}
|
|
99
|
+
/>
|
|
101
100
|
</FormControl>
|
|
102
101
|
{:else}
|
|
103
102
|
<div class="px-3 py-2 rounded opacity-70">Aucun élément</div>
|
|
@@ -5,8 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
class?: string | undefined;
|
|
6
6
|
classLabel?: string | undefined;
|
|
7
7
|
key?: string | undefined;
|
|
8
|
-
label?: string | import("svelte").
|
|
9
|
-
labelAppend?: import("svelte").Snippet<[]> | null | undefined;
|
|
8
|
+
label?: string | import("svelte").ComponentType | import("../../utils/index.js").ComponentAndProps | undefined;
|
|
10
9
|
error?: string | undefined;
|
|
11
10
|
hint?: string | undefined;
|
|
12
11
|
prefix?: string | number | undefined;
|
|
@@ -45,41 +45,39 @@
|
|
|
45
45
|
|
|
46
46
|
<DropDown {tippyProps}>
|
|
47
47
|
<div class="contents" slot="activator">
|
|
48
|
-
<FormControl {...props}>
|
|
49
|
-
|
|
50
|
-
<div class="flex grow gap-2"
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
<slot name="append" />
|
|
48
|
+
<FormControl {...props} let:key>
|
|
49
|
+
<div class="flex grow gap-2" class:hidden={selectedOption}>
|
|
50
|
+
<div class="relative flex grow items-center gap-2">
|
|
51
|
+
<input
|
|
52
|
+
type="text"
|
|
53
|
+
id={key}
|
|
54
|
+
bind:this={inputElement}
|
|
55
|
+
bind:value={searchValue}
|
|
56
|
+
on:focus={() => filterOptions('')}
|
|
57
|
+
on:blur={() => (searchValue = '')}
|
|
58
|
+
on:input={(e) => filterOptions(e.currentTarget.value)}
|
|
59
|
+
autocomplete="off"
|
|
60
|
+
class="input input-bordered grow {inputClass || {}}"
|
|
61
|
+
{...inputProps}
|
|
62
|
+
/>
|
|
66
63
|
</div>
|
|
64
|
+
<slot name="append" />
|
|
65
|
+
</div>
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{/snippet}
|
|
67
|
+
{#if selectedOption}
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
class="flex h-12 items-center gap-2 rounded-lg border pl-4 pr-2"
|
|
71
|
+
on:click={clear}
|
|
72
|
+
on:focus={clear}
|
|
73
|
+
>
|
|
74
|
+
{#if selectedOption.icon}
|
|
75
|
+
<Icon path={selectedOption.icon} size={21} class="opacity-70" />
|
|
76
|
+
{/if}
|
|
77
|
+
<span>{selectedOption.label}</span>
|
|
78
|
+
</button>
|
|
79
|
+
<input type="hidden" name={key} value={selectedOption.value} />
|
|
80
|
+
{/if}
|
|
83
81
|
</FormControl>
|
|
84
82
|
</div>
|
|
85
83
|
|
|
@@ -8,8 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
class?: string | undefined;
|
|
9
9
|
classLabel?: string | undefined;
|
|
10
10
|
key?: string | undefined;
|
|
11
|
-
label?: string | import("svelte").
|
|
12
|
-
labelAppend?: import("svelte").Snippet<[]> | null | undefined;
|
|
11
|
+
label?: string | import("svelte").ComponentType | import("../..").ComponentAndProps | undefined;
|
|
13
12
|
error?: string | undefined;
|
|
14
13
|
hint?: string | undefined;
|
|
15
14
|
prefix?: string | number | undefined;
|
|
@@ -22,19 +22,17 @@
|
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
|
-
<FormControl {...$$restProps}>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/>
|
|
25
|
+
<FormControl {...$$restProps} let:key>
|
|
26
|
+
<input
|
|
27
|
+
value={value && dayjs(value).format('YYYY-MM-DD')}
|
|
28
|
+
on:input={handleInput}
|
|
29
|
+
on:focus
|
|
30
|
+
on:blur
|
|
31
|
+
type="date"
|
|
32
|
+
id={key}
|
|
33
|
+
class="input input-bordered {inputClass}"
|
|
34
|
+
{...inputProps}
|
|
35
|
+
/>
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
{/snippet}
|
|
37
|
+
<input type="hidden" name={key} value="{USE_COERCE_DATE}{value?.toJSON()}" />
|
|
40
38
|
</FormControl>
|
|
@@ -23,19 +23,17 @@
|
|
|
23
23
|
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<FormControl {...$$restProps}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/>
|
|
26
|
+
<FormControl {...$$restProps} let:key>
|
|
27
|
+
<input
|
|
28
|
+
value={value && dayjs(value).format('YYYY-MM-DDTHH:mm')}
|
|
29
|
+
on:input={handleInput}
|
|
30
|
+
on:focus
|
|
31
|
+
on:blur
|
|
32
|
+
type="datetime-local"
|
|
33
|
+
id={key}
|
|
34
|
+
class="input input-bordered {inputClass}"
|
|
35
|
+
{...inputProps}
|
|
36
|
+
/>
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
{/snippet}
|
|
38
|
+
<input type="hidden" name={key} value="{USE_COERCE_DATE}{value?.toJSON()}" />
|
|
41
39
|
</FormControl>
|