@mjhls/mjh-framework 1.0.944 → 1.0.945-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.
Files changed (84) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AlgoliaSearch.js +131 -15
  3. package/dist/cjs/ArticleProgramLandingPage.js +2 -1
  4. package/dist/cjs/ArticleSeriesLandingPage.js +2 -1
  5. package/dist/cjs/AuthWrapper.js +1 -1
  6. package/dist/cjs/ConferenceArticleCard.js +15 -15
  7. package/dist/cjs/ContentCardPaginated.js +1 -2
  8. package/dist/cjs/DeckContent.js +30 -17
  9. package/dist/cjs/DeckQueue.js +29 -11
  10. package/dist/cjs/DeckQueuePaginated.js +1 -2
  11. package/dist/cjs/EventsDeck.js +17 -17
  12. package/dist/cjs/GridContent.js +26 -11
  13. package/dist/cjs/GridContentPaginated.js +1 -2
  14. package/dist/cjs/HamMagazine.js +9 -9
  15. package/dist/cjs/IssueLanding.js +34 -31
  16. package/dist/cjs/KMTracker.js +15 -15
  17. package/dist/cjs/MasterDeck.js +17 -18
  18. package/dist/cjs/MasterDeckPaginated.js +9 -10
  19. package/dist/cjs/{MediaSeriesCard-acb4581d.js → MediaSeriesCard-543e905f.js} +1 -1
  20. package/dist/cjs/MediaSeriesLanding.js +24 -15
  21. package/dist/cjs/MediaSeriesLandingPaginated.js +9 -9
  22. package/dist/cjs/NavMagazine.js +10 -10
  23. package/dist/cjs/NavNative.js +9 -9
  24. package/dist/cjs/Pagination-42f92f7c.js +97 -0
  25. package/dist/cjs/PartnerDetailListingPaginated.js +1 -2
  26. package/dist/cjs/PublicationLanding.js +26 -26
  27. package/dist/cjs/QueueDeckExpanded.js +3 -5
  28. package/dist/cjs/QueueDeckExpandedPaginated.js +1 -2
  29. package/dist/cjs/RelatedContent.js +28 -28
  30. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  31. package/dist/cjs/SeriesListingDeck.js +1 -1
  32. package/dist/cjs/{SeriesSlider-ba0c5d1a.js → SeriesSlider-de93a303.js} +4 -4
  33. package/dist/cjs/SideFooter.js +2 -2
  34. package/dist/cjs/VideoProgramLandingPage.js +2 -1
  35. package/dist/cjs/VideoSeriesCard.js +1 -1
  36. package/dist/cjs/VideoSeriesListing.js +17 -9
  37. package/dist/cjs/View.js +12 -8
  38. package/dist/cjs/YoutubeGroup.js +4 -4
  39. package/dist/cjs/{getTargeting-3c5754ac.js → getTargeting-dab97fe1.js} +9 -9
  40. package/dist/cjs/getTargeting.js +1 -1
  41. package/dist/cjs/index.js +2 -3
  42. package/dist/esm/AlgoliaSearch.js +132 -16
  43. package/dist/esm/ArticleProgramLandingPage.js +2 -1
  44. package/dist/esm/ArticleSeriesLandingPage.js +2 -1
  45. package/dist/esm/AuthWrapper.js +1 -1
  46. package/dist/esm/ConferenceArticleCard.js +15 -15
  47. package/dist/esm/ContentCardPaginated.js +1 -2
  48. package/dist/esm/DeckContent.js +30 -17
  49. package/dist/esm/DeckQueue.js +29 -11
  50. package/dist/esm/DeckQueuePaginated.js +1 -2
  51. package/dist/esm/EventsDeck.js +17 -17
  52. package/dist/esm/GridContent.js +26 -11
  53. package/dist/esm/GridContentPaginated.js +1 -2
  54. package/dist/esm/HamMagazine.js +9 -9
  55. package/dist/esm/IssueLanding.js +34 -31
  56. package/dist/esm/KMTracker.js +15 -15
  57. package/dist/esm/MasterDeck.js +17 -18
  58. package/dist/esm/MasterDeckPaginated.js +9 -10
  59. package/dist/esm/{MediaSeriesCard-227aea3c.js → MediaSeriesCard-a525d485.js} +1 -1
  60. package/dist/esm/MediaSeriesLanding.js +24 -15
  61. package/dist/esm/MediaSeriesLandingPaginated.js +9 -9
  62. package/dist/esm/NavMagazine.js +10 -10
  63. package/dist/esm/NavNative.js +9 -9
  64. package/dist/esm/Pagination-484b86c5.js +90 -0
  65. package/dist/esm/PartnerDetailListingPaginated.js +1 -2
  66. package/dist/esm/PublicationLanding.js +26 -26
  67. package/dist/esm/QueueDeckExpanded.js +3 -5
  68. package/dist/esm/QueueDeckExpandedPaginated.js +1 -2
  69. package/dist/esm/RelatedContent.js +28 -28
  70. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  71. package/dist/esm/SeriesListingDeck.js +1 -1
  72. package/dist/esm/{SeriesSlider-45adb8dc.js → SeriesSlider-98ad6d97.js} +4 -4
  73. package/dist/esm/SideFooter.js +2 -2
  74. package/dist/esm/VideoProgramLandingPage.js +2 -1
  75. package/dist/esm/VideoSeriesCard.js +1 -1
  76. package/dist/esm/VideoSeriesListing.js +17 -9
  77. package/dist/esm/View.js +12 -7
  78. package/dist/esm/YoutubeGroup.js +4 -4
  79. package/dist/esm/{getTargeting-42f9b439.js → getTargeting-04d979c9.js} +9 -9
  80. package/dist/esm/getTargeting.js +1 -1
  81. package/dist/esm/index.js +2 -3
  82. package/package.json +115 -115
  83. package/dist/cjs/Pagination-885dcfbd.js +0 -90
  84. package/dist/esm/Pagination-59436882.js +0 -82
@@ -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;
@@ -1767,7 +1767,7 @@ client$1.Provider;
1767
1767
 
1768
1768
  var client = client$1.default;
1769
1769
 
1770
- var css = ".AuthWrapper-module_loginBox__3l-BE {\n margin-bottom: 2rem;\n width: 350px;\n max-width: 90vw;\n margin-left: auto;\n margin-right: auto;\n /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\n background: #fff;\n z-index: 1;\n}\n.AuthWrapper-module_loginBox_title__12rGD {\n margin-bottom: 2rem;\n text-align: center;\n}\n.AuthWrapper-module_bar__1dafn {\n background: #eee;\n margin-left: unset;\n margin-right: unset;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\n float: left;\n border-right: 1rem solid #fff;\n background: rgb(245, 245, 245);\n height: 10rem;\n width: 25%;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 2rem;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\n width: 97%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\n width: 96%;\n height: 1.5rem;\n margin-bottom: 1.5rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\n width: 72%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\n width: 88%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n\n.AuthWrapper-module_iframe__2wDJW {\n margin-top: -3rem;\n border: none;\n width: 100%;\n height: 1900px;\n}";
1770
+ var css = ".AuthWrapper-module_loginBox__3l-BE {\r\n margin-bottom: 2rem;\r\n width: 350px;\r\n max-width: 90vw;\r\n margin-left: auto;\r\n margin-right: auto;\r\n /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\r\n background: #fff;\r\n z-index: 1;\r\n}\r\n.AuthWrapper-module_loginBox_title__12rGD {\r\n margin-bottom: 2rem;\r\n text-align: center;\r\n}\r\n.AuthWrapper-module_bar__1dafn {\r\n background: #eee;\r\n margin-left: unset;\r\n margin-right: unset;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\r\n float: left;\r\n border-right: 1rem solid #fff;\r\n background: rgb(245, 245, 245);\r\n height: 10rem;\r\n width: 25%;\r\n margin-left: auto;\r\n margin-right: auto;\r\n margin-bottom: 2rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\r\n width: 97%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\r\n width: 96%;\r\n height: 1.5rem;\r\n margin-bottom: 1.5rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\r\n width: 72%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\r\n width: 88%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n\r\n.AuthWrapper-module_iframe__2wDJW {\r\n margin-top: -3rem;\r\n border: none;\r\n width: 100%;\r\n height: 1900px;\r\n}";
1771
1771
  var styles = { "loginBox": "AuthWrapper-module_loginBox__3l-BE", "loginBox_title": "AuthWrapper-module_loginBox_title__12rGD", "bar": "AuthWrapper-module_bar__1dafn", "iframe": "AuthWrapper-module_iframe__2wDJW" };
1772
1772
  styleInject_es.styleInject(css);
1773
1773
 
@@ -13,21 +13,21 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
 
14
14
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
15
 
16
- /*
17
- Example usage - targetedonc.com/latest-conference
18
- const query = `*[!(_id in path("drafts.**")) && _type == "article" && defined(title) && is_visible == true && published <= '${today}' && references('b49d36b8-aa56-4183-a2bc-1568c229fb72') ] | order(published desc) [$from...$to] {
19
- ...,
20
- title,
21
- summary,
22
- thumbnail,
23
- url,
24
- published,
25
- documentGroup->,
26
- contentCategory->,
27
- 'pageNumber': ${currentPage}
28
- }`
29
-
30
- const posts = await client.fetch(query, params)
16
+ /*
17
+ Example usage - targetedonc.com/latest-conference
18
+ const query = `*[!(_id in path("drafts.**")) && _type == "article" && defined(title) && is_visible == true && published <= '${today}' && references('b49d36b8-aa56-4183-a2bc-1568c229fb72') ] | order(published desc) [$from...$to] {
19
+ ...,
20
+ title,
21
+ summary,
22
+ thumbnail,
23
+ url,
24
+ published,
25
+ documentGroup->,
26
+ contentCategory->,
27
+ 'pageNumber': ${currentPage}
28
+ }`
29
+
30
+ const posts = await client.fetch(query, params)
31
31
  */
32
32
 
33
33
  var ConferenceArticleCard = function ConferenceArticleCard(props) {
@@ -17,7 +17,7 @@ var index$1 = require('./index-eadd5035.js');
17
17
  var main = require('./main-f1c77adb.js');
18
18
  var entities = require('./entities-df1aed86.js');
19
19
  var ADInfeed = require('./ADInfeed-44d43b8a.js');
20
- var Pagination = require('./Pagination-885dcfbd.js');
20
+ var Pagination = require('./Pagination-42f92f7c.js');
21
21
  var Spinner = require('react-bootstrap/Spinner');
22
22
  require('./_commonjsHelpers-06173234.js');
23
23
  require('./core.get-iterator-method-5643aa10.js');
@@ -41,7 +41,6 @@ require('./toNumber-5e1fac58.js');
41
41
  require('./Beam.js');
42
42
  require('./stringify-f7a37a8d.js');
43
43
  require('./Segment.js');
44
- require('react-paginate');
45
44
  require('react-bootstrap/Button');
46
45
  require('./index.esm-d51c9ac6.js');
47
46
  require('./iconBase-be4097c0.js');
@@ -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,18 +118,26 @@ 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
132
  }, _this.renderCardImage = function (row, page) {
129
133
  if (row.thumbnail && row.thumbnail.asset) {
130
- var url = urlFor({ client: _this.client, source: row.thumbnail, imageHeight: _this.props.imageHeight || null, imageWidth: _this.props.imageWidth || null, imageFit: _this.props.imageFit || null });
134
+ var url = urlFor({
135
+ client: _this.client,
136
+ source: row.thumbnail,
137
+ imageHeight: _this.props.imageHeight || null,
138
+ imageWidth: _this.props.imageWidth || null,
139
+ imageFit: _this.props.imageFit || null
140
+ });
131
141
  return url;
132
142
  } else {
133
143
  return _this.defaultImage;
@@ -182,14 +192,14 @@ var DeckContent = function (_React$Component) {
182
192
  var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
183
193
 
184
194
  // please leave this for later debug purpose : Yong Jun.
185
- /* console.log('page change reported', {
186
- currentPage: currentPage,
187
- pageNumber: pageNumber,
188
- pathname: pathname,
189
- path: path,
190
- newPath: newPath,
191
- firstPage: pageNumber === 1,
192
- queryString: queryString
195
+ /* console.log('page change reported', {
196
+ currentPage: currentPage,
197
+ pageNumber: pageNumber,
198
+ pathname: pathname,
199
+ path: path,
200
+ newPath: newPath,
201
+ firstPage: pageNumber === 1,
202
+ queryString: queryString
193
203
  }) */
194
204
 
195
205
  if (pageview) {
@@ -370,7 +380,8 @@ var DeckContent = function (_React$Component) {
370
380
  { md: 12, style: { display: 'flex', flex: '1 0 auto' } },
371
381
  rightItems[i].component
372
382
  );
373
- }, _this.renderManualPagination = function () {
383
+ }, _this.renderManualPagination = function (_ref2) {
384
+ var nextPagePostsCount = _ref2.nextPagePostsCount;
374
385
  var currentPage = _this.state.currentPage;
375
386
 
376
387
  return React__default['default'].createElement(
@@ -381,7 +392,7 @@ var DeckContent = function (_React$Component) {
381
392
  { href: '?page=' + (currentPage - 1) },
382
393
  '<< Previous'
383
394
  ),
384
- React__default['default'].createElement(
395
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && nextPagePostsCount > 0 && React__default['default'].createElement(
385
396
  'a',
386
397
  { href: '?page=' + (currentPage + 1) },
387
398
  'Next >>'
@@ -425,7 +436,9 @@ var DeckContent = function (_React$Component) {
425
436
  page = _props.page,
426
437
  showBI = _props.showBI,
427
438
  brandInsight = _props.brandInsight,
428
- biStart = _props.biStart;
439
+ biStart = _props.biStart,
440
+ _props$nextPagePostsC = _props.nextPagePostsCount,
441
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC;
429
442
 
430
443
 
431
444
  return React__default['default'].createElement(
@@ -446,7 +459,7 @@ var DeckContent = function (_React$Component) {
446
459
  React__default['default'].createElement(
447
460
  'noscript',
448
461
  null,
449
- this.renderManualPagination()
462
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
450
463
  )
451
464
  ) : React__default['default'].createElement(
452
465
  React__default['default'].Fragment,
@@ -480,7 +493,7 @@ var DeckContent = function (_React$Component) {
480
493
  React__default['default'].createElement(
481
494
  'noscript',
482
495
  null,
483
- this.renderManualPagination()
496
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
484
497
  )
485
498
  )
486
499
  );
@@ -69,7 +69,8 @@ var DeckQueue = function (_React$Component) {
69
69
  total_pages: null,
70
70
  scrolling: true,
71
71
  query: _this.query,
72
- currentPage: _this.props.currentPage || 1
72
+ currentPage: _this.props.currentPage || 1,
73
+ lastDataSize: _this.data ? _this.data.length : 0
73
74
  }, _this.loadMore = debounce.debounce_1(function () {
74
75
  _this.setState(function (state) {
75
76
  var page = state.page,
@@ -109,11 +110,13 @@ var DeckQueue = function (_React$Component) {
109
110
  if (dataArr.length > 0) {
110
111
  return {
111
112
  data: [].concat(toConsumableArray._toConsumableArray(data), toConsumableArray._toConsumableArray(dataArr)),
113
+ lastDataSize: dataArr.length,
112
114
  scrolling: true
113
115
  };
114
116
  } else {
115
117
  return {
116
- scrolling: false
118
+ scrolling: false,
119
+ lastDataSize: 0
117
120
  };
118
121
  }
119
122
  });
@@ -199,8 +202,12 @@ var DeckQueue = function (_React$Component) {
199
202
  { style: { display: 'flex', flex: '1 0 auto' } },
200
203
  rightItems[i].component
201
204
  );
202
- }, _this.renderManualPagination = function () {
203
- var currentPage = _this.state.currentPage;
205
+ }, _this.renderManualPagination = function (_ref2) {
206
+ var nextPagePostsCount = _ref2.nextPagePostsCount;
207
+ var _this$state2 = _this.state,
208
+ currentPage = _this$state2.currentPage,
209
+ per = _this$state2.per,
210
+ lastDataSize = _this$state2.lastDataSize;
204
211
 
205
212
  return React__default['default'].createElement(
206
213
  'div',
@@ -210,7 +217,7 @@ var DeckQueue = function (_React$Component) {
210
217
  { href: '?page=' + (currentPage - 1) },
211
218
  '<< Previous'
212
219
  ),
213
- React__default['default'].createElement(
220
+ !(lastDataSize < per) && nextPagePostsCount > 0 && React__default['default'].createElement(
214
221
  'a',
215
222
  { href: '?page=' + (currentPage + 1) },
216
223
  'Next >>'
@@ -325,19 +332,30 @@ var DeckQueue = function (_React$Component) {
325
332
  columns = _props.columns,
326
333
  variant = _props.variant,
327
334
  autoScroll = _props.autoScroll,
328
- page = _props.page;
335
+ page = _props.page,
336
+ _props$nextPagePostsC = _props.nextPagePostsCount,
337
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC;
329
338
 
330
339
 
331
340
  return React__default['default'].createElement(
332
341
  'div',
333
342
  { className: 'contentDeck' },
334
343
  autoScroll ? React__default['default'].createElement(
335
- index_es.InfiniteScroll,
336
- { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling },
344
+ React__default['default'].Fragment,
345
+ null,
337
346
  React__default['default'].createElement(
338
- Container__default['default'],
347
+ index_es.InfiniteScroll,
348
+ { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling },
349
+ React__default['default'].createElement(
350
+ Container__default['default'],
351
+ null,
352
+ this.cardLoader(page, columns, variant)
353
+ )
354
+ ),
355
+ React__default['default'].createElement(
356
+ 'noscript',
339
357
  null,
340
- this.cardLoader(page, columns, variant)
358
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
341
359
  )
342
360
  ) : React__default['default'].createElement(
343
361
  React__default['default'].Fragment,
@@ -371,7 +389,7 @@ var DeckQueue = function (_React$Component) {
371
389
  React__default['default'].createElement(
372
390
  'noscript',
373
391
  null,
374
- this.renderManualPagination()
392
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
375
393
  )
376
394
  )
377
395
  );
@@ -18,7 +18,7 @@ var get = require('./get-5839e5b5.js');
18
18
  var main = require('./main-f1c77adb.js');
19
19
  var urlFor = require('./urlFor.js');
20
20
  var entities = require('./entities-df1aed86.js');
21
- var Pagination = require('./Pagination-885dcfbd.js');
21
+ var Pagination = require('./Pagination-42f92f7c.js');
22
22
  require('./_commonjsHelpers-06173234.js');
23
23
  require('./core.get-iterator-method-5643aa10.js');
24
24
  require('./web.dom.iterable-d98303e0.js');
@@ -36,7 +36,6 @@ require('./isSymbol-03abbdf0.js');
36
36
  require('./eq-5fc26c07.js');
37
37
  require('./slicedToArray-067dd3bc.js');
38
38
  require('./index-d48b231c.js');
39
- require('react-paginate');
40
39
  require('react-bootstrap/Button');
41
40
  require('./index.esm-d51c9ac6.js');
42
41
  require('./iconBase-be4097c0.js');
@@ -256,23 +256,23 @@ var EventsDeck = function EventsDeck(_ref) {
256
256
  if (cventAccessToken && cventAccessToken !== 'undefined') {
257
257
  setAccessToken(cventAccessToken);
258
258
  } else {
259
- /*const encodedData = window.btoa(clientId + ':' + clientSecret)
260
- //const url = `${corsProxy}https://api-platform.cvent.com/ea/oauth2/token`
261
- const url = `https://api-platform.cvent.com/ea/oauth2/token`
262
- fetch(url, {
263
- headers: {
264
- 'Content-Type': 'application/x-www-form-urlencoded',
265
- Authorization: `Basic ${encodedData}`
266
- },
267
- method: 'POST',
268
- body: `grant_type=client_credentials&client_id=${clientId}`
269
- })
270
- .then((response) => response.json())
271
- .then((json) => {
272
- const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000)
273
- Cookies.set('cvent_access_token', json.access_token, { expires: inOneHour })
274
- setAccessToken(json.access_token)
275
- })
259
+ /*const encodedData = window.btoa(clientId + ':' + clientSecret)
260
+ //const url = `${corsProxy}https://api-platform.cvent.com/ea/oauth2/token`
261
+ const url = `https://api-platform.cvent.com/ea/oauth2/token`
262
+ fetch(url, {
263
+ headers: {
264
+ 'Content-Type': 'application/x-www-form-urlencoded',
265
+ Authorization: `Basic ${encodedData}`
266
+ },
267
+ method: 'POST',
268
+ body: `grant_type=client_credentials&client_id=${clientId}`
269
+ })
270
+ .then((response) => response.json())
271
+ .then((json) => {
272
+ const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000)
273
+ Cookies.set('cvent_access_token', json.access_token, { expires: inOneHour })
274
+ setAccessToken(json.access_token)
275
+ })
276
276
  .catch((e) => console.log(e))*/
277
277
  // hello
278
278
  var url = 'https://beam.mjhlifesciences.com/api/cvent/token';
@@ -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
  });
@@ -236,7 +239,8 @@ var GridContent = function (_React$Component) {
236
239
  { style: { display: 'flex', flex: '1 0 auto' } },
237
240
  rightItems[i].component
238
241
  );
239
- }, _this.renderManualPagination = function () {
242
+ }, _this.renderManualPagination = function (_ref2) {
243
+ var nextPagePostsCount = _ref2.nextPagePostsCount;
240
244
  var currentPage = _this.state.currentPage;
241
245
 
242
246
  return React__default['default'].createElement(
@@ -247,7 +251,7 @@ var GridContent = function (_React$Component) {
247
251
  { href: '?page=' + (currentPage - 1) },
248
252
  '<< Previous'
249
253
  ),
250
- React__default['default'].createElement(
254
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && nextPagePostsCount > 0 && React__default['default'].createElement(
251
255
  'a',
252
256
  { href: '?page=' + (currentPage + 1) },
253
257
  'Next >>'
@@ -739,19 +743,30 @@ var GridContent = function (_React$Component) {
739
743
  showVideo = _props.showVideo,
740
744
  VideoPlayer = _props.VideoPlayer,
741
745
  showBI = _props.showBI,
742
- brandInsight = _props.brandInsight;
746
+ brandInsight = _props.brandInsight,
747
+ _props$nextPagePostsC = _props.nextPagePostsCount,
748
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC;
743
749
 
744
750
 
745
751
  return React__default['default'].createElement(
746
752
  'div',
747
753
  { className: 'contentDeck' },
748
754
  autoScroll ? React__default['default'].createElement(
749
- index_es.InfiniteScroll,
750
- { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling },
755
+ React__default['default'].Fragment,
756
+ null,
751
757
  React__default['default'].createElement(
752
- Container__default['default'],
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.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight, this.state.lgInfeedAd, this.state.contentCategoryMapping)
769
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
755
770
  )
756
771
  ) : React__default['default'].createElement(
757
772
  React__default['default'].Fragment,
@@ -785,7 +800,7 @@ var GridContent = function (_React$Component) {
785
800
  React__default['default'].createElement(
786
801
  'noscript',
787
802
  null,
788
- this.renderManualPagination()
803
+ this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
789
804
  )
790
805
  )
791
806
  );
@@ -24,7 +24,7 @@ var urlFor = require('./urlFor.js');
24
24
  var main = require('./main-f1c77adb.js');
25
25
  var AuthorComponent = require('./AuthorComponent-39b37d84.js');
26
26
  var PublicationFeature = require('./PublicationFeature-5ccf9b13.js');
27
- var Pagination = require('./Pagination-885dcfbd.js');
27
+ var Pagination = require('./Pagination-42f92f7c.js');
28
28
  var Spinner = require('react-bootstrap/Spinner');
29
29
  require('./_commonjsHelpers-06173234.js');
30
30
  require('./core.get-iterator-method-5643aa10.js');
@@ -49,7 +49,6 @@ require('./Segment.js');
49
49
  require('./eq-5fc26c07.js');
50
50
  require('./index-d48b231c.js');
51
51
  require('react-bootstrap/Button');
52
- require('react-paginate');
53
52
  require('./index.esm-d51c9ac6.js');
54
53
  require('./iconBase-be4097c0.js');
55
54
 
@@ -38,15 +38,15 @@ var Navbar__default = /*#__PURE__*/_interopDefaultLegacy(Navbar);
38
38
  var NavDropdown__default = /*#__PURE__*/_interopDefaultLegacy(NavDropdown);
39
39
 
40
40
  var HamMagazine = function HamMagazine(props) {
41
- /*
42
- Example Nav with acceptable props
43
- <MagazineNav
44
- showLogin
45
- logo={props.settings.logo}
46
- dataObject={props.cache.mainNavCache}
47
- website={website}
48
- subNav={props.cache.subNavCache}
49
- />
41
+ /*
42
+ Example Nav with acceptable props
43
+ <MagazineNav
44
+ showLogin
45
+ logo={props.settings.logo}
46
+ dataObject={props.cache.mainNavCache}
47
+ website={website}
48
+ subNav={props.cache.subNavCache}
49
+ />
50
50
  */
51
51
 
52
52
  // Setting 'socialIconVariant' as 'light' as default to make the social icons and search icon black
@@ -76,35 +76,35 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
76
76
 
77
77
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
78
78
 
79
- /* usage
80
- import Settings, { Ads } from '../../../../settings'
81
- import { IssueLanding, getQuery } from '@mjhls/mjh-framework'
82
- import client from '../../../../client'
83
- import moment from 'moment'
84
- import Shell from '../../../../components/2.0/Shell'
85
- import { pageview } from '../../../../utilities/gtag'
86
-
87
- const Issue = (props) => {
88
- const { pubIssue, cache } = props
89
- const targeting = {
90
- content_placement: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
91
- document_url: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
92
- }
93
- return (
94
- <Shell cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3' title={pubIssue.issue.name}>
95
- <IssueLanding pubIssue={pubIssue} client={client} settings={Settings} pageview={pageview} rightItems={Ads.getMobileAds(targeting)} />
96
- </Shell>
97
- )
98
- }
99
-
100
- Issue.getInitialProps = async (ctx) => {
101
- const { query } = ctx
102
- const pubIssue = await client.fetch(getQuery('issue'), { ...query, currentDate: moment().utc().format() }
103
- )
104
- return { pubIssue }
105
- }
106
-
107
- export default Issue
79
+ /* usage
80
+ import Settings, { Ads } from '../../../../settings'
81
+ import { IssueLanding, getQuery } from '@mjhls/mjh-framework'
82
+ import client from '../../../../client'
83
+ import moment from 'moment'
84
+ import Shell from '../../../../components/2.0/Shell'
85
+ import { pageview } from '../../../../utilities/gtag'
86
+
87
+ const Issue = (props) => {
88
+ const { pubIssue, cache } = props
89
+ const targeting = {
90
+ content_placement: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
91
+ document_url: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
92
+ }
93
+ return (
94
+ <Shell cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3' title={pubIssue.issue.name}>
95
+ <IssueLanding pubIssue={pubIssue} client={client} settings={Settings} pageview={pageview} rightItems={Ads.getMobileAds(targeting)} />
96
+ </Shell>
97
+ )
98
+ }
99
+
100
+ Issue.getInitialProps = async (ctx) => {
101
+ const { query } = ctx
102
+ const pubIssue = await client.fetch(getQuery('issue'), { ...query, currentDate: moment().utc().format() }
103
+ )
104
+ return { pubIssue }
105
+ }
106
+
107
+ export default Issue
108
108
  */
109
109
 
110
110
  var IssueLanding = function IssueLanding(props) {
@@ -128,7 +128,9 @@ var IssueLanding = function IssueLanding(props) {
128
128
  _props$imageHeight = props.imageHeight,
129
129
  imageHeight = _props$imageHeight === undefined ? 270 : _props$imageHeight,
130
130
  _props$imageWidth = props.imageWidth,
131
- imageWidth = _props$imageWidth === undefined ? 480 : _props$imageWidth;
131
+ imageWidth = _props$imageWidth === undefined ? 480 : _props$imageWidth,
132
+ _props$nextPagePostsC = props.nextPagePostsCount,
133
+ nextPagePostsCount = _props$nextPagePostsC === undefined ? 1 : _props$nextPagePostsC;
132
134
 
133
135
  return React__default['default'].createElement(
134
136
  'div',
@@ -162,7 +164,8 @@ var IssueLanding = function IssueLanding(props) {
162
164
  showPubInfo: showPubInfo,
163
165
  columns: 'rotate',
164
166
  variant: 'top',
165
- contentCategoryMapping: settings.contentCategoryMapping ? settings.contentCategoryMapping : []
167
+ contentCategoryMapping: settings.contentCategoryMapping ? settings.contentCategoryMapping : [],
168
+ nextPagePostsCount: nextPagePostsCount
166
169
  })
167
170
  );
168
171
  };
@@ -1,27 +1,27 @@
1
1
  'use strict';
2
2
 
3
3
  var KMTracker = function KMTracker(props) {
4
- var id = props.id;
4
+ var id = props.id;
5
5
 
6
- if (document && id) {
6
+ if (document && id) {
7
7
  (function () {
8
- var ecnJquery = document.createElement('script');
8
+ var ecnJquery = document.createElement('script');
9
9
 
10
- ecnJquery.type = 'text/javascript';
11
- ecnJquery.async = true;
12
- ecnJquery.src = 'https://apidt.ecn5.com/ECN_jQuery.min.js';
10
+ ecnJquery.type = 'text/javascript';
11
+ ecnJquery.async = true;
12
+ ecnJquery.src = 'https://apidt.ecn5.com/ECN_jQuery.min.js';
13
13
 
14
- var ecnScript = document.createElement('script');
14
+ var ecnScript = document.createElement('script');
15
15
 
16
- ecnScript.type = 'text/javascript';
17
- ecnScript.async = true;
18
- ecnScript.id = 'km-tracker';
19
- ecnScript.src = 'https://apidt.ecn5.com/ECN_tracker_Secure.js?TrackerKey=' + id;
16
+ ecnScript.type = 'text/javascript';
17
+ ecnScript.async = true;
18
+ ecnScript.id = 'km-tracker';
19
+ ecnScript.src = 'https://apidt.ecn5.com/ECN_tracker_Secure.js?TrackerKey=' + id;
20
20
 
21
- document.head.appendChild(ecnJquery);
22
- document.head.appendChild(ecnScript);
23
- })();
24
- }
21
+ document.head.appendChild(ecnJquery);
22
+ document.head.appendChild(ecnScript);
23
+ })();
24
+ }
25
25
  };
26
26
 
27
27
  module.exports = KMTracker;