pagy 5.7.3 → 5.7.4
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 +4 -2
- data/lib/javascripts/pagy-module.d.ts +30 -0
- data/lib/javascripts/{pagy.mjs → pagy-module.js} +2 -2
- data/lib/javascripts/pagy.js +1 -1
- data/lib/pagy.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffee9e2ec41fcebb3b4e4abdaf1cb8e275020175cd8a7c654be1ff1f3c3f8a82
|
4
|
+
data.tar.gz: 5ab1e068ad52d7b1a4dea955e10e0b6fcf9ffdf1424ddc9f955a7471d713853d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f260102ec456d5b151d066576d5890d6bccb6510386cad6aa3566d9fec3b997f74ecc0cb8f2bc7127664f525c2c907cfa87050814366e14203aecd51ea0a4299
|
7
|
+
data.tar.gz: 18d1e9028eedef735f1d17e01d13bbbff97edefe74660e2422b8be67c1c3a90057adc9c9ad1417f63b4bd7ce5b9003647e4dd2a10fe7ab6322f3dd168d28d524
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (5.7.
|
3
|
+
# Pagy initializer file (5.7.4)
|
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,6 +1,7 @@
|
|
1
|
-
|
1
|
+
/* Generated from 'src/pagy.ts' with TypeScript Version 4.5.4 */
|
2
|
+
"use strict";
|
2
3
|
const Pagy = {
|
3
|
-
version: "5.7.
|
4
|
+
version: "5.7.4",
|
4
5
|
// Scan for "data-pagy-json" elements, parse their JSON content and call their init functions
|
5
6
|
init(arg) {
|
6
7
|
const target = arg instanceof Element ? arg : document;
|
@@ -115,3 +116,4 @@ const Pagy = {
|
|
115
116
|
// Trim the ${page-param}=1 params in links
|
116
117
|
trim: (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "")
|
117
118
|
};
|
119
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWdCQSxNQUFNLElBQUksR0FBRztJQUNULE9BQU8sRUFBRSxPQUFPO0lBRWhCLDZGQUE2RjtJQUM3RixJQUFJLENBQUMsR0FBa0I7UUFDbkIsTUFBTSxNQUFNLEdBQUssR0FBRyxZQUFZLE9BQU8sQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUM7UUFDekQsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLGdCQUFnQixDQUFDLGtCQUFrQixDQUFDLENBQUM7UUFDN0QsTUFBTSxJQUFJLEdBQU8sQ0FBQyxFQUFVLEVBQUUsR0FBVyxFQUFFLEVBQUUsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLHFDQUFxQyxFQUFFLEVBQUUsRUFBRSxHQUFHLENBQUMsQ0FBQztRQUMzRyxLQUFLLE1BQU0sT0FBTyxJQUFJLFFBQVEsRUFBRTtZQUM1QixNQUFNLElBQUksR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDLGdCQUFnQixDQUFXLENBQUM7WUFDOUQsSUFBSTtnQkFDQSxNQUFNLENBQUMsT0FBTyxFQUFFLEdBQUcsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQW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RzLCBwYXJzZSB0aGVpciBKU09OIGNvbnRlbnQgYW5kIGNhbGwgdGhlaXIgaW5pdCBmdW5jdGlvbnNcbiAgICBpbml0KGFyZz86RWxlbWVudHxuZXZlcikge1xuICAgICAgICBjb25zdCB0YXJnZXQgICA9IGFyZyBpbnN0YW5jZW9mIEVsZW1lbnQgPyBhcmcgOiBkb2N1bWVudDtcbiAgICAgICAgY29uc3QgZWxlbWVudHMgPSB0YXJnZXQucXVlcnlTZWxlY3RvckFsbChcIltkYXRhLXBhZ3ktanNvbl1cIik7XG4gICAgICAgIGNvbnN0IHdhcm4gICAgID0gKGVsOkVsZW1lbnQsIGVycjp1bmtub3duKSA9PiBjb25zb2xlLndhcm4oXCJQYWd5LmluaXQoKSBza2lwcGVkIGVsZW1lbnQ6ICVvXFxuJXNcIiwgZWwsIGVycik7XG4gICAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiBlbGVtZW50cykge1xuICAgICAgICAgICAgY29uc3QganNvbiA9IGVsZW1lbnQuZ2V0QXR0cmlidXRlKFwiZGF0YS1wYWd5LWpzb25cIikgYXMgc3RyaW5nO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKGpzb24pIGFzIFBhZ3lKU09OO1xuICAgICAgICAgICAgICAgIGlmIChrZXl3b3JkID09PSBcIm5hdlwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdE5hdihlbGVtZW50IGFzIE5hdkVsZW1lbnQsIGFyZ3MgYXMgTmF2QXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgUGFneS5pbml0Q29tYm8oZWxlbWVudCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxl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kZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gd2lkdGhzLmZpbmQodyA9PiB3IDwgY29udGFpbmVyLmNsaWVudFdpZHRoKSB8fCAwO1xuICAgICAgICAgICAgaWYgKHdpZHRoID09PSBsYXN0V2lkdGgpIHsgcmV0dXJuIH0gLy8gbm8gY2hhbmdlOiBhYm9ydFxuICAgICAgICAgICAgbGV0IGh0bWwgICAgID0gdGFncy5iZWZvcmU7XG4gICAgICAgICAgICBjb25zdCBzZXJpZXMgPSBzZXF1ZWxzW3dpZHRoLnRvU3RyaW5nKCldO1xuICAgICAgICAgICAgY29uc3QgbGFiZWxzID0gbGFiZWxTZXF1ZWxzPy5bd2lkdGgudG9TdHJpbmcoKV0gPz8gc2VyaWVzLm1hcChsID0+IGwudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGkgaW4gc2VyaWVzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgaXRlbSAgPSBzZXJpZXNbaV07XG4gICAgICAgICAgICAgICAgY29uc3QgbGFiZWwgPSBsYWJlbHNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgaXRlbSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBodG1sICs9IFBhZ3kudHJpbShmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKSwgdHJpbVBhcmFtKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gZmlsbEluKHRhZ3MubGluaywgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtID09PSBcImdhcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gdGFncy5nYXA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gYWN0aXZlIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5hY3RpdmUsIGl0ZW0sIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBodG1sICs9IHRhZ3MuYWZ0ZXI7ICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBhbGlnbi1hc3NpZ25tZW50cy9hbGlnbi1hc3NpZ25tZW50c1xuICAgICAgICAgICAgZWwuaW5uZXJIVE1MID0gXCJcIjtcbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICBsYXN0V2lkdGggPSB3aWR0aDtcbiAgICAgICAgfSkoKTtcbiAgICAgICAgaWYgKGVsLmNsYXNzTGlzdC5jb250YWlucyhcInBhZ3ktcmpzXCIpKSB7IFBhZ3kucmpzT2JzZXJ2ZXIub2JzZXJ2ZShjb250YWluZXIpIH1cbiAgICB9LFxuXG4gICAgLy8gVGhlIG9ic2VydmVyIGluc3RhbmNlIGZvciByZXNwb25zaXZlIG5hdnNcbiAgICByanNPYnNlcnZlcjogbmV3IFJlc2l6ZU9ic2VydmVyKGVudHJpZXMgPT4ge1xuICAgICAgICBlbnRyaWVzLmZpbHRlcihlID0+IGUuY29udGVudEJveFNpemUpXG4gICAgICAgICAgICAgICAuZm9yRWFjaChlID0+IGUudGFyZ2V0LnF1ZXJ5U2VsZWN0b3JBbGw8TmF2RWxlbWVudD4oXCIucGFneS1yanNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZm9yRWFjaChyanMgPT4gcmpzLnBhZ3lSZW5kZXIoKSkpO1xuICAgIH0pLFxuXG4gICAgLy8gSW5pdCB0aGUgKl9jb21ib19uYXZfanMgaGVscGVyc1xuICAgIGluaXRDb21ibyhlbDp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VudExpc3RlbmVyKFwiZm9jdXNvdXRcIiwgYWN0aW9uKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0cmlnZ2VyIGFjdGlvblxuICAgICAgICBpbnB1dC5hZGRFdmVudExpc3RlbmVyKFwia2V5cHJlc3NcIiwgZSA9PiB7IGlmIChlLmtleSA9PT0gXCJFbnRlclwiKSB7IGFjdGlvbigpIH0gfSk7IC8vIHRyaWdnZXIgYWN0aW9uXG4gICAgfSxcblxuICAgIC8vIFRyaW0gdGhlICR7cGFnZS1wYXJhbX09MSBwYXJhbXMgaW4gbGlua3NcbiAgICB0cmltOiAobGluazpzdHJpbmcsIHBhcmFtOnN0cmluZykgPT4gbGluay5yZXBsYWNlKG5ldyBSZWdFeHAoYFs/Jl0ke3BhcmFtfT0xXFxcXGIoPyEmKXxcXFxcYiR7cGFyYW19PTEmYCksIFwiXCIpXG59O1xuIl19
|
@@ -0,0 +1,30 @@
|
|
1
|
+
declare type NavArgs = readonly [Tags, Sequels, null | LabelSequels, string?];
|
2
|
+
declare type ComboArgs = readonly [string, string?];
|
3
|
+
declare type SelectorArgs = readonly [number, string, string?];
|
4
|
+
interface Tags {
|
5
|
+
readonly before: string;
|
6
|
+
readonly link: string;
|
7
|
+
readonly active: string;
|
8
|
+
readonly gap: string;
|
9
|
+
readonly after: string;
|
10
|
+
}
|
11
|
+
interface Sequels {
|
12
|
+
readonly [width: string]: (string | number | "gap")[];
|
13
|
+
}
|
14
|
+
interface LabelSequels {
|
15
|
+
readonly [width: string]: string[];
|
16
|
+
}
|
17
|
+
interface NavElement extends Element {
|
18
|
+
pagyRender(): void;
|
19
|
+
}
|
20
|
+
declare const Pagy: {
|
21
|
+
version: string;
|
22
|
+
init(arg?: Element | never): void;
|
23
|
+
initNav(el: NavElement, [tags, sequels, labelSequels, trimParam]: NavArgs): void;
|
24
|
+
rjsObserver: ResizeObserver;
|
25
|
+
initCombo(el: Element, [link, trimParam]: ComboArgs): void;
|
26
|
+
initSelector(el: Element, [from, link, trimParam]: SelectorArgs): void;
|
27
|
+
initInput(el: Element, getVars: (v: string) => [string, string], trimParam?: string): void;
|
28
|
+
trim: (link: string, param: string) => string;
|
29
|
+
};
|
30
|
+
export default Pagy;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
/* Generated from 'src/pagy.ts' with TypeScript Version 4.5.4 */
|
2
2
|
const Pagy = {
|
3
|
-
version: "5.7.
|
3
|
+
version: "5.7.4",
|
4
4
|
// Scan for "data-pagy-json" elements, parse their JSON content and call their init functions
|
5
5
|
init(arg) {
|
6
6
|
const target = arg instanceof Element ? arg : document;
|
data/lib/javascripts/pagy.js
CHANGED
@@ -1 +1 @@
|
|
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.7.
|
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.7.4",init:function(r){var a,o=(r instanceof Element?r:document).querySelectorAll("[data-pagy-json]"),c=function(t,n){return console.warn("Pagy.init() skipped element: %o\n%s",t,n)},u=!0,l=!1,f=void 0;try{for(var p,s=o[Symbol.iterator]();!(u=(p=s.next()).done);u=!0){var v=p.value,g=v.getAttribute("data-pagy-json");try{var y=t(a=JSON.parse(g))||n(a)||e(),d=y[0],m=y.slice(1);"nav"===d?i.initNav(v,m):"combo"===d?i.initCombo(v,m):"selector"===d?i.initSelector(v,m):c(v,'Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "'.concat(d,'"'))}catch(t){c(v,t)}}}catch(t){l=!0,f=t}finally{try{u||null==s.return||s.return()}finally{if(l)throw f}}},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.getOwnPropertyNames(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],m=g[y];r+="string"==typeof l&&1===d?i.trim(v(o.link,d.toString(),m),l):"number"==typeof d?v(o.link,d.toString(),m):"gap"===d?o.gap:v(o.active,d,m)}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.filter((function(t){return t.contentBoxSize})).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}();
|
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.7.
|
4
|
+
version: 5.7.4
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Agnostic pagination in plain ruby. It does it all. Better.
|
14
14
|
email:
|
@@ -20,8 +20,9 @@ files:
|
|
20
20
|
- LICENSE.txt
|
21
21
|
- lib/config/pagy.rb
|
22
22
|
- lib/javascripts/pagy-dev.js
|
23
|
+
- lib/javascripts/pagy-module.d.ts
|
24
|
+
- lib/javascripts/pagy-module.js
|
23
25
|
- lib/javascripts/pagy.js
|
24
|
-
- lib/javascripts/pagy.mjs
|
25
26
|
- lib/locales/ar.yml
|
26
27
|
- lib/locales/bg.yml
|
27
28
|
- lib/locales/bs.yml
|