@mjhls/mjh-framework 1.0.884-gridcontent-paginated-v2 → 1.0.884
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/README.md +168 -168
- package/dist/cjs/AlgoliaSearch.js +1 -1
- package/dist/cjs/AuthWrapper.js +1 -1
- package/dist/cjs/ConferenceArticleCard.js +15 -15
- package/dist/cjs/DeckContent.js +8 -8
- package/dist/cjs/EventsDeck.js +17 -17
- package/dist/cjs/GridContent.js +157 -44
- package/dist/cjs/HamMagazine.js +9 -9
- package/dist/cjs/IssueLanding.js +29 -29
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/MasterDeck.js +8 -8
- package/dist/cjs/MediaSeriesLanding.js +9524 -42
- package/dist/cjs/NavMagazine.js +10 -10
- package/dist/cjs/NavNative.js +9 -9
- package/dist/cjs/PartnerDetailListing.js +2807 -12
- package/dist/cjs/PublicationLanding.js +26 -26
- package/dist/cjs/RelatedContent.js +28 -28
- package/dist/cjs/RelatedTopicsDropdown.js +10 -10
- package/dist/cjs/SeriesListingDeck.js +1 -1
- package/dist/cjs/{SeriesSlider-de93a303.js → SeriesSlider-ba0c5d1a.js} +4 -4
- package/dist/cjs/SideFooter.js +2 -2
- package/dist/cjs/VideoSeriesCard.js +1 -1
- package/dist/cjs/View.js +3 -3
- package/dist/cjs/YoutubeGroup.js +4 -4
- package/dist/cjs/{getTargeting-6d59cc5b.js → getTargeting-9d509319.js} +9 -9
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/index.js +2 -4
- package/dist/esm/AlgoliaSearch.js +1 -1
- package/dist/esm/AuthWrapper.js +1 -1
- package/dist/esm/ConferenceArticleCard.js +15 -15
- package/dist/esm/DeckContent.js +8 -8
- package/dist/esm/EventsDeck.js +17 -17
- package/dist/esm/GridContent.js +114 -2
- package/dist/esm/HamMagazine.js +9 -9
- package/dist/esm/IssueLanding.js +29 -29
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/MasterDeck.js +8 -8
- package/dist/esm/MediaSeriesLanding.js +9518 -38
- package/dist/esm/NavMagazine.js +10 -10
- package/dist/esm/NavNative.js +9 -9
- package/dist/esm/PartnerDetailListing.js +2807 -13
- package/dist/esm/PublicationLanding.js +26 -26
- package/dist/esm/RelatedContent.js +28 -28
- package/dist/esm/RelatedTopicsDropdown.js +10 -10
- package/dist/esm/SeriesListingDeck.js +1 -1
- package/dist/esm/{SeriesSlider-98ad6d97.js → SeriesSlider-45adb8dc.js} +4 -4
- package/dist/esm/SideFooter.js +2 -2
- package/dist/esm/VideoSeriesCard.js +1 -1
- package/dist/esm/View.js +3 -3
- package/dist/esm/YoutubeGroup.js +4 -4
- package/dist/esm/{getTargeting-36031a00.js → getTargeting-4061f839.js} +9 -9
- package/dist/esm/getTargeting.js +1 -1
- package/dist/esm/index.js +2 -4
- package/package.json +111 -112
- package/dist/cjs/ContentCardPaginated.js +0 -413
- package/dist/cjs/DeckQueuePaginated.js +0 -344
- package/dist/cjs/GridContentPaginated.js +0 -703
- package/dist/cjs/ImageSlider-b96720eb.js +0 -2813
- package/dist/cjs/MasterDeckPaginated.js +0 -445
- package/dist/cjs/MediaSeriesCard-3d5c69ba.js +0 -9505
- package/dist/cjs/MediaSeriesLandingPaginated.js +0 -523
- package/dist/cjs/Pagination-b5e8b8dc.js +0 -60
- package/dist/cjs/PartnerDetailListingPaginated.js +0 -313
- package/dist/cjs/PublicationFeature-5ccf9b13.js +0 -130
- package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1377
- package/dist/esm/ContentCardPaginated.js +0 -402
- package/dist/esm/DeckQueuePaginated.js +0 -333
- package/dist/esm/GridContentPaginated.js +0 -692
- package/dist/esm/ImageSlider-de7846ea.js +0 -2804
- package/dist/esm/MasterDeckPaginated.js +0 -437
- package/dist/esm/MediaSeriesCard-5b1d13dd.js +0 -9495
- package/dist/esm/MediaSeriesLandingPaginated.js +0 -516
- package/dist/esm/Pagination-481eaaf5.js +0 -54
- package/dist/esm/PartnerDetailListingPaginated.js +0 -307
- package/dist/esm/PublicationFeature-d88e76b9.js +0 -121
- package/dist/esm/QueueDeckExpandedPaginated.js +0 -1371
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './asyncToGenerator-5ef104a7.js';
|
|
2
|
-
import { _ as _typeof } from './typeof-e9fc0c5d.js';
|
|
3
|
-
import { _ as _extends } from './extends-6d8e3924.js';
|
|
4
|
-
import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
|
|
5
|
-
import React__default, { useState, useEffect } from 'react';
|
|
6
|
-
import { M as MediaSeriesCard, D as DropdownButton, a as Dropdown } from './MediaSeriesCard-5b1d13dd.js';
|
|
7
|
-
import './index-98ca9cec.js';
|
|
8
|
-
import 'react-dom';
|
|
9
|
-
import Link from 'next/link';
|
|
10
|
-
import { B as BlockContent } from './BlockContent-1e73bd2c.js';
|
|
11
|
-
import MasterDeck from './MasterDeckPaginated.js';
|
|
12
|
-
import { g as getSerializers } from './index-ca0c9ff5.js';
|
|
13
|
-
import './_commonjsHelpers-0c4b6f40.js';
|
|
14
|
-
import './core.get-iterator-method-ea258bb1.js';
|
|
15
|
-
import './web.dom.iterable-ab4dea5c.js';
|
|
16
|
-
import './_library-528f1934.js';
|
|
17
|
-
import './_iter-detect-98db3b07.js';
|
|
18
|
-
import './_is-array-8d21b9e3.js';
|
|
19
|
-
import './_object-pie-133f504a.js';
|
|
20
|
-
import 'prop-types';
|
|
21
|
-
import './index-755f2cc2.js';
|
|
22
|
-
import './urlFor.js';
|
|
23
|
-
import './index-3f5c03b2.js';
|
|
24
|
-
import './moment-bc12cb97.js';
|
|
25
|
-
import './style-inject.es-1f59c1d0.js';
|
|
26
|
-
import './stringify-2b084bee.js';
|
|
27
|
-
import './toConsumableArray-f7074d7c.js';
|
|
28
|
-
import './inherits-a6ba2ec4.js';
|
|
29
|
-
import './_object-sap-7cee6f84.js';
|
|
30
|
-
import './define-property-5f1bda73.js';
|
|
31
|
-
import './index-f0fc23eb.js';
|
|
32
|
-
import './events-6c3a7a63.js';
|
|
33
|
-
import 'react-bootstrap/Container';
|
|
34
|
-
import 'react-bootstrap/Spinner';
|
|
35
|
-
import 'next/router';
|
|
36
|
-
import './lodash-f97fd99a.js';
|
|
37
|
-
import './main-1894c974.js';
|
|
38
|
-
import './ADlgInfeed-013e1f4a.js';
|
|
39
|
-
import 'react-bootstrap/Card';
|
|
40
|
-
import './AdSlot.js';
|
|
41
|
-
import './debounce-533d9748.js';
|
|
42
|
-
import './isSymbol-a7e9aafe.js';
|
|
43
|
-
import './toNumber-5aeba6e7.js';
|
|
44
|
-
import './Beam.js';
|
|
45
|
-
import './Segment.js';
|
|
46
|
-
import './ADInfeed-0a55cd2d.js';
|
|
47
|
-
import './Pagination-481eaaf5.js';
|
|
48
|
-
import 'react-bootstrap';
|
|
49
|
-
import './index-c7e2ac95.js';
|
|
50
|
-
import './util-8ed16d48.js';
|
|
51
|
-
import './brightcove-react-player-loader.es-57a70a56.js';
|
|
52
|
-
import './GroupDeck.js';
|
|
53
|
-
import './smoothscroll-fa4e3f8c.js';
|
|
54
|
-
import './SocialShare.js';
|
|
55
|
-
import 'next/head';
|
|
56
|
-
import 'react-share';
|
|
57
|
-
import './_object-to-array-2300e51b.js';
|
|
58
|
-
import 'react-bootstrap/Pagination';
|
|
59
|
-
import 'react-bootstrap/Button';
|
|
60
|
-
import './entities-6d9154b4.js';
|
|
61
|
-
import 'react-bootstrap/Row';
|
|
62
|
-
import 'react-bootstrap/Col';
|
|
63
|
-
import './index.esm-f6156a57.js';
|
|
64
|
-
import './iconBase-ccc56b97.js';
|
|
65
|
-
import 'react-bootstrap/Figure';
|
|
66
|
-
import 'react-bootstrap/OverlayTrigger';
|
|
67
|
-
import 'react-bootstrap/Tooltip';
|
|
68
|
-
import 'react-bootstrap/Popover';
|
|
69
|
-
|
|
70
|
-
var _this = undefined;
|
|
71
|
-
|
|
72
|
-
var Filter = function Filter(_ref) {
|
|
73
|
-
var filterData = _ref.filterData,
|
|
74
|
-
setFilterTopicID = _ref.setFilterTopicID;
|
|
75
|
-
|
|
76
|
-
if (!filterData || filterData.length == 0) return null;
|
|
77
|
-
|
|
78
|
-
var _useState = useState(null),
|
|
79
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
-
parentData = _useState2[0],
|
|
81
|
-
setParentData = _useState2[1];
|
|
82
|
-
|
|
83
|
-
var _useState3 = useState(null),
|
|
84
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
85
|
-
childData = _useState4[0],
|
|
86
|
-
setChildData = _useState4[1];
|
|
87
|
-
|
|
88
|
-
var _useState5 = useState(null),
|
|
89
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
90
|
-
grandChildData = _useState6[0],
|
|
91
|
-
setGrandChildData = _useState6[1];
|
|
92
|
-
/*
|
|
93
|
-
{parent: showAll,
|
|
94
|
-
chidlren: show selected from parent,
|
|
95
|
-
grandchildren: show selected from children
|
|
96
|
-
}
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
useEffect(function () {
|
|
101
|
-
if (filterData.length < 2) {
|
|
102
|
-
setChildData({ name: null, data: filterData[0].children, _id: filterData[0]._id });
|
|
103
|
-
} else {
|
|
104
|
-
setParentData({ name: null, data: filterData });
|
|
105
|
-
}
|
|
106
|
-
}, []);
|
|
107
|
-
|
|
108
|
-
var handleFilterSelect = function handleFilterSelect(group, type) {
|
|
109
|
-
if (type === 'parent') {
|
|
110
|
-
setParentData(function (prevState) {
|
|
111
|
-
return _extends({}, prevState, { name: group.name ? group.name : null });
|
|
112
|
-
});
|
|
113
|
-
if (group && group.children && group.children.length > 0) {
|
|
114
|
-
setChildData({ data: group.children, _id: group._id });
|
|
115
|
-
setFilterTopicID(group._id);
|
|
116
|
-
} else {
|
|
117
|
-
//handle filter
|
|
118
|
-
setChildData(null);
|
|
119
|
-
setGrandChildData(null);
|
|
120
|
-
setFilterTopicID(group._id ? group._id : 'all');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (type === 'child') {
|
|
124
|
-
setChildData(function (prevState) {
|
|
125
|
-
return _extends({}, prevState, { name: group.name ? group.name : null, _id: group._id });
|
|
126
|
-
});
|
|
127
|
-
if (group && group.grandchildren && group.grandchildren.length > 0) {
|
|
128
|
-
setGrandChildData({ data: group.grandchildren, _id: group._id });
|
|
129
|
-
setFilterTopicID(group._id);
|
|
130
|
-
var topics = [];
|
|
131
|
-
topics.push(group._id);
|
|
132
|
-
group.grandchildren.forEach(function (topic) {
|
|
133
|
-
topics.push(topic._id);
|
|
134
|
-
});
|
|
135
|
-
setFilterTopicID(topics);
|
|
136
|
-
} else {
|
|
137
|
-
//handle filter
|
|
138
|
-
setGrandChildData(null);
|
|
139
|
-
setFilterTopicID(group._id ? group._id : 'all');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (type === 'grandchild') {
|
|
143
|
-
setGrandChildData(function (prevState) {
|
|
144
|
-
return _extends({}, prevState, { name: group.name ? group.name : 'All', _id: group._id });
|
|
145
|
-
});
|
|
146
|
-
//handle filter
|
|
147
|
-
if (!group._id) {
|
|
148
|
-
var _topics = [];
|
|
149
|
-
_topics.push(childData._id);
|
|
150
|
-
grandChildData.data.forEach(function (topic) {
|
|
151
|
-
_topics.push(topic._id);
|
|
152
|
-
});
|
|
153
|
-
setFilterTopicID(_topics);
|
|
154
|
-
} else {
|
|
155
|
-
setFilterTopicID([group._id, childData._id]);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
return React__default.createElement(
|
|
161
|
-
'div',
|
|
162
|
-
{ className: 'flex-container' },
|
|
163
|
-
parentData && React__default.createElement(
|
|
164
|
-
DropdownButton,
|
|
165
|
-
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn', title: parentData.name ? parentData.name : 'Filter By Category' },
|
|
166
|
-
React__default.createElement(
|
|
167
|
-
Dropdown.Item,
|
|
168
|
-
{ onSelect: function onSelect() {
|
|
169
|
-
return handleFilterSelect({}, 'parent');
|
|
170
|
-
} },
|
|
171
|
-
'All'
|
|
172
|
-
),
|
|
173
|
-
parentData.data.map(function (docGroup) {
|
|
174
|
-
if (!docGroup._id) return null;
|
|
175
|
-
return React__default.createElement(
|
|
176
|
-
Dropdown.Item,
|
|
177
|
-
{ key: docGroup._id, onSelect: function onSelect() {
|
|
178
|
-
return handleFilterSelect(docGroup, 'parent');
|
|
179
|
-
} },
|
|
180
|
-
docGroup.name
|
|
181
|
-
);
|
|
182
|
-
})
|
|
183
|
-
),
|
|
184
|
-
childData && childData.data && childData.data.length > 0 && React__default.createElement(
|
|
185
|
-
DropdownButton,
|
|
186
|
-
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: childData.name ? childData.name : 'Filter By Topic' },
|
|
187
|
-
React__default.createElement(
|
|
188
|
-
Dropdown.Item,
|
|
189
|
-
{ onSelect: function onSelect() {
|
|
190
|
-
return handleFilterSelect({}, 'child');
|
|
191
|
-
} },
|
|
192
|
-
'All'
|
|
193
|
-
),
|
|
194
|
-
childData.data.map(function (docGroup) {
|
|
195
|
-
if (!docGroup._id) return null;
|
|
196
|
-
return React__default.createElement(
|
|
197
|
-
Dropdown.Item,
|
|
198
|
-
{ key: docGroup._id, onSelect: function onSelect() {
|
|
199
|
-
return handleFilterSelect(docGroup, 'child');
|
|
200
|
-
} },
|
|
201
|
-
docGroup.name
|
|
202
|
-
);
|
|
203
|
-
})
|
|
204
|
-
),
|
|
205
|
-
grandChildData && grandChildData.data && grandChildData.data.length > 0 && React__default.createElement(
|
|
206
|
-
DropdownButton,
|
|
207
|
-
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: grandChildData.name ? grandChildData.name : 'Select Sub Topic' },
|
|
208
|
-
React__default.createElement(
|
|
209
|
-
Dropdown.Item,
|
|
210
|
-
{ onSelect: function onSelect() {
|
|
211
|
-
return handleFilterSelect({}, 'grandchild');
|
|
212
|
-
} },
|
|
213
|
-
'All'
|
|
214
|
-
),
|
|
215
|
-
grandChildData.data.map(function (docGroup) {
|
|
216
|
-
if (!docGroup._id) return null;
|
|
217
|
-
return React__default.createElement(
|
|
218
|
-
Dropdown.Item,
|
|
219
|
-
{ key: docGroup._id, onSelect: function onSelect() {
|
|
220
|
-
return handleFilterSelect(docGroup, 'grandchild');
|
|
221
|
-
} },
|
|
222
|
-
docGroup.name
|
|
223
|
-
);
|
|
224
|
-
})
|
|
225
|
-
),
|
|
226
|
-
React__default.createElement(
|
|
227
|
-
'style',
|
|
228
|
-
{ jsx: 'true' },
|
|
229
|
-
'\n .flex-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .filter-btn button {\n border-radius: 3px;\n z-index: 99999;\n }\n .filter-btn .dropdown-menu {\n z-index: 9999999;\n }\n @media (max-width: 768px) {\n .flex-container {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n '
|
|
230
|
-
)
|
|
231
|
-
);
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
var MediaSeriesLanding = function MediaSeriesLanding(props) {
|
|
235
|
-
var client = props.client,
|
|
236
|
-
pageview = props.pageview;
|
|
237
|
-
|
|
238
|
-
var _useState7 = useState(false),
|
|
239
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
240
|
-
filterTopicID = _useState8[0],
|
|
241
|
-
setFilterTopicID = _useState8[1];
|
|
242
|
-
|
|
243
|
-
var _useState9 = useState(props.seriesData),
|
|
244
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
245
|
-
seriesData = _useState10[0],
|
|
246
|
-
setSeriesData = _useState10[1];
|
|
247
|
-
|
|
248
|
-
var _useState11 = useState(props.totalSeriesCount),
|
|
249
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
250
|
-
totalSeriesCount = _useState12[0],
|
|
251
|
-
setTotalSeriesCount = _useState12[1];
|
|
252
|
-
|
|
253
|
-
var _useState13 = useState(props.params),
|
|
254
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
255
|
-
params = _useState14[0],
|
|
256
|
-
setParams = _useState14[1];
|
|
257
|
-
|
|
258
|
-
var _useState15 = useState(props.query),
|
|
259
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
260
|
-
query = _useState16[0],
|
|
261
|
-
setQuery = _useState16[1];
|
|
262
|
-
|
|
263
|
-
var _useState17 = useState(props.currentPage),
|
|
264
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
265
|
-
currentPage = _useState18[0],
|
|
266
|
-
setCurrentPage = _useState18[1];
|
|
267
|
-
|
|
268
|
-
useEffect(function () {
|
|
269
|
-
if (filterTopicID) {
|
|
270
|
-
fetchFilteredData();
|
|
271
|
-
}
|
|
272
|
-
}, [filterTopicID]);
|
|
273
|
-
|
|
274
|
-
var fetchFilteredData = function () {
|
|
275
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
276
|
-
var newParams, filterQuery, x, seriesQuerySorts, seriesQueryProjection, seriesQueryFilters, seriesQuery, totalSeriesCountQuery, _ref3, _ref4, newData, newDataCount;
|
|
277
|
-
|
|
278
|
-
return regenerator.wrap(function _callee$(_context) {
|
|
279
|
-
while (1) {
|
|
280
|
-
switch (_context.prev = _context.next) {
|
|
281
|
-
case 0:
|
|
282
|
-
newParams = _extends({}, params, { from: 0, to: 30 });
|
|
283
|
-
filterQuery = void 0;
|
|
284
|
-
|
|
285
|
-
if ((typeof filterTopicID === 'undefined' ? 'undefined' : _typeof(filterTopicID)) === 'object') {
|
|
286
|
-
filterQuery = '[';
|
|
287
|
-
for (x = 0; x < filterTopicID.length; x++) {
|
|
288
|
-
filterQuery = filterQuery + (' references(\'' + filterTopicID[x] + '\') ');
|
|
289
|
-
if (x === filterTopicID.length - 1) {
|
|
290
|
-
filterQuery = filterQuery + ']';
|
|
291
|
-
} else {
|
|
292
|
-
filterQuery = filterQuery + ' || ';
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
} else {
|
|
296
|
-
filterQuery = filterTopicID !== 'all' ? '[references(\'' + filterTopicID + '\')]' : '';
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
seriesQuerySorts = props.seriesQuerySorts, seriesQueryProjection = props.seriesQueryProjection;
|
|
300
|
-
seriesQueryFilters = props.seriesQueryFilters;
|
|
301
|
-
|
|
302
|
-
seriesQueryFilters = filterQuery ? [seriesQueryFilters, filterQuery] : seriesQueryFilters;
|
|
303
|
-
seriesQuery = ['*'].concat(seriesQueryFilters).concat(seriesQuerySorts).concat(seriesQueryProjection).join('|');
|
|
304
|
-
totalSeriesCountQuery = 'count(' + ['*'].concat(seriesQueryFilters).join('|') + ')';
|
|
305
|
-
_context.next = 10;
|
|
306
|
-
return _Promise.all([client.fetch(seriesQuery, newParams), client.fetch(totalSeriesCountQuery)]);
|
|
307
|
-
|
|
308
|
-
case 10:
|
|
309
|
-
_ref3 = _context.sent;
|
|
310
|
-
_ref4 = _slicedToArray(_ref3, 2);
|
|
311
|
-
newData = _ref4[0];
|
|
312
|
-
newDataCount = _ref4[1];
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
setParams(newParams);
|
|
316
|
-
setQuery(seriesQuery);
|
|
317
|
-
setSeriesData(newData);
|
|
318
|
-
setTotalSeriesCount(newDataCount);
|
|
319
|
-
setCurrentPage(1);
|
|
320
|
-
|
|
321
|
-
case 19:
|
|
322
|
-
case 'end':
|
|
323
|
-
return _context.stop();
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}, _callee, _this);
|
|
327
|
-
}));
|
|
328
|
-
|
|
329
|
-
return function fetchFilteredData() {
|
|
330
|
-
return _ref2.apply(this, arguments);
|
|
331
|
-
};
|
|
332
|
-
}();
|
|
333
|
-
|
|
334
|
-
if (props.statusCode === 404) {
|
|
335
|
-
return React__default.createElement(
|
|
336
|
-
'div',
|
|
337
|
-
{ className: 'd-flex flex-column align-items-center mt-3' },
|
|
338
|
-
React__default.createElement(
|
|
339
|
-
'h3',
|
|
340
|
-
null,
|
|
341
|
-
'404: Resource not found'
|
|
342
|
-
),
|
|
343
|
-
React__default.createElement(
|
|
344
|
-
'p',
|
|
345
|
-
null,
|
|
346
|
-
'We seem to have misplaced the page you\'re looking for. Sorry! Please try checking the URL for errors.'
|
|
347
|
-
),
|
|
348
|
-
React__default.createElement(
|
|
349
|
-
'p',
|
|
350
|
-
null,
|
|
351
|
-
'Click here to',
|
|
352
|
-
React__default.createElement(
|
|
353
|
-
Link,
|
|
354
|
-
{ href: '/' },
|
|
355
|
-
React__default.createElement(
|
|
356
|
-
'a',
|
|
357
|
-
{ style: { color: 'blue', textDecoration: 'underline' } },
|
|
358
|
-
' return to homepage.'
|
|
359
|
-
)
|
|
360
|
-
)
|
|
361
|
-
)
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return React__default.createElement(
|
|
366
|
-
'div',
|
|
367
|
-
{ className: 'mb-5' },
|
|
368
|
-
props.docGroup && props.docGroup.description && React__default.createElement(BlockContent, { blocks: props.docGroup.description, serializers: getSerializers(client) }),
|
|
369
|
-
props.taxonomyFilter && props.taxonomyFilter && React__default.createElement(
|
|
370
|
-
'div',
|
|
371
|
-
{ className: '' },
|
|
372
|
-
React__default.createElement(Filter, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
|
|
373
|
-
React__default.createElement('hr', null)
|
|
374
|
-
),
|
|
375
|
-
seriesData && React__default.createElement(MasterDeck, {
|
|
376
|
-
deck: MediaSeriesCard,
|
|
377
|
-
variant: 'left',
|
|
378
|
-
defaultImage: '/placeholder.jpg',
|
|
379
|
-
client: client,
|
|
380
|
-
dataRecord: seriesData,
|
|
381
|
-
totalDataCount: totalSeriesCount,
|
|
382
|
-
query: query && query,
|
|
383
|
-
params: params && params,
|
|
384
|
-
currentPage: currentPage,
|
|
385
|
-
pageview: pageview,
|
|
386
|
-
autoScroll: true,
|
|
387
|
-
seoPaginate: true
|
|
388
|
-
})
|
|
389
|
-
);
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
MediaSeriesLanding.getInitialData = function () {
|
|
393
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(ctx, client, cache) {
|
|
394
|
-
var urlQuery, pathname, identifier, itemsPerPage, currentPage, start, statusCode, params, docGroupID, seriesQueryFilters, seriesQuerySorts, seriesQueryProjection, seriesQuery, totalSeriesCountQuery, _ref6, _ref7, seriesData, totalSeriesCount, allSeries, buildUsedTopicsArray, usedTopics, taxonomyFilter;
|
|
395
|
-
|
|
396
|
-
return regenerator.wrap(function _callee2$(_context2) {
|
|
397
|
-
while (1) {
|
|
398
|
-
switch (_context2.prev = _context2.next) {
|
|
399
|
-
case 0:
|
|
400
|
-
urlQuery = ctx.query, pathname = ctx.pathname;
|
|
401
|
-
identifier = pathname.replace('/', '');
|
|
402
|
-
itemsPerPage = 30;
|
|
403
|
-
currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
404
|
-
start = (currentPage - 1) * itemsPerPage;
|
|
405
|
-
statusCode = 200;
|
|
406
|
-
params = {
|
|
407
|
-
count: itemsPerPage,
|
|
408
|
-
from: start,
|
|
409
|
-
to: start + itemsPerPage,
|
|
410
|
-
url: pathname
|
|
411
|
-
};
|
|
412
|
-
_context2.next = 9;
|
|
413
|
-
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
414
|
-
|
|
415
|
-
case 9:
|
|
416
|
-
docGroupID = _context2.sent;
|
|
417
|
-
seriesQueryFilters = '[\n _type == \'documentGroup\' \n && references(\'' + docGroupID._id + '\') \n && isSeries != false \n && isShow != false \n && defined(published) \n && published <= now()\n ]';
|
|
418
|
-
seriesQuerySorts = 'order(published desc) [$from...$to]';
|
|
419
|
-
seriesQueryProjection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
420
|
-
seriesQuery = ['*'].concat(seriesQueryFilters).concat(seriesQuerySorts).concat(seriesQueryProjection).join('|');
|
|
421
|
-
totalSeriesCountQuery = 'count(' + ['*'].concat(seriesQueryFilters).join('|') + ')';
|
|
422
|
-
_context2.next = 17;
|
|
423
|
-
return _Promise.all([client.fetch(seriesQuery, params), client.fetch(totalSeriesCountQuery)]);
|
|
424
|
-
|
|
425
|
-
case 17:
|
|
426
|
-
_ref6 = _context2.sent;
|
|
427
|
-
_ref7 = _slicedToArray(_ref6, 2);
|
|
428
|
-
seriesData = _ref7[0];
|
|
429
|
-
totalSeriesCount = _ref7[1];
|
|
430
|
-
_context2.next = 23;
|
|
431
|
-
return client.fetch('*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] {\n topicMapping[]->\n }');
|
|
432
|
-
|
|
433
|
-
case 23:
|
|
434
|
-
allSeries = _context2.sent;
|
|
435
|
-
|
|
436
|
-
//Take all series topicMapping and put in an array
|
|
437
|
-
buildUsedTopicsArray = function buildUsedTopicsArray(seriesArray) {
|
|
438
|
-
var usedTopics = [];
|
|
439
|
-
for (var x = 0; x < seriesArray.length; x++) {
|
|
440
|
-
if (seriesArray[x].topicMapping) {
|
|
441
|
-
seriesArray[x].topicMapping.forEach(function (topic) {
|
|
442
|
-
if (!usedTopics.includes(topic._id)) {
|
|
443
|
-
usedTopics.push(topic._id);
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
return usedTopics;
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
usedTopics = buildUsedTopicsArray(allSeries);
|
|
452
|
-
_context2.next = 28;
|
|
453
|
-
return client.fetch('\n *[_type == \'taxonomy\' && !defined(parent) && isMainTopic]{\n _id,\n identifier,\n name,\n "children": *[_type == \'taxonomy\' && references(^._id)]{\n _id,\n name,\n identifier,\n "grandchildren": *[_type == \'taxonomy\' && references(^._id)]\n }\t\n }');
|
|
454
|
-
|
|
455
|
-
case 28:
|
|
456
|
-
taxonomyFilter = _context2.sent;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
taxonomyFilter.forEach(function (topic) {
|
|
460
|
-
if (topic.children) {
|
|
461
|
-
topic.children.forEach(function (child) {
|
|
462
|
-
if (child.grandchildren) {
|
|
463
|
-
child.grandchildren = child.grandchildren.filter(function (grandchild) {
|
|
464
|
-
if (!usedTopics.includes(grandchild._id)) {
|
|
465
|
-
return false;
|
|
466
|
-
}
|
|
467
|
-
return true;
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
if (!usedTopics.includes(child._id) || !child.grandchildren) {
|
|
471
|
-
child._id = null;
|
|
472
|
-
child.name = null;
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
topic.children = topic.children.filter(function (child) {
|
|
477
|
-
return child._id !== null;
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
if (currentPage > 1 && seriesData.length === 0) {
|
|
483
|
-
statusCode = 404;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
return _context2.abrupt('return', {
|
|
487
|
-
seriesData: seriesData,
|
|
488
|
-
totalSeriesCount: totalSeriesCount,
|
|
489
|
-
query: seriesQuery,
|
|
490
|
-
seriesQueryFilters: seriesQueryFilters,
|
|
491
|
-
seriesQuerySorts: seriesQuerySorts,
|
|
492
|
-
seriesQueryProjection: seriesQueryProjection,
|
|
493
|
-
params: params,
|
|
494
|
-
currentPage: currentPage,
|
|
495
|
-
taxonomyFilter: taxonomyFilter,
|
|
496
|
-
identifier: identifier,
|
|
497
|
-
docGroupID: docGroupID._id,
|
|
498
|
-
parentUrl: identifier,
|
|
499
|
-
statusCode: statusCode,
|
|
500
|
-
docGroup: docGroupID
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
case 32:
|
|
504
|
-
case 'end':
|
|
505
|
-
return _context2.stop();
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}, _callee2, _this);
|
|
509
|
-
}));
|
|
510
|
-
|
|
511
|
-
return function (_x, _x2, _x3) {
|
|
512
|
-
return _ref5.apply(this, arguments);
|
|
513
|
-
};
|
|
514
|
-
}();
|
|
515
|
-
|
|
516
|
-
export default MediaSeriesLanding;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
3
|
-
|
|
4
|
-
var reactPaginate = createCommonjsModule(function (module, exports) {
|
|
5
|
-
!function(e,a){module.exports=a(React__default);}(commonjsGlobal,(function(e){return function(e){var a={};function t(r){if(a[r])return a[r].exports;var n=a[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:r});},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var n in e)t.d(r,n,function(a){return e[a]}.bind(null,n));return r},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=4)}([function(e,a,t){e.exports=t(2)();},function(a,t){a.exports=e;},function(e,a,t){var r=t(3);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,a,t,n,i,s){if(s!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return t.PropTypes=t,t};},function(e,a,t){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,a,t){t.r(a);var r=t(1),n=t.n(r),i=t(0),s=t.n(i);function l(){return (l=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var o=function(e){var a=e.pageClassName,t=e.pageLinkClassName,r=e.page,i=e.selected,s=e.activeClassName,o=e.activeLinkClassName,u=e.getEventListener,c=e.pageSelectedHandler,p=e.href,f=e.extraAriaContext,g=e.pageLabelBuilder,d=e.ariaLabel||"Page "+r+(f?" "+f:""),b=null;return i&&(b="page",d=e.ariaLabel||"Page "+r+" is your current page",a=void 0!==a?a+" "+s:s,void 0!==t?void 0!==o&&(t=t+" "+o):t=o),n.a.createElement("li",{className:a},n.a.createElement("a",l({role:"button",className:t,href:p,tabIndex:"0","aria-label":d,"aria-current":b,onKeyPress:c},u(c)),g(r)))};o.propTypes={pageSelectedHandler:s.a.func.isRequired,selected:s.a.bool.isRequired,pageClassName:s.a.string,pageLinkClassName:s.a.string,activeClassName:s.a.string,activeLinkClassName:s.a.string,extraAriaContext:s.a.string,href:s.a.string,ariaLabel:s.a.string,page:s.a.number.isRequired,getEventListener:s.a.func.isRequired,pageLabelBuilder:s.a.func.isRequired};var u=o;function c(){return (c=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var p=function(e){var a=e.breakLabel,t=e.breakClassName,r=e.breakLinkClassName,i=e.breakHandler,s=e.getEventListener,l=t||"break";return n.a.createElement("li",{className:l},n.a.createElement("a",c({className:r,role:"button",tabIndex:"0",onKeyPress:i},s(i)),a))};p.propTypes={breakLabel:s.a.oneOfType([s.a.string,s.a.node]),breakClassName:s.a.string,breakLinkClassName:s.a.string,breakHandler:s.a.func.isRequired,getEventListener:s.a.func.isRequired};var f=p;function g(e){return (g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return (d=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}function b(e,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function v(e,a){return (v=Object.setPrototypeOf||function(e,a){return e.__proto__=a,e})(e,a)}function m(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}();return function(){var t,r=C(e);if(a){var n=C(this).constructor;t=Reflect.construct(r,arguments,n);}else t=r.apply(this,arguments);return h(this,t)}}function h(e,a){return !a||"object"!==g(a)&&"function"!=typeof a?y(e):a}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return (C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var k=function(e){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&v(e,a);}(s,e);var a,t,i=m(s);function s(e){var a,t;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),P(y(a=i.call(this,e)),"handlePreviousPage",(function(e){var t=a.state.selected;e.preventDefault?e.preventDefault():e.returnValue=!1,t>0&&a.handlePageSelected(t-1,e);})),P(y(a),"handleNextPage",(function(e){var t=a.state.selected,r=a.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,t<r-1&&a.handlePageSelected(t+1,e);})),P(y(a),"handlePageSelected",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1,a.state.selected!==e?(a.setState({selected:e}),a.callCallback(e)):a.callActiveCallback(e);})),P(y(a),"getEventListener",(function(e){return P({},a.props.eventListener,e)})),P(y(a),"handleBreakClick",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1;var r=a.state.selected;a.handlePageSelected(r<e?a.getForwardJump():a.getBackwardJump(),t);})),P(y(a),"callCallback",(function(e){void 0!==a.props.onPageChange&&"function"==typeof a.props.onPageChange&&a.props.onPageChange({selected:e});})),P(y(a),"callActiveCallback",(function(e){void 0!==a.props.onPageActive&&"function"==typeof a.props.onPageActive&&a.props.onPageActive({selected:e});})),P(y(a),"pagination",(function(){var e=[],t=a.props,r=t.pageRangeDisplayed,i=t.pageCount,s=t.marginPagesDisplayed,l=t.breakLabel,o=t.breakClassName,u=t.breakLinkClassName,c=a.state.selected;if(i<=r)for(var p=0;p<i;p++)e.push(a.getPageElement(p));else {var g,d,b,v=r/2,m=r-v;c>i-r/2?v=r-(m=i-c):c<r/2&&(m=r-(v=c));var h=function(e){return a.getPageElement(e)};for(g=0;g<i;g++)(d=g+1)<=s||d>i-s||g>=c-v&&g<=c+m?e.push(h(g)):l&&e[e.length-1]!==b&&(b=n.a.createElement(f,{key:g,breakLabel:l,breakClassName:o,breakLinkClassName:u,breakHandler:a.handleBreakClick.bind(null,g),getEventListener:a.getEventListener}),e.push(b));}return e})),t=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,a.state={selected:t},a}return a=s,(t=[{key:"componentDidMount",value:function(){var e=this.props,a=e.initialPage,t=e.disableInitialCallback,r=e.extraAriaContext;void 0===a||t||this.callCallback(a),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead.");}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:this.props.forcePage});}},{key:"getForwardJump",value:function(){var e=this.state.selected,a=this.props,t=a.pageCount,r=e+a.pageRangeDisplayed;return r>=t?t-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"hrefBuilder",value:function(e){var a=this.props,t=a.hrefBuilder,r=a.pageCount;if(t&&e!==this.state.selected&&e>=0&&e<r)return t(e+1)}},{key:"ariaLabelBuilder",value:function(e){var a=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var t=this.props.ariaLabelBuilder(e+1,a);return this.props.extraAriaContext&&!a&&(t=t+" "+this.props.extraAriaContext),t}}},{key:"getPageElement",value:function(e){var a=this.state.selected,t=this.props,r=t.pageClassName,i=t.pageLinkClassName,s=t.activeClassName,l=t.activeLinkClassName,o=t.extraAriaContext,c=t.pageLabelBuilder;return n.a.createElement(u,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:a===e,pageClassName:r,pageLinkClassName:i,activeClassName:s,activeLinkClassName:l,extraAriaContext:o,href:this.hrefBuilder(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:c,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props,a=e.disabledClassName,t=e.pageCount,r=e.containerClassName,i=e.previousLabel,s=e.previousClassName,l=e.previousLinkClassName,o=e.previousAriaLabel,u=e.prevRel,c=e.nextLabel,p=e.nextClassName,f=e.nextLinkClassName,g=e.nextAriaLabel,b=e.nextRel,v=this.state.selected,m=s+(0===v?" ".concat(a):""),h=p+(v===t-1?" ".concat(a):""),y=0===v?"true":"false",C=v===t-1?"true":"false";return n.a.createElement("ul",{className:r},n.a.createElement("li",{className:m},n.a.createElement("a",d({className:l,href:this.hrefBuilder(v-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":y,"aria-label":o,rel:u},this.getEventListener(this.handlePreviousPage)),i)),this.pagination(),n.a.createElement("li",{className:h},n.a.createElement("a",d({className:f,href:this.hrefBuilder(v+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":C,"aria-label":g,rel:b},this.getEventListener(this.handleNextPage)),c)))}}])&&b(a.prototype,t),s}(r.Component);P(k,"propTypes",{pageCount:s.a.number.isRequired,pageRangeDisplayed:s.a.number.isRequired,marginPagesDisplayed:s.a.number.isRequired,previousLabel:s.a.node,previousAriaLabel:s.a.string,prevRel:s.a.string,nextLabel:s.a.node,nextAriaLabel:s.a.string,nextRel:s.a.string,breakLabel:s.a.oneOfType([s.a.string,s.a.node]),hrefBuilder:s.a.func,onPageChange:s.a.func,onPageActive:s.a.func,initialPage:s.a.number,forcePage:s.a.number,disableInitialCallback:s.a.bool,containerClassName:s.a.string,pageClassName:s.a.string,pageLinkClassName:s.a.string,pageLabelBuilder:s.a.func,activeClassName:s.a.string,activeLinkClassName:s.a.string,previousClassName:s.a.string,nextClassName:s.a.string,previousLinkClassName:s.a.string,nextLinkClassName:s.a.string,disabledClassName:s.a.string,breakClassName:s.a.string,breakLinkClassName:s.a.string,extraAriaContext:s.a.string,ariaLabelBuilder:s.a.func,eventListener:s.a.string}),P(k,"defaultProps",{pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick"});a.default=k;}])}));
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
var ReactPaginate = unwrapExports(reactPaginate);
|
|
10
|
-
reactPaginate.ReactPaginate;
|
|
11
|
-
|
|
12
|
-
var Pagination = function Pagination(props) {
|
|
13
|
-
var pageCount = props.pageCount,
|
|
14
|
-
_props$marginPagesDis = props.marginPagesDisplayed,
|
|
15
|
-
marginPagesDisplayed = _props$marginPagesDis === undefined ? 1 : _props$marginPagesDis,
|
|
16
|
-
_props$pageRangeDispl = props.pageRangeDisplayed,
|
|
17
|
-
pageRangeDisplayed = _props$pageRangeDispl === undefined ? 5 : _props$pageRangeDispl,
|
|
18
|
-
_props$currentPage = props.currentPage,
|
|
19
|
-
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
20
|
-
_onPageChange = props.onPageChange;
|
|
21
|
-
|
|
22
|
-
if (!pageCount || pageCount <= 1) return null;
|
|
23
|
-
return React__default.createElement(
|
|
24
|
-
React__default.Fragment,
|
|
25
|
-
null,
|
|
26
|
-
React__default.createElement(ReactPaginate, {
|
|
27
|
-
pageCount: pageCount,
|
|
28
|
-
marginPagesDisplayed: marginPagesDisplayed,
|
|
29
|
-
pageRangeDisplayed: pageRangeDisplayed,
|
|
30
|
-
forcePage: currentPage - 1,
|
|
31
|
-
onPageChange: function onPageChange(_ref) {
|
|
32
|
-
var selected = _ref.selected;
|
|
33
|
-
return _onPageChange(selected + 1);
|
|
34
|
-
},
|
|
35
|
-
hrefBuilder: function hrefBuilder(page) {
|
|
36
|
-
return '?page=' + page;
|
|
37
|
-
},
|
|
38
|
-
previousLabel: '<',
|
|
39
|
-
nextLabel: '>',
|
|
40
|
-
containerClassName: 'pagination-container',
|
|
41
|
-
previousLinkClassName: 'previous',
|
|
42
|
-
nextLinkClassName: 'next',
|
|
43
|
-
disabledClassName: 'disbaled',
|
|
44
|
-
activeClassName: 'active'
|
|
45
|
-
}),
|
|
46
|
-
React__default.createElement(
|
|
47
|
-
'style',
|
|
48
|
-
{ jsx: 'true' },
|
|
49
|
-
'\n .pagination-container {\n list-style: none;\n padding: 10px 0;\n margin: 0;\n display: flex;\n overflow: auto;\n }\n .pagination-container::before,\n .pagination-container::after {\n content: \'\';\n margin: 0 auto;\n }\n .pagination-container::-webkit-scrollbar {\n height: 6px;\n }\n .pagination-container a {\n padding: 10px;\n border: 1px solid #dee2e6;\n }\n .pagination-container a:hover {\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #dee2e6;\n }\n .pagination-container .active a {\n color: #fff;\n background-color: #666;\n background-color: var(--primary);\n border-color: #007bff;\n }\n .pagination-container .previous a {\n border-radius: 5px 0 0 5px;\n }\n .pagination-container .next a {\n border-radius: 0 5px 5px 0;\n }\n .pagination-container .disbaled a {\n cursor: default;\n }\n '
|
|
50
|
-
)
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { Pagination as P };
|