jeawin-astro 3.0.61 → 3.0.63
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/category_list.astro +5 -2
- package/src/components/common_card.astro +2 -2
- package/src/components/news_category_list.astro +6 -18
- package/src/components/news_category_list1.astro +6 -18
- package/src/components/news_category_list2.astro +6 -18
- package/src/components/nodes_list.astro +11 -0
- package/src/components/product_category_list.astro +5 -2
- package/src/components/tags_category_list.astro +5 -2
- package/src/layouts/category.astro +2 -2
- package/src/layouts/channel.astro +2 -2
- package/src/scripts/cms.js +8 -0
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ const {
|
|
|
28
28
|
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
29
29
|
node_item_component,
|
|
30
30
|
max_width_screen='max-w-screen-2xl',
|
|
31
|
+
search_for,
|
|
31
32
|
...other_props
|
|
32
33
|
} = Astro.props;
|
|
33
34
|
|
|
@@ -75,7 +76,8 @@ switch (node_item_component) {
|
|
|
75
76
|
include_children_category_nodes={
|
|
76
77
|
include_children_category_nodes
|
|
77
78
|
}
|
|
78
|
-
no_fields={no_fields}
|
|
79
|
+
no_fields={no_fields}
|
|
80
|
+
search_for={search_for}
|
|
79
81
|
>
|
|
80
82
|
{(nodes: any[]) => (
|
|
81
83
|
<div class:list={[layout]}>
|
|
@@ -109,7 +111,8 @@ switch (node_item_component) {
|
|
|
109
111
|
page={page}
|
|
110
112
|
limit={limit}
|
|
111
113
|
include_children_category_nodes={include_children_category_nodes}
|
|
112
|
-
no_fields={no_fields}
|
|
114
|
+
no_fields={no_fields}
|
|
115
|
+
search_for={search_for}
|
|
113
116
|
>
|
|
114
117
|
{(nodes: any[]) => (
|
|
115
118
|
<div class:list={[layout]}>
|
|
@@ -48,7 +48,7 @@ if (render_value(node, "content")) {
|
|
|
48
48
|
) : (
|
|
49
49
|
<a href={render_url(node.node_url, base, null, url_suffix)} title={node.node_title}>
|
|
50
50
|
{node.node_picurl ? (
|
|
51
|
-
<RenderImage img_html={node.node_picurl_html} add_classes="border border-gray-200" />
|
|
51
|
+
<RenderImage img_html={node.node_picurl_html} add_classes="border border-gray-200 mx-auto" />
|
|
52
52
|
) : (
|
|
53
53
|
<DefaultImage />
|
|
54
54
|
)}
|
|
@@ -58,7 +58,7 @@ if (render_value(node, "content")) {
|
|
|
58
58
|
) : (
|
|
59
59
|
<a href={render_url(node.node_url, base, null, url_suffix)} title={node.node_title}>
|
|
60
60
|
{node.node_picurl ? (
|
|
61
|
-
<RenderImage img_html={node.node_picurl_html} add_classes="border border-gray-200" />
|
|
61
|
+
<RenderImage img_html={node.node_picurl_html} add_classes="border border-gray-200 mx-auto" />
|
|
62
62
|
) : (
|
|
63
63
|
<DefaultImage />
|
|
64
64
|
)}
|
|
@@ -22,21 +22,6 @@ import NewsGridCard3 from "./cards/news_grid_card3.astro";
|
|
|
22
22
|
import NewsGridCard4 from "./cards/news_grid_card4.astro";
|
|
23
23
|
import NewsGridCard5 from "./cards/news_grid_card5.astro";
|
|
24
24
|
|
|
25
|
-
interface Props {
|
|
26
|
-
channel_id: any;
|
|
27
|
-
category_id?: any;
|
|
28
|
-
uri?: any;
|
|
29
|
-
page?: any;
|
|
30
|
-
limit?: any;
|
|
31
|
-
no_fields?: any;
|
|
32
|
-
include_children_category_nodes?: any;
|
|
33
|
-
show_category_nodes?: boolean;
|
|
34
|
-
has_sider?: boolean;
|
|
35
|
-
layout?: any;
|
|
36
|
-
node_item_component?: any;
|
|
37
|
-
max_width_screen?: any;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
25
|
const {
|
|
41
26
|
channel_id,
|
|
42
27
|
category_id,
|
|
@@ -49,7 +34,8 @@ const {
|
|
|
49
34
|
has_sider = false,
|
|
50
35
|
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
51
36
|
node_item_component,
|
|
52
|
-
max_width_screen='max-w-screen-2xl'
|
|
37
|
+
max_width_screen='max-w-screen-2xl',
|
|
38
|
+
search_for
|
|
53
39
|
} = Astro.props;
|
|
54
40
|
|
|
55
41
|
const { btn_class, all_categories, base, url_suffix } = Astro.locals;
|
|
@@ -117,7 +103,8 @@ switch (node_item_component) {
|
|
|
117
103
|
include_children_category_nodes={
|
|
118
104
|
include_children_category_nodes
|
|
119
105
|
}
|
|
120
|
-
no_fields={no_fields}
|
|
106
|
+
no_fields={no_fields}
|
|
107
|
+
search_for={search_for}
|
|
121
108
|
>
|
|
122
109
|
{(nodes: any[]) => (
|
|
123
110
|
<Fragment>
|
|
@@ -164,7 +151,8 @@ switch (node_item_component) {
|
|
|
164
151
|
page={page}
|
|
165
152
|
limit={limit}
|
|
166
153
|
no_fields={no_fields}
|
|
167
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
154
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
155
|
+
search_for={search_for}
|
|
168
156
|
>
|
|
169
157
|
{(nodes: any[]) => (
|
|
170
158
|
<Fragment>
|
|
@@ -23,21 +23,6 @@ import NewsGridCard3 from "./cards/news_grid_card3.astro";
|
|
|
23
23
|
import NewsGridCard4 from "./cards/news_grid_card4.astro";
|
|
24
24
|
import NewsGridCard5 from "./cards/news_grid_card5.astro";
|
|
25
25
|
|
|
26
|
-
interface Props {
|
|
27
|
-
channel_id: any;
|
|
28
|
-
category_id?: any;
|
|
29
|
-
uri?: any;
|
|
30
|
-
page?: any;
|
|
31
|
-
limit?: any;
|
|
32
|
-
no_fields?: any;
|
|
33
|
-
include_children_category_nodes?: any;
|
|
34
|
-
show_category_nodes?: boolean;
|
|
35
|
-
has_sider?: boolean;
|
|
36
|
-
layout?: any;
|
|
37
|
-
node_item_component?: any;
|
|
38
|
-
max_width_screen?: any;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
26
|
const {
|
|
42
27
|
channel_id,
|
|
43
28
|
category_id,
|
|
@@ -50,7 +35,8 @@ const {
|
|
|
50
35
|
has_sider = false,
|
|
51
36
|
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
52
37
|
node_item_component,
|
|
53
|
-
max_width_screen='max-w-screen-2xl'
|
|
38
|
+
max_width_screen='max-w-screen-2xl',
|
|
39
|
+
search_for
|
|
54
40
|
} = Astro.props;
|
|
55
41
|
|
|
56
42
|
const { btn_class, all_categories, base, url_suffix } = Astro.locals;
|
|
@@ -127,7 +113,8 @@ switch (node_item_component) {
|
|
|
127
113
|
include_children_category_nodes={
|
|
128
114
|
include_children_category_nodes
|
|
129
115
|
}
|
|
130
|
-
no_fields={no_fields}
|
|
116
|
+
no_fields={no_fields}
|
|
117
|
+
search_for={search_for}
|
|
131
118
|
>
|
|
132
119
|
{(nodes: any[]) => (
|
|
133
120
|
<Swiper
|
|
@@ -176,7 +163,8 @@ switch (node_item_component) {
|
|
|
176
163
|
page={page}
|
|
177
164
|
limit={limit}
|
|
178
165
|
no_fields={no_fields}
|
|
179
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
166
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
167
|
+
search_for={search_for}
|
|
180
168
|
>
|
|
181
169
|
{(nodes: any[]) => (
|
|
182
170
|
<Fragment>
|
|
@@ -23,21 +23,6 @@ import NewsGridCard3 from "./cards/news_grid_card3.astro";
|
|
|
23
23
|
import NewsGridCard4 from "./cards/news_grid_card4.astro";
|
|
24
24
|
import NewsGridCard5 from "./cards/news_grid_card5.astro";
|
|
25
25
|
|
|
26
|
-
interface Props {
|
|
27
|
-
channel_id: any;
|
|
28
|
-
category_id?: any;
|
|
29
|
-
uri?: any;
|
|
30
|
-
page?: any;
|
|
31
|
-
limit?: any;
|
|
32
|
-
no_fields?: any;
|
|
33
|
-
include_children_category_nodes?: any;
|
|
34
|
-
show_category_nodes?: boolean;
|
|
35
|
-
has_sider?: boolean;
|
|
36
|
-
layout?: any;
|
|
37
|
-
node_item_component?: any;
|
|
38
|
-
max_width_screen?: any;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
26
|
const {
|
|
42
27
|
channel_id,
|
|
43
28
|
category_id,
|
|
@@ -50,7 +35,8 @@ const {
|
|
|
50
35
|
has_sider = false,
|
|
51
36
|
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
52
37
|
node_item_component,
|
|
53
|
-
max_width_screen = 'max-w-screen-2xl'
|
|
38
|
+
max_width_screen = 'max-w-screen-2xl',
|
|
39
|
+
search_for
|
|
54
40
|
} = Astro.props;
|
|
55
41
|
|
|
56
42
|
const { btn_class, all_categories, base, url_suffix } = Astro.locals;
|
|
@@ -112,7 +98,8 @@ switch (node_item_component) {
|
|
|
112
98
|
include_children_category_nodes={
|
|
113
99
|
include_children_category_nodes
|
|
114
100
|
}
|
|
115
|
-
no_fields={no_fields}
|
|
101
|
+
no_fields={no_fields}
|
|
102
|
+
search_for={search_for}
|
|
116
103
|
>
|
|
117
104
|
{(nodes: any[]) => (
|
|
118
105
|
<Block1
|
|
@@ -167,7 +154,8 @@ switch (node_item_component) {
|
|
|
167
154
|
page={page}
|
|
168
155
|
limit={limit}
|
|
169
156
|
no_fields={no_fields}
|
|
170
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
157
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
158
|
+
search_for={search_for}
|
|
171
159
|
>
|
|
172
160
|
{(nodes: any[]) => (
|
|
173
161
|
<Fragment>
|
|
@@ -23,6 +23,7 @@ const {
|
|
|
23
23
|
no_images_html,
|
|
24
24
|
field_array,
|
|
25
25
|
ids,
|
|
26
|
+
search_for
|
|
26
27
|
} = Astro.props;
|
|
27
28
|
const { jeawin_apikey, jeawin_api_domain, jeawin_api_path, is_preview, sticky_top_height } = Astro.locals;
|
|
28
29
|
const jeawinapi = new JeawinApi({
|
|
@@ -43,6 +44,7 @@ if (limit) {
|
|
|
43
44
|
let current_page = 1;
|
|
44
45
|
let total_pages = 0;
|
|
45
46
|
let total = 0;
|
|
47
|
+
let results_info = '';
|
|
46
48
|
// console.log(page);
|
|
47
49
|
let res = null;
|
|
48
50
|
switch (limit_type) {
|
|
@@ -56,6 +58,7 @@ switch (limit_type) {
|
|
|
56
58
|
no_images_html: no_images_html,
|
|
57
59
|
field_array: field_array,
|
|
58
60
|
ids: ids,
|
|
61
|
+
search_for: search_for
|
|
59
62
|
});
|
|
60
63
|
// console.log(res);
|
|
61
64
|
break;
|
|
@@ -70,6 +73,7 @@ switch (limit_type) {
|
|
|
70
73
|
no_images_html: no_images_html,
|
|
71
74
|
field_array: field_array,
|
|
72
75
|
ids: ids,
|
|
76
|
+
search_for: search_for
|
|
73
77
|
});
|
|
74
78
|
// console.log(res);
|
|
75
79
|
break;
|
|
@@ -83,6 +87,7 @@ switch (limit_type) {
|
|
|
83
87
|
no_images_html: no_images_html,
|
|
84
88
|
field_array: field_array,
|
|
85
89
|
ids: ids,
|
|
90
|
+
search_for: search_for
|
|
86
91
|
});
|
|
87
92
|
break;
|
|
88
93
|
default:
|
|
@@ -97,6 +102,7 @@ switch (limit_type) {
|
|
|
97
102
|
no_images_html: no_images_html,
|
|
98
103
|
field_array: field_array,
|
|
99
104
|
ids: ids,
|
|
105
|
+
search_for: search_for
|
|
100
106
|
});
|
|
101
107
|
// console.log(res);
|
|
102
108
|
break;
|
|
@@ -107,10 +113,15 @@ current_page = res.current_page;
|
|
|
107
113
|
total_pages = res.total_pages;
|
|
108
114
|
total = res.nodecount;
|
|
109
115
|
nodes = res.nodes;
|
|
116
|
+
results_info = res.results_info;
|
|
110
117
|
|
|
111
118
|
const html = await Astro.slots.render("default", [nodes]);
|
|
112
119
|
// console.log(html);
|
|
113
120
|
---
|
|
121
|
+
{
|
|
122
|
+
results_info ? (<div class="mb-4 text-gray-700 text-sm"><Fragment set:html={results_info} /></div>) : null
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
|
|
115
126
|
<Fragment set:html={html} />
|
|
116
127
|
|
|
@@ -31,6 +31,7 @@ const {
|
|
|
31
31
|
layout = "grid gap-4 grid-cols-2 xl:grid-cols-4",
|
|
32
32
|
node_item_component,
|
|
33
33
|
max_width_screen= 'max-w-screen-2xl',
|
|
34
|
+
search_for,
|
|
34
35
|
...other_props
|
|
35
36
|
} = Astro.props;
|
|
36
37
|
|
|
@@ -116,7 +117,8 @@ switch (node_item_component) {
|
|
|
116
117
|
include_children_category_nodes={
|
|
117
118
|
include_children_category_nodes
|
|
118
119
|
}
|
|
119
|
-
no_fields={no_fields}
|
|
120
|
+
no_fields={no_fields}
|
|
121
|
+
search_for={search_for}
|
|
120
122
|
>
|
|
121
123
|
{(nodes: any[]) => (
|
|
122
124
|
<div class:list={[layout]}>
|
|
@@ -157,7 +159,8 @@ switch (node_item_component) {
|
|
|
157
159
|
page={page}
|
|
158
160
|
limit={limit}
|
|
159
161
|
no_fields={no_fields}
|
|
160
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
162
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
163
|
+
search_for={search_for}
|
|
161
164
|
>
|
|
162
165
|
{(nodes: any[]) => (
|
|
163
166
|
<div class:list={[layout]}>
|
|
@@ -27,6 +27,7 @@ const {
|
|
|
27
27
|
layout = "",
|
|
28
28
|
node_item_component,
|
|
29
29
|
max_width_screen = 'max-w-screen-2xl',
|
|
30
|
+
search_for,
|
|
30
31
|
...other_props
|
|
31
32
|
} = Astro.props;
|
|
32
33
|
|
|
@@ -67,7 +68,8 @@ const categories: any[] = _.filter(all_categories, (o: any) => {
|
|
|
67
68
|
include_children_category_nodes={
|
|
68
69
|
include_children_category_nodes
|
|
69
70
|
}
|
|
70
|
-
no_fields={no_fields}
|
|
71
|
+
no_fields={no_fields}
|
|
72
|
+
search_for={search_for}
|
|
71
73
|
>
|
|
72
74
|
{(nodes: any[]) => (
|
|
73
75
|
<div class:list={[layout]}>
|
|
@@ -106,7 +108,8 @@ const categories: any[] = _.filter(all_categories, (o: any) => {
|
|
|
106
108
|
page={page}
|
|
107
109
|
limit={limit}
|
|
108
110
|
no_fields={no_fields}
|
|
109
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
111
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
112
|
+
search_for={search_for}
|
|
110
113
|
>
|
|
111
114
|
{(nodes: any[]) => (
|
|
112
115
|
<div class:list={[layout]}>
|
|
@@ -130,7 +130,7 @@ if (Astro.slots.has("inner-header")) {
|
|
|
130
130
|
<div class="px-4">
|
|
131
131
|
{categoryinfo.extra ? (
|
|
132
132
|
<div class="my-5 break-words prose !max-w-none">
|
|
133
|
-
<Fragment set:html={categoryinfo
|
|
133
|
+
<Fragment set:html={render_value(categoryinfo, 'extra_html')} />
|
|
134
134
|
</div>
|
|
135
135
|
) : null}
|
|
136
136
|
|
|
@@ -138,7 +138,7 @@ if (Astro.slots.has("inner-header")) {
|
|
|
138
138
|
<Fragment>
|
|
139
139
|
{render_value(categoryinfo, `extra-${i0}`) ? (
|
|
140
140
|
<div class="my-5 break-words prose !max-w-none">
|
|
141
|
-
<Fragment set:html={categoryinfo
|
|
141
|
+
<Fragment set:html={render_value(categoryinfo, `extra-${i0}_html`)} />
|
|
142
142
|
</div>
|
|
143
143
|
) : null}
|
|
144
144
|
</Fragment>
|
|
@@ -135,7 +135,7 @@ if (Astro.slots.has("inner-header")) {
|
|
|
135
135
|
<div class="px-4">
|
|
136
136
|
{channelinfo.extra ? (
|
|
137
137
|
<div class="my-5 break-words prose !max-w-none">
|
|
138
|
-
<Fragment set:html={channelinfo
|
|
138
|
+
<Fragment set:html={render_value(channelinfo, 'extra_html')} />
|
|
139
139
|
</div>
|
|
140
140
|
) : null}
|
|
141
141
|
|
|
@@ -143,7 +143,7 @@ if (Astro.slots.has("inner-header")) {
|
|
|
143
143
|
<Fragment>
|
|
144
144
|
{render_value(channelinfo, `extra-${i0}`) ? (
|
|
145
145
|
<div class="my-5 break-words prose !max-w-none">
|
|
146
|
-
<Fragment set:html={channelinfo
|
|
146
|
+
<Fragment set:html={render_value(channelinfo, `extra-${i0}_html`)} />
|
|
147
147
|
</div>
|
|
148
148
|
) : null}
|
|
149
149
|
</Fragment>
|
package/src/scripts/cms.js
CHANGED
|
@@ -767,6 +767,11 @@ export default class JeawinApi {
|
|
|
767
767
|
if (_.has(params, 'ids')) {
|
|
768
768
|
new_params.append('ids', params.ids || '');
|
|
769
769
|
}
|
|
770
|
+
|
|
771
|
+
if(_.has(params, 'search_for')){
|
|
772
|
+
new_params.append('search_for', params.search_for || '');
|
|
773
|
+
}
|
|
774
|
+
|
|
770
775
|
// console.log(new_params.toString());
|
|
771
776
|
const res = await this.jeawinFetch(
|
|
772
777
|
`${this.server_api_url}&m=nodes&${new_params.toString()}`,
|
|
@@ -808,6 +813,9 @@ export default class JeawinApi {
|
|
|
808
813
|
if (_.has(params, 'no_images_html')) {
|
|
809
814
|
new_params.append('no_images_html', params.no_images_html || '');
|
|
810
815
|
}
|
|
816
|
+
if(_.has(params, 'search_for')){
|
|
817
|
+
new_params.append('search_for', params.search_for || '');
|
|
818
|
+
}
|
|
811
819
|
consolelog('get_rel_nodes start at', params);
|
|
812
820
|
const res = await this.jeawinFetch(
|
|
813
821
|
`${this.server_api_url}&m=rel_nodes&${new_params.toString()}`,
|