@mjhls/mjh-framework 1.0.939-nojs-pagination-v1 → 1.0.939-nojs-pagination-v3

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.
@@ -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;
@@ -383,9 +383,6 @@ var DeckContent = function (_React$Component) {
383
383
  }, _this.renderManualPagination = function () {
384
384
  var currentPage = _this.state.currentPage;
385
385
 
386
- if (_this.state.lastDataSize < _this.state.itemsPerPage) {
387
- return null;
388
- }
389
386
  return React__default['default'].createElement(
390
387
  'div',
391
388
  { className: 'd-flex justify-content-between' },
@@ -394,7 +391,7 @@ var DeckContent = function (_React$Component) {
394
391
  { href: '?page=' + (currentPage - 1) },
395
392
  '<< Previous'
396
393
  ),
397
- React__default['default'].createElement(
394
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && React__default['default'].createElement(
398
395
  'a',
399
396
  { href: '?page=' + (currentPage + 1) },
400
397
  'Next >>'
@@ -242,9 +242,6 @@ var GridContent = function (_React$Component) {
242
242
  }, _this.renderManualPagination = function () {
243
243
  var currentPage = _this.state.currentPage;
244
244
 
245
- if (_this.state.lastDataSize < _this.state.per) {
246
- return null;
247
- }
248
245
  return React__default['default'].createElement(
249
246
  'div',
250
247
  { className: 'd-flex justify-content-between' },
@@ -253,7 +250,7 @@ var GridContent = function (_React$Component) {
253
250
  { href: '?page=' + (currentPage - 1) },
254
251
  '<< Previous'
255
252
  ),
256
- React__default['default'].createElement(
253
+ !(_this.state.lastDataSize < _this.state.per) && React__default['default'].createElement(
257
254
  'a',
258
255
  { href: '?page=' + (currentPage + 1) },
259
256
  'Next >>'
@@ -311,7 +311,6 @@ var MasterDeck = function (_React$Component) {
311
311
  document_url: brandInsightAd.targeting.document_url,
312
312
  document_group: brandInsightAd.targeting.document_group,
313
313
  rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
314
-
315
314
  },
316
315
  _type: 'brandInsightAd',
317
316
  /* Passing refresh flag */
@@ -412,9 +411,6 @@ var MasterDeck = function (_React$Component) {
412
411
 
413
412
  console.log('lastDataSize:', lastDataSize);
414
413
  console.log('itemsPerPage:', itemsPerPage);
415
- if (lastDataSize < itemsPerPage) {
416
- return null;
417
- }
418
414
 
419
415
  return React__default['default'].createElement(
420
416
  'div',
@@ -424,7 +420,7 @@ var MasterDeck = function (_React$Component) {
424
420
  { href: '?page=' + (currentPage - 1) },
425
421
  '<< Previous'
426
422
  ),
427
- React__default['default'].createElement(
423
+ !(lastDataSize < itemsPerPage) && React__default['default'].createElement(
428
424
  'a',
429
425
  { href: '?page=' + (currentPage + 1) },
430
426
  'Next >>'
@@ -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 }');
@@ -1420,10 +1420,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1420
1420
  var prevValues = usePrevious(values);
1421
1421
 
1422
1422
  var renderManualPagination = function renderManualPagination(currentPage) {
1423
- if (lastDataSize < itemsPerPage) {
1424
- return null;
1425
- }
1426
-
1427
1423
  return React__default['default'].createElement(
1428
1424
  'div',
1429
1425
  { className: 'd-flex justify-content-between' },
@@ -1432,7 +1428,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1432
1428
  { href: '?page=' + (currentPage - 1) },
1433
1429
  '<< Previous'
1434
1430
  ),
1435
- React__default['default'].createElement(
1431
+ !(lastDataSize < itemsPerPage) && React__default['default'].createElement(
1436
1432
  'a',
1437
1433
  { href: '?page=' + (currentPage + 1) },
1438
1434
  'Next >>'
@@ -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}';
@@ -204,9 +204,7 @@ var VideoSeriesListing = function (_React$Component) {
204
204
  }, _this.renderManualPagination = function () {
205
205
  var currentPage = _this.state.currentPage;
206
206
 
207
- if (_this.state.lastDataSize < _this.state.per) {
208
- return null;
209
- }
207
+
210
208
  return React__default['default'].createElement(
211
209
  'div',
212
210
  { className: 'd-flex justify-content-between' },
@@ -215,7 +213,7 @@ var VideoSeriesListing = function (_React$Component) {
215
213
  { href: '?page=' + (currentPage - 1) },
216
214
  '<< Previous'
217
215
  ),
218
- React__default['default'].createElement(
216
+ !(_this.state.lastDataSize < _this.state.per) && React__default['default'].createElement(
219
217
  'a',
220
218
  { href: '?page=' + (currentPage + 1) },
221
219
  'Next >>'
@@ -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;
@@ -373,9 +373,6 @@ var DeckContent = function (_React$Component) {
373
373
  }, _this.renderManualPagination = function () {
374
374
  var currentPage = _this.state.currentPage;
375
375
 
376
- if (_this.state.lastDataSize < _this.state.itemsPerPage) {
377
- return null;
378
- }
379
376
  return React__default.createElement(
380
377
  'div',
381
378
  { className: 'd-flex justify-content-between' },
@@ -384,7 +381,7 @@ var DeckContent = function (_React$Component) {
384
381
  { href: '?page=' + (currentPage - 1) },
385
382
  '<< Previous'
386
383
  ),
387
- React__default.createElement(
384
+ !(_this.state.lastDataSize < _this.state.itemsPerPage) && React__default.createElement(
388
385
  'a',
389
386
  { href: '?page=' + (currentPage + 1) },
390
387
  'Next >>'
@@ -232,9 +232,6 @@ var GridContent = function (_React$Component) {
232
232
  }, _this.renderManualPagination = function () {
233
233
  var currentPage = _this.state.currentPage;
234
234
 
235
- if (_this.state.lastDataSize < _this.state.per) {
236
- return null;
237
- }
238
235
  return React__default.createElement(
239
236
  'div',
240
237
  { className: 'd-flex justify-content-between' },
@@ -243,7 +240,7 @@ var GridContent = function (_React$Component) {
243
240
  { href: '?page=' + (currentPage - 1) },
244
241
  '<< Previous'
245
242
  ),
246
- React__default.createElement(
243
+ !(_this.state.lastDataSize < _this.state.per) && React__default.createElement(
247
244
  'a',
248
245
  { href: '?page=' + (currentPage + 1) },
249
246
  'Next >>'
@@ -304,7 +304,6 @@ var MasterDeck = function (_React$Component) {
304
304
  document_url: brandInsightAd.targeting.document_url,
305
305
  document_group: brandInsightAd.targeting.document_group,
306
306
  rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
307
-
308
307
  },
309
308
  _type: 'brandInsightAd',
310
309
  /* Passing refresh flag */
@@ -405,9 +404,6 @@ var MasterDeck = function (_React$Component) {
405
404
 
406
405
  console.log('lastDataSize:', lastDataSize);
407
406
  console.log('itemsPerPage:', itemsPerPage);
408
- if (lastDataSize < itemsPerPage) {
409
- return null;
410
- }
411
407
 
412
408
  return React__default.createElement(
413
409
  'div',
@@ -417,7 +413,7 @@ var MasterDeck = function (_React$Component) {
417
413
  { href: '?page=' + (currentPage - 1) },
418
414
  '<< Previous'
419
415
  ),
420
- React__default.createElement(
416
+ !(lastDataSize < itemsPerPage) && React__default.createElement(
421
417
  'a',
422
418
  { href: '?page=' + (currentPage + 1) },
423
419
  'Next >>'
@@ -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 }');
@@ -1414,10 +1414,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1414
1414
  var prevValues = usePrevious(values);
1415
1415
 
1416
1416
  var renderManualPagination = function renderManualPagination(currentPage) {
1417
- if (lastDataSize < itemsPerPage) {
1418
- return null;
1419
- }
1420
-
1421
1417
  return React__default.createElement(
1422
1418
  'div',
1423
1419
  { className: 'd-flex justify-content-between' },
@@ -1426,7 +1422,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1426
1422
  { href: '?page=' + (currentPage - 1) },
1427
1423
  '<< Previous'
1428
1424
  ),
1429
- React__default.createElement(
1425
+ !(lastDataSize < itemsPerPage) && React__default.createElement(
1430
1426
  'a',
1431
1427
  { href: '?page=' + (currentPage + 1) },
1432
1428
  'Next >>'
@@ -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}';
@@ -197,9 +197,7 @@ var VideoSeriesListing = function (_React$Component) {
197
197
  }, _this.renderManualPagination = function () {
198
198
  var currentPage = _this.state.currentPage;
199
199
 
200
- if (_this.state.lastDataSize < _this.state.per) {
201
- return null;
202
- }
200
+
203
201
  return React__default.createElement(
204
202
  'div',
205
203
  { className: 'd-flex justify-content-between' },
@@ -208,7 +206,7 @@ var VideoSeriesListing = function (_React$Component) {
208
206
  { href: '?page=' + (currentPage - 1) },
209
207
  '<< Previous'
210
208
  ),
211
- React__default.createElement(
209
+ !(_this.state.lastDataSize < _this.state.per) && React__default.createElement(
212
210
  'a',
213
211
  { href: '?page=' + (currentPage + 1) },
214
212
  'Next >>'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.939-nojs-pagination-v1",
3
+ "version": "1.0.939-nojs-pagination-v3",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",