@esportsplus/ui 0.0.73 → 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.
@@ -123,6 +123,9 @@ declare const _default: {
123
123
  name?: string | undefined;
124
124
  placeholder?: string | undefined;
125
125
  style?: string | undefined;
126
+ tag?: {
127
+ class?: string | undefined;
128
+ } | undefined;
126
129
  type?: string | undefined;
127
130
  value?: unknown;
128
131
  } & {
@@ -204,6 +207,9 @@ declare const _default: {
204
207
  name?: string | undefined;
205
208
  placeholder?: string | undefined;
206
209
  style?: string | undefined;
210
+ tag?: {
211
+ class?: string | undefined;
212
+ } | undefined;
207
213
  type?: string | undefined;
208
214
  value?: unknown;
209
215
  } & {
@@ -79,6 +79,9 @@ declare const _default: {
79
79
  name?: string | undefined;
80
80
  placeholder?: string | undefined;
81
81
  style?: string | undefined;
82
+ tag?: {
83
+ class?: string | undefined;
84
+ } | undefined;
82
85
  type?: string | undefined;
83
86
  value?: unknown;
84
87
  } & {
@@ -10,6 +10,9 @@ type Data = {
10
10
  name?: string;
11
11
  placeholder?: string;
12
12
  style?: string;
13
+ tag?: {
14
+ class?: string;
15
+ };
13
16
  type?: string;
14
17
  value?: unknown;
15
18
  } & Parameters<typeof description>[0] & Parameters<typeof title>[0];
@@ -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"
@@ -23,15 +26,15 @@ export default (data) => {
23
26
  ${title(data)}
24
27
 
25
28
  <label
26
- class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300'
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
30
- class='field-tag --padding-400'
32
+ <${data?.type === 'textarea' ? 'textarea' : 'input'}
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.73"
25
+ "version": "0.0.76"
26
26
  }
@@ -16,6 +16,9 @@ type Data = {
16
16
  name?: string;
17
17
  placeholder?: string;
18
18
  style?: string;
19
+ tag?: {
20
+ class?: string;
21
+ };
19
22
  type?: string;
20
23
  value?: unknown;
21
24
  } & Parameters<typeof description>[0] & Parameters<typeof title>[0];
@@ -25,7 +28,12 @@ export default (data: Data) => {
25
28
  let state = reactive({
26
29
  active: false,
27
30
  error: ''
28
- });
31
+ }),
32
+ type = data?.type || 'string';
33
+
34
+ if (type === 'textarea') {
35
+ type = 'string';
36
+ }
29
37
 
30
38
  return html`
31
39
  <div
@@ -41,15 +49,15 @@ export default (data: Data) => {
41
49
  ${title(data)}
42
50
 
43
51
  <label
44
- class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300'
52
+ class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
45
53
  style='${data?.mask?.style || ''}'
46
54
  >
47
- <input
48
- class='field-tag --padding-400'
55
+ <${data?.type === 'textarea' ? 'textarea' : 'input'}
56
+ class='field-tag --padding-400 ${data?.tag?.class || ''}'
49
57
  name='${data?.name || ''}'
50
58
  placeholder='${data?.placeholder || ''}'
51
59
  onrender='${form.input.attributes(state)}'
52
- type='${data?.type || 'string'}'
60
+ type='${type}'
53
61
  ${data?.value !== undefined ? `value='${data.value}'` : ''}
54
62
  >
55
63