@esportsplus/ui 0.0.76 → 0.0.78
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 +28 -0
- package/build/components/field/index.js +2 -1
- package/build/components/field/optional.d.ts +1 -0
- package/build/components/field/text.d.ts +1 -0
- package/build/components/field/text.js +5 -7
- 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/index.ts +2 -1
- package/src/components/field/text.ts +6 -8
- 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
|
} & {
|
|
@@ -197,6 +198,32 @@ declare const _default: {
|
|
|
197
198
|
type: string;
|
|
198
199
|
values: never[];
|
|
199
200
|
};
|
|
201
|
+
textarea: (data: {
|
|
202
|
+
class?: string | undefined;
|
|
203
|
+
mask?: {
|
|
204
|
+
class?: string | undefined;
|
|
205
|
+
content?: any;
|
|
206
|
+
style?: string | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
name?: string | undefined;
|
|
209
|
+
placeholder?: string | undefined;
|
|
210
|
+
style?: string | undefined;
|
|
211
|
+
tag?: {
|
|
212
|
+
class?: string | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
textarea?: boolean | undefined;
|
|
215
|
+
type?: string | undefined;
|
|
216
|
+
value?: unknown;
|
|
217
|
+
} & {
|
|
218
|
+
description?: string | undefined;
|
|
219
|
+
} & {
|
|
220
|
+
required?: boolean | undefined;
|
|
221
|
+
title?: string | undefined;
|
|
222
|
+
}) => {
|
|
223
|
+
content: string;
|
|
224
|
+
type: string;
|
|
225
|
+
values: never[];
|
|
226
|
+
};
|
|
200
227
|
text: (data: {
|
|
201
228
|
class?: string | undefined;
|
|
202
229
|
mask?: {
|
|
@@ -210,6 +237,7 @@ declare const _default: {
|
|
|
210
237
|
tag?: {
|
|
211
238
|
class?: string | undefined;
|
|
212
239
|
} | undefined;
|
|
240
|
+
textarea?: boolean | undefined;
|
|
213
241
|
type?: string | undefined;
|
|
214
242
|
value?: unknown;
|
|
215
243
|
} & {
|
|
@@ -3,5 +3,6 @@ import file from './file';
|
|
|
3
3
|
import optional from './optional';
|
|
4
4
|
import select from './select';
|
|
5
5
|
import s from './switch';
|
|
6
|
+
import textarea from './textarea';
|
|
6
7
|
import text from './text';
|
|
7
|
-
export default { checkbox, file, optional, select, switch: s, text };
|
|
8
|
+
export default { checkbox, file, optional, select, switch: s, textarea, text };
|
|
@@ -8,10 +8,7 @@ export default (data) => {
|
|
|
8
8
|
let state = reactive({
|
|
9
9
|
active: false,
|
|
10
10
|
error: ''
|
|
11
|
-
}),
|
|
12
|
-
if (type === 'textarea') {
|
|
13
|
-
type = 'string';
|
|
14
|
-
}
|
|
11
|
+
}), value = data?.value !== undefined ? `value='${data.value}'` : '';
|
|
15
12
|
return html `
|
|
16
13
|
<div
|
|
17
14
|
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
@@ -29,14 +26,15 @@ export default (data) => {
|
|
|
29
26
|
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
30
27
|
style='${data?.mask?.style || ''}'
|
|
31
28
|
>
|
|
32
|
-
<${data?.
|
|
29
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
33
30
|
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
34
31
|
name='${data?.name || ''}'
|
|
35
32
|
placeholder='${data?.placeholder || ''}'
|
|
36
33
|
onrender='${form.input.attributes(state)}'
|
|
37
|
-
type='${type}'
|
|
38
|
-
${data?.
|
|
34
|
+
type='${data?.type || 'string'}'
|
|
35
|
+
${!data?.textarea && value}
|
|
39
36
|
>
|
|
37
|
+
${data?.textarea ? html `${value}</textarea>` : ''}
|
|
40
38
|
|
|
41
39
|
${data?.mask?.content || ''}
|
|
42
40
|
</label>
|
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@ import file from './file';
|
|
|
3
3
|
import optional from './optional';
|
|
4
4
|
import select from './select';
|
|
5
5
|
import s from './switch';
|
|
6
|
+
import textarea from './textarea';
|
|
6
7
|
import text from './text';
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
export default { checkbox, file, optional, select, switch: s, text };
|
|
10
|
+
export default { checkbox, file, optional, select, switch: s, textarea, text };
|
|
@@ -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];
|
|
@@ -29,11 +30,7 @@ export default (data: Data) => {
|
|
|
29
30
|
active: false,
|
|
30
31
|
error: ''
|
|
31
32
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (type === 'textarea') {
|
|
35
|
-
type = 'string';
|
|
36
|
-
}
|
|
33
|
+
value = data?.value !== undefined ? `value='${data.value}'` : '';
|
|
37
34
|
|
|
38
35
|
return html`
|
|
39
36
|
<div
|
|
@@ -52,14 +49,15 @@ export default (data: Data) => {
|
|
|
52
49
|
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
53
50
|
style='${data?.mask?.style || ''}'
|
|
54
51
|
>
|
|
55
|
-
<${data?.
|
|
52
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
56
53
|
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
57
54
|
name='${data?.name || ''}'
|
|
58
55
|
placeholder='${data?.placeholder || ''}'
|
|
59
56
|
onrender='${form.input.attributes(state)}'
|
|
60
|
-
type='${type}'
|
|
61
|
-
${data?.
|
|
57
|
+
type='${data?.type || 'string'}'
|
|
58
|
+
${!data?.textarea && value}
|
|
62
59
|
>
|
|
60
|
+
${data?.textarea ? html`${value}</textarea>` : ''}
|
|
63
61
|
|
|
64
62
|
${data?.mask?.content || ''}
|
|
65
63
|
</label>
|