@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.
@@ -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
  } & {
@@ -82,6 +82,7 @@ declare const _default: {
82
82
  tag?: {
83
83
  class?: string | undefined;
84
84
  } | undefined;
85
+ textarea?: boolean | undefined;
85
86
  type?: string | undefined;
86
87
  value?: unknown;
87
88
  } & {
@@ -13,6 +13,7 @@ type Data = {
13
13
  tag?: {
14
14
  class?: string;
15
15
  };
16
+ textarea?: boolean;
16
17
  type?: string;
17
18
  value?: unknown;
18
19
  } & Parameters<typeof description>[0] & Parameters<typeof title>[0];
@@ -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
- <input
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?.value !== undefined ? `value='${data.value}'` : ''}
35
+ ${!data?.textarea && value}
36
36
  >
37
+ ${data?.textarea ? html `${value}</textarea>` : ''}
37
38
 
38
39
  ${data?.mask?.content || ''}
39
40
  </label>
@@ -0,0 +1,7 @@
1
+ import text from './text';
2
+ declare const _default: (data: Parameters<typeof text>[0]) => {
3
+ content: string;
4
+ type: string;
5
+ values: never[];
6
+ };
7
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import text from './text';
2
+ export default (data) => {
3
+ data.textarea = true;
4
+ return text(data);
5
+ };
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "prepublishOnly": "npm run build"
23
23
  },
24
24
  "types": "build/index.d.ts",
25
- "version": "0.0.74"
25
+ "version": "0.0.77"
26
26
  }
@@ -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
- <input
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?.value !== undefined ? `value='${data.value}'` : ''}
58
+ ${!data?.textarea && value}
57
59
  >
60
+ ${data?.textarea ? html`${value}</textarea>` : ''}
58
61
 
59
62
  ${data?.mask?.content || ''}
60
63
  </label>
@@ -0,0 +1,8 @@
1
+ import text from './text';
2
+
3
+
4
+ export default (data: Parameters<typeof text>[0]) => {
5
+ data.textarea = true;
6
+
7
+ return text(data);
8
+ };