fuma 0.3.33 → 0.3.35
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.
|
@@ -14,7 +14,7 @@ export { klass as class };
|
|
|
14
14
|
</div>
|
|
15
15
|
<slot />
|
|
16
16
|
<div class="mt-10 flex justify-end gap-2">
|
|
17
|
-
<button type="button" class="btn btn-ghost
|
|
17
|
+
<button type="button" class="btn btn-ghost" on:click={() => dialog.close()}>
|
|
18
18
|
Annuler
|
|
19
19
|
</button>
|
|
20
20
|
<slot name="action" />
|
package/dist/ui/form/Form.svelte
CHANGED
|
@@ -31,6 +31,7 @@ export let action = "";
|
|
|
31
31
|
export let actionCreate = "_create";
|
|
32
32
|
export let actionDelete = "_delete";
|
|
33
33
|
export let actionUpdate = "_update";
|
|
34
|
+
export let simpleAction = false;
|
|
34
35
|
export let options = {};
|
|
35
36
|
let dataInput = initData(fields);
|
|
36
37
|
export { dataInput as data };
|
|
@@ -90,7 +91,7 @@ const getBoolean = (bool) => (_data) => typeof bool === "boolean" || bool === vo
|
|
|
90
91
|
|
|
91
92
|
<form
|
|
92
93
|
method="post"
|
|
93
|
-
action="{action}{data.id ? actionUpdate : actionCreate}"
|
|
94
|
+
action="{action}{simpleAction ? '' : data.id ? actionUpdate : actionCreate}"
|
|
94
95
|
enctype="multipart/form-data"
|
|
95
96
|
class="{klass} flex flex-col gap-4"
|
|
96
97
|
use:enhance
|
|
@@ -138,7 +139,7 @@ const getBoolean = (bool) => (_data) => typeof bool === "boolean" || bool === vo
|
|
|
138
139
|
>
|
|
139
140
|
<button class="btn btn-primary"> Valider </button>
|
|
140
141
|
<div class="grow" />
|
|
141
|
-
{#if data.id && actionDelete}
|
|
142
|
+
{#if !simpleAction && data.id && actionDelete}
|
|
142
143
|
{@const formaction = `${action}${actionDelete}`}
|
|
143
144
|
<slot name="delete" {formaction}>
|
|
144
145
|
<ButtonDelete {formaction}>Supprimer</ButtonDelete>
|
|
@@ -15,6 +15,7 @@ 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
|
+
/** Ignore actionCreate, actionDelete and actionUpdate */ simpleAction?: boolean | undefined;
|
|
18
19
|
options?: UseFormOptions<ReturnData> | undefined;
|
|
19
20
|
data?: Nullable<Data> | undefined;
|
|
20
21
|
set?: (<K extends keyof Shape>(key: K, value: Nullable<Data>[K]) => void) | undefined;
|
|
@@ -21,7 +21,7 @@ function toggle(event) {
|
|
|
21
21
|
<div class="h-4" transition:slide></div>
|
|
22
22
|
{/if}
|
|
23
23
|
|
|
24
|
-
<section class="{klass} flex flex-col
|
|
24
|
+
<section class="{klass} flex flex-col">
|
|
25
25
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
26
26
|
<div
|
|
27
27
|
on:click={open}
|