jeawin-astro 3.0.89 → 3.0.90
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/package.json +1 -1
- package/src/components/form.astro +21 -15
- package/src/components/formitem/checkbox.astro +3 -3
- package/src/components/formitem/country.astro +4 -4
- package/src/components/formitem/input.astro +2 -2
- package/src/components/formitem/radio.astro +3 -3
- package/src/components/formitem/select.astro +2 -2
- package/src/components/formitem/textarea.astro +2 -2
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ import Radio from "./formitem/radio.astro";
|
|
|
16
16
|
import Checkbox from "./formitem/checkbox.astro";
|
|
17
17
|
import Select from "./formitem/select.astro";
|
|
18
18
|
import Country from "./formitem/country.astro";
|
|
19
|
-
const { form_id } = Astro.props;
|
|
19
|
+
const { form_id, col_num = 1, max_width = null } = Astro.props;
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
22
|
btn_class,
|
|
@@ -62,11 +62,18 @@ const submitbuttontext = render_lang(all_langs, "send message");
|
|
|
62
62
|
id={`captchaCode${form_id}`}
|
|
63
63
|
value=""
|
|
64
64
|
/>
|
|
65
|
-
<div class="
|
|
65
|
+
<div class:list={["max-w-md mx-auto", max_width]}>
|
|
66
66
|
{forminfo.form_before_content ? (
|
|
67
|
-
<div class="
|
|
67
|
+
<div class="prose max-w-none break-words"><Fragment set:html={forminfo.form_before_content} /></div>
|
|
68
68
|
) : null}
|
|
69
|
-
<div class=
|
|
69
|
+
<div class:list={[
|
|
70
|
+
"mt-4 grid grid-cols-1 gap-4",
|
|
71
|
+
{'xl:grid-cols-2': col_num == 2},
|
|
72
|
+
{'xl:grid-cols-3': col_num == 3},
|
|
73
|
+
{'xl:grid-cols-4': col_num == 4},
|
|
74
|
+
{'xl:grid-cols-5': col_num == 5},
|
|
75
|
+
{'xl:grid-cols-6': col_num == 6}
|
|
76
|
+
]}>
|
|
70
77
|
{forminfo.forms_fields.map((field: any) => (
|
|
71
78
|
<Fragment>
|
|
72
79
|
{field.field_type == "1" ? (
|
|
@@ -94,19 +101,18 @@ const submitbuttontext = render_lang(all_langs, "send message");
|
|
|
94
101
|
)}
|
|
95
102
|
</Fragment>
|
|
96
103
|
))}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="mt-4 w-full text-center">
|
|
106
|
+
<button
|
|
107
|
+
type="submit"
|
|
108
|
+
id={`submitbtn${form_id}`}
|
|
109
|
+
class:list={['cursor-pointer capitalize',btn_class]}
|
|
110
|
+
>
|
|
111
|
+
{forminfo.submit_button_text || submitbuttontext}
|
|
112
|
+
</button>
|
|
107
113
|
</div>
|
|
108
114
|
{forminfo.form_after_content ? (
|
|
109
|
-
<div class="
|
|
115
|
+
<div class="mt-4 prose max-w-none break-words"><Fragment set:html={forminfo.form_after_content} /></div>
|
|
110
116
|
) : null}
|
|
111
117
|
</div>
|
|
112
118
|
</form>
|
|
@@ -17,7 +17,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
17
17
|
|
|
18
18
|
<div class="block">
|
|
19
19
|
<span class="text-gray-700">
|
|
20
|
-
{field.field_display_name}
|
|
20
|
+
{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} />
|
|
21
21
|
</span>
|
|
22
22
|
{
|
|
23
23
|
field_option_arr.map((option: any) => (
|
|
@@ -29,7 +29,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
29
29
|
name={field.field_name}
|
|
30
30
|
value={option}
|
|
31
31
|
checked="checked"
|
|
32
|
-
class="mt-1 block w-full"
|
|
32
|
+
class="mt-1 block w-full" required={field.isrequired == '1' ? 'required' : null}
|
|
33
33
|
/>
|
|
34
34
|
) : (
|
|
35
35
|
<input
|
|
@@ -37,7 +37,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
37
37
|
id={field.field_name}
|
|
38
38
|
name={field.field_name}
|
|
39
39
|
value={option}
|
|
40
|
-
class="mt-1 block w-full"
|
|
40
|
+
class="mt-1 block w-full" required={field.isrequired == '1' ? 'required' : null}
|
|
41
41
|
/>
|
|
42
42
|
)}
|
|
43
43
|
{option}
|
|
@@ -25,10 +25,10 @@ const countrylist = await jeawinapi.get_country();
|
|
|
25
25
|
|
|
26
26
|
<label class="block">
|
|
27
27
|
<span class="text-gray-700">
|
|
28
|
-
{field.field_display_name}
|
|
28
|
+
{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} />
|
|
29
29
|
</span>
|
|
30
30
|
{siteinfo.language_id.indexOf('zh')=== 0 ? (
|
|
31
|
-
<select class="mt-1 block w-full" autocomplete="off">
|
|
31
|
+
<select class="mt-1 block w-full" autocomplete="off" required={field.isrequired == '1' ? 'required' : null}>
|
|
32
32
|
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
33
33
|
{
|
|
34
34
|
countrylist.map((country: any) => (
|
|
@@ -37,7 +37,7 @@ const countrylist = await jeawinapi.get_country();
|
|
|
37
37
|
}
|
|
38
38
|
</select>
|
|
39
39
|
) : siteinfo.language_id.indexOf('fr') === 0 ?(
|
|
40
|
-
<select class="mt-1 block w-full" autocomplete="off">
|
|
40
|
+
<select class="mt-1 block w-full" autocomplete="off" required={field.isrequired == '1' ? 'required' : null}>
|
|
41
41
|
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
42
42
|
{
|
|
43
43
|
countrylist.map((country: any) => (
|
|
@@ -46,7 +46,7 @@ const countrylist = await jeawinapi.get_country();
|
|
|
46
46
|
}
|
|
47
47
|
</select>
|
|
48
48
|
) : (
|
|
49
|
-
<select class="mt-1 block w-full" autocomplete="off">
|
|
49
|
+
<select class="mt-1 block w-full" autocomplete="off" required={field.isrequired == '1' ? 'required' : null}>
|
|
50
50
|
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
51
51
|
{
|
|
52
52
|
countrylist.map((country: any) => (
|
|
@@ -14,11 +14,11 @@ const { field, type } = Astro.props;
|
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
16
|
<span class="text-gray-700">
|
|
17
|
-
{field.field_display_name}
|
|
17
|
+
{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} />
|
|
18
18
|
</span>
|
|
19
19
|
<input
|
|
20
20
|
type={type}
|
|
21
|
-
required="required"
|
|
21
|
+
required={field.isrequired == '1' ? "required" : null}
|
|
22
22
|
id={field.field_name}
|
|
23
23
|
name={field.field_name}
|
|
24
24
|
placeholder={field.placeholder ? field.placeholder : field.field_display_name}
|
|
@@ -17,7 +17,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
17
17
|
|
|
18
18
|
<div class="block">
|
|
19
19
|
<span class="text-gray-700">
|
|
20
|
-
{field.field_display_name}
|
|
20
|
+
{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} />
|
|
21
21
|
</span>
|
|
22
22
|
{
|
|
23
23
|
field_option_arr.map((option: any) => (
|
|
@@ -29,7 +29,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
29
29
|
name={field.field_name}
|
|
30
30
|
value={option}
|
|
31
31
|
checked="checked"
|
|
32
|
-
class="mt-1 block w-full"
|
|
32
|
+
class="mt-1 block w-full" required={field.isrequired == '1' ? 'required' : null}
|
|
33
33
|
/>
|
|
34
34
|
) : (
|
|
35
35
|
<input
|
|
@@ -37,7 +37,7 @@ let field_option_defaults_arr = field.field_option_defaults.split("\n");
|
|
|
37
37
|
id={field.field_name}
|
|
38
38
|
name={field.field_name}
|
|
39
39
|
value={option}
|
|
40
|
-
class="mt-1 block w-full"
|
|
40
|
+
class="mt-1 block w-full" required={field.isrequired == '1' ? 'required' : null}
|
|
41
41
|
/>
|
|
42
42
|
)}
|
|
43
43
|
{option}
|
|
@@ -14,8 +14,8 @@ const { field } = Astro.props;
|
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
16
|
<span class="text-gray-700">
|
|
17
|
-
{field.field_display_name}
|
|
17
|
+
{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} />
|
|
18
18
|
</span>
|
|
19
|
-
<select class="mt-1 block w-full" autocomplete="off"> </select>
|
|
19
|
+
<select class="mt-1 block w-full" autocomplete="off" required={field.isrequired == '1' ? 'required' : null}> </select>
|
|
20
20
|
{render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
|
|
21
21
|
</label>
|
|
@@ -13,11 +13,11 @@ const { field } = Astro.props;
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
|
-
<span class="text-gray-700">{field.field_display_name}
|
|
16
|
+
<span class="text-gray-700">{field.field_display_name}<Fragment set:html={field.isrequired == '1' ? '<span class="text-[#f00] ml-1">*</span>' : ''} /></span>
|
|
17
17
|
<textarea
|
|
18
18
|
id={field.field_name}
|
|
19
19
|
name={field.field_name}
|
|
20
|
-
required="required"
|
|
20
|
+
required={field.isrequired == '1' ? "required" : null}
|
|
21
21
|
class="mt-1 block w-full"
|
|
22
22
|
autocomplete="off" placeholder={field.placeholder ? field.placeholder : field.field_display_name}></textarea>
|
|
23
23
|
{render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
|