jeawin-astro 3.0.81 → 3.0.83
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/formitem/checkbox.astro +1 -1
- package/src/components/formitem/country.astro +31 -10
- package/src/components/formitem/input.astro +2 -2
- package/src/components/formitem/radio.astro +1 -1
- package/src/components/formitem/select.astro +1 -1
- package/src/components/formitem/textarea.astro +2 -2
- package/src/layouts/Layout.astro +1 -1
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import JeawinApi from "../../scripts/cms.js";
|
|
12
12
|
import { render_lang, render_value } from "../../scripts/util.js";
|
|
13
13
|
const { field } = Astro.props;
|
|
14
|
-
const { all_langs, jeawin_apikey, jeawin_api_domain, jeawin_api_path, sticky_top_height, is_preview } =
|
|
14
|
+
const { all_langs, jeawin_apikey, jeawin_api_domain, jeawin_api_path, sticky_top_height, is_preview, siteinfo } =
|
|
15
15
|
Astro.locals;
|
|
16
16
|
const jeawinapi = new JeawinApi({
|
|
17
17
|
apikey: jeawin_apikey,
|
|
@@ -25,15 +25,36 @@ const countrylist = await jeawinapi.get_country();
|
|
|
25
25
|
|
|
26
26
|
<label class="block">
|
|
27
27
|
<span class="text-gray-700">
|
|
28
|
-
{field.
|
|
28
|
+
{field.field_display_name}
|
|
29
29
|
</span>
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
{siteinfo.language_id.indexOf('zh')=== 0 ? (
|
|
31
|
+
<select class="mt-1 block w-full" autocomplete="off">
|
|
32
|
+
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
33
|
+
{
|
|
34
|
+
countrylist.map((country: any) => (
|
|
35
|
+
<option value={country.cn}>{country.cn}</option>
|
|
36
|
+
))
|
|
37
|
+
}
|
|
38
|
+
</select>
|
|
39
|
+
) : siteinfo.language_id.indexOf('fr') === 0 ?(
|
|
40
|
+
<select class="mt-1 block w-full" autocomplete="off">
|
|
41
|
+
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
42
|
+
{
|
|
43
|
+
countrylist.map((country: any) => (
|
|
44
|
+
<option value={country.fr}>{country.fr}</option>
|
|
45
|
+
))
|
|
46
|
+
}
|
|
47
|
+
</select>
|
|
48
|
+
) : (
|
|
49
|
+
<select class="mt-1 block w-full" autocomplete="off">
|
|
50
|
+
<option value="">{render_lang(all_langs, "Chooce One")}</option>
|
|
51
|
+
{
|
|
52
|
+
countrylist.map((country: any) => (
|
|
53
|
+
<option value={country.en}>{country.en}</option>
|
|
54
|
+
))
|
|
55
|
+
}
|
|
56
|
+
</select>
|
|
57
|
+
)}
|
|
58
|
+
|
|
38
59
|
{render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
|
|
39
60
|
</label>
|
|
@@ -14,14 +14,14 @@ const { field, type } = Astro.props;
|
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
16
|
<span class="text-gray-700">
|
|
17
|
-
{field.
|
|
17
|
+
{field.field_display_name}
|
|
18
18
|
</span>
|
|
19
19
|
<input
|
|
20
20
|
type={type}
|
|
21
21
|
required="required"
|
|
22
22
|
id={field.field_name}
|
|
23
23
|
name={field.field_name}
|
|
24
|
-
placeholder={field.placeholder ? field.placeholder : field.
|
|
24
|
+
placeholder={field.placeholder ? field.placeholder : field.field_display_name}
|
|
25
25
|
autocomplete="off"
|
|
26
26
|
class="form-input mt-1 block w-full"
|
|
27
27
|
/>
|
|
@@ -14,7 +14,7 @@ const { field } = Astro.props;
|
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
16
|
<span class="text-gray-700">
|
|
17
|
-
{field.
|
|
17
|
+
{field.field_display_name}
|
|
18
18
|
</span>
|
|
19
19
|
<select class="mt-1 block w-full" autocomplete="off"> </select>
|
|
20
20
|
{render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
|
|
@@ -13,12 +13,12 @@ const { field } = Astro.props;
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
<label class="block">
|
|
16
|
-
<span class="text-gray-700">{field.
|
|
16
|
+
<span class="text-gray-700">{field.field_display_name}</span>
|
|
17
17
|
<textarea
|
|
18
18
|
id={field.field_name}
|
|
19
19
|
name={field.field_name}
|
|
20
20
|
required="required"
|
|
21
21
|
class="mt-1 block w-full"
|
|
22
|
-
autocomplete="off" placeholder={field.placeholder ? field.placeholder : field.
|
|
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}
|
|
24
24
|
</label>
|