fuma 2.0.16 → 2.0.17
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/form/Form.svelte
CHANGED
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
export let simpleAction = false
|
|
48
48
|
|
|
49
49
|
export let options: UseFormOptions<ReturnData> = {}
|
|
50
|
-
let dataInput:
|
|
50
|
+
let dataInput: Partial<Data> = initData<Shape, Data>(fields)
|
|
51
51
|
export { dataInput as data }
|
|
52
52
|
|
|
53
53
|
let data = dataInput
|
|
54
54
|
|
|
55
|
-
export function set<K extends keyof
|
|
55
|
+
export function set<K extends keyof Data>(key: K, value: Partial<Data>[K]) {
|
|
56
56
|
isDirty.set(true)
|
|
57
57
|
data[key] = value
|
|
58
58
|
}
|
|
59
|
-
export function update(updater: (currentData:
|
|
59
|
+
export function update(updater: (currentData: Partial<Data>) => Partial<Data>) {
|
|
60
60
|
isDirty.set(true)
|
|
61
61
|
data = updater(data)
|
|
62
62
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { FormDataInput } from './form.js';
|
|
3
|
-
import { type FormField, type FormSectionProps
|
|
3
|
+
import { type FormField, type FormSectionProps } from './form.js';
|
|
4
4
|
import { type UseFormOptions } from '../../validation/form.js';
|
|
5
5
|
declare class __sveltets_Render<Shape extends z.core.$ZodShape, ReturnData extends Record<string, unknown> = FormDataInput<Shape>, Data extends FormDataInput<Shape> = FormDataInput<Shape>> {
|
|
6
6
|
props(): {
|
|
@@ -17,9 +17,9 @@ declare class __sveltets_Render<Shape extends z.core.$ZodShape, ReturnData exten
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
/** Ignore actionCreate, actionDelete and actionUpdate */ simpleAction?: boolean;
|
|
19
19
|
options?: UseFormOptions<ReturnData> | undefined;
|
|
20
|
-
data?:
|
|
21
|
-
set?: (<K extends keyof
|
|
22
|
-
update?: ((updater: (currentData:
|
|
20
|
+
data?: Partial<Data> | undefined;
|
|
21
|
+
set?: (<K extends keyof Data>(key: K, value: Partial<Data>[K]) => void) | undefined;
|
|
22
|
+
update?: ((updater: (currentData: Partial<Data>) => Partial<Data>) => void) | undefined;
|
|
23
23
|
};
|
|
24
24
|
events(): {
|
|
25
25
|
success: CustomEvent<{
|
|
@@ -40,8 +40,8 @@ declare class __sveltets_Render<Shape extends z.core.$ZodShape, ReturnData exten
|
|
|
40
40
|
};
|
|
41
41
|
bindings(): string;
|
|
42
42
|
exports(): {
|
|
43
|
-
set: <K extends keyof
|
|
44
|
-
update: (updater: (currentData:
|
|
43
|
+
set: <K extends keyof Data>(key: K, value: Partial<Data>[K]) => void;
|
|
44
|
+
update: (updater: (currentData: Partial<Data>) => Partial<Data>) => void;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
interface $$IsomorphicComponent {
|