@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.
@@ -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
- <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
20
- <textarea
21
- {...rest}
22
- id={id}
23
- name={id}
24
- rows={rows}
25
- bind:value={value}
26
- placeholder={placeholder}
27
- required={rest.required}
28
- readonly={rest.readonly}
29
- style="background-color: {background}; border: {borderSize} solid {borderColor}; border-radius: {borderRadius};"
30
- onclick={(e: MouseEvent) => {
31
- rest.onclick?.(e);
32
- }}></textarea>
33
- </label>
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}
@@ -11,6 +11,7 @@ declare const Textarea: import("svelte").Component<{
11
11
  width?: string;
12
12
  maxWidth?: string;
13
13
  textColor?: string;
14
+ showInput?: boolean;
14
15
  } & Record<string, any>, {}, "value">;
15
16
  type Textarea = ReturnType<typeof Textarea>;
16
17
  export default Textarea;
@@ -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
- <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
22
- <input
23
- {...rest}
24
- id={id}
25
- name={id}
26
- type={type}
27
- bind:value={value}
28
- placeholder={placeholder}
29
- autocomplete={autocomplete ?? undefined}
30
- required={rest.required}
31
- readonly={rest.readonly}
32
- class="{underline? 'underline-input':''}"
33
- style="background-color: {background}; border: {borderSize} solid {borderColor};"
34
- onclick={(e: MouseEvent) => {
35
- rest.onclick?.(e);
36
- }}
37
- />
38
- </label>
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
- <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
22
- <div style="position: relative;">
23
- <input
24
- type={show ? "text" : "password"}
25
- id={id}
26
- name={id}
27
- bind:value={value}
28
- placeholder={placeholder}
29
- autocomplete={autocomplete ?? undefined}
30
- required={required}
31
- class="{underline? 'underline-input':''}"
32
- style="width: 100%; background-color: {background}; border: {borderSize} solid {borderColor}; border-radius: 4px;"
33
- />
34
- <button on:click|preventDefault={() => show = !show}>
35
- {#if show}
36
- <i class="fa fa-eye"></i>
37
- {:else}
38
- <i class="fa fa-eye-slash"></i>
39
- {/if}
40
- </button>
41
- </div>
42
- </label>
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}
@@ -23,6 +23,7 @@ declare const Password: $$__sveltets_2_IsomorphicComponent<{
23
23
  width?: string;
24
24
  maxWidth?: string;
25
25
  textColor?: string;
26
+ showInput?: boolean;
26
27
  autocomplete?: AutoFill | null | undefined;
27
28
  required?: boolean;
28
29
  }, {
@@ -1,26 +1,29 @@
1
1
  <script lang="ts">
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';
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
- <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
16
- <select bind:value={value} id={id} name={id} required style="background-color: {background}; height: {height}">
17
- {#each options as option}
18
- <option
19
- value={option.value}
20
- disabled={option.disabled}
21
- style="color: {optionsColor}; background-color: {optionsBackground};"
22
- >{option.label}
23
- </option>
24
- {/each}
25
- </select>
26
- </label>
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}
@@ -27,6 +27,7 @@ declare const Select: $$__sveltets_2_IsomorphicComponent<{
27
27
  textColor?: string;
28
28
  optionsColor?: string;
29
29
  optionsBackground?: string;
30
+ showInput?: boolean;
30
31
  }, {
31
32
  [evt: string]: CustomEvent<any>;
32
33
  }, {}, {}, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sierra-95/svelte-scaffold",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",