pagy 5.7.6 → 5.8.0
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 +11 -12
- data/lib/javascripts/pagy-module.js +10 -11
- data/lib/javascripts/pagy.js +1 -1
- data/lib/pagy/extras/bootstrap.rb +2 -2
- data/lib/pagy/extras/bulma.rb +2 -2
- data/lib/pagy/extras/foundation.rb +2 -2
- data/lib/pagy/extras/frontend_helpers.rb +9 -7
- data/lib/pagy/extras/items.rb +1 -1
- data/lib/pagy/extras/materialize.rb +2 -2
- data/lib/pagy/extras/navs.rb +2 -2
- data/lib/pagy/extras/semantic.rb +2 -2
- data/lib/pagy/extras/uikit.rb +2 -2
- 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: c55fcd46b6bf57b7c531075a1425bdd6b130fae3d63d4effbf969ac3eb82dea1
|
4
|
+
data.tar.gz: b0790efbc7565e69cc1c18b4bbeeedafd4b9dbdd7703e823e2fa0e8191fb7004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c0334914b4748a423b46776822359c234c0b8af531d92a289f037189638d6abe92dbebdfffe53316872d4af3a34032ec9742de21509d856e75010a1fa0e4936
|
7
|
+
data.tar.gz: 308b3a243a6398abd0d7de7acdfcbd095f600dabff402575b4ff793af53a67622c14ddf7a02c88c69b5250392d019a0b59868535fbd523eae8a7d4f7e9ef4b29
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (5.
|
3
|
+
# Pagy initializer file (5.8.0)
|
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
@@ -1,29 +1,28 @@
|
|
1
1
|
"use strict";
|
2
2
|
const Pagy = {
|
3
|
-
version: "5.
|
4
|
-
// Scan for "data-pagy
|
3
|
+
version: "5.8.0",
|
4
|
+
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
|
5
5
|
init(arg) {
|
6
6
|
const target = arg instanceof Element ? arg : document;
|
7
|
-
const elements = target.querySelectorAll("[data-pagy
|
8
|
-
for (const
|
7
|
+
const elements = target.querySelectorAll("[data-pagy]");
|
8
|
+
for (const el of elements) {
|
9
9
|
try {
|
10
|
-
const
|
11
|
-
const [keyword, ...args] = JSON.parse(jsonString);
|
10
|
+
const [keyword, ...args] = JSON.parse(atob(el.getAttribute("data-pagy"))); // base64 JSON -> Array
|
12
11
|
if (keyword === "nav") {
|
13
|
-
Pagy.initNav(
|
12
|
+
Pagy.initNav(el, args);
|
14
13
|
}
|
15
14
|
else if (keyword === "combo") {
|
16
|
-
Pagy.initCombo(
|
15
|
+
Pagy.initCombo(el, args);
|
17
16
|
}
|
18
17
|
else if (keyword === "selector") {
|
19
|
-
Pagy.initSelector(
|
18
|
+
Pagy.initSelector(el, args);
|
20
19
|
}
|
21
20
|
else {
|
22
|
-
Pagy.initWarn(
|
21
|
+
Pagy.initWarn(el, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
|
23
22
|
}
|
24
23
|
}
|
25
24
|
catch (err) {
|
26
|
-
Pagy.initWarn(
|
25
|
+
Pagy.initWarn(el, err);
|
27
26
|
}
|
28
27
|
}
|
29
28
|
},
|
@@ -113,4 +112,4 @@ const Pagy = {
|
|
113
112
|
// Trim the ${page-param}=1 params in links
|
114
113
|
trim: (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "")
|
115
114
|
};
|
116
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJm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gICAgICAgICBjb25zdCBqc29uU3RyaW5nICAgICAgICAgPSBlbGVtZW50LmdldEF0dHJpYnV0ZShcImRhdGEtcGFneS1qc29uXCIpIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKGpzb25TdHJpbmcpIGFzIFBhZ3lKU09OO1xuICAgICAgICAgICAgICAgIGlmIChrZXl3b3JkID09PSBcIm5hdlwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdE5hdihlbGVtZW50IGFzIE5hdkVsZW1lbnQsIGFyZ3MgYXMgTmF2QXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgUGFneS5pbml0Q29tYm8oZWxlbWVudCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdFNlbGVjdG9yKGVsZW1lbnQsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBQYWd5LmluaXRXYXJuKGVsZW1lbnQsIGBJbGxlZ2FsIFBhZ3lKU09OIGtleXdvcmQ6IGV4cGVjdGVkIFwibmF2XCJ8XCJjb21ib1wifFwic2VsZWN0b3JcIiwgZ290IFwiJHtrZXl3b3JkfVwiYCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7IFBhZ3kuaW5pdFdhcm4oZWxlbWVudCwgZXJyKSB9XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgaW5pdFdhcm4oZWw6RWxlbWVudCwgZXJyOnVua25vd24pIHsgY29uc29sZS53YXJuKFwiUG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Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtICA9IHNlcmllc1tpXTtcbiAgICAgICAgICAgICAgICBjb25zdCBsYWJlbCA9IGxhYmVsc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyaW1QYXJhbSA9PT0gXCJzdHJpbmdcIiAmJiBpdGVtID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gUGFneS50cmltKGZpbGxJbih0YWdzLmxpbmssIGl0ZW0udG9TdHJpbmcoKSwgbGFiZWwpLCB0cmltUGFyYW0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGl0ZW0gPT09IFwibnVtYmVyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGl0ZW0gPT09IFwiZ2FwXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSB0YWdzLmdhcDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBhY3RpdmUgcGFnZVxuICAgICAgICAgICAgICAgICAgICBodG1sICs9IGZpbGxJbih0YWdzLmFjdGl2ZSwgaXRlbSwgbGFiZWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGh0bWwgKz0gdGFncy5hZnRlcjsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGFsaWduLWFzc2lnbm1lbnRzL2FsaWduLWFzc2lnbm1lbnRzXG4gICAgICAgICAgICBlbC5pbm5lckhUTUwgPSBcIlwiO1xuICAgICAgICAgICAgZWwuaW5zZXJ0QWRqYWNlb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ldEF0dHJpYnV0ZShcImRhdGEtcGFneVwiKSBhcyBzdHJpbmcpKTsgLy8gYmFzZTY0IEpTT04gLT4gQXJyYXlcbiAgICAgICAgICAgICAgICBpZiAoa2V5d29yZCA9PT0gXCJuYXZcIikge1xuICAgICAgICAgICAgICAgICAgICBQYWd5LmluaXROYXYoZWwgYXMgTmF2RWxlbWVudCwgYXJncyBhcyBOYXZBcmdzKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwiY29tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICBQYWd5LmluaXRDb21ibyhlbCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdFNlbGVjdG9yKGVsLCBhcmdzIGFzIFNlbGVjdG9yQXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgUGFneS5pbml0V2FybihlbCwgYElsbGVnYWwgUGFneUpTT04ga2V5d29yZDogZXhwZWN0ZWQgXCJuYXZcInxcImNvbWJvXCJ8XCJzZWxlY3RvclwiLCBnb3QgXCIke2tleXdvcmR9XCJgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHsgUGFneS5pbml0V2FybihlbCwgZXJyKSB9XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgaW5pdFdhcm4oZWw6RWxlbWVudCwgZXJyOnVua25vd24pIHsgY29uc29sZS53YXJuKFwiUGFneS5pbml0KCkgc2tpcHBlZCBlbGVtZW50OiAlb1xcbiVzXCIsIGVsLCBlcnIpIH0sXG5cbiAgICAvLyBJbml0IHRoZSAqX25hdl9qcyBoZWxwZXJzXG4gICAgaW5pdE5hdihlbDpOYXZFbGVtZW50LCBbdGFncywgc2VxdWVscywgbGFiZWxTZXF1ZWxzLCB0cmltUGFyYW1dOk5hdkFyZ3MpIHtcbiAgICAgICAgY29uc3QgY29udGFpbmVyID0gZWwucGFyZW50RWxlbWVudCA/PyBlbDtcbiAgICAgICAgY29uc3Qgd2lkdGhzICAgID0gT2JqZWN0LmtleXMoc2VxdWVscykubWFwKHcgPT4gcGFyc2VJbnQodykpLnNvcnQoKGEsIGIpID0+IGIgLSBhKTtcbiAgICAgICAgbGV0IGxhc3RXaWR0aCAgID0gLTE7XG4gICAgICAgIGNvbnN0IGZpbGxJbiAgICA9IChsaW5rOnN0cmluZywgcGFnZTpzdHJpbmcsIGxhYmVsOnN0cmluZyk6c3RyaW5nID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rLnJlcGxhY2UoL19fcGFneV9wYWdlX18vZywgcGFnZSkucmVwbGFjZSgvX19wYWd5X2xhYmVsX18vZywgbGFiZWwpO1xuICAgICAgICAoZWwucGFneVJlbmRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSB3aWR0aHMuZmluZCh3ID0+IHcgPCBjb250YWluZXIuY2xpZW50V2lkdGgpIHx8IDA7XG4gICAgICAgICAgICBpZiAod2lkdGggPT09IGxhc3RXaWR0aCkgeyByZXR1cm4gfSAvLyBubyBjaGFuZ2U6IGFib3J0XG4gICAgICAgICAgICBsZXQgaHRtbCAgICAgPSB0YWdzLmJlZm9yZTtcbiAgICAgICAgICAgIGNvbnN0IHNlcmllcyA9IHNlcXVlbHNbd2lkdGgudG9TdHJpbmcoKV07XG4gICAgICAgICAgICBjb25zdCBsYWJlbHMgPSBsYWJlbFNlcXVlbHM/Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtICA9IHNlcmllc1tpXTtcbiAgICAgICAgICAgICAgICBjb25zdCBsYWJlbCA9IGxhYmVsc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyaW1QYXJhbSA9PT0gXCJzdHJpbmdcIiAmJiBpdGVtID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gUGFneS50cmltKGZpbGxJbih0YWdzLmxpbmssIGl0ZW0udG9TdHJpbmcoKSwgbGFiZWwpLCB0cmltUGFyYW0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGl0ZW0gPT09IFwibnVtYmVyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGl0ZW0gPT09IFwiZ2FwXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSB0YWdzLmdhcDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBhY3RpdmUgcGFnZVxuICAgICAgICAgICAgICAgICAgICBodG1sICs9IGZpbGxJbih0YWdzLmFjdGl2ZSwgaXRlbSwgbGFiZWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGh0bWwgKz0gdGFncy5hZnRlcjsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGFsaWduLWFzc2lnbm1lbnRzL2FsaWduLWFzc2lnbm1lbnRzXG4gICAgICAgICAgICBlbC5pbm5lckhUTUwgPSBcIlwiO1xuICAgICAgICAgICAgZWwuaW5zZXJ0QWRqYWNlbnRIVE1MKFwiYWZ0ZXJiZWdpblwiLCBodG1sKTtcbiAgICAgICAgICAgIGxhc3RXaWR0aCA9IHdpZHRoO1xuICAgICAgICB9KSgpO1xuICAgICAgICBpZiAoZWwuY2xhc3NMaXN0LmNvbnRhaW5zKFwicGFneS1yanNcIikpIHsgUGFneS5yanNPY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ic3RyaW5nXCIgJiYgcGFnZSA9PT0gXCIxXCIpIHsgaHRtbCA9IFBhZ3kudHJpbShodG1sLCB0cmltUGFyYW0pIH1cbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICAoZWwucXVlcnlTZWxlY3RvcihcImFcIikgYXMgSFRNTEFuY2hvckVsZW1lbnQpLmNsaWNrKCk7XG4gICAgICAgIH07XG4gICAgICAgIFtcImNoYW5nZVwiLCBcImZvY3VzXCJdLmZvckVhY2goZSA9PiBpbnB1dC5hZGRFdmVudExpc3RlbmVyKGUsIGlucHV0LnNlbGVjdCkpOyAgICAgICAgLy8gYXV0by1zZWxlY3RcbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImZvY3Vzb3V0XCIsIGFjdGlvbik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBhY3Rpb25cbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImtleXByZXNzXCIsIGUgPT4geyBpZiAoZS5rZXkgPT09IFwiRW50ZXJcIikgeyBhY3Rpb24oKSB9IH0pOyAvLyB0cmlnZ2VyIGFjdGlvblxuICAgIH0sXG5cbiAgICAvLyBUcmltIHRoZSAke3BhZ2UtcGFyYW19PTEgcGFyYW1zIGluIGxpbmtzXG4gICAgdHJpbTogKGxpbms6c3RyaW5nLCBwYXJhbTpzdHJpbmcpID0+IGxpbmsucmVwbGFjZShuZXcgUmVnRXhwKGBbPyZdJHtwYXJhbX09MVxcXFxiKD8hJil8XFxcXGIke3BhcmFtfT0xJmApLCBcIlwiKVxufTtcbiJdfQ==
|
@@ -1,28 +1,27 @@
|
|
1
1
|
const Pagy = {
|
2
|
-
version: "5.
|
3
|
-
// Scan for "data-pagy
|
2
|
+
version: "5.8.0",
|
3
|
+
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
|
4
4
|
init(arg) {
|
5
5
|
const target = arg instanceof Element ? arg : document;
|
6
|
-
const elements = target.querySelectorAll("[data-pagy
|
7
|
-
for (const
|
6
|
+
const elements = target.querySelectorAll("[data-pagy]");
|
7
|
+
for (const el of elements) {
|
8
8
|
try {
|
9
|
-
const
|
10
|
-
const [keyword, ...args] = JSON.parse(jsonString);
|
9
|
+
const [keyword, ...args] = JSON.parse(atob(el.getAttribute("data-pagy"))); // base64 JSON -> Array
|
11
10
|
if (keyword === "nav") {
|
12
|
-
Pagy.initNav(
|
11
|
+
Pagy.initNav(el, args);
|
13
12
|
}
|
14
13
|
else if (keyword === "combo") {
|
15
|
-
Pagy.initCombo(
|
14
|
+
Pagy.initCombo(el, args);
|
16
15
|
}
|
17
16
|
else if (keyword === "selector") {
|
18
|
-
Pagy.initSelector(
|
17
|
+
Pagy.initSelector(el, args);
|
19
18
|
}
|
20
19
|
else {
|
21
|
-
Pagy.initWarn(
|
20
|
+
Pagy.initWarn(el, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
|
22
21
|
}
|
23
22
|
}
|
24
23
|
catch (err) {
|
25
|
-
Pagy.initWarn(
|
24
|
+
Pagy.initWarn(el, err);
|
26
25
|
}
|
27
26
|
}
|
28
27
|
},
|
data/lib/javascripts/pagy.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){function
|
1
|
+
!function(){function t(t){if(Array.isArray(t))return t}function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(r,i){return t(r)||n(r)||e()}var i={version:"5.8.0",init:function(r){var a,o=(r instanceof Element?r:document).querySelectorAll("[data-pagy]"),c=!0,u=!1,l=void 0;try{for(var f,p=o[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var s=f.value;try{var v=t(a=JSON.parse(atob(s.getAttribute("data-pagy"))))||n(a)||e(),g=v[0],y=v.slice(1);"nav"===g?i.initNav(s,y):"combo"===g?i.initCombo(s,y):"selector"===g?i.initSelector(s,y):i.initWarn(s,'Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "'.concat(g,'"'))}catch(t){i.initWarn(s,t)}}}catch(t){u=!0,l=t}finally{try{c||null==p.return||p.return()}finally{if(u)throw l}}},initWarn:function(t,n){console.warn("Pagy.init() skipped element: %o\n%s",t,n)},initNav:function(t,n){var e,a=r(n),o=a[0],c=a[1],u=a[2],l=a[3],f=null!==(e=t.parentElement)&&void 0!==e?e:t,p=Object.keys(c).map((function(t){return parseInt(t)})).sort((function(t,n){return n-t})),s=-1,v=function(t,n,e){return t.replace(/__pagy_page__/g,n).replace(/__pagy_label__/g,e)};(t.pagyRender=function(){var n=p.find((function(t){return t<f.clientWidth}))||0;if(n!==s){var e,r=o.before,a=c[n.toString()],g=null!==(e=null==u?void 0:u[n.toString()])&&void 0!==e?e:a.map((function(t){return t.toString()}));for(var y in a){var d=a[y],_=g[y];r+="string"==typeof l&&1===d?i.trim(v(o.link,d.toString(),_),l):"number"==typeof d?v(o.link,d.toString(),_):"gap"===d?o.gap:v(o.active,d,_)}r+=o.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",r),s=n}})(),t.classList.contains("pagy-rjs")&&i.rjsObserver.observe(f)},rjsObserver:new ResizeObserver((function(t){t.forEach((function(t){return t.target.querySelectorAll(".pagy-rjs").forEach((function(t){return t.pagyRender()}))}))})),initCombo:function(t,n){var e=r(n),a=e[0],o=e[1];i.initInput(t,(function(t){return[t,a.replace(/__pagy_page__/,t)]}),o)},initSelector:function(t,n){var e=r(n),a=e[0],o=e[1],c=e[2];i.initInput(t,(function(t){var n=Math.max(Math.ceil(a/parseInt(t)),1).toString();return[n,o.replace(/__pagy_page__/,n).replace(/__pagy_items__/,t)]}),c)},initInput:function(t,n,e){var a=t.querySelector("input"),o=a.value,c=function(){if(a.value!==o){var c=r([a.min,a.value,a.max].map((function(t){return parseInt(t)||0}))),u=c[0],l=c[1],f=c[2];if(l<u||l>f)return a.value=o,void a.select();var p=r(n(a.value)),s=p[0],v=p[1];"string"==typeof e&&"1"===s&&(v=i.trim(v,e)),t.insertAdjacentHTML("afterbegin",v),t.querySelector("a").click()}};["change","focus"].forEach((function(t){return a.addEventListener(t,a.select)})),a.addEventListener("focusout",c),a.addEventListener("keypress",(function(t){"Enter"===t.key&&c()}))},trim:function(t,n){return t.replace(new RegExp("[?&]".concat(n,"=1\\b(?!&)|\\b").concat(n,"=1&")),"")}},a=i;window.Pagy=a}();
|
@@ -41,7 +41,7 @@ class Pagy # :nodoc:
|
|
41
41
|
'after' => %(#{pagy_bootstrap_next_html pagy, link}</ul>) }
|
42
42
|
|
43
43
|
%(<nav#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-bootstrap-nav-js" aria-label="pager" #{
|
44
|
-
|
44
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></nav>)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Javascript combo pagination for bootstrap: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -55,7 +55,7 @@ class Pagy # :nodoc:
|
|
55
55
|
p_pages.to_s.length + 1}rem;">)
|
56
56
|
|
57
57
|
%(<nav#{p_id} class="pagy-bootstrap-combo-nav-js pagination" aria-label="pager"><div class="btn-group" role="group" #{
|
58
|
-
|
58
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
59
59
|
if (p_prev = pagy.prev)
|
60
60
|
link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="prev btn btn-primary"'
|
61
61
|
else
|
data/lib/pagy/extras/bulma.rb
CHANGED
@@ -45,7 +45,7 @@ class Pagy # :nodoc:
|
|
45
45
|
'after' => '</ul>' }
|
46
46
|
|
47
47
|
%(<nav#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-bulma-nav-js pagination is-centered" aria-label="pagination" #{
|
48
|
-
|
48
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></nav>)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Javascript combo pagination for bulma: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -59,7 +59,7 @@ class Pagy # :nodoc:
|
|
59
59
|
|
60
60
|
html = %(<nav#{p_id} class="pagy-bulma-combo-nav-js" aria-label="pagination">)
|
61
61
|
%(#{html}<div class="field is-grouped is-grouped-centered" role="group" #{
|
62
|
-
|
62
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
63
63
|
if (p_prev = pagy.prev)
|
64
64
|
%(<p class="control">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'class="button" aria-label="previous page"'}</p>)
|
65
65
|
else
|
@@ -38,7 +38,7 @@ class Pagy # :nodoc:
|
|
38
38
|
'after' => %(#{pagy_foundation_next_html pagy, link}</ul>) }
|
39
39
|
|
40
40
|
%(<nav#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-foundation-nav-js" aria-label="Pagination" #{
|
41
|
-
|
41
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></nav>)
|
42
42
|
end
|
43
43
|
|
44
44
|
# Javascript combo pagination for Foundation: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -52,7 +52,7 @@ class Pagy # :nodoc:
|
|
52
52
|
p_pages.to_s.length + 1}rem; padding: 0 0.3rem; margin: 0 0.3rem;">)
|
53
53
|
|
54
54
|
%(<nav#{p_id} class="pagy-foundation-combo-nav-js" aria-label="Pagination"><div class="input-group" #{
|
55
|
-
|
55
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
56
56
|
if (p_prev = pagy.prev)
|
57
57
|
link.call p_prev, pagy_t('pagy.nav.prev'),
|
58
58
|
'style="margin-bottom: 0" aria-label="previous" class="prev button primary"'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'base64'
|
4
4
|
|
5
5
|
class Pagy # :nodoc:
|
6
6
|
DEFAULT[:steps] = false # default false will use {0 => @vars[:size]}
|
@@ -44,17 +44,19 @@ class Pagy # :nodoc:
|
|
44
44
|
# Additions for the Frontend
|
45
45
|
module Frontend
|
46
46
|
if defined?(Oj)
|
47
|
-
# Return a
|
48
|
-
|
47
|
+
# Return a data tag with the base64 encoded JSON-serialized args generated with the faster oj gem
|
48
|
+
# Base64 encoded JSON is smaller than HTML escaped JSON
|
49
|
+
def pagy_data(pagy, *args)
|
49
50
|
args << pagy.vars[:page_param] if pagy.vars[:trim_extra]
|
50
|
-
%(data-pagy
|
51
|
+
%(data-pagy="#{Base64.strict_encode64(Oj.dump(args, mode: :strict))}")
|
51
52
|
end
|
52
53
|
else
|
53
54
|
require 'json'
|
54
|
-
# Return a
|
55
|
-
|
55
|
+
# Return a data tag with the base64 encoded JSON-serialized args generated with the slower to_json
|
56
|
+
# Base64 encoded JSON is smaller than HTML escaped JSON
|
57
|
+
def pagy_data(pagy, *args)
|
56
58
|
args << pagy.vars[:page_param] if pagy.vars[:trim_extra]
|
57
|
-
%(data-pagy
|
59
|
+
%(data-pagy="#{Base64.strict_encode64(args.to_json)}")
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
data/lib/pagy/extras/items.rb
CHANGED
@@ -39,7 +39,7 @@ class Pagy # :nodoc:
|
|
39
39
|
link = pagy_marked_link(pagy_link_proc(pagy, link_extra: link_extra))
|
40
40
|
p_vars[:items] = p_items # restore the items
|
41
41
|
|
42
|
-
html = +%(<span#{p_id} class="pagy-items-selector-js" #{
|
42
|
+
html = +%(<span#{p_id} class="pagy-items-selector-js" #{pagy_data(pagy, :selector, pagy.from, link)}>)
|
43
43
|
input = %(<input type="number" min="1" max="#{p_vars[:max_items]}" value="#{
|
44
44
|
p_items}" style="padding: 0; text-align: center; width: #{p_items.to_s.length + 1}rem;">)
|
45
45
|
html << pagy_t('pagy.items_selector_js', item_name: item_name || pagy_t(i18n_key || p_vars[:i18n_key], count: p_items),
|
@@ -39,7 +39,7 @@ class Pagy # :nodoc:
|
|
39
39
|
'after' => %(#{pagy_materialize_next_html pagy, link}</ul>) }
|
40
40
|
|
41
41
|
%(<div#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-materialize-nav-js" role="navigation" aria-label="pager" #{
|
42
|
-
|
42
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></div>)
|
43
43
|
end
|
44
44
|
|
45
45
|
# Javascript combo pagination for materialize: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -54,7 +54,7 @@ class Pagy # :nodoc:
|
|
54
54
|
|
55
55
|
html = %(<ul#{p_id} class="pagy-materialize-combo-nav-js pagination chip" role="navigation")
|
56
56
|
%(#{html} aria-label="pager" style="padding-right: 0" #{
|
57
|
-
|
57
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
58
58
|
pagy_materialize_prev_html pagy, link, style}<li class="pagy-combo-input">#{
|
59
59
|
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages}</li>#{
|
60
60
|
pagy_materialize_next_html pagy, link, style}</ul>)
|
data/lib/pagy/extras/navs.rb
CHANGED
@@ -19,7 +19,7 @@ class Pagy # :nodoc:
|
|
19
19
|
'after' => pagy_nav_next_html(pagy, link) }
|
20
20
|
|
21
21
|
%(<nav#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-nav-js pagination" aria-label="pager" #{
|
22
|
-
|
22
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></nav>)
|
23
23
|
end
|
24
24
|
|
25
25
|
# Javascript combo pagination: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -32,7 +32,7 @@ class Pagy # :nodoc:
|
|
32
32
|
p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length + 1}rem;">)
|
33
33
|
|
34
34
|
%(<nav#{p_id} class="pagy-combo-nav-js pagination" aria-label="pager" #{
|
35
|
-
|
35
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
36
36
|
pagy_nav_prev_html pagy, link
|
37
37
|
}<span class="pagy-combo-input" style="margin: 0 0.6rem;">#{
|
38
38
|
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages
|
data/lib/pagy/extras/semantic.rb
CHANGED
@@ -38,7 +38,7 @@ class Pagy # :nodoc:
|
|
38
38
|
'after' => pagy_semantic_next_html(pagy, link) }
|
39
39
|
|
40
40
|
%(<div#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-semantic-nav-js ui pagination menu" role="navigation" #{
|
41
|
-
|
41
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></div>)
|
42
42
|
end
|
43
43
|
|
44
44
|
# Combo pagination for semantic: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -51,7 +51,7 @@ class Pagy # :nodoc:
|
|
51
51
|
p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length + 1}rem; margin: 0 0.3rem">)
|
52
52
|
|
53
53
|
%(<div#{p_id} class="pagy-semantic-combo-nav-js ui compact menu" role="navigation" #{
|
54
|
-
|
54
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))}>#{
|
55
55
|
pagy_semantic_prev_html pagy, link
|
56
56
|
}<div class="pagy-combo-input item">#{
|
57
57
|
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages
|
data/lib/pagy/extras/uikit.rb
CHANGED
@@ -37,7 +37,7 @@ class Pagy # :nodoc:
|
|
37
37
|
'after' => pagy_uikit_next_html(pagy, link) }
|
38
38
|
|
39
39
|
%(<ul#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-uikit-nav-js uk-pagination uk-flex-center" #{
|
40
|
-
|
40
|
+
pagy_data(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></ul>)
|
41
41
|
end
|
42
42
|
|
43
43
|
# Javascript combo pagination for uikit: it returns a nav and a JSON tag used by the pagy.js file
|
@@ -50,7 +50,7 @@ class Pagy # :nodoc:
|
|
50
50
|
p_page}" style="text-align: center; width: #{p_pages.to_s.length + 1}rem;">)
|
51
51
|
|
52
52
|
%(<ul#{p_id} class="pagy-uikit-combo-nav-js uk-button-group uk-pagination uk-flex-center" #{
|
53
|
-
|
53
|
+
pagy_data(pagy, :combo, pagy_marked_link(link))
|
54
54
|
}>#{
|
55
55
|
pagy_uikit_prev_html pagy, link
|
56
56
|
}<li>#{
|
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: 5.
|
4
|
+
version: 5.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Agnostic pagination in plain ruby. It does it all. Better.
|
14
14
|
email:
|