@sierra-95/svelte-scaffold 1.2.13 → 1.2.14
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/Core/components/Form/Input/TextArea/textarea.svelte +18 -15
- package/dist/Core/components/Form/Input/TextArea/textarea.svelte.d.ts +1 -0
- package/dist/Core/components/Form/Input/input/input.svelte +21 -18
- package/dist/Core/components/Form/Input/input/input.svelte.d.ts +1 -0
- package/dist/Core/components/Form/Input/password/password.svelte +25 -22
- package/dist/Core/components/Form/Input/password/password.svelte.d.ts +1 -0
- package/dist/Core/components/Form/Input/select/select.svelte +26 -23
- package/dist/Core/components/Form/Input/select/select.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -12,22 +12,25 @@
|
|
|
12
12
|
width = '100%',
|
|
13
13
|
maxWidth = '',
|
|
14
14
|
textColor = 'inherit',
|
|
15
|
+
showInput = true,
|
|
15
16
|
...rest
|
|
16
17
|
} = $props();
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
{#if showInput}
|
|
21
|
+
<label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
|
|
22
|
+
<textarea
|
|
23
|
+
{...rest}
|
|
24
|
+
id={id}
|
|
25
|
+
name={id}
|
|
26
|
+
rows={rows}
|
|
27
|
+
bind:value={value}
|
|
28
|
+
placeholder={placeholder}
|
|
29
|
+
required={rest.required}
|
|
30
|
+
readonly={rest.readonly}
|
|
31
|
+
style="background-color: {background}; border: {borderSize} solid {borderColor}; border-radius: {borderRadius};"
|
|
32
|
+
onclick={(e: MouseEvent) => {
|
|
33
|
+
rest.onclick?.(e);
|
|
34
|
+
}}></textarea>
|
|
35
|
+
</label>
|
|
36
|
+
{/if}
|
|
@@ -13,26 +13,29 @@
|
|
|
13
13
|
width = '100%',
|
|
14
14
|
maxWidth = '',
|
|
15
15
|
textColor = 'inherit',
|
|
16
|
+
showInput = true,
|
|
16
17
|
autocomplete = undefined as _autocomplete,
|
|
17
18
|
...rest
|
|
18
19
|
} = $props();
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
<input
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
{#if showInput}
|
|
23
|
+
<label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
|
|
24
|
+
<input
|
|
25
|
+
{...rest}
|
|
26
|
+
id={id}
|
|
27
|
+
name={id}
|
|
28
|
+
type={type}
|
|
29
|
+
bind:value={value}
|
|
30
|
+
placeholder={placeholder}
|
|
31
|
+
autocomplete={autocomplete ?? undefined}
|
|
32
|
+
required={rest.required}
|
|
33
|
+
readonly={rest.readonly}
|
|
34
|
+
class="{underline? 'underline-input':''}"
|
|
35
|
+
style="background-color: {background}; border: {borderSize} solid {borderColor};"
|
|
36
|
+
onclick={(e: MouseEvent) => {
|
|
37
|
+
rest.onclick?.(e);
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</label>
|
|
41
|
+
{/if}
|
|
@@ -11,6 +11,7 @@ declare const Input: import("svelte").Component<{
|
|
|
11
11
|
width?: string;
|
|
12
12
|
maxWidth?: string;
|
|
13
13
|
textColor?: string;
|
|
14
|
+
showInput?: boolean;
|
|
14
15
|
autocomplete?: AutoFill | null | undefined;
|
|
15
16
|
} & Record<string, any>, {}, "value">;
|
|
16
17
|
type Input = ReturnType<typeof Input>;
|
|
@@ -12,31 +12,34 @@
|
|
|
12
12
|
export let width: string = '100%';
|
|
13
13
|
export let maxWidth: string = '';
|
|
14
14
|
export let textColor: string = 'inherit';
|
|
15
|
+
export let showInput = true;
|
|
15
16
|
export let autocomplete = undefined as _autocomplete;
|
|
16
17
|
export let required = false;
|
|
17
18
|
|
|
18
19
|
let show: boolean = false;
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</
|
|
22
|
+
{#if showInput}
|
|
23
|
+
<label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
|
|
24
|
+
<div style="position: relative;">
|
|
25
|
+
<input
|
|
26
|
+
type={show ? "text" : "password"}
|
|
27
|
+
id={id}
|
|
28
|
+
name={id}
|
|
29
|
+
bind:value={value}
|
|
30
|
+
placeholder={placeholder}
|
|
31
|
+
autocomplete={autocomplete ?? undefined}
|
|
32
|
+
required={required}
|
|
33
|
+
class="{underline? 'underline-input':''}"
|
|
34
|
+
style="width: 100%; background-color: {background}; border: {borderSize} solid {borderColor}; border-radius: 4px;"
|
|
35
|
+
/>
|
|
36
|
+
<button on:click|preventDefault={() => show = !show}>
|
|
37
|
+
{#if show}
|
|
38
|
+
<i class="fa fa-eye"></i>
|
|
39
|
+
{:else}
|
|
40
|
+
<i class="fa fa-eye-slash"></i>
|
|
41
|
+
{/if}
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</label>
|
|
45
|
+
{/if}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
export let id: string = '';
|
|
3
|
+
export let label: string = '';
|
|
4
|
+
export let value: string | number = '';
|
|
5
|
+
export let options: { value: string | number; label: string; disabled?: boolean }[] = [];
|
|
6
|
+
export let background: string ='transparent';
|
|
7
|
+
export let width: string = '100%';
|
|
8
|
+
export let maxWidth: string = '';
|
|
9
|
+
export let height: string = '100%';
|
|
10
|
+
export let textColor: string = 'inherit';
|
|
11
|
+
export let optionsColor: string = 'inherit';
|
|
12
|
+
export let optionsBackground: string = 'white';
|
|
13
|
+
export let showInput = true;
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
16
|
+
{#if showInput}
|
|
17
|
+
<label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
|
|
18
|
+
<select bind:value={value} id={id} name={id} required style="background-color: {background}; height: {height}">
|
|
19
|
+
{#each options as option}
|
|
20
|
+
<option
|
|
21
|
+
value={option.value}
|
|
22
|
+
disabled={option.disabled}
|
|
23
|
+
style="color: {optionsColor}; background-color: {optionsBackground};"
|
|
24
|
+
>{option.label}
|
|
25
|
+
</option>
|
|
26
|
+
{/each}
|
|
27
|
+
</select>
|
|
28
|
+
</label>
|
|
29
|
+
{/if}
|