@esportsplus/ui 0.0.74 → 0.0.77
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/build/components/field/index.d.ts +2 -0
- package/build/components/field/optional.d.ts +1 -0
- package/build/components/field/text.d.ts +1 -0
- package/build/components/field/text.js +4 -3
- package/build/components/field/textarea.d.ts +7 -0
- package/build/components/field/textarea.js +5 -0
- package/package.json +1 -1
- package/src/components/field/text.ts +6 -3
- package/src/components/field/textarea.ts +8 -0
|
@@ -126,6 +126,7 @@ declare const _default: {
|
|
|
126
126
|
tag?: {
|
|
127
127
|
class?: string | undefined;
|
|
128
128
|
} | undefined;
|
|
129
|
+
textarea?: boolean | undefined;
|
|
129
130
|
type?: string | undefined;
|
|
130
131
|
value?: unknown;
|
|
131
132
|
} & {
|
|
@@ -210,6 +211,7 @@ declare const _default: {
|
|
|
210
211
|
tag?: {
|
|
211
212
|
class?: string | undefined;
|
|
212
213
|
} | undefined;
|
|
214
|
+
textarea?: boolean | undefined;
|
|
213
215
|
type?: string | undefined;
|
|
214
216
|
value?: unknown;
|
|
215
217
|
} & {
|
|
@@ -8,7 +8,7 @@ export default (data) => {
|
|
|
8
8
|
let state = reactive({
|
|
9
9
|
active: false,
|
|
10
10
|
error: ''
|
|
11
|
-
});
|
|
11
|
+
}), value = data?.value !== undefined ? `value='${data.value}'` : '';
|
|
12
12
|
return html `
|
|
13
13
|
<div
|
|
14
14
|
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
@@ -26,14 +26,15 @@ export default (data) => {
|
|
|
26
26
|
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
27
27
|
style='${data?.mask?.style || ''}'
|
|
28
28
|
>
|
|
29
|
-
|
|
29
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
30
30
|
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
31
31
|
name='${data?.name || ''}'
|
|
32
32
|
placeholder='${data?.placeholder || ''}'
|
|
33
33
|
onrender='${form.input.attributes(state)}'
|
|
34
34
|
type='${data?.type || 'string'}'
|
|
35
|
-
${data?.
|
|
35
|
+
${!data?.textarea && value}
|
|
36
36
|
>
|
|
37
|
+
${data?.textarea ? html `${value}</textarea>` : ''}
|
|
37
38
|
|
|
38
39
|
${data?.mask?.content || ''}
|
|
39
40
|
</label>
|
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ type Data = {
|
|
|
19
19
|
tag?: {
|
|
20
20
|
class?: string;
|
|
21
21
|
};
|
|
22
|
+
textarea?: boolean;
|
|
22
23
|
type?: string;
|
|
23
24
|
value?: unknown;
|
|
24
25
|
} & Parameters<typeof description>[0] & Parameters<typeof title>[0];
|
|
@@ -28,7 +29,8 @@ export default (data: Data) => {
|
|
|
28
29
|
let state = reactive({
|
|
29
30
|
active: false,
|
|
30
31
|
error: ''
|
|
31
|
-
})
|
|
32
|
+
}),
|
|
33
|
+
value = data?.value !== undefined ? `value='${data.value}'` : '';
|
|
32
34
|
|
|
33
35
|
return html`
|
|
34
36
|
<div
|
|
@@ -47,14 +49,15 @@ export default (data: Data) => {
|
|
|
47
49
|
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
48
50
|
style='${data?.mask?.style || ''}'
|
|
49
51
|
>
|
|
50
|
-
|
|
52
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
51
53
|
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
52
54
|
name='${data?.name || ''}'
|
|
53
55
|
placeholder='${data?.placeholder || ''}'
|
|
54
56
|
onrender='${form.input.attributes(state)}'
|
|
55
57
|
type='${data?.type || 'string'}'
|
|
56
|
-
${data?.
|
|
58
|
+
${!data?.textarea && value}
|
|
57
59
|
>
|
|
60
|
+
${data?.textarea ? html`${value}</textarea>` : ''}
|
|
58
61
|
|
|
59
62
|
${data?.mask?.content || ''}
|
|
60
63
|
</label>
|