@stubber/form-fields 1.6.0 → 1.6.1
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/fields2/Form.svelte
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script>import { get as getStoreValue } from "svelte/store";
|
|
1
|
+
<script>import { get as getStoreValue, writable } from "svelte/store";
|
|
2
2
|
import FormField from "./form-field.svelte";
|
|
3
3
|
import { build_fields } from "./utils";
|
|
4
4
|
import { validate_field } from "./validations/validate_field";
|
|
5
5
|
export let initial_form;
|
|
6
6
|
export let form;
|
|
7
|
-
export let attachments;
|
|
7
|
+
export let attachments = writable([]);
|
|
8
8
|
export let dependencies = void 0;
|
|
9
|
-
export let form_valid;
|
|
9
|
+
export let form_valid = false;
|
|
10
10
|
if (initial_form.data) {
|
|
11
11
|
form.update((data) => {
|
|
12
12
|
return { ...data, ...initial_form.data };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { type Writable } from "svelte/store";
|
|
3
3
|
import type { IFormDependencies, IInitialForm } from "./interfaces";
|
|
4
|
+
import type { UploadedFile } from "./fileserver";
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
6
7
|
initial_form: IInitialForm;
|
|
7
8
|
form: Writable<any>;
|
|
8
|
-
attachments
|
|
9
|
+
attachments?: Writable<UploadedFile[]>;
|
|
9
10
|
dependencies?: IFormDependencies | undefined;
|
|
10
|
-
form_valid
|
|
11
|
+
form_valid?: boolean;
|
|
11
12
|
};
|
|
12
13
|
events: {
|
|
13
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -311,6 +311,7 @@ function select_field_type(newValue, trigger) {
|
|
|
311
311
|
</Collapsible.Trigger>
|
|
312
312
|
|
|
313
313
|
<Collapsible.Content class="flex flex-col gap-y-2 pl-2 pt-2">
|
|
314
|
+
<!-- todo this doesnt update when fieldtype changes -->
|
|
314
315
|
{@const field_param_spec = field_params_spec_lookup[value.fieldtype ?? "unknown"]}
|
|
315
316
|
{#if field_param_spec}
|
|
316
317
|
<Form
|