fuma 2.0.17 → 2.0.18
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,10 +47,10 @@
|
|
|
47
47
|
export let simpleAction = false
|
|
48
48
|
|
|
49
49
|
export let options: UseFormOptions<ReturnData> = {}
|
|
50
|
-
let dataInput: Partial<Data> = initData<Shape, Data>(fields)
|
|
50
|
+
let dataInput: Partial<Data> | null = initData<Shape, Data>(fields)
|
|
51
51
|
export { dataInput as data }
|
|
52
52
|
|
|
53
|
-
let data = dataInput
|
|
53
|
+
let data: Partial<Data> = dataInput || {}
|
|
54
54
|
|
|
55
55
|
export function set<K extends keyof Data>(key: K, value: Partial<Data>[K]) {
|
|
56
56
|
isDirty.set(true)
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
const { handleInput, isDirty } = useHandleInput({ model, setError })
|
|
84
84
|
|
|
85
85
|
onMount(lookupValueFromParams)
|
|
86
|
-
$: $isDirty ? (dataInput = data) : (data = dataInput)
|
|
86
|
+
$: $isDirty ? (dataInput = data) : (data = dataInput || {})
|
|
87
87
|
|
|
88
88
|
function lookupValueFromParams() {
|
|
89
89
|
fields.flat().forEach(({ key }) => {
|
|
@@ -17,7 +17,7 @@ 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?: Partial<Data> | undefined;
|
|
20
|
+
data?: Partial<Data> | null | undefined;
|
|
21
21
|
set?: (<K extends keyof Data>(key: K, value: Partial<Data>[K]) => void) | undefined;
|
|
22
22
|
update?: ((updater: (currentData: Partial<Data>) => Partial<Data>) => void) | undefined;
|
|
23
23
|
};
|