@onsvisual/svelte-components 1.0.32 → 1.0.33
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/inputs/Dropdown/Dropdown.svelte +6 -1
- package/dist/inputs/Dropdown/Dropdown.svelte.d.ts +2 -0
- package/dist/inputs/Input/Input.svelte +7 -0
- package/dist/inputs/Input/Input.svelte.d.ts +2 -0
- package/dist/inputs/Radios/Radio.svelte +1 -1
- package/dist/inputs/Radios/Radios.svelte +2 -2
- package/dist/inputs/Select/Select.svelte +9 -4
- package/dist/inputs/Select/Select.svelte.d.ts +2 -0
- package/dist/inputs/Textarea/Textarea.svelte +6 -1
- package/dist/inputs/Textarea/Textarea.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* @type {string|null}
|
|
9
9
|
*/
|
|
10
10
|
export let id = null;
|
|
11
|
+
/**
|
|
12
|
+
* Name for the <select> element
|
|
13
|
+
* @type {string|null}
|
|
14
|
+
*/
|
|
15
|
+
export let name = id;
|
|
11
16
|
/**
|
|
12
17
|
* A label to describe the <select> element (expected for accessibility)
|
|
13
18
|
* @type {string|null}
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
{/if}
|
|
47
52
|
<select
|
|
48
53
|
{id}
|
|
49
|
-
name
|
|
54
|
+
{name}
|
|
50
55
|
class="ons-input ons-input--select"
|
|
51
56
|
bind:value
|
|
52
57
|
on:change={(e) => dispatch("change", e)}
|
|
@@ -5,6 +5,7 @@ export default class Dropdown extends SvelteComponentTyped<{
|
|
|
5
5
|
cls?: string | null | undefined;
|
|
6
6
|
id?: string | null | undefined;
|
|
7
7
|
label?: string | null | undefined;
|
|
8
|
+
name?: string | null | undefined;
|
|
8
9
|
value?: object | null | undefined;
|
|
9
10
|
hideLabel?: boolean | undefined;
|
|
10
11
|
placeholder?: string | undefined;
|
|
@@ -24,6 +25,7 @@ declare const __propDef: {
|
|
|
24
25
|
cls?: string | null | undefined;
|
|
25
26
|
id?: string | null | undefined;
|
|
26
27
|
label?: string | null | undefined;
|
|
28
|
+
name?: string | null | undefined;
|
|
27
29
|
value?: object | null | undefined;
|
|
28
30
|
hideLabel?: boolean | undefined;
|
|
29
31
|
placeholder?: string | undefined;
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* @type {string|null}
|
|
9
9
|
*/
|
|
10
10
|
export let id = null;
|
|
11
|
+
/**
|
|
12
|
+
* Name attribute for <input> element
|
|
13
|
+
* @type {string|null}
|
|
14
|
+
*/
|
|
15
|
+
export let name = id;
|
|
11
16
|
/**
|
|
12
17
|
* A prop to bind to for the entered value
|
|
13
18
|
* @type {string|null}
|
|
@@ -103,6 +108,7 @@
|
|
|
103
108
|
<input
|
|
104
109
|
type="text"
|
|
105
110
|
{id}
|
|
111
|
+
{name}
|
|
106
112
|
bind:value
|
|
107
113
|
maxlength={charLimit}
|
|
108
114
|
pattern={pattern ? pattern : numeric ? "[0-9]*" : null}
|
|
@@ -129,6 +135,7 @@
|
|
|
129
135
|
<input
|
|
130
136
|
type="text"
|
|
131
137
|
{id}
|
|
138
|
+
{name}
|
|
132
139
|
bind:value
|
|
133
140
|
pattern={pattern ? pattern : numeric ? "[0-9]*" : null}
|
|
134
141
|
inputmode={numeric ? "numeric" : null}
|
|
@@ -7,6 +7,7 @@ export default class Input extends SvelteComponentTyped<{
|
|
|
7
7
|
width?: number | undefined;
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
pattern?: string | null | undefined;
|
|
10
|
+
name?: string | null | undefined;
|
|
10
11
|
error?: boolean | undefined;
|
|
11
12
|
numeric?: boolean | undefined;
|
|
12
13
|
value?: string | null | undefined;
|
|
@@ -34,6 +35,7 @@ declare const __propDef: {
|
|
|
34
35
|
width?: number | undefined;
|
|
35
36
|
label?: string | undefined;
|
|
36
37
|
pattern?: string | null | undefined;
|
|
38
|
+
name?: string | null | undefined;
|
|
37
39
|
error?: boolean | undefined;
|
|
38
40
|
numeric?: boolean | undefined;
|
|
39
41
|
value?: string | null | undefined;
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export let hideTitle = false;
|
|
14
14
|
/**
|
|
15
|
-
* Unique ID for radio group (required)
|
|
15
|
+
* Unique ID/name for radio group (required)
|
|
16
16
|
* @type {string}
|
|
17
17
|
*/
|
|
18
|
-
export let id = "
|
|
18
|
+
export let id = "radios";
|
|
19
19
|
/**
|
|
20
20
|
* Descriptive "how to" label for inputs
|
|
21
21
|
* @type {string|null}
|
|
@@ -16,10 +16,15 @@
|
|
|
16
16
|
let hideMenu = false;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Unique id for the element
|
|
19
|
+
* Unique id for the HTML element
|
|
20
20
|
* @type {string}
|
|
21
21
|
*/
|
|
22
22
|
export let id = "autocomplete";
|
|
23
|
+
/**
|
|
24
|
+
* Name for the HTML element
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
export let name = id;
|
|
23
28
|
/**
|
|
24
29
|
* The mode can be either "default" or "search"
|
|
25
30
|
* @type {"default"|"search"}
|
|
@@ -173,7 +178,7 @@
|
|
|
173
178
|
accessibleAutocomplete({
|
|
174
179
|
element,
|
|
175
180
|
id,
|
|
176
|
-
name
|
|
181
|
+
name,
|
|
177
182
|
source: loadOptions,
|
|
178
183
|
autoselect: true,
|
|
179
184
|
onConfirm: select,
|
|
@@ -212,9 +217,9 @@
|
|
|
212
217
|
|
|
213
218
|
{#if renderFallback && !scriptLoaded}
|
|
214
219
|
{#if mode === "search"}
|
|
215
|
-
<Input {id} {label} {hideLabel} value={value?.[labelKey]} />
|
|
220
|
+
<Input {id} {name} {label} {hideLabel} value={value?.[labelKey]} />
|
|
216
221
|
{:else}
|
|
217
|
-
<Dropdown {id} {options} {label} {hideLabel} {placeholder} {value} />
|
|
222
|
+
<Dropdown {id} {name} {options} {label} {hideLabel} {placeholder} {value} />
|
|
218
223
|
{/if}
|
|
219
224
|
{:else}
|
|
220
225
|
<div class="ons-field {cls}">
|
|
@@ -5,6 +5,7 @@ export default class Select extends SvelteComponentTyped<{
|
|
|
5
5
|
cls?: string | null | undefined;
|
|
6
6
|
id?: string | undefined;
|
|
7
7
|
label?: string | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
8
9
|
mode?: "default" | "search" | undefined;
|
|
9
10
|
value?: object | undefined;
|
|
10
11
|
hideLabel?: boolean | undefined;
|
|
@@ -35,6 +36,7 @@ declare const __propDef: {
|
|
|
35
36
|
cls?: string | null | undefined;
|
|
36
37
|
id?: string | undefined;
|
|
37
38
|
label?: string | undefined;
|
|
39
|
+
name?: string | undefined;
|
|
38
40
|
mode?: "default" | "search" | undefined;
|
|
39
41
|
value?: object | undefined;
|
|
40
42
|
hideLabel?: boolean | undefined;
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* @type {string|null}
|
|
9
9
|
*/
|
|
10
10
|
export let id = null;
|
|
11
|
+
/**
|
|
12
|
+
* Name for <textarea> element
|
|
13
|
+
* @type {string|null}
|
|
14
|
+
*/
|
|
15
|
+
export let name = id;
|
|
11
16
|
/**
|
|
12
17
|
* A prop to bind to for the entered value
|
|
13
18
|
* @type {string|null}
|
|
@@ -68,11 +73,11 @@
|
|
|
68
73
|
{/if}
|
|
69
74
|
<textarea
|
|
70
75
|
{id}
|
|
76
|
+
{name}
|
|
71
77
|
bind:value
|
|
72
78
|
class="ons-input ons-input--textarea {Number.isInteger(width) ? `ons-input--w-${width}` : null}"
|
|
73
79
|
class:ons-js-char-limit-input={charLimit}
|
|
74
80
|
class:ons-input--limit-reached={remaining === 0}
|
|
75
|
-
name={id}
|
|
76
81
|
{rows}
|
|
77
82
|
maxlength={charLimit}
|
|
78
83
|
data-char-limit-ref="{id}-lim"
|
|
@@ -6,6 +6,7 @@ export default class Textarea extends SvelteComponentTyped<{
|
|
|
6
6
|
id?: string | null | undefined;
|
|
7
7
|
width?: number | undefined;
|
|
8
8
|
label?: string | undefined;
|
|
9
|
+
name?: string | null | undefined;
|
|
9
10
|
value?: string | null | undefined;
|
|
10
11
|
description?: string | null | undefined;
|
|
11
12
|
hideLabel?: boolean | undefined;
|
|
@@ -25,6 +26,7 @@ declare const __propDef: {
|
|
|
25
26
|
id?: string | null | undefined;
|
|
26
27
|
width?: number | undefined;
|
|
27
28
|
label?: string | undefined;
|
|
29
|
+
name?: string | null | undefined;
|
|
28
30
|
value?: string | null | undefined;
|
|
29
31
|
description?: string | null | undefined;
|
|
30
32
|
hideLabel?: boolean | undefined;
|