@mjhls/mjh-framework 1.0.232 → 1.0.234

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/index.js CHANGED
@@ -12,7 +12,7 @@ var PropTypes = _interopDefault(require('prop-types'));
12
12
  var Container = _interopDefault(require('react-bootstrap/Container'));
13
13
  var Row = _interopDefault(require('react-bootstrap/Row'));
14
14
  var Col = _interopDefault(require('react-bootstrap/Col'));
15
- var Card = _interopDefault(require('react-bootstrap/Card'));
15
+ require('react-bootstrap/Card');
16
16
  var visibilitySensor = require('./visibility-sensor-bea3105d.js');
17
17
  var Link = _interopDefault(require('next/link'));
18
18
  var Router = require('next/router');
@@ -44,7 +44,8 @@ var PublicationDeck = require('./PublicationDeck.js');
44
44
  var IssueDeck = require('./IssueDeck.js');
45
45
  require('react-bootstrap/Badge');
46
46
  var IssueContentDeck = require('./IssueContentDeck.js');
47
- var TemplateNormal = require('./Normal-5cf206ec.js');
47
+ var Spinner = _interopDefault(require('react-bootstrap/Spinner'));
48
+ var TemplateNormal = require('./Normal-821546cd.js');
48
49
  require('react-bootstrap/ListGroup');
49
50
  var Head = _interopDefault(require('next/head'));
50
51
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -62,376 +63,431 @@ var DropdownButton = _interopDefault(require('react-bootstrap/DropdownButton'));
62
63
  var Dropdown = _interopDefault(require('react-bootstrap/Dropdown'));
63
64
  var Ustream = require('./Ustream-0d3dd953.js');
64
65
 
65
- var EventsDeck = function (_React$Component) {
66
- _babelHelpers.inherits(EventsDeck, _React$Component);
67
-
68
- function EventsDeck() {
69
- var _ref;
66
+ var clientId = process.env.CVENT_CLIENT_ID;
67
+ var clientSecret = process.env.CVENT_CLIENT_SECRET;
68
+ var corsProxy = 'https://cors-anywhere.herokuapp.com/';
69
+ var currentTime = visibilitySensor.moment().toISOString();
70
+
71
+ var EventsDeck = function EventsDeck(_ref) {
72
+ var _ref$autoScroll = _ref.autoScroll,
73
+ autoScroll = _ref$autoScroll === undefined ? true : _ref$autoScroll,
74
+ rightItems = _ref.rightItems,
75
+ _ref$seoPaginate = _ref.seoPaginate,
76
+ seoPaginate = _ref$seoPaginate === undefined ? true : _ref$seoPaginate,
77
+ pageview = _ref.pageview,
78
+ _ref$filter = _ref.filter,
79
+ filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter;
70
80
 
71
- var _temp, _this, _ret;
81
+ var router = Router.useRouter();
72
82
 
73
- _babelHelpers.classCallCheck(this, EventsDeck);
83
+ var _useState = React.useState(true),
84
+ _useState2 = _babelHelpers.slicedToArray(_useState, 2),
85
+ isLoading = _useState2[0],
86
+ setIsLoading = _useState2[1];
74
87
 
75
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
76
- args[_key] = arguments[_key];
77
- }
88
+ var _useState3 = React.useState(null),
89
+ _useState4 = _babelHelpers.slicedToArray(_useState3, 2),
90
+ accessToken = _useState4[0],
91
+ setAccessToken = _useState4[1];
78
92
 
79
- return _ret = (_temp = (_this = _babelHelpers.possibleConstructorReturn(this, (_ref = EventsDeck.__proto__ || Object.getPrototypeOf(EventsDeck)).call.apply(_ref, [this].concat(args))), _this), _this.data = _this.props.dataRecord || [], _this.params = _this.props.params, _this.state = {
80
- data: _this.data,
81
- dataKeptToCompareNewDatarecord: _this.data,
82
- page: _this.props.currentPage || 1,
83
- scrolling: true,
84
- currentPage: _this.props.currentPage || 1,
85
- params: _this.params
86
- }, _this.loadMore = debounce.debounce_1(function () {
87
- _this.setState(function (prevState) {
88
- return {
89
- page: prevState.page + 1
90
- };
91
- }, _this.loadData);
92
- }, 0), _this.loadData = function () {
93
- var _this$state = _this.state,
94
- data = _this$state.data,
95
- page = _this$state.page,
96
- params = _this$state.params;
97
- var dataHandler = _this.props.dataHandler;
93
+ var _useState5 = React.useState([]),
94
+ _useState6 = _babelHelpers.slicedToArray(_useState5, 2),
95
+ data = _useState6[0],
96
+ setData = _useState6[1];
98
97
 
98
+ var _useState7 = React.useState(null),
99
+ _useState8 = _babelHelpers.slicedToArray(_useState7, 2),
100
+ nextPagingToken = _useState8[0],
101
+ setNextPagingToken = _useState8[1];
99
102
 
100
- var dataHandlerPromise = new Promise(function (resolve, reject) {
101
- try {
102
- var result = dataHandler(params);
103
- resolve(result);
104
- } catch (e) {
105
- reject(e);
106
- }
107
- });
108
- dataHandlerPromise.then(function (newData) {
109
- _this.loadDataFinished(data, newData, page);
110
- });
111
- }, _this.loadDataFinished = function (data, newData, page) {
112
- var newDataArray = newData.data.map(function (item) {
103
+ var _useState9 = React.useState(true),
104
+ _useState10 = _babelHelpers.slicedToArray(_useState9, 2),
105
+ scrolling = _useState10[0],
106
+ setScrolling = _useState10[1];
107
+
108
+ var _useState11 = React.useState(1),
109
+ _useState12 = _babelHelpers.slicedToArray(_useState11, 2),
110
+ page = _useState12[0],
111
+ setPage = _useState12[1];
112
+
113
+ var _useState13 = React.useState(1),
114
+ _useState14 = _babelHelpers.slicedToArray(_useState13, 2),
115
+ currentPage = _useState14[0],
116
+ setCurrentPage = _useState14[1];
117
+
118
+ var getEvents = function getEvents() {
119
+ var itemsPerPage = 10;
120
+ var url = corsProxy + 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
121
+ fetch(url, {
122
+ headers: {
123
+ Accept: 'application/json',
124
+ 'x-api-key': clientId,
125
+ Authorization: 'Bearer ' + accessToken
126
+ },
127
+ body: JSON.stringify({ filter: filter }),
128
+ method: 'POST'
129
+ }).then(function (response) {
130
+ return response.json();
131
+ }).then(function (events) {
132
+ setIsLoading(false);
133
+ var newData = events.data.map(function (item) {
113
134
  return _babelHelpers._extends({}, item, {
114
135
  pageNumber: page
115
136
  });
116
137
  });
117
- var newParams = _babelHelpers._extends({}, _this.state.params, { nextPagingToken: newData.paging.nextToken });
118
- _this.setState(function () {
119
- if (newDataArray.length > 0) {
120
- return {
121
- data: [].concat(_babelHelpers.toConsumableArray(data), _babelHelpers.toConsumableArray(newDataArray)),
122
- params: newParams,
123
- scrolling: true
124
- };
138
+ console.log(events.paging);
139
+ if (newData.length > 0) {
140
+ setData(function (prevData) {
141
+ return [].concat(_babelHelpers.toConsumableArray(prevData), _babelHelpers.toConsumableArray(newData));
142
+ });
143
+ setNextPagingToken(events.paging.nextToken ? events.paging.nextToken : null);
144
+ setScrolling(true);
145
+ } else {
146
+ setScrolling(false);
147
+ }
148
+ });
149
+ };
150
+
151
+ React.useEffect(function () {
152
+ // load initial data
153
+ if (accessToken && page === 1 && currentPage === 1) {
154
+ getEvents();
155
+ }
156
+ }, [accessToken, filter, page, currentPage]);
157
+
158
+ React.useEffect(function () {
159
+ // reset state when filter changes
160
+ setIsLoading(true);
161
+ setData([]);
162
+ setPage(1);
163
+ setCurrentPage(1);
164
+ }, [filter]);
165
+
166
+ React.useEffect(function () {
167
+ // get access token
168
+ var encodedData = window.btoa(clientId + ':' + clientSecret);
169
+ var url = corsProxy + 'https://api-platform.cvent.com/ea/oauth2/token';
170
+ fetch(url, {
171
+ headers: {
172
+ 'Content-Type': 'application/x-www-form-urlencoded',
173
+ Authorization: 'Basic ' + encodedData
174
+ },
175
+ method: 'POST',
176
+ body: 'grant_type=client_credentials&client_id=' + clientId
177
+ }).then(function (response) {
178
+ return response.json();
179
+ }).then(function (json) {
180
+ return setAccessToken(json.access_token);
181
+ }).catch(function (e) {
182
+ return console.log(e);
183
+ });
184
+ }, []);
185
+
186
+ var loadMore = debounce.debounce_1(function () {
187
+ setPage(function (prevPage) {
188
+ return prevPage + 1;
189
+ });
190
+ }, 0);
191
+
192
+ React.useEffect(function () {
193
+ // load more events
194
+ page !== 1 && page !== currentPage && loadMoreEvents();
195
+ }, [page]);
196
+
197
+ var loadMoreEvents = function loadMoreEvents() {
198
+ console.log(nextPagingToken, 'nextPagingToken');
199
+ if (nextPagingToken) {
200
+ var url = corsProxy + 'https://api-platform.cvent.com/event/v1/events/filter?token=' + nextPagingToken;
201
+ fetch(url, {
202
+ headers: {
203
+ Accept: 'application/json',
204
+ 'x-api-key': clientId,
205
+ Authorization: 'Bearer ' + accessToken
206
+ },
207
+ body: JSON.stringify({ filter: filter }),
208
+ method: 'POST'
209
+ }).then(function (response) {
210
+ return response.json();
211
+ }).then(function (events) {
212
+ var newData = events.data.map(function (item) {
213
+ return _babelHelpers._extends({}, item, {
214
+ pageNumber: page
215
+ });
216
+ });
217
+ console.log(events.paging);
218
+ if (newData.length > 0) {
219
+ setData(function (prevData) {
220
+ return [].concat(_babelHelpers.toConsumableArray(prevData), _babelHelpers.toConsumableArray(newData));
221
+ });
222
+ setNextPagingToken(events.paging.nextToken ? events.paging.nextToken : null);
223
+ setScrolling(true);
125
224
  } else {
126
- return {
127
- scrolling: false
128
- };
225
+ setScrolling(false);
129
226
  }
130
227
  });
131
- }, _this.changePageNumber = function (pageNumber) {
132
- var _this$props = _this.props,
133
- seoPaginate = _this$props.seoPaginate,
134
- pageview = _this$props.pageview,
135
- router = _this$props.router;
136
- var currentPage = _this.state.currentPage;
137
-
138
- if (seoPaginate) {
139
- var path = router.asPath;
140
- var qrIndex = path.indexOf('?');
141
- var pathname = router.pathname;
142
- var queryString = '';
143
-
144
- if (qrIndex > 0) {
145
- path = path.substring(1, qrIndex);
146
-
147
- var partialQS = router.asPath.substring(qrIndex + 1);
148
- var partialQSArr = partialQS.split('&');
149
-
150
- // exclude page=xxx from query string
151
- partialQSArr.map(function (item) {
152
- var itemArr = item.split('=');
153
- var key = itemArr[0];
154
- var val = itemArr[1];
155
-
156
- if (key !== 'page') {
157
- queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
158
- }
159
- });
160
- }
228
+ }
229
+ };
161
230
 
162
- if (queryString.length > 0) {
163
- path += '?' + queryString;
164
- }
231
+ var changePageNumber = function changePageNumber(pageNumber) {
232
+ if (seoPaginate) {
233
+ var path = router.asPath;
234
+ var qrIndex = path.indexOf('?');
235
+ var pathname = router.pathname;
236
+ var queryString = '';
165
237
 
166
- pageNumber = parseInt(pageNumber);
238
+ if (qrIndex > 0) {
239
+ path = path.substring(1, qrIndex);
167
240
 
168
- if (currentPage !== pageNumber) {
169
- index.lib_3.refresh();
241
+ var partialQS = router.asPath.substring(qrIndex + 1);
242
+ var partialQSArr = partialQS.split('&');
170
243
 
171
- _this.setState({
172
- currentPage: pageNumber
173
- }, function () {
174
- if (path[0] !== '/') {
175
- path = '/' + path;
176
- }
244
+ // exclude page=xxx from query string
245
+ partialQSArr.map(function (item) {
246
+ var itemArr = item.split('=');
247
+ var key = itemArr[0];
248
+ var val = itemArr[1];
177
249
 
178
- var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
179
-
180
- // please leave this for later debug purpose : Yong Jun.
181
- /* console.log('page change reported', {
182
- currentPage: currentPage,
183
- pageNumber: pageNumber,
184
- pathname: pathname,
185
- path: path,
186
- newPath: newPath,
187
- firstPage: pageNumber === 1,
188
- queryString: queryString
189
- }) */
190
-
191
- if (pageview) {
192
- pageview(newPath);
193
- }
250
+ if (key !== 'page') {
251
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
252
+ }
253
+ });
254
+ }
194
255
 
195
- router.push(pathname, newPath, {
196
- shallow: true
197
- });
198
- });
256
+ if (queryString.length > 0) {
257
+ path += '?' + queryString;
258
+ }
259
+
260
+ pageNumber = parseInt(pageNumber);
261
+
262
+ if (currentPage !== pageNumber) {
263
+ index.lib_3.refresh();
264
+
265
+ setCurrentPage(pageNumber);
266
+ if (path[0] !== '/') {
267
+ path = '/' + path;
268
+ }
269
+ var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
270
+
271
+ if (pageview) {
272
+ pageview(newPath);
199
273
  }
274
+
275
+ router.push(pathname, newPath, {
276
+ shallow: true
277
+ });
200
278
  }
201
- }, _this.registrationButton = function (registrationLink) {
202
- return React__default.createElement(
203
- 'a',
204
- { href: registrationLink, target: '_blank' },
205
- React__default.createElement(
206
- Button,
207
- { className: 'event-registration-button' },
208
- 'Register Now'
209
- )
210
- );
211
- }, _this.renderVenue = function (venue, index) {
212
- return React__default.createElement(
213
- Col,
214
- { xs: 12, sm: 6, md: 6, xl: 6 },
215
- React__default.createElement(
216
- 'div',
217
- { className: 'venue-card', style: { width: '18rem' } },
279
+ }
280
+ };
281
+
282
+ var renderRegisterButton = function renderRegisterButton(registrationLink) {
283
+ return React__default.createElement(
284
+ 'a',
285
+ { href: registrationLink, target: '_blank' },
286
+ React__default.createElement(
287
+ Button,
288
+ { size: 'sm', className: 'event-registration-button' },
289
+ 'Register Now'
290
+ )
291
+ );
292
+ };
293
+
294
+ var cardLoader = function cardLoader() {
295
+ var numberOfItemsBeforeAd = 5;
296
+ return React__default.createElement(
297
+ Row,
298
+ null,
299
+ data && data.map(function (row, index) {
300
+ var title = row.title,
301
+ description = row.description,
302
+ start = row.start,
303
+ venues = row.venues,
304
+ _links = row._links,
305
+ virtual = row.virtual;
306
+
307
+ var pageNumber = row.pageNumber || 1;
308
+ return React__default.createElement(
309
+ React__default.Fragment,
310
+ { key: index },
218
311
  React__default.createElement(
219
- Card.Body,
220
- null,
221
- React__default.createElement(
222
- Card.Title,
223
- null,
224
- venue.name
225
- ),
226
- React__default.createElement(
227
- Card.Subtitle,
228
- { className: 'mb-2 text-muted' },
229
- venue.address.address1
230
- ),
231
- React__default.createElement(
232
- Card.Subtitle,
233
- { className: 'mb-2 text-muted' },
234
- venue.address.city
235
- ),
236
- React__default.createElement(
237
- Card.Subtitle,
238
- { className: 'mb-2 text-muted' },
239
- venue.address.country
240
- ),
241
- React__default.createElement(
242
- Card.Subtitle,
243
- { className: 'mb-2 text-muted' },
244
- venue.address.postalCode
245
- )
246
- )
247
- )
248
- );
249
- }, _this.cardLoader = function () {
250
- var numberOfItemsBeforeAd = 5;
251
- return React__default.createElement(
252
- Row,
253
- null,
254
- _this.state.data && _this.state.data.map(function (row, index) {
255
- var title = row.title,
256
- description = row.description,
257
- start = row.start,
258
- venues = row.venues,
259
- _links = row._links;
260
-
261
- var pageNumber = row.pageNumber || _this.state.page;
262
- return React__default.createElement(
263
- React__default.Fragment,
264
- { key: index },
312
+ visibilitySensor.VisibilitySensor,
313
+ {
314
+ onChange: function onChange(isVisible) {
315
+ isVisible && changePageNumber(pageNumber);
316
+ } },
265
317
  React__default.createElement(
266
- visibilitySensor.VisibilitySensor,
267
- {
268
- onChange: function onChange(isVisible) {
269
- isVisible && _this.changePageNumber(pageNumber);
270
- } },
318
+ Col,
319
+ { xl: 12, style: { paddingTop: '10px', marginBottom: '20px', borderTop: '1px solid #D3D3D3' } },
271
320
  React__default.createElement(
272
- Col,
273
- { xl: 12, style: { marginBottom: '1rem' } },
321
+ Row,
322
+ null,
274
323
  React__default.createElement(
275
- Row,
276
- null,
277
- React__default.createElement(
278
- Col,
279
- { xs: 12, style: { paddingTop: '10px', marginBottom: '20px', borderTop: '1px solid #EEE' } },
280
- !main.main_36 && React__default.createElement(
281
- 'div',
282
- { style: { float: 'right' } },
283
- _this.registrationButton(_links.registration.href)
324
+ Col,
325
+ { xs: 12, sm: 4 },
326
+ venues && venues.length > 0 && React__default.createElement(
327
+ 'div',
328
+ null,
329
+ React__default.createElement(
330
+ 'h5',
331
+ null,
332
+ venues[0].name
284
333
  ),
285
- React__default.createElement('h4', { className: 'mb-1', style: { fontWeight: '500', fontSize: '22px' }, dangerouslySetInnerHTML: { __html: title } }),
286
334
  React__default.createElement(
287
335
  'p',
288
- { className: 'mb-2' },
289
- 'Sarting at ',
290
- visibilitySensor.moment(start).format('MMMM Do YYYY, h:mma')
336
+ { style: { padding: 0, margin: 0 } },
337
+ visibilitySensor.moment(start).format('LL')
291
338
  ),
292
- description && React__default.createElement('p', { dangerouslySetInnerHTML: { __html: description } }),
293
339
  React__default.createElement(
294
- Row,
295
- null,
296
- venues && venues.length > 0 && venues.map(function (venue, index) {
297
- return _this.renderVenue(venue, index);
298
- })
299
- ),
300
- main.main_36 && _this.registrationButton(_links.registration.href)
340
+ 'p',
341
+ { style: { padding: 0, margin: 0 } },
342
+ visibilitySensor.moment(start).format('LT')
343
+ )
344
+ )
345
+ ),
346
+ React__default.createElement(
347
+ Col,
348
+ { xs: 12, sm: 5 },
349
+ React__default.createElement('h6', { className: 'mb-1', dangerouslySetInnerHTML: { __html: title } }),
350
+ virtual && React__default.createElement(
351
+ 'h5',
352
+ null,
353
+ 'VIRTUAL MEETING'
301
354
  )
355
+ ),
356
+ React__default.createElement(
357
+ Col,
358
+ { xs: 12, sm: 3 },
359
+ renderRegisterButton(_links.registration.href)
360
+ )
361
+ ),
362
+ description && React__default.createElement(
363
+ Row,
364
+ { style: { marginTop: '8px' } },
365
+ React__default.createElement(
366
+ Col,
367
+ null,
368
+ React__default.createElement('p', { dangerouslySetInnerHTML: { __html: description } })
302
369
  )
303
370
  )
304
- ),
305
- main.main_36 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
306
- 'div',
307
- { style: { margin: '0 auto' } },
308
- _this.renderMobileAd(index, numberOfItemsBeforeAd, _this.rightItems)
309
371
  )
310
- );
311
- })
312
- );
313
- }, _this.renderMobileAd = function (index, numberOfItemsBeforeAd) {
314
- var rightItems = _this.props.rightItems;
372
+ ),
373
+ main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
374
+ 'div',
375
+ { style: { margin: '0 auto' } },
376
+ renderMobileAd(index, numberOfItemsBeforeAd)
377
+ )
378
+ );
379
+ })
380
+ );
381
+ };
315
382
 
316
- var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
317
- return React__default.createElement(
318
- Col,
319
- { md: 12, style: { display: 'flex', flex: '1 0 auto' } },
320
- rightItems[i].component
321
- );
322
- }, _this.renderManualPagination = function () {
323
- var currentPage = _this.state.currentPage;
383
+ var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd) {
384
+ var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
385
+ return React__default.createElement(
386
+ Col,
387
+ { md: 12, style: { display: 'flex', flex: '1 0 auto' } },
388
+ rightItems[i].component
389
+ );
390
+ };
324
391
 
325
- return React__default.createElement(
326
- 'div',
327
- { className: 'd-flex justify-content-between' },
328
- currentPage && currentPage > 1 && React__default.createElement(
329
- 'a',
330
- { href: '?page=' + (currentPage - 1) },
331
- '<< Previous'
332
- ),
392
+ var renderManualPagination = function renderManualPagination() {
393
+ var currentPage = 1;
394
+ return React__default.createElement(
395
+ 'div',
396
+ { className: 'd-flex justify-content-between' },
397
+ currentPage > 1 ,
398
+ React__default.createElement(
399
+ 'a',
400
+ { href: '?page=' + (currentPage + 1) },
401
+ 'Next >>'
402
+ )
403
+ );
404
+ };
405
+
406
+ if (isLoading) {
407
+ return React__default.createElement(
408
+ 'div',
409
+ { style: { display: 'flex', justifyContent: 'center', marginTop: '48px' } },
410
+ React__default.createElement(
411
+ Spinner,
412
+ { animation: 'border', role: 'status' },
333
413
  React__default.createElement(
334
- 'a',
335
- { href: '?page=' + (currentPage + 1) },
336
- 'Next >>'
414
+ 'span',
415
+ { className: 'sr-only' },
416
+ 'Loading...'
337
417
  )
338
- );
339
- }, _temp), _babelHelpers.possibleConstructorReturn(_this, _ret);
418
+ )
419
+ );
340
420
  }
341
421
 
342
- _babelHelpers.createClass(EventsDeck, [{
343
- key: 'componentDidUpdate',
344
- value: function componentDidUpdate(prevProps, prevState) {
345
- if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
346
- // eslint-disable-next-line react/no-did-update-set-state
347
- this.setState({
348
- data: this.props.dataRecord,
349
- dataKeptToCompareNewDatarecord: this.props.dataRecord,
350
- page: 1,
351
- scrolling: true
352
- });
353
- }
354
- }
355
- }, {
356
- key: 'componentDidMount',
357
- value: function componentDidMount() {
358
- // this.loadData();
359
- }
360
- }, {
361
- key: 'render',
362
- value: function render() {
363
- var _this2 = this;
364
-
365
- var autoScroll = this.props.autoScroll;
366
-
367
- console.log(this.state.data);
368
- return React__default.createElement(
369
- 'div',
370
- { className: 'contentDeck' },
371
- autoScroll ? React__default.createElement(
372
- React__default.Fragment,
373
- null,
374
- React__default.createElement(
375
- visibilitySensor.InfiniteScroll,
376
- { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
377
- React__default.createElement(
378
- Container,
379
- null,
380
- this.cardLoader()
381
- )
382
- ),
422
+ if (data.length > 0) {
423
+ return React__default.createElement(
424
+ 'div',
425
+ { className: 'contentDeck' },
426
+ autoScroll ? React__default.createElement(
427
+ React__default.Fragment,
428
+ null,
429
+ React__default.createElement(
430
+ visibilitySensor.InfiniteScroll,
431
+ { dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
383
432
  React__default.createElement(
384
- 'noscript',
433
+ Container,
385
434
  null,
386
- this.renderManualPagination()
435
+ cardLoader()
387
436
  )
388
- ) : React__default.createElement(
389
- React__default.Fragment,
437
+ ),
438
+ React__default.createElement(
439
+ 'noscript',
390
440
  null,
391
- React__default.createElement(
392
- Container,
393
- null,
394
- this.cardLoader()
395
- ),
396
- React__default.createElement(
397
- 'div',
398
- { style: { padding: '0px 10px' } },
399
- this.state.scrolling ? React__default.createElement(
400
- 'button',
401
- {
402
- style: { margin: 'auto', width: '100%' },
403
- onClick: function onClick(e) {
404
- _this2.loadMore();
405
- } },
406
- 'Load More'
407
- ) : React__default.createElement(
408
- 'p',
409
- { style: { textAlign: 'center' } },
410
- React__default.createElement(
411
- 'b',
412
- null,
413
- 'End of data'
414
- )
441
+ renderManualPagination()
442
+ )
443
+ ) : React__default.createElement(
444
+ React__default.Fragment,
445
+ null,
446
+ React__default.createElement(
447
+ Container,
448
+ null,
449
+ cardLoader()
450
+ ),
451
+ React__default.createElement(
452
+ 'div',
453
+ { style: { padding: '0px 10px' } },
454
+ scrolling ? React__default.createElement(
455
+ 'button',
456
+ {
457
+ style: { margin: 'auto', width: '100%' },
458
+ onClick: function onClick(e) {
459
+ loadMore();
460
+ } },
461
+ 'Load More'
462
+ ) : React__default.createElement(
463
+ 'p',
464
+ { style: { textAlign: 'center' } },
465
+ React__default.createElement(
466
+ 'b',
467
+ null,
468
+ 'End of data'
415
469
  )
416
- ),
417
- React__default.createElement(
418
- 'noscript',
419
- null,
420
- this.renderManualPagination()
421
470
  )
422
471
  ),
423
472
  React__default.createElement(
424
- 'style',
425
- { jsx: 'true' },
426
- '\n .venue-card {\n border: 1px solid #c0c0c0;\n border-radius: 6px;\n padding: 2px;\n }\n '
473
+ 'noscript',
474
+ null,
475
+ renderManualPagination()
427
476
  )
428
- );
429
- }
430
- }]);
431
- return EventsDeck;
432
- }(React__default.Component);
433
-
434
- var EventsDeck$1 = Router.withRouter(EventsDeck);
477
+ )
478
+ );
479
+ } else {
480
+ return React__default.createElement(
481
+ 'div',
482
+ null,
483
+ React__default.createElement(
484
+ 'div',
485
+ null,
486
+ 'No events found '
487
+ )
488
+ );
489
+ }
490
+ };
435
491
 
436
492
  var AccordionPanel = function AccordionPanel(props) {
437
493
  var accordionClassName = props.accordionClassName,
@@ -798,7 +854,7 @@ var FigureComponent = function FigureComponent(_ref) {
798
854
  };
799
855
 
800
856
  var urlFor$1 = function urlFor(source, builder) {
801
- return builder.image(source);
857
+ return builder.image(source).auto('format');
802
858
  };
803
859
 
804
860
  var onChangeSlide = function onChangeSlide(selectedIndex, router) {
@@ -3460,7 +3516,7 @@ var Media = function Media(_ref) {
3460
3516
  var builder = index$1.imageUrlBuilder(client);
3461
3517
 
3462
3518
  var urlFor = function urlFor(source) {
3463
- return builder.image(source);
3519
+ return builder.image(source).auto('format');
3464
3520
  };
3465
3521
 
3466
3522
  var renderFigure = function renderFigure(uploadDoc, poster, blank, caption) {
@@ -10784,7 +10840,7 @@ var Leads = function Leads(_ref) {
10784
10840
 
10785
10841
  var urlFor$2 = function urlFor(source, client) {
10786
10842
  var builder = index$1.imageUrlBuilder(client);
10787
- return builder.image(source);
10843
+ return builder.image(source).auto('format');
10788
10844
  };
10789
10845
 
10790
10846
  var Slideshow$1 = function Slideshow(_ref) {
@@ -11386,7 +11442,7 @@ var SetCookie = function SetCookie(key, value) {
11386
11442
 
11387
11443
  var urlFor$3 = function urlFor(source, client) {
11388
11444
  var builder = index$1.imageUrlBuilder(client);
11389
- return builder.image(source);
11445
+ return builder.image(source).auto('format');
11390
11446
  };
11391
11447
 
11392
11448
  var renderCardImage = function renderCardImage(thumbnail, client, imageHeight, imageWidth) {
@@ -11684,7 +11740,7 @@ var fbsHero = function fbsHero(props) {
11684
11740
 
11685
11741
  var builder = index$1.imageUrlBuilder(client);
11686
11742
  function urlFor(source) {
11687
- return builder.image(source);
11743
+ return builder.image(source).auto('format');
11688
11744
  }
11689
11745
 
11690
11746
  var topArticleThumbnail = '';
@@ -11793,7 +11849,7 @@ var HorizontalHero = function HorizontalHero(props) {
11793
11849
 
11794
11850
  var builder = index$1.imageUrlBuilder(client);
11795
11851
  function urlFor(source) {
11796
- return builder.image(source);
11852
+ return builder.image(source).auto('format');
11797
11853
  }
11798
11854
  var topArticle = props.dataRecord[0];
11799
11855
  var subArticles = props.dataRecord.slice(1, props.dataRecord.length);
@@ -11878,7 +11934,7 @@ var HorizontalHero = function HorizontalHero(props) {
11878
11934
  React__default.createElement(
11879
11935
  'style',
11880
11936
  { jsx: 'true' },
11881
- '\n .horizontal-hero-container {\n margin-bottom: 3rem;\n margin-top: 2rem;\n position: relative;\n }\n .horizontal-hero-title {\n position: absolute;\n top: -25px;\n background: white;\n z-index: 2;\n padding-right: 1.5rem;\n font-weight: bold;\n }\n .horizontal-hero-inner {\n display: flex;\n flex-direction: row;\n padding-top: 0.75rem;\n margin-top: 0.75rem;\n }\n\n .horizontal-articles-wrap {\n padding: 0 1rem;\n }\n\n .horizontal-hero-img {\n width: 33%;\n min-width: 200px;\n }\n .horizontal-hero-img img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .horizontal-article {\n border-bottom: 1px solid #ccc;\n display: block;\n margin-bottom: 0.5rem;\n }\n .horizontal-article:hover {\n background: #eee;\n }\n .horizontal-article p {\n margin-bottom: 0.5rem;\n font-weight: bold;\n color: #252525;\n }\n .horizontal-view-more {\n position: absolute;\n right: 0;\n margin-top: 0.25rem;\n font-weight: bold;\n }\n .horizontal-view-more span {\n display: inline-block;\n color: rgb(81, 116, 153);\n font-size: 1.2rem;\n }\n @media screen and (max-width: 768px) {\n .horizontal-hero-img {\n display: none;\n }\n }\n '
11937
+ '\n .horizontal-hero-container {\n margin-bottom: 3rem;\n margin-top: 2rem;\n position: relative;\n }\n .horizontal-hero-title {\n position: absolute;\n top: -25px;\n background: white;\n z-index: 2;\n padding-right: 1.5rem;\n font-weight: bold;\n }\n .horizontal-hero-inner {\n display: flex;\n flex-direction: row;\n padding-top: 0.75rem;\n margin-top: 0.75rem;\n }\n\n .horizontal-articles-wrap {\n padding: 0 1rem;\n }\n\n .horizontal-hero-img {\n width: 33%;\n min-width: 200px;\n }\n .horizontal-hero-img img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .horizontal-article {\n border-bottom: 1px solid #ccc;\n display: block;\n margin-bottom: 0.5rem;\n }\n .horizontal-article:hover {\n background: #eee;\n }\n .horizontal-article p {\n margin-bottom: 0.5rem;\n font-weight: bold;\n color: #252525;\n }\n .horizontal-view-more {\n position: absolute;\n right: 0;\n margin-top: 0.25rem;\n font-weight: bold;\n }\n .horizontal-view-more span {\n display: inline-block;\n color: rgb(81, 116, 153);\n font-size: 1.2rem;\n }\n @media screen and (max-width: 768px) {\n .horizontal-hero-img {\n display: none;\n }\n }\n '
11882
11938
  )
11883
11939
  );
11884
11940
  };
@@ -11888,7 +11944,7 @@ var OncliveHero = function OncliveHero(props) {
11888
11944
 
11889
11945
  var builder = index$1.imageUrlBuilder(client);
11890
11946
  function urlFor(source) {
11891
- return builder.image(source);
11947
+ return builder.image(source).auto('format');
11892
11948
  }
11893
11949
  return React__default.createElement(
11894
11950
  'div',
@@ -11941,7 +11997,7 @@ var OncliveHero = function OncliveHero(props) {
11941
11997
  React__default.createElement(
11942
11998
  'style',
11943
11999
  { jsx: 'true' },
11944
- '\n .article-group--container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n }\n .article-group--container * {\n transition: all 0.13s ease;\n }\n .article-group {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0.5rem 1rem;\n width: calc(50% - 2rem);\n background: #fff;\n min-width: 320px;\n transition: all 0.1s ease-out;\n border-top: 1px solid #eee;\n position: relative;\n overflow: hidden;\n }\n \n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--body {\n }\n .article-group:nth-of-type(1) figure img {\n width: 225px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1.4rem;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: block;\n }\n @media screen and (max-width: 1091px) {\n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: none;\n }\n .article-group:nth-of-type(1) figure img {\n width: 130px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1rem;\n }\n }\n .article-group figure {\n margin-bottom: 0;\n }\n .article-group figure img {\n height: 100%;\n width: 130px;\n object-fit: contain;\n }\n \n .article-group--body {\n padding-left: 1rem;\n }\n .article-group--body p {\n font-size: .9rem;\n }\n .article-group--body h2 {\n font-weight: bold;\n margin-top: 1rem;\n font-size: 1rem;\n padding-right: 0.5rem;\n }\n .article-group--summary {\n font-size: 1rem;\n display: none;\n }\n '
12000
+ '\n .article-group--container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n }\n .article-group--container * {\n transition: all 0.13s ease;\n }\n .article-group {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0.5rem 1rem;\n width: calc(50% - 2rem);\n background: #fff;\n min-width: 320px;\n transition: all 0.1s ease-out;\n border-top: 1px solid #eee;\n position: relative;\n overflow: hidden;\n }\n\n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--body {\n }\n .article-group:nth-of-type(1) figure img {\n width: 225px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1.4rem;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: block;\n }\n @media screen and (max-width: 1091px) {\n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: none;\n }\n .article-group:nth-of-type(1) figure img {\n width: 130px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1rem;\n }\n }\n .article-group figure {\n margin-bottom: 0;\n }\n .article-group figure img {\n height: 100%;\n width: 130px;\n object-fit: contain;\n }\n\n .article-group--body {\n padding-left: 1rem;\n }\n .article-group--body p {\n font-size: 0.9rem;\n }\n .article-group--body h2 {\n font-weight: bold;\n margin-top: 1rem;\n font-size: 1rem;\n padding-right: 0.5rem;\n }\n .article-group--summary {\n font-size: 1rem;\n display: none;\n }\n '
11945
12001
  )
11946
12002
  );
11947
12003
  };
@@ -11954,7 +12010,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
11954
12010
 
11955
12011
  var builder = index$1.imageUrlBuilder(client);
11956
12012
  function urlFor(source) {
11957
- return builder.image(source);
12013
+ return builder.image(source).auto('format');
11958
12014
  }
11959
12015
 
11960
12016
  var topArticleThumbnail = '';
@@ -12150,7 +12206,7 @@ var VerticalHero = function VerticalHero(props) {
12150
12206
 
12151
12207
  var builder = index$1.imageUrlBuilder(client);
12152
12208
  function urlFor(source) {
12153
- return builder.image(source);
12209
+ return builder.image(source).auto('format');
12154
12210
  }
12155
12211
  var _props$heroTitle = props.heroTitle,
12156
12212
  heroTitle = _props$heroTitle === undefined ? '' : _props$heroTitle;
@@ -12215,7 +12271,7 @@ var YahooHero = function YahooHero(props) {
12215
12271
 
12216
12272
  var builder = index$1.imageUrlBuilder(client);
12217
12273
  function urlFor(source) {
12218
- return builder.image(source);
12274
+ return builder.image(source).auto('format');
12219
12275
  }
12220
12276
 
12221
12277
  var topArticleThumbnail = '';
@@ -12306,7 +12362,7 @@ var YahooHero = function YahooHero(props) {
12306
12362
  React__default.createElement(
12307
12363
  'style',
12308
12364
  { jsx: 'true' },
12309
- '\n .yh-top-article {\n display: flex;\n flex-direction: row;\n position: relative;\n font-family: \'Roboto\', sans-serif;\n margin-bottom: 1rem;\n border-radius: 15px;\n overflow: hidden;\n min-height: 315px;\n }\n .yh-top-article--img {\n width: 100%;\n min-height: 240px;\n overflow: hidden;\n }\n .yh-top-article--img img {\n width: 100%;\n height: auto;\n min-height: 100%;\n max-height: 315px;\n object-fit: cover;\n }\n .yh-top-article--body {\n height: 100%;\n width: 40%;\n min-width: 320px;\n right: 0;\n position: absolute;\n color: white;\n padding: 1.75rem;\n height: 315px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: column;\n }\n .yh-top-article--body h1 {\n color: white!important;\n font-size: 1.4rem;\n font-weight: 500;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--body p {\n font-size: 0.9rem;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--blur {\n height: 100%;\n width: 40%;\n right: 0;\n position: absolute;\n filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));\n background: rgba(0,0,0,.65);\n min-width: 320px;\n }\n .yh-sub-article-container {\n display: flex;\n justify-content: space-between;\n }\n .yh-sub-article {\n width: 23.25%;\n }\n .yh-sub-article p.yh-sub-article--title {\n font-weight: bold;\n }\n .yh-sub-article img {\n width: 100%;\n height: 150px;\n object-fit: cover;\n border-radius: 15px;\n }\n .yh-sub-article img[src=\'' + props.thumbnail + '\']{\n object-fit: contain;\n }\n .yh-sub-article--title {\n font-weight: bold;\n margin-top: .25rem;\n font-size: 1rem;\n margin-bottom: .25rem;\n }\n .yh-sub-article--info {\n font-size: .8rem;\n margin-bottom: 0;\n \n }\n @media screen and (max-width: 968px) {\n .yh-sub-article-container {\n flex-wrap: wrap;\n }\n .yh-sub-article {\n width: 48%;\n margin-bottom: 1rem;\n }\n }\n '
12365
+ '\n .yh-top-article {\n display: flex;\n flex-direction: row;\n position: relative;\n font-family: \'Roboto\', sans-serif;\n margin-bottom: 1rem;\n border-radius: 15px;\n overflow: hidden;\n min-height: 315px;\n }\n .yh-top-article--img {\n width: 100%;\n min-height: 240px;\n overflow: hidden;\n }\n .yh-top-article--img img {\n width: 100%;\n height: auto;\n min-height: 100%;\n max-height: 315px;\n object-fit: cover;\n }\n .yh-top-article--body {\n height: 100%;\n width: 40%;\n min-width: 320px;\n right: 0;\n position: absolute;\n color: white;\n padding: 1.75rem;\n height: 315px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: column;\n }\n .yh-top-article--body h1 {\n color: white!important;\n font-size: 1.4rem;\n font-weight: 500;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--body p {\n font-size: 0.9rem;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--blur {\n height: 100%;\n width: 40%;\n right: 0;\n position: absolute;\n filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));\n background: rgba(0,0,0,.65);\n min-width: 320px;\n }\n .yh-sub-article-container {\n display: flex;\n justify-content: space-between;\n }\n .yh-sub-article {\n width: 23.25%;\n }\n .yh-sub-article p.yh-sub-article--title {\n font-weight: bold;\n }\n .yh-sub-article img {\n width: 100%;\n height: 150px;\n object-fit: cover;\n border-radius: 15px;\n }\n .yh-sub-article img[src=\'' + props.thumbnail + '\']{\n object-fit: contain;\n }\n .yh-sub-article--title {\n font-weight: bold;\n margin-top: .25rem;\n font-size: 1rem;\n margin-bottom: .25rem;\n }\n .yh-sub-article--info {\n font-size: .8rem;\n margin-bottom: 0;\n\n }\n @media screen and (max-width: 968px) {\n .yh-sub-article-container {\n flex-wrap: wrap;\n }\n .yh-sub-article {\n width: 48%;\n margin-bottom: 1rem;\n }\n }\n '
12310
12366
  )
12311
12367
  );
12312
12368
  };
@@ -12432,7 +12488,7 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
12432
12488
  var builder = index$1.imageUrlBuilder(client);
12433
12489
 
12434
12490
  function urlFor(source) {
12435
- return builder.image(source);
12491
+ return builder.image(source).auto('format');
12436
12492
  }
12437
12493
 
12438
12494
  //title, thumbnail, summary, published, documentGroup.identifier.current, documentGroup.identifier.name
@@ -12597,6 +12653,7 @@ var Article = function Article(props) {
12597
12653
  current: ''
12598
12654
  } : _props$article$url;
12599
12655
  var url = _props$article$url.current,
12656
+ issue = _props$article.issue,
12600
12657
  changeUrl = props.changeUrl,
12601
12658
  isCutomPage = props.isCutomPage,
12602
12659
  shareOptions = props.shareOptions,
@@ -12690,7 +12747,14 @@ var Article = function Article(props) {
12690
12747
  serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
12691
12748
  blocks: articleBody,
12692
12749
  imageOptions: { w: 320, h: 240, fit: 'max' }
12693
- }, client.config()))
12750
+ }, client.config())),
12751
+ issue && issue.url && React__default.createElement(
12752
+ 'a',
12753
+ { href: issue.url, target: '_blank', title: 'Download issue' },
12754
+ React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
12755
+ 'Download Issue : ',
12756
+ issue.name
12757
+ )
12694
12758
  )
12695
12759
  ),
12696
12760
  renderIsiContent(props.article)
@@ -13076,7 +13140,7 @@ exports.ArticleDetailDropdown = ArticleDetailDropdown;
13076
13140
  exports.ArticleQueue = ArticleQueue;
13077
13141
  exports.Breadcrumbs = Breadcrumbs$1;
13078
13142
  exports.ConferenceArticleCard = ConferenceArticleCard;
13079
- exports.EventsDeck = EventsDeck$1;
13143
+ exports.EventsDeck = EventsDeck;
13080
13144
  exports.Feature = Feature;
13081
13145
  exports.ForbesHero = fbsHero;
13082
13146
  exports.Hero = Hero;