@mjhls/mjh-framework 1.0.939-nojs-pagination-v2 → 1.0.939-nojs-pagination-v4

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.
@@ -76,7 +76,8 @@ var DeckContent = function (_React$Component) {
76
76
  query: _this.query,
77
77
  currentPage: _this.props.currentPage || 1,
78
78
  lastDataSize: _this.data ? _this.data.length : 0,
79
- itemsPerPage: _this.params.itemsPerPage || 3
79
+ itemsPerPage: _this.params.itemsPerPage || 3,
80
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 3
80
81
  }, _this.loadMore = debounce.debounce_1(function () {
81
82
  _this.setState(function (state) {
82
83
  var page = state.page,
@@ -383,9 +384,6 @@ var DeckContent = function (_React$Component) {
383
384
  }, _this.renderManualPagination = function () {
384
385
  var currentPage = _this.state.currentPage;
385
386
 
386
- if (_this.state.lastDataSize < _this.state.itemsPerPage) {
387
- return null;
388
- }
389
387
  return React__default['default'].createElement(
390
388
  'div',
391
389
  { className: 'd-flex justify-content-between' },
@@ -394,7 +392,7 @@ var DeckContent = function (_React$Component) {
394
392
  { href: '?page=' + (currentPage - 1) },
395
393
  '<< Previous'
396
394
  ),
397
- React__default['default'].createElement(
395
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && _this.state.nextPagePostsCount > 0 && React__default['default'].createElement(
398
396
  'a',
399
397
  { href: '?page=' + (currentPage + 1) },
400
398
  'Next >>'
@@ -86,7 +86,8 @@ var GridContent = function (_React$Component) {
86
86
  lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
87
87
  showCategory: _this.props.showCategory ? _this.props.showCategory : false,
88
88
  contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
89
- lastDataSize: _this.data ? _this.data.length : 0
89
+ lastDataSize: _this.data ? _this.data.length : 0,
90
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 3
90
91
  }, _this.loadMore = debounce.debounce_1(function () {
91
92
  _this.setState(function (state) {
92
93
  var page = state.page,
@@ -242,9 +243,6 @@ var GridContent = function (_React$Component) {
242
243
  }, _this.renderManualPagination = function () {
243
244
  var currentPage = _this.state.currentPage;
244
245
 
245
- if (_this.state.lastDataSize < _this.state.per) {
246
- return null;
247
- }
248
246
  return React__default['default'].createElement(
249
247
  'div',
250
248
  { className: 'd-flex justify-content-between' },
@@ -253,7 +251,7 @@ var GridContent = function (_React$Component) {
253
251
  { href: '?page=' + (currentPage - 1) },
254
252
  '<< Previous'
255
253
  ),
256
- React__default['default'].createElement(
254
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && _this.state.nextPagePostsCount > 0 && React__default['default'].createElement(
257
255
  'a',
258
256
  { href: '?page=' + (currentPage + 1) },
259
257
  'Next >>'
@@ -75,7 +75,8 @@ var MasterDeck = function (_React$Component) {
75
75
  dataRemapped: !_this.props.showBI || !_this.props.brandInsightAd,
76
76
  lastDataSize: _this.data ? _this.data.length : 0,
77
77
  itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2,
78
- mobileView: false
78
+ mobileView: false,
79
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 2
79
80
  }, _this.loadMore = debounce.debounce_1(function () {
80
81
  _this.setState(function (state) {
81
82
  var page = state.page,
@@ -311,7 +312,6 @@ var MasterDeck = function (_React$Component) {
311
312
  document_url: brandInsightAd.targeting.document_url,
312
313
  document_group: brandInsightAd.targeting.document_group,
313
314
  rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
314
-
315
315
  },
316
316
  _type: 'brandInsightAd',
317
317
  /* Passing refresh flag */
@@ -408,13 +408,11 @@ var MasterDeck = function (_React$Component) {
408
408
  var _this$state3 = _this.state,
409
409
  currentPage = _this$state3.currentPage,
410
410
  itemsPerPage = _this$state3.itemsPerPage,
411
- lastDataSize = _this$state3.lastDataSize;
411
+ lastDataSize = _this$state3.lastDataSize,
412
+ nextPagePostsCount = _this$state3.nextPagePostsCount;
412
413
 
413
414
  console.log('lastDataSize:', lastDataSize);
414
415
  console.log('itemsPerPage:', itemsPerPage);
415
- if (lastDataSize < itemsPerPage) {
416
- return null;
417
- }
418
416
 
419
417
  return React__default['default'].createElement(
420
418
  'div',
@@ -424,7 +422,7 @@ var MasterDeck = function (_React$Component) {
424
422
  { href: '?page=' + (currentPage - 1) },
425
423
  '<< Previous'
426
424
  ),
427
- React__default['default'].createElement(
425
+ !(lastDataSize < itemsPerPage) && nextPagePostsCount > 0 && React__default['default'].createElement(
428
426
  'a',
429
427
  { href: '?page=' + (currentPage + 1) },
430
428
  'Next >>'
@@ -1367,6 +1367,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1367
1367
  imageFit = props.imageFit,
1368
1368
  rightItems = props.rightItems,
1369
1369
  brandInsightAd = props.brandInsightAd,
1370
+ _props$nextPagePostsC = props.nextPagePostsCount,
1371
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC,
1370
1372
  _props$showBI = props.showBI,
1371
1373
  showBI = _props$showBI === undefined ? false : _props$showBI,
1372
1374
  _props$heroContent = props.heroContent,
@@ -1420,10 +1422,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1420
1422
  var prevValues = usePrevious(values);
1421
1423
 
1422
1424
  var renderManualPagination = function renderManualPagination(currentPage) {
1423
- if (lastDataSize < itemsPerPage) {
1424
- return null;
1425
- }
1426
-
1427
1425
  return React__default['default'].createElement(
1428
1426
  'div',
1429
1427
  { className: 'd-flex justify-content-between' },
@@ -1432,7 +1430,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1432
1430
  { href: '?page=' + (currentPage - 1) },
1433
1431
  '<< Previous'
1434
1432
  ),
1435
- React__default['default'].createElement(
1433
+ !(lastDataSize < itemsPerPage) && nextPagePostsCount > 0 && React__default['default'].createElement(
1436
1434
  'a',
1437
1435
  { href: '?page=' + (currentPage + 1) },
1438
1436
  'Next >>'
@@ -87,7 +87,8 @@ var VideoSeriesListing = function (_React$Component) {
87
87
  scrolling: true,
88
88
  query: _this.query,
89
89
  currentPage: _this.props.currentPage || 1,
90
- lastDataSize: _this.data ? _this.data.length : 0
90
+ lastDataSize: _this.data ? _this.data.length : 0,
91
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 2
91
92
  }, _this.loadMore = debounce.debounce_1(function () {
92
93
  _this.setState(function (state) {
93
94
  var page = state.page,
@@ -204,9 +205,7 @@ var VideoSeriesListing = function (_React$Component) {
204
205
  }, _this.renderManualPagination = function () {
205
206
  var currentPage = _this.state.currentPage;
206
207
 
207
- if (_this.state.lastDataSize < _this.state.per) {
208
- return null;
209
- }
208
+
210
209
  return React__default['default'].createElement(
211
210
  'div',
212
211
  { className: 'd-flex justify-content-between' },
@@ -215,7 +214,7 @@ var VideoSeriesListing = function (_React$Component) {
215
214
  { href: '?page=' + (currentPage - 1) },
216
215
  '<< Previous'
217
216
  ),
218
- React__default['default'].createElement(
217
+ !(_this.state.lastDataSize < _this.state.per) && _this.state.nextPagePostsCount > 0 && React__default['default'].createElement(
219
218
  'a',
220
219
  { href: '?page=' + (currentPage + 1) },
221
220
  'Next >>'
@@ -66,7 +66,8 @@ var DeckContent = function (_React$Component) {
66
66
  query: _this.query,
67
67
  currentPage: _this.props.currentPage || 1,
68
68
  lastDataSize: _this.data ? _this.data.length : 0,
69
- itemsPerPage: _this.params.itemsPerPage || 3
69
+ itemsPerPage: _this.params.itemsPerPage || 3,
70
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 3
70
71
  }, _this.loadMore = debounce_1(function () {
71
72
  _this.setState(function (state) {
72
73
  var page = state.page,
@@ -373,9 +374,6 @@ var DeckContent = function (_React$Component) {
373
374
  }, _this.renderManualPagination = function () {
374
375
  var currentPage = _this.state.currentPage;
375
376
 
376
- if (_this.state.lastDataSize < _this.state.itemsPerPage) {
377
- return null;
378
- }
379
377
  return React__default.createElement(
380
378
  'div',
381
379
  { className: 'd-flex justify-content-between' },
@@ -384,7 +382,7 @@ var DeckContent = function (_React$Component) {
384
382
  { href: '?page=' + (currentPage - 1) },
385
383
  '<< Previous'
386
384
  ),
387
- React__default.createElement(
385
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && _this.state.nextPagePostsCount > 0 && React__default.createElement(
388
386
  'a',
389
387
  { href: '?page=' + (currentPage + 1) },
390
388
  'Next >>'
@@ -76,7 +76,8 @@ var GridContent = function (_React$Component) {
76
76
  lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
77
77
  showCategory: _this.props.showCategory ? _this.props.showCategory : false,
78
78
  contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
79
- lastDataSize: _this.data ? _this.data.length : 0
79
+ lastDataSize: _this.data ? _this.data.length : 0,
80
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 3
80
81
  }, _this.loadMore = debounce_1(function () {
81
82
  _this.setState(function (state) {
82
83
  var page = state.page,
@@ -232,9 +233,6 @@ var GridContent = function (_React$Component) {
232
233
  }, _this.renderManualPagination = function () {
233
234
  var currentPage = _this.state.currentPage;
234
235
 
235
- if (_this.state.lastDataSize < _this.state.per) {
236
- return null;
237
- }
238
236
  return React__default.createElement(
239
237
  'div',
240
238
  { className: 'd-flex justify-content-between' },
@@ -243,7 +241,7 @@ var GridContent = function (_React$Component) {
243
241
  { href: '?page=' + (currentPage - 1) },
244
242
  '<< Previous'
245
243
  ),
246
- React__default.createElement(
244
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && _this.state.nextPagePostsCount > 0 && React__default.createElement(
247
245
  'a',
248
246
  { href: '?page=' + (currentPage + 1) },
249
247
  'Next >>'
@@ -68,7 +68,8 @@ var MasterDeck = function (_React$Component) {
68
68
  dataRemapped: !_this.props.showBI || !_this.props.brandInsightAd,
69
69
  lastDataSize: _this.data ? _this.data.length : 0,
70
70
  itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2,
71
- mobileView: false
71
+ mobileView: false,
72
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 2
72
73
  }, _this.loadMore = debounce_1(function () {
73
74
  _this.setState(function (state) {
74
75
  var page = state.page,
@@ -304,7 +305,6 @@ var MasterDeck = function (_React$Component) {
304
305
  document_url: brandInsightAd.targeting.document_url,
305
306
  document_group: brandInsightAd.targeting.document_group,
306
307
  rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
307
-
308
308
  },
309
309
  _type: 'brandInsightAd',
310
310
  /* Passing refresh flag */
@@ -401,13 +401,11 @@ var MasterDeck = function (_React$Component) {
401
401
  var _this$state3 = _this.state,
402
402
  currentPage = _this$state3.currentPage,
403
403
  itemsPerPage = _this$state3.itemsPerPage,
404
- lastDataSize = _this$state3.lastDataSize;
404
+ lastDataSize = _this$state3.lastDataSize,
405
+ nextPagePostsCount = _this$state3.nextPagePostsCount;
405
406
 
406
407
  console.log('lastDataSize:', lastDataSize);
407
408
  console.log('itemsPerPage:', itemsPerPage);
408
- if (lastDataSize < itemsPerPage) {
409
- return null;
410
- }
411
409
 
412
410
  return React__default.createElement(
413
411
  'div',
@@ -417,7 +415,7 @@ var MasterDeck = function (_React$Component) {
417
415
  { href: '?page=' + (currentPage - 1) },
418
416
  '<< Previous'
419
417
  ),
420
- React__default.createElement(
418
+ !(lastDataSize < itemsPerPage) && nextPagePostsCount > 0 && React__default.createElement(
421
419
  'a',
422
420
  { href: '?page=' + (currentPage + 1) },
423
421
  'Next >>'
@@ -1361,6 +1361,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1361
1361
  imageFit = props.imageFit,
1362
1362
  rightItems = props.rightItems,
1363
1363
  brandInsightAd = props.brandInsightAd,
1364
+ _props$nextPagePostsC = props.nextPagePostsCount,
1365
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC,
1364
1366
  _props$showBI = props.showBI,
1365
1367
  showBI = _props$showBI === undefined ? false : _props$showBI,
1366
1368
  _props$heroContent = props.heroContent,
@@ -1414,10 +1416,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1414
1416
  var prevValues = usePrevious(values);
1415
1417
 
1416
1418
  var renderManualPagination = function renderManualPagination(currentPage) {
1417
- if (lastDataSize < itemsPerPage) {
1418
- return null;
1419
- }
1420
-
1421
1419
  return React__default.createElement(
1422
1420
  'div',
1423
1421
  { className: 'd-flex justify-content-between' },
@@ -1426,7 +1424,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1426
1424
  { href: '?page=' + (currentPage - 1) },
1427
1425
  '<< Previous'
1428
1426
  ),
1429
- React__default.createElement(
1427
+ !(lastDataSize < itemsPerPage) && nextPagePostsCount > 0 && React__default.createElement(
1430
1428
  'a',
1431
1429
  { href: '?page=' + (currentPage + 1) },
1432
1430
  'Next >>'
@@ -80,7 +80,8 @@ var VideoSeriesListing = function (_React$Component) {
80
80
  scrolling: true,
81
81
  query: _this.query,
82
82
  currentPage: _this.props.currentPage || 1,
83
- lastDataSize: _this.data ? _this.data.length : 0
83
+ lastDataSize: _this.data ? _this.data.length : 0,
84
+ nextPagePostsCount: _this.props.nextPagePostsCount ? _this.props.nextPagePostsCount : 2
84
85
  }, _this.loadMore = debounce_1(function () {
85
86
  _this.setState(function (state) {
86
87
  var page = state.page,
@@ -197,9 +198,7 @@ var VideoSeriesListing = function (_React$Component) {
197
198
  }, _this.renderManualPagination = function () {
198
199
  var currentPage = _this.state.currentPage;
199
200
 
200
- if (_this.state.lastDataSize < _this.state.per) {
201
- return null;
202
- }
201
+
203
202
  return React__default.createElement(
204
203
  'div',
205
204
  { className: 'd-flex justify-content-between' },
@@ -208,7 +207,7 @@ var VideoSeriesListing = function (_React$Component) {
208
207
  { href: '?page=' + (currentPage - 1) },
209
208
  '<< Previous'
210
209
  ),
211
- React__default.createElement(
210
+ !(_this.state.lastDataSize < _this.state.per) && _this.state.nextPagePostsCount > 0 && React__default.createElement(
212
211
  'a',
213
212
  { href: '?page=' + (currentPage + 1) },
214
213
  'Next >>'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.939-nojs-pagination-v2",
3
+ "version": "1.0.939-nojs-pagination-v4",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",