@mjhls/mjh-framework 1.0.939-image-width-v1 → 1.0.939-nojs-pagination-v2
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/dist/cjs/ArticleProgramLandingPage.js +2 -1
- package/dist/cjs/ArticleSeriesLandingPage.js +2 -1
- package/dist/cjs/DeckContent.js +15 -33
- package/dist/cjs/GridContent.js +22 -7
- package/dist/cjs/MediaSeriesLanding.js +2 -1
- package/dist/cjs/MediaSeriesLandingPaginated.js +2 -1
- package/dist/cjs/VideoProgramLandingPage.js +2 -1
- package/dist/cjs/VideoSeriesListing.js +9 -3
- package/dist/esm/ArticleProgramLandingPage.js +2 -1
- package/dist/esm/ArticleSeriesLandingPage.js +2 -1
- package/dist/esm/DeckContent.js +15 -33
- package/dist/esm/GridContent.js +22 -7
- package/dist/esm/MediaSeriesLanding.js +2 -1
- package/dist/esm/MediaSeriesLandingPaginated.js +2 -1
- package/dist/esm/VideoProgramLandingPage.js +2 -1
- package/dist/esm/VideoSeriesListing.js +9 -3
- package/package.json +1 -1
|
@@ -141,7 +141,8 @@ ArticleProgramLandingPage.getInitialData = function () {
|
|
|
141
141
|
start = (currentPage - 1) * itemsPerPage;
|
|
142
142
|
params = {
|
|
143
143
|
from: start,
|
|
144
|
-
to: start + itemsPerPage
|
|
144
|
+
to: start + itemsPerPage,
|
|
145
|
+
itemsPerPage: itemsPerPage
|
|
145
146
|
};
|
|
146
147
|
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'' + taxonomyId + '\')\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n \'pageNumber\': ' + currentPage + '\n }';
|
|
147
148
|
postsPromise = client.fetch(query, params);
|
|
@@ -118,7 +118,8 @@ ArticleSeriesLandingPage.getInitialData = function () {
|
|
|
118
118
|
start = (currentPage - 1) * itemsPerPage;
|
|
119
119
|
params = {
|
|
120
120
|
from: start,
|
|
121
|
-
to: start + itemsPerPage
|
|
121
|
+
to: start + itemsPerPage,
|
|
122
|
+
itemsPerPage: itemsPerPage
|
|
122
123
|
};
|
|
123
124
|
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'' + taxonomyId + '\')\n && url.current == \'' + seriesName + '\'\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n summary,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n }';
|
|
124
125
|
_context.next = 9;
|
package/dist/cjs/DeckContent.js
CHANGED
|
@@ -74,7 +74,9 @@ var DeckContent = function (_React$Component) {
|
|
|
74
74
|
total_pages: null,
|
|
75
75
|
scrolling: true,
|
|
76
76
|
query: _this.query,
|
|
77
|
-
currentPage: _this.props.currentPage || 1
|
|
77
|
+
currentPage: _this.props.currentPage || 1,
|
|
78
|
+
lastDataSize: _this.data ? _this.data.length : 0,
|
|
79
|
+
itemsPerPage: _this.params.itemsPerPage || 3
|
|
78
80
|
}, _this.loadMore = debounce.debounce_1(function () {
|
|
79
81
|
_this.setState(function (state) {
|
|
80
82
|
var page = state.page,
|
|
@@ -116,33 +118,24 @@ var DeckContent = function (_React$Component) {
|
|
|
116
118
|
if (dataArr.length > 0) {
|
|
117
119
|
return {
|
|
118
120
|
data: [].concat(toConsumableArray._toConsumableArray(data), toConsumableArray._toConsumableArray(dataArr)),
|
|
119
|
-
scrolling: true
|
|
121
|
+
scrolling: true,
|
|
122
|
+
lastDataSize: dataArr.length
|
|
120
123
|
};
|
|
121
124
|
} else {
|
|
122
125
|
return {
|
|
123
|
-
scrolling: false
|
|
126
|
+
scrolling: false,
|
|
127
|
+
lastDataSize: 0
|
|
124
128
|
};
|
|
125
129
|
}
|
|
126
130
|
});
|
|
127
131
|
});
|
|
128
|
-
}, _this.renderCardImage = function (row, page
|
|
129
|
-
var getImageWidth = function getImageWidth(lgVar) {
|
|
130
|
-
if (main.main_43 === true) {
|
|
131
|
-
return Number(_this.props.imageWidth) / 2;
|
|
132
|
-
} else if (lgVar === 12) {
|
|
133
|
-
return Number(_this.props.imageWidth);
|
|
134
|
-
} else if (lgVar === 6) {
|
|
135
|
-
return Number(_this.props.imageWidth) / 2;
|
|
136
|
-
} else {
|
|
137
|
-
return Number(_this.props.imageWidth) / (12 / lgVar);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
132
|
+
}, _this.renderCardImage = function (row, page) {
|
|
140
133
|
if (row.thumbnail && row.thumbnail.asset) {
|
|
141
134
|
var url = urlFor({
|
|
142
135
|
client: _this.client,
|
|
143
136
|
source: row.thumbnail,
|
|
144
137
|
imageHeight: _this.props.imageHeight || null,
|
|
145
|
-
imageWidth:
|
|
138
|
+
imageWidth: _this.props.imageWidth || null,
|
|
146
139
|
imageFit: _this.props.imageFit || null
|
|
147
140
|
});
|
|
148
141
|
return url;
|
|
@@ -299,19 +292,7 @@ var DeckContent = function (_React$Component) {
|
|
|
299
292
|
} else {
|
|
300
293
|
articles = _this.state.data;
|
|
301
294
|
}
|
|
302
|
-
|
|
303
|
-
if (mobileView) {
|
|
304
|
-
return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
|
|
305
|
-
} else {
|
|
306
|
-
if (lgVar === 12) {
|
|
307
|
-
return Number(_this.props.imageWidth) / aspectRatio + 'px';
|
|
308
|
-
} else if (lgVar === 6) {
|
|
309
|
-
return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
|
|
310
|
-
} else {
|
|
311
|
-
return Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px';
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
};
|
|
295
|
+
|
|
315
296
|
return React__default['default'].createElement(
|
|
316
297
|
Row__default['default'],
|
|
317
298
|
null,
|
|
@@ -345,15 +326,13 @@ var DeckContent = function (_React$Component) {
|
|
|
345
326
|
{ className: 'content-card', style: { flexDirection: mode } },
|
|
346
327
|
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default['default'].createElement(
|
|
347
328
|
'a',
|
|
348
|
-
{
|
|
349
|
-
href: _this.mapping[contentCategoryName] + '/' + row.url.current,
|
|
350
|
-
style: { minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, main.main_43) } },
|
|
329
|
+
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
351
330
|
React__default['default'].createElement(
|
|
352
331
|
index$1.LazyLoad,
|
|
353
332
|
{ height: _this.props.imageHeight },
|
|
354
333
|
React__default['default'].createElement(Card__default['default'].Img, {
|
|
355
334
|
variant: 'top',
|
|
356
|
-
src: _this.renderCardImage(row, page
|
|
335
|
+
src: _this.renderCardImage(row, page),
|
|
357
336
|
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
358
337
|
})
|
|
359
338
|
)
|
|
@@ -404,6 +383,9 @@ var DeckContent = function (_React$Component) {
|
|
|
404
383
|
}, _this.renderManualPagination = function () {
|
|
405
384
|
var currentPage = _this.state.currentPage;
|
|
406
385
|
|
|
386
|
+
if (_this.state.lastDataSize < _this.state.itemsPerPage) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
407
389
|
return React__default['default'].createElement(
|
|
408
390
|
'div',
|
|
409
391
|
{ className: 'd-flex justify-content-between' },
|
package/dist/cjs/GridContent.js
CHANGED
|
@@ -85,7 +85,8 @@ var GridContent = function (_React$Component) {
|
|
|
85
85
|
currentPage: _this.props.currentPage || 1,
|
|
86
86
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
87
87
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
88
|
-
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : []
|
|
88
|
+
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
89
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
89
90
|
}, _this.loadMore = debounce.debounce_1(function () {
|
|
90
91
|
_this.setState(function (state) {
|
|
91
92
|
var page = state.page,
|
|
@@ -140,11 +141,13 @@ var GridContent = function (_React$Component) {
|
|
|
140
141
|
if (dataArr.length > 0) {
|
|
141
142
|
return {
|
|
142
143
|
data: [].concat(toConsumableArray._toConsumableArray(data), toConsumableArray._toConsumableArray(dataArr)),
|
|
143
|
-
scrolling: true
|
|
144
|
+
scrolling: true,
|
|
145
|
+
lastDataSize: dataArr.length
|
|
144
146
|
};
|
|
145
147
|
} else {
|
|
146
148
|
return {
|
|
147
|
-
scrolling: false
|
|
149
|
+
scrolling: false,
|
|
150
|
+
lastDataSize: 0
|
|
148
151
|
};
|
|
149
152
|
}
|
|
150
153
|
});
|
|
@@ -239,6 +242,9 @@ var GridContent = function (_React$Component) {
|
|
|
239
242
|
}, _this.renderManualPagination = function () {
|
|
240
243
|
var currentPage = _this.state.currentPage;
|
|
241
244
|
|
|
245
|
+
if (_this.state.lastDataSize < _this.state.per) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
242
248
|
return React__default['default'].createElement(
|
|
243
249
|
'div',
|
|
244
250
|
{ className: 'd-flex justify-content-between' },
|
|
@@ -746,12 +752,21 @@ var GridContent = function (_React$Component) {
|
|
|
746
752
|
'div',
|
|
747
753
|
{ className: 'contentDeck' },
|
|
748
754
|
autoScroll ? React__default['default'].createElement(
|
|
749
|
-
|
|
750
|
-
|
|
755
|
+
React__default['default'].Fragment,
|
|
756
|
+
null,
|
|
751
757
|
React__default['default'].createElement(
|
|
752
|
-
|
|
758
|
+
index_es.InfiniteScroll,
|
|
759
|
+
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
760
|
+
React__default['default'].createElement(
|
|
761
|
+
Container__default['default'],
|
|
762
|
+
null,
|
|
763
|
+
this.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight, this.state.lgInfeedAd, this.state.contentCategoryMapping)
|
|
764
|
+
)
|
|
765
|
+
),
|
|
766
|
+
React__default['default'].createElement(
|
|
767
|
+
'noscript',
|
|
753
768
|
null,
|
|
754
|
-
this.
|
|
769
|
+
this.renderManualPagination()
|
|
755
770
|
)
|
|
756
771
|
) : React__default['default'].createElement(
|
|
757
772
|
React__default['default'].Fragment,
|
|
@@ -396,7 +396,8 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
396
396
|
count: itemsPerPage,
|
|
397
397
|
from: start,
|
|
398
398
|
to: start + itemsPerPage,
|
|
399
|
-
url: pathname
|
|
399
|
+
url: pathname,
|
|
400
|
+
itemsPerPage: itemsPerPage
|
|
400
401
|
};
|
|
401
402
|
_context2.next = 9;
|
|
402
403
|
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
@@ -418,7 +418,8 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
418
418
|
count: itemsPerPage,
|
|
419
419
|
from: start,
|
|
420
420
|
to: start + itemsPerPage,
|
|
421
|
-
url: pathname
|
|
421
|
+
url: pathname,
|
|
422
|
+
itemsPerPage: itemsPerPage
|
|
422
423
|
};
|
|
423
424
|
_context2.next = 9;
|
|
424
425
|
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
@@ -233,7 +233,8 @@ VideoProgramLandingPage.getInitialData = function () {
|
|
|
233
233
|
params = {
|
|
234
234
|
from: start,
|
|
235
235
|
to: start + itemsPerPage,
|
|
236
|
-
url: pathname
|
|
236
|
+
url: pathname,
|
|
237
|
+
itemsPerPage: itemsPerPage
|
|
237
238
|
};
|
|
238
239
|
|
|
239
240
|
query = '*[\n _type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true\n && dateTime(published) <= dateTime(now())\n && references(\'' + taxonomyId + '\')\n ' + (topicId ? '&& references(\'' + topicId + '\')' : '') + '\n ] | order(published desc) [$from...$to]{\n \t\t...,\n \t\ttitle,\n \t\tsummary,\n \t\tpublished,\n \t\tthumbnail{ ..., asset->},\n \t\turl,\n \t\ttaxonomy,\n \t\tcontentCategory->,\n \t\tbody[_type == "youtubeGallery"]{\n ...,\n videos[]{\n ...,\n thumbnail{...,asset->}\n }\n },\n \t\t\'pageNumber\': ' + currentPage + '\n \t}';
|
|
@@ -86,7 +86,8 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
86
86
|
total_pages: null,
|
|
87
87
|
scrolling: true,
|
|
88
88
|
query: _this.query,
|
|
89
|
-
currentPage: _this.props.currentPage || 1
|
|
89
|
+
currentPage: _this.props.currentPage || 1,
|
|
90
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
90
91
|
}, _this.loadMore = debounce.debounce_1(function () {
|
|
91
92
|
_this.setState(function (state) {
|
|
92
93
|
var page = state.page,
|
|
@@ -130,11 +131,13 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
130
131
|
newDataArr.push(dataArr);
|
|
131
132
|
return {
|
|
132
133
|
data: newDataArr,
|
|
133
|
-
scrolling: true
|
|
134
|
+
scrolling: true,
|
|
135
|
+
lastDataSize: dataArr.length
|
|
134
136
|
};
|
|
135
137
|
} else {
|
|
136
138
|
return {
|
|
137
|
-
scrolling: false
|
|
139
|
+
scrolling: false,
|
|
140
|
+
lastDataSize: 0
|
|
138
141
|
};
|
|
139
142
|
}
|
|
140
143
|
});
|
|
@@ -201,6 +204,9 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
201
204
|
}, _this.renderManualPagination = function () {
|
|
202
205
|
var currentPage = _this.state.currentPage;
|
|
203
206
|
|
|
207
|
+
if (_this.state.lastDataSize < _this.state.per) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
204
210
|
return React__default['default'].createElement(
|
|
205
211
|
'div',
|
|
206
212
|
{ className: 'd-flex justify-content-between' },
|
|
@@ -135,7 +135,8 @@ ArticleProgramLandingPage.getInitialData = function () {
|
|
|
135
135
|
start = (currentPage - 1) * itemsPerPage;
|
|
136
136
|
params = {
|
|
137
137
|
from: start,
|
|
138
|
-
to: start + itemsPerPage
|
|
138
|
+
to: start + itemsPerPage,
|
|
139
|
+
itemsPerPage: itemsPerPage
|
|
139
140
|
};
|
|
140
141
|
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'' + taxonomyId + '\')\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n \'pageNumber\': ' + currentPage + '\n }';
|
|
141
142
|
postsPromise = client.fetch(query, params);
|
|
@@ -112,7 +112,8 @@ ArticleSeriesLandingPage.getInitialData = function () {
|
|
|
112
112
|
start = (currentPage - 1) * itemsPerPage;
|
|
113
113
|
params = {
|
|
114
114
|
from: start,
|
|
115
|
-
to: start + itemsPerPage
|
|
115
|
+
to: start + itemsPerPage,
|
|
116
|
+
itemsPerPage: itemsPerPage
|
|
116
117
|
};
|
|
117
118
|
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'' + taxonomyId + '\')\n && url.current == \'' + seriesName + '\'\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n summary,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n }';
|
|
118
119
|
_context.next = 9;
|
package/dist/esm/DeckContent.js
CHANGED
|
@@ -64,7 +64,9 @@ var DeckContent = function (_React$Component) {
|
|
|
64
64
|
total_pages: null,
|
|
65
65
|
scrolling: true,
|
|
66
66
|
query: _this.query,
|
|
67
|
-
currentPage: _this.props.currentPage || 1
|
|
67
|
+
currentPage: _this.props.currentPage || 1,
|
|
68
|
+
lastDataSize: _this.data ? _this.data.length : 0,
|
|
69
|
+
itemsPerPage: _this.params.itemsPerPage || 3
|
|
68
70
|
}, _this.loadMore = debounce_1(function () {
|
|
69
71
|
_this.setState(function (state) {
|
|
70
72
|
var page = state.page,
|
|
@@ -106,33 +108,24 @@ var DeckContent = function (_React$Component) {
|
|
|
106
108
|
if (dataArr.length > 0) {
|
|
107
109
|
return {
|
|
108
110
|
data: [].concat(_toConsumableArray(data), _toConsumableArray(dataArr)),
|
|
109
|
-
scrolling: true
|
|
111
|
+
scrolling: true,
|
|
112
|
+
lastDataSize: dataArr.length
|
|
110
113
|
};
|
|
111
114
|
} else {
|
|
112
115
|
return {
|
|
113
|
-
scrolling: false
|
|
116
|
+
scrolling: false,
|
|
117
|
+
lastDataSize: 0
|
|
114
118
|
};
|
|
115
119
|
}
|
|
116
120
|
});
|
|
117
121
|
});
|
|
118
|
-
}, _this.renderCardImage = function (row, page
|
|
119
|
-
var getImageWidth = function getImageWidth(lgVar) {
|
|
120
|
-
if (main_43 === true) {
|
|
121
|
-
return Number(_this.props.imageWidth) / 2;
|
|
122
|
-
} else if (lgVar === 12) {
|
|
123
|
-
return Number(_this.props.imageWidth);
|
|
124
|
-
} else if (lgVar === 6) {
|
|
125
|
-
return Number(_this.props.imageWidth) / 2;
|
|
126
|
-
} else {
|
|
127
|
-
return Number(_this.props.imageWidth) / (12 / lgVar);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
122
|
+
}, _this.renderCardImage = function (row, page) {
|
|
130
123
|
if (row.thumbnail && row.thumbnail.asset) {
|
|
131
124
|
var url = urlFor({
|
|
132
125
|
client: _this.client,
|
|
133
126
|
source: row.thumbnail,
|
|
134
127
|
imageHeight: _this.props.imageHeight || null,
|
|
135
|
-
imageWidth:
|
|
128
|
+
imageWidth: _this.props.imageWidth || null,
|
|
136
129
|
imageFit: _this.props.imageFit || null
|
|
137
130
|
});
|
|
138
131
|
return url;
|
|
@@ -289,19 +282,7 @@ var DeckContent = function (_React$Component) {
|
|
|
289
282
|
} else {
|
|
290
283
|
articles = _this.state.data;
|
|
291
284
|
}
|
|
292
|
-
|
|
293
|
-
if (mobileView) {
|
|
294
|
-
return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
|
|
295
|
-
} else {
|
|
296
|
-
if (lgVar === 12) {
|
|
297
|
-
return Number(_this.props.imageWidth) / aspectRatio + 'px';
|
|
298
|
-
} else if (lgVar === 6) {
|
|
299
|
-
return Number(_this.props.imageWidth) / (2 * aspectRatio) + 'px';
|
|
300
|
-
} else {
|
|
301
|
-
return Number(_this.props.imageWidth) / (12 / lgVar * aspectRatio) + 'px';
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
};
|
|
285
|
+
|
|
305
286
|
return React__default.createElement(
|
|
306
287
|
Row,
|
|
307
288
|
null,
|
|
@@ -335,15 +316,13 @@ var DeckContent = function (_React$Component) {
|
|
|
335
316
|
{ className: 'content-card', style: { flexDirection: mode } },
|
|
336
317
|
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
337
318
|
'a',
|
|
338
|
-
{
|
|
339
|
-
href: _this.mapping[contentCategoryName] + '/' + row.url.current,
|
|
340
|
-
style: { minHeight: getImageHeight(lgVar, row.thumbnail.asset.metadata.dimensions.aspectRatio, main_43) } },
|
|
319
|
+
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
341
320
|
React__default.createElement(
|
|
342
321
|
LazyLoad,
|
|
343
322
|
{ height: _this.props.imageHeight },
|
|
344
323
|
React__default.createElement(Card.Img, {
|
|
345
324
|
variant: 'top',
|
|
346
|
-
src: _this.renderCardImage(row, page
|
|
325
|
+
src: _this.renderCardImage(row, page),
|
|
347
326
|
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
348
327
|
})
|
|
349
328
|
)
|
|
@@ -394,6 +373,9 @@ var DeckContent = function (_React$Component) {
|
|
|
394
373
|
}, _this.renderManualPagination = function () {
|
|
395
374
|
var currentPage = _this.state.currentPage;
|
|
396
375
|
|
|
376
|
+
if (_this.state.lastDataSize < _this.state.itemsPerPage) {
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
397
379
|
return React__default.createElement(
|
|
398
380
|
'div',
|
|
399
381
|
{ className: 'd-flex justify-content-between' },
|
package/dist/esm/GridContent.js
CHANGED
|
@@ -75,7 +75,8 @@ var GridContent = function (_React$Component) {
|
|
|
75
75
|
currentPage: _this.props.currentPage || 1,
|
|
76
76
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
77
77
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
78
|
-
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : []
|
|
78
|
+
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
79
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
79
80
|
}, _this.loadMore = debounce_1(function () {
|
|
80
81
|
_this.setState(function (state) {
|
|
81
82
|
var page = state.page,
|
|
@@ -130,11 +131,13 @@ var GridContent = function (_React$Component) {
|
|
|
130
131
|
if (dataArr.length > 0) {
|
|
131
132
|
return {
|
|
132
133
|
data: [].concat(_toConsumableArray(data), _toConsumableArray(dataArr)),
|
|
133
|
-
scrolling: true
|
|
134
|
+
scrolling: true,
|
|
135
|
+
lastDataSize: dataArr.length
|
|
134
136
|
};
|
|
135
137
|
} else {
|
|
136
138
|
return {
|
|
137
|
-
scrolling: false
|
|
139
|
+
scrolling: false,
|
|
140
|
+
lastDataSize: 0
|
|
138
141
|
};
|
|
139
142
|
}
|
|
140
143
|
});
|
|
@@ -229,6 +232,9 @@ var GridContent = function (_React$Component) {
|
|
|
229
232
|
}, _this.renderManualPagination = function () {
|
|
230
233
|
var currentPage = _this.state.currentPage;
|
|
231
234
|
|
|
235
|
+
if (_this.state.lastDataSize < _this.state.per) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
232
238
|
return React__default.createElement(
|
|
233
239
|
'div',
|
|
234
240
|
{ className: 'd-flex justify-content-between' },
|
|
@@ -736,12 +742,21 @@ var GridContent = function (_React$Component) {
|
|
|
736
742
|
'div',
|
|
737
743
|
{ className: 'contentDeck' },
|
|
738
744
|
autoScroll ? React__default.createElement(
|
|
739
|
-
|
|
740
|
-
|
|
745
|
+
React__default.Fragment,
|
|
746
|
+
null,
|
|
741
747
|
React__default.createElement(
|
|
742
|
-
|
|
748
|
+
InfiniteScroll,
|
|
749
|
+
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
750
|
+
React__default.createElement(
|
|
751
|
+
Container,
|
|
752
|
+
null,
|
|
753
|
+
this.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight, this.state.lgInfeedAd, this.state.contentCategoryMapping)
|
|
754
|
+
)
|
|
755
|
+
),
|
|
756
|
+
React__default.createElement(
|
|
757
|
+
'noscript',
|
|
743
758
|
null,
|
|
744
|
-
this.
|
|
759
|
+
this.renderManualPagination()
|
|
745
760
|
)
|
|
746
761
|
) : React__default.createElement(
|
|
747
762
|
React__default.Fragment,
|
|
@@ -389,7 +389,8 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
389
389
|
count: itemsPerPage,
|
|
390
390
|
from: start,
|
|
391
391
|
to: start + itemsPerPage,
|
|
392
|
-
url: pathname
|
|
392
|
+
url: pathname,
|
|
393
|
+
itemsPerPage: itemsPerPage
|
|
393
394
|
};
|
|
394
395
|
_context2.next = 9;
|
|
395
396
|
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
@@ -411,7 +411,8 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
411
411
|
count: itemsPerPage,
|
|
412
412
|
from: start,
|
|
413
413
|
to: start + itemsPerPage,
|
|
414
|
-
url: pathname
|
|
414
|
+
url: pathname,
|
|
415
|
+
itemsPerPage: itemsPerPage
|
|
415
416
|
};
|
|
416
417
|
_context2.next = 9;
|
|
417
418
|
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
@@ -224,7 +224,8 @@ VideoProgramLandingPage.getInitialData = function () {
|
|
|
224
224
|
params = {
|
|
225
225
|
from: start,
|
|
226
226
|
to: start + itemsPerPage,
|
|
227
|
-
url: pathname
|
|
227
|
+
url: pathname,
|
|
228
|
+
itemsPerPage: itemsPerPage
|
|
228
229
|
};
|
|
229
230
|
|
|
230
231
|
query = '*[\n _type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true\n && dateTime(published) <= dateTime(now())\n && references(\'' + taxonomyId + '\')\n ' + (topicId ? '&& references(\'' + topicId + '\')' : '') + '\n ] | order(published desc) [$from...$to]{\n \t\t...,\n \t\ttitle,\n \t\tsummary,\n \t\tpublished,\n \t\tthumbnail{ ..., asset->},\n \t\turl,\n \t\ttaxonomy,\n \t\tcontentCategory->,\n \t\tbody[_type == "youtubeGallery"]{\n ...,\n videos[]{\n ...,\n thumbnail{...,asset->}\n }\n },\n \t\t\'pageNumber\': ' + currentPage + '\n \t}';
|
|
@@ -79,7 +79,8 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
79
79
|
total_pages: null,
|
|
80
80
|
scrolling: true,
|
|
81
81
|
query: _this.query,
|
|
82
|
-
currentPage: _this.props.currentPage || 1
|
|
82
|
+
currentPage: _this.props.currentPage || 1,
|
|
83
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
83
84
|
}, _this.loadMore = debounce_1(function () {
|
|
84
85
|
_this.setState(function (state) {
|
|
85
86
|
var page = state.page,
|
|
@@ -123,11 +124,13 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
123
124
|
newDataArr.push(dataArr);
|
|
124
125
|
return {
|
|
125
126
|
data: newDataArr,
|
|
126
|
-
scrolling: true
|
|
127
|
+
scrolling: true,
|
|
128
|
+
lastDataSize: dataArr.length
|
|
127
129
|
};
|
|
128
130
|
} else {
|
|
129
131
|
return {
|
|
130
|
-
scrolling: false
|
|
132
|
+
scrolling: false,
|
|
133
|
+
lastDataSize: 0
|
|
131
134
|
};
|
|
132
135
|
}
|
|
133
136
|
});
|
|
@@ -194,6 +197,9 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
194
197
|
}, _this.renderManualPagination = function () {
|
|
195
198
|
var currentPage = _this.state.currentPage;
|
|
196
199
|
|
|
200
|
+
if (_this.state.lastDataSize < _this.state.per) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
197
203
|
return React__default.createElement(
|
|
198
204
|
'div',
|
|
199
205
|
{ className: 'd-flex justify-content-between' },
|