pict-section-recordset 1.0.11 → 1.0.12
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/package.json
CHANGED
|
@@ -92,9 +92,9 @@ const _DEFAULT_CONFIGURATION_List_PaginationTop = (
|
|
|
92
92
|
{
|
|
93
93
|
Hash: 'PRSP-List-Pagination-Template-Pages',
|
|
94
94
|
Template: /*html*/`
|
|
95
|
-
<!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Button-
|
|
96
|
-
<a href="{~D:Record.URL~}" aria-label="Go to page {~D:Record.Page~}">{~D:Record.Page~}</a>
|
|
97
|
-
<!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Button-
|
|
95
|
+
<!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Button-Pages] -->
|
|
96
|
+
<a href="{~D:Record.URL~}" aria-label="Go to page {~D:Record.Page~}" class="page-offset_{~D:Record.RelativeOffset~}">{~D:Record.Page~}</a>
|
|
97
|
+
<!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Button-Pages] -->
|
|
98
98
|
`
|
|
99
99
|
}
|
|
100
100
|
],
|
|
@@ -235,6 +235,11 @@ class viewRecordSetList extends libPictRecordSetRecordView
|
|
|
235
235
|
|
|
236
236
|
// Generate each page's links.
|
|
237
237
|
// TODO: This is fast and cool; any reason not to?
|
|
238
|
+
// Get "bookmarks" as references to the array of page links.
|
|
239
|
+
tmpRecordListData.PageLinkBookmarks = (
|
|
240
|
+
{
|
|
241
|
+
Current: Math.floor(tmpRecordListData.Offset / tmpRecordListData.PageSize)
|
|
242
|
+
});
|
|
238
243
|
tmpRecordListData.PageLinks = [];
|
|
239
244
|
for (let i = 0; i < tmpRecordListData.PageCount; i++)
|
|
240
245
|
{
|
|
@@ -242,24 +247,21 @@ class viewRecordSetList extends libPictRecordSetRecordView
|
|
|
242
247
|
{
|
|
243
248
|
tmpRecordListData.PageLinks.push(
|
|
244
249
|
{
|
|
245
|
-
Page: i+1,
|
|
246
|
-
|
|
250
|
+
Page: i + 1,
|
|
251
|
+
RelativeOffset: (i + 1) - tmpRecordListData.PageLinkBookmarks.Current,
|
|
252
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/FilteredTo/${tmpRecordListData.FilterString}/${i * tmpRecordListData.PageSize}/${tmpRecordListData.PageSize}`
|
|
247
253
|
});
|
|
248
254
|
}
|
|
249
255
|
else
|
|
250
256
|
{
|
|
251
257
|
tmpRecordListData.PageLinks.push(
|
|
252
258
|
{
|
|
253
|
-
Page: i+1,
|
|
254
|
-
|
|
259
|
+
Page: i + 1,
|
|
260
|
+
RelativeOffset: (i + 1) - tmpRecordListData.PageLinkBookmarks.Current,
|
|
261
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/${i * tmpRecordListData.PageSize}/${tmpRecordListData.PageSize}`
|
|
255
262
|
});
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
|
-
// Get "bookmarks" as references to the array of page links.
|
|
259
|
-
tmpRecordListData.PageLinkBookmarks = (
|
|
260
|
-
{
|
|
261
|
-
Current: Math.floor(tmpRecordListData.Offset / tmpRecordListData.PageSize)
|
|
262
|
-
});
|
|
263
265
|
|
|
264
266
|
//FIXME: short-term workaround to not blow up the tempplate rendering with way too many links
|
|
265
267
|
const linkRangeStart = Math.max(0, tmpRecordListData.PageLinkBookmarks.Current - 10);
|
|
@@ -267,19 +269,45 @@ class viewRecordSetList extends libPictRecordSetRecordView
|
|
|
267
269
|
tmpRecordListData.PageLinksLimited = tmpRecordListData.PageLinks.slice(linkRangeStart, linkRangeEnd);
|
|
268
270
|
if (linkRangeStart > 0)
|
|
269
271
|
{
|
|
270
|
-
tmpRecordListData.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
if (tmpRecordListData.FilterString)
|
|
273
|
+
{
|
|
274
|
+
tmpRecordListData.PageLinksLimited.unshift(
|
|
275
|
+
{
|
|
276
|
+
Page: 1,
|
|
277
|
+
RelativeOffset: 1 - tmpRecordListData.PageLinkBookmarks.Current,
|
|
278
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/FilteredTo/${tmpRecordListData.FilterString}/${tmpRecordListData.PageSize}/${tmpRecordListData.PageSize}`
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
else
|
|
282
|
+
{
|
|
283
|
+
tmpRecordListData.PageLinksLimited.unshift(
|
|
284
|
+
{
|
|
285
|
+
Page: 1,
|
|
286
|
+
RelativeOffset: 1 - tmpRecordListData.PageLinkBookmarks.Current,
|
|
287
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/${0}/${tmpRecordListData.PageSize}`
|
|
288
|
+
});
|
|
289
|
+
}
|
|
275
290
|
}
|
|
276
291
|
if (linkRangeEnd < tmpRecordListData.PageLinks.length)
|
|
277
292
|
{
|
|
278
|
-
tmpRecordListData.
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
293
|
+
if (tmpRecordListData.FilterString)
|
|
294
|
+
{
|
|
295
|
+
tmpRecordListData.PageLinksLimited.push(
|
|
296
|
+
{
|
|
297
|
+
Page: tmpRecordListData.PageCount,
|
|
298
|
+
RelativeOffset: tmpRecordListData.PageCount - tmpRecordListData.PageLinkBookmarks.Current,
|
|
299
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/FilteredTo/${tmpRecordListData.FilterString}/${(tmpRecordListData.PageCount - 1) * tmpRecordListData.PageSize}/${tmpRecordListData.PageSize}`
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
else
|
|
303
|
+
{
|
|
304
|
+
tmpRecordListData.PageLinksLimited.push(
|
|
305
|
+
{
|
|
306
|
+
Page: tmpRecordListData.PageCount,
|
|
307
|
+
RelativeOffset: tmpRecordListData.PageCount - tmpRecordListData.PageLinkBookmarks.Current,
|
|
308
|
+
URL: `#/PSRS/${tmpRecordListData.RecordSet}/List/${(tmpRecordListData.PageCount - 1) * tmpRecordListData.PageSize}/${tmpRecordListData.PageSize}`
|
|
309
|
+
});
|
|
310
|
+
}
|
|
283
311
|
}
|
|
284
312
|
|
|
285
313
|
tmpRecordListData.PageLinkBookmarks.Previous = tmpRecordListData.PageLinkBookmarks.Current - 1;
|