@functionalcms/svelte-components 4.19.7 → 4.19.10
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,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { cn } from '../../utils.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
import
|
|
4
|
+
import { InputType, LabelSize } from './form.ts';
|
|
5
|
+
import Layout from '../../../routes/+layout.svelte';
|
|
5
6
|
|
|
6
7
|
interface Props{
|
|
7
8
|
label: string;
|
|
@@ -58,8 +59,8 @@
|
|
|
58
59
|
isSkinned = true,
|
|
59
60
|
isUnderlinedWithBackground = false,
|
|
60
61
|
isUnderlined = false,
|
|
61
|
-
labelSize =
|
|
62
|
-
type =
|
|
62
|
+
labelSize = LabelSize.None,
|
|
63
|
+
type = InputType.Text,
|
|
63
64
|
value = '',
|
|
64
65
|
placeholder= '',
|
|
65
66
|
...restProps
|
|
@@ -120,7 +121,7 @@
|
|
|
120
121
|
|
|
121
122
|
<div class="w-100">
|
|
122
123
|
<label class={labelClasses} for={id}>{label}</label>
|
|
123
|
-
{#if type ==
|
|
124
|
+
{#if type == InputType.Textarea}
|
|
124
125
|
<textarea
|
|
125
126
|
{id}
|
|
126
127
|
{name}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Input from './Input.svelte';
|
|
3
|
-
import { type Field, FieldType} from './form.js';
|
|
3
|
+
import { type Field, FieldType, InputType} from './form.js';
|
|
4
4
|
import { fade } from 'svelte/transition';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
<Input
|
|
56
56
|
name={field.name}
|
|
57
57
|
id={field.name}
|
|
58
|
+
label={field.label}
|
|
58
59
|
placeholder={field.placeholder}
|
|
59
60
|
type={field.subType}
|
|
60
61
|
isRequired={field.isRequired || false}
|
|
@@ -63,6 +64,8 @@
|
|
|
63
64
|
<Input
|
|
64
65
|
name={field.name}
|
|
65
66
|
id={field.name}
|
|
67
|
+
label={field.label}
|
|
68
|
+
type={InputType.Textarea}
|
|
66
69
|
placeholder={field.placeholder}
|
|
67
70
|
isRequired={field.isRequired || false}
|
|
68
71
|
/>
|
|
@@ -20,6 +20,7 @@ export var InputType;
|
|
|
20
20
|
InputType["Date"] = "date";
|
|
21
21
|
InputType["DateTimeLocal"] = "datetime-local";
|
|
22
22
|
InputType["Color"] = "color";
|
|
23
|
+
InputType["Textarea"] = "textarea";
|
|
23
24
|
})(InputType || (InputType = {}));
|
|
24
25
|
export var LabelSize;
|
|
25
26
|
(function (LabelSize) {
|