@esportsplus/ui 0.0.74 → 0.0.76

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.
@@ -8,7 +8,10 @@ export default (data) => {
8
8
  let state = reactive({
9
9
  active: false,
10
10
  error: ''
11
- });
11
+ }), type = data?.type || 'string';
12
+ if (type === 'textarea') {
13
+ type = 'string';
14
+ }
12
15
  return html `
13
16
  <div
14
17
  class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
@@ -26,12 +29,12 @@ export default (data) => {
26
29
  class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
27
30
  style='${data?.mask?.style || ''}'
28
31
  >
29
- <input
32
+ <${data?.type === 'textarea' ? 'textarea' : 'input'}
30
33
  class='field-tag --padding-400 ${data?.tag?.class || ''}'
31
34
  name='${data?.name || ''}'
32
35
  placeholder='${data?.placeholder || ''}'
33
36
  onrender='${form.input.attributes(state)}'
34
- type='${data?.type || 'string'}'
37
+ type='${type}'
35
38
  ${data?.value !== undefined ? `value='${data.value}'` : ''}
36
39
  >
37
40
 
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.76"
26
26
  }
@@ -28,7 +28,12 @@ export default (data: Data) => {
28
28
  let state = reactive({
29
29
  active: false,
30
30
  error: ''
31
- });
31
+ }),
32
+ type = data?.type || 'string';
33
+
34
+ if (type === 'textarea') {
35
+ type = 'string';
36
+ }
32
37
 
33
38
  return html`
34
39
  <div
@@ -47,12 +52,12 @@ export default (data: Data) => {
47
52
  class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
48
53
  style='${data?.mask?.style || ''}'
49
54
  >
50
- <input
55
+ <${data?.type === 'textarea' ? 'textarea' : 'input'}
51
56
  class='field-tag --padding-400 ${data?.tag?.class || ''}'
52
57
  name='${data?.name || ''}'
53
58
  placeholder='${data?.placeholder || ''}'
54
59
  onrender='${form.input.attributes(state)}'
55
- type='${data?.type || 'string'}'
60
+ type='${type}'
56
61
  ${data?.value !== undefined ? `value='${data.value}'` : ''}
57
62
  >
58
63