pagy 7.0.6 → 7.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/pagy.rb +1 -1
- data/lib/javascripts/pagy-dev.js +8 -9
- data/lib/javascripts/pagy-module.js +7 -8
- data/lib/javascripts/pagy.js +1 -1
- data/lib/pagy.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad56d9989566c41b48046508ab040e26c8a6350c1c433ce1a341d5ac8d624f97
|
4
|
+
data.tar.gz: dbaafa022867515e0912d80751244386e3026c0fa5de774f2014e80f1a26eb5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb54413602bd78d87cb84a604d4a025dabae7a73cf54bbb0b5054d68f20119a6d9166188cf555f28f23659c6b375e55ade74429fdd042a8f1ac6c482112b69d5
|
7
|
+
data.tar.gz: e9083757c4cac1b40110d41ada75e13d626f8d0949486b32104a359653a61cf08bb384a1fcb674088ead0fb021528fd26dcbd1541d4dcd382ab8d6925734fec3
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (7.0.
|
3
|
+
# Pagy initializer file (7.0.7)
|
4
4
|
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
|
5
5
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
6
6
|
|
data/lib/javascripts/pagy-dev.js
CHANGED
@@ -19,18 +19,17 @@ window.Pagy = (() => {
|
|
19
19
|
for (const i in series) {
|
20
20
|
const item = series[i];
|
21
21
|
const label = labels[i];
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
else if (typeof item === "number") {
|
26
|
-
html += fillIn(tags.link, item.toString(), label);
|
22
|
+
let filled;
|
23
|
+
if (typeof item === "number") {
|
24
|
+
filled = fillIn(tags.link, item.toString(), label);
|
27
25
|
}
|
28
26
|
else if (item === "gap") {
|
29
|
-
|
27
|
+
filled = tags.gap;
|
30
28
|
}
|
31
29
|
else { // active page
|
32
|
-
|
30
|
+
filled = fillIn(tags.active, item, label);
|
33
31
|
}
|
32
|
+
html += (typeof trimParam === "string" && item == 1) ? trim(filled, trimParam) : filled;
|
34
33
|
}
|
35
34
|
html += tags.after; // eslint-disable-line align-assignments/align-assignments
|
36
35
|
el.innerHTML = "";
|
@@ -82,7 +81,7 @@ window.Pagy = (() => {
|
|
82
81
|
const trim = (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
|
83
82
|
// Public interface
|
84
83
|
return {
|
85
|
-
version: "7.0.
|
84
|
+
version: "7.0.7",
|
86
85
|
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
|
87
86
|
init(arg) {
|
88
87
|
const target = arg instanceof Element ? arg : document;
|
@@ -111,4 +110,4 @@ window.Pagy = (() => {
|
|
111
110
|
}
|
112
111
|
};
|
113
112
|
})();
|
114
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWtCQSxNQUFNLElBQUksR0FBRyxDQUFDLEdBQUcsRUFBRTtJQUNmLDRDQUE0QztJQUM1QyxNQUFNLFdBQVcsR0FBRyxJQUFJLGNBQWMsQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUNOLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFhLFdBQVcsQ0FBQyxDQUFDLE9BQU8sQ0FDM0UsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsVU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b2YgZWxlbWVudHMpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OGFycmF5ID0gVWludDhBcnJheS5mcm9tKGF0b2IoZWwuZ2V0QXR0cmlidXRlKFwiZGF0YS1wYWd5XCIpIGFzIHN0cmluZyksIGMgPT4gYy5jaGFyQ29kZUF0KDApKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgW2tleXdvcmQsIC4uLmFyZ3NdID0gSlNPTi5wYXJzZSgobmV3IFRleHREZWNvZGVyKCkpLmRlY29kZSh1aW50OGFycmF5KSk7IC8vIGJhc2U2NC11dGY4IC0+IEpTT04gLT4gQXJyYXlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleXdvcmQgPT09IFwibmF2XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXROYXYoZWwgYXMgTmF2RWxlbWVudCwgYXJncyBhcyBOYXZBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXRDb21ibyhlbCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwic2VsZWN0b3JcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdFNlbGVjdG9yKGVsLCBhcmdzIGFzIFNlbGVjdG9yQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG5Vbmtub3duIGtleXdvcmQgJyVzJ1wiLCBlbCwga2V5d29yZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHsgY29uc29sZS53YXJuKFwiU2tpcH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cbiAgICBjb25zdCByanNPYnNlcnZlciA9IG5ldyBSZXNpemVPYnNlcnZlcihlbnRyaWVzID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJpZXMuZm9yRWFjaChlID0+IGUudGFyZ2V0LnF1ZXJ5U2VsZWN0b3JBbGw8TmF2RWxlbWVudD4oXCIucGFneS1yanNcIikuZm9yRWFjaChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsID0+IGVsLnBhZ3lSZW5kZXIoKSkpKTtcblxuICAgIC8vIEluaXQgdGhlICpfbmF2X2pzIGhlbHBlcnNcbiAgICBjb25zdCBpbml0TmF2ID0gKGVsOk5hdkVsZW1lbnQsIFt0YWdzLCBzZXF1ZWxzLCBsYWJlbFNlcXVlbHMsIHRyaW1QYXJhbV06TmF2QXJncykgPT4ge1xuICAgICAgICBjb25zdCBjb250YWluZXIgPSBlbC5wYXJlbnRFbGVtZW50ID8/IGVsO1xuICAgICAgICBjb25zdCB3aWR0aHMgPSBPYmplY3Qua2V5cyhzZXF1ZWxzKS5tYXAodyA9PiBwYXJzZUludCh3KSkuc29ydCgoYSwgYikgPT4gYiAtIGEpO1xuICAgICAgICBsZXQgbGFzdFdpZHRoID0gLTE7XG4gICAgICAgIGNvbnN0IGZpbGxJbiA9IChsaW5rOnN0cmluZywgcGFnZTpzdHJpbmcsIGxhYmVsOnN0cmluZyk6c3RyaW5nID0+XG4gICAgICAgICAgICBsaW5rLnJlcGxhY2UoL19fcGFneV9wYWdlX18vZywgcGFnZSkucmVwbGFjZSgvX19wYWd5X2xhYmVsX18vZywgbGFiZWwpO1xuICAgICAgICAoZWwucGFneVJlbmRlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gd2lkdGhzLmZpbmQodyA9PiB3IDwgY29udGFpbmVyLmNsaWVudFdpZHRoKSB8fCAwO1xuICAgICAgICAgICAg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tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbWJvKGVsLCBhcmdzIGFzIENvbWJvQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VsZWN0b3IoZWwsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlNraXBwZWQgUGFneS5pbml0KCkgZm9yOiAlb1xcblVua25vd24ga2V5d29yZCAnJXMnXCIsIGVsLCBrZXl3b3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgeyBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG4lc1wiLCBlbCwgZXJyKSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkoKTtcbiJdfQ==
|
@@ -18,18 +18,17 @@ const Pagy = (() => {
|
|
18
18
|
for (const i in series) {
|
19
19
|
const item = series[i];
|
20
20
|
const label = labels[i];
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
else if (typeof item === "number") {
|
25
|
-
html += fillIn(tags.link, item.toString(), label);
|
21
|
+
let filled;
|
22
|
+
if (typeof item === "number") {
|
23
|
+
filled = fillIn(tags.link, item.toString(), label);
|
26
24
|
}
|
27
25
|
else if (item === "gap") {
|
28
|
-
|
26
|
+
filled = tags.gap;
|
29
27
|
}
|
30
28
|
else { // active page
|
31
|
-
|
29
|
+
filled = fillIn(tags.active, item, label);
|
32
30
|
}
|
31
|
+
html += (typeof trimParam === "string" && item == 1) ? trim(filled, trimParam) : filled;
|
33
32
|
}
|
34
33
|
html += tags.after; // eslint-disable-line align-assignments/align-assignments
|
35
34
|
el.innerHTML = "";
|
@@ -81,7 +80,7 @@ const Pagy = (() => {
|
|
81
80
|
const trim = (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
|
82
81
|
// Public interface
|
83
82
|
return {
|
84
|
-
version: "7.0.
|
83
|
+
version: "7.0.7",
|
85
84
|
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
|
86
85
|
init(arg) {
|
87
86
|
const target = arg instanceof Element ? arg : document;
|
data/lib/javascripts/pagy.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,n,
|
1
|
+
!function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,a,n,i])=>{let l=t.parentElement??t,c=Object.keys(a).map(e=>parseInt(e)).sort((e,t)=>t-e),p=-1,s=(e,t,r)=>e.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,r);(t.pagyRender=function(){let e=c.find(e=>e<l.clientWidth)||0;if(e===p)return;let g=r.before,y=a[e.toString()],f=n?.[e.toString()]??y.map(e=>e.toString());for(let e in y){let t;let a=y[e],n=f[e];t="number"==typeof a?s(r.link,a.toString(),n):"gap"===a?r.gap:s(r.active,a,n),g+="string"==typeof i&&1==a?o(t,i):t}g+=r.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",g),p=e})(),t.classList.contains("pagy-rjs")&&e.observe(l)},r=(e,[t,r])=>n(e,e=>[e,t.replace(/__pagy_page__/,e)],r),a=(e,[t,r,a])=>{n(e,e=>{let a=Math.max(Math.ceil(t/parseInt(e)),1).toString(),n=r.replace(/__pagy_page__/,a).replace(/__pagy_items__/,e);return[a,n]},a)},n=(e,t,r)=>{let a=e.querySelector("input"),n=a.value,i=function(){if(a.value===n)return;let[i,l,c]=[a.min,a.value,a.max].map(e=>parseInt(e)||0);if(l<i||l>c){a.value=n,a.select();return}let[p,s]=t(a.value);"string"==typeof r&&"1"===p&&(s=o(s,r)),e.insertAdjacentHTML("afterbegin",s),e.querySelector("a").click()};["change","focus"].forEach(e=>a.addEventListener(e,a.select)),a.addEventListener("focusout",i),a.addEventListener("keypress",e=>{"Enter"===e.key&&i()})},o=(e,t)=>e.replace(RegExp(`[?&]${t}=1\\b(?!&)|\\b${t}=1&`),"");return{version:"7.0.7",init(e){for(let n of(e instanceof Element?e:document).querySelectorAll("[data-pagy]"))try{let e=Uint8Array.from(atob(n.getAttribute("data-pagy")),e=>e.charCodeAt(0)),[o,...i]=JSON.parse(new TextDecoder().decode(e));"nav"===o?t(n,i):"combo"===o?r(n,i):"selector"===o?a(n,i):console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",n,o)}catch(e){console.warn("Skipped Pagy.init() for: %o\n%s",n,e)}}}})();window.Pagy=e}();
|
data/lib/pagy.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Agnostic pagination in plain ruby. It does it all. Better.
|
14
14
|
email:
|