@functionalcms/svelte-components 4.19.2 → 4.19.5

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.
@@ -1,42 +1,42 @@
1
1
  <script lang="ts">
2
- import ChoiceInput from "./ChoiceInput.svelte";
3
- import type { Field } from "./form.js";
4
- import Input from "./Input.svelte";
5
- import Select from "./Select.svelte";
6
- import Switch from "./Switch.svelte";
2
+ import ChoiceInput from './ChoiceInput.svelte';
3
+ import type { Field } from './form.js';
4
+ import Input from './Input.svelte';
5
+ import Select from './Select.svelte';
6
+ import Switch from './Switch.svelte';
7
7
 
8
8
  interface Props {
9
- action: string;
10
- css?: string;
11
- successMessage?: string;
12
- submitButonText?: string;
13
- fields?: Array<Field>;
9
+ action: string;
10
+ css?: string;
11
+ successMessage?: string;
12
+ submitButonText?: string;
13
+ fields?: Array<Field>;
14
14
  }
15
15
 
16
- let {
17
- action,
18
- fields = [],
19
- css = "",
20
- submitButonText = "Submit",
21
- successMessage = "Your message has been delivered",
22
- }: Props = $props();
16
+ let {
17
+ action,
18
+ fields = [],
19
+ css = '',
20
+ submitButonText = 'Submit',
21
+ successMessage = 'Your message has been delivered'
22
+ }: Props = $props();
23
23
 
24
- let form: any;
24
+ let form: any;
25
25
 
26
- const showMessage = $state(false);
26
+ const showMessage = $state(false);
27
27
 
28
- const submitContactForm = async (event: Event) => {
29
- event.preventDefault();
30
- const formData = new FormData(form);
31
- const response = await fetch("/contact", {
32
- method: "POST",
33
- body: formData,
34
- });
35
- console.log("Form submitted", response);
36
- };
28
+ const submitContactForm = async (event: Event) => {
29
+ event.preventDefault();
30
+ const formData = new FormData(form);
31
+ const response = await fetch('/contact', {
32
+ method: 'POST',
33
+ body: formData
34
+ });
35
+ console.log('Form submitted', response);
36
+ };
37
37
  </script>
38
38
 
39
- <form method="POST" action={action} class={css}>
39
+ <form method="POST" {action} class={css}>
40
40
  <fieldset>
41
41
  {#each fields as field}
42
42
  <div>
@@ -49,5 +49,6 @@
49
49
  />
50
50
  </div>
51
51
  {/each}
52
+ <button onclick={submitContactForm}>{submitButonText}</button>
52
53
  </fieldset>
53
54
  </form>
@@ -1,4 +1,4 @@
1
- import type { Field } from "./form.js";
1
+ import type { Field } from './form.js';
2
2
  interface Props {
3
3
  action: string;
4
4
  css?: string;
@@ -29,7 +29,6 @@ export interface Field {
29
29
  label?: string;
30
30
  type: FieldType;
31
31
  subType?: InputType;
32
- meta: any;
33
- entries?: any[];
34
- field: any;
32
+ isRequired?: boolean;
33
+ placeholder?: string;
35
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.19.2",
3
+ "version": "4.19.5",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [