pagy 5.7.2 → 5.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38c707df42d0be0b796b5f5127521dc98876c36ddd2f59f4b15b58cdcbb39365
4
- data.tar.gz: 67297b4ade3bb8c07e56c2a9640fd9fbec48b7f3bb3c59c690bc4c78051a396b
3
+ metadata.gz: 3b065a7027d07b5bc504cbd2b80389a2e25168a075a7485d6a0155bd54b36bf4
4
+ data.tar.gz: 345c15d964cf6511adcbdf60514f605c64b83e51dd172849f98d337fcff67696
5
5
  SHA512:
6
- metadata.gz: f5e068d8a5e139859dabf10e281bf83eb2245f439b145559d0ee50e63632d4c8de6edf16c7aa9140aa8c0a39453e596f6e84c5e65714866d08ea1887cf9106db
7
- data.tar.gz: 0cfa89dcde19e35efa752aaf8374fe2335576c6a7ac25b5453a7b513e07e50f7057f169cac1835298ddf2774d6a5db0e7c4684803983d16130720b77a692da7a
6
+ metadata.gz: 16b5e3b3cee1cde9f609260324ad045e45b97ecbb457eb648044b726fcc0735dd16f7909f49066ae21c01589e3dafdf303be19a865d0d71fcebe3e9b325e9fe1
7
+ data.tar.gz: df2a7604efbd881c69977e05a23b4b4125eaf0660410d619dbeafbfed7f42de2f4382f01b91f591bd66a6a799c8f5970deb782ea6ca48e9cb8fe95c018428feb
data/lib/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (5.7.2)
3
+ # Pagy initializer file (5.7.3)
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
 
@@ -1,7 +1,6 @@
1
- "use strict";
2
1
  // The Pagy object
3
2
  const Pagy = {
4
- version: "5.7.2",
3
+ version: "5.7.3",
5
4
  // Scan for "data-pagy-json" elements, parse their JSON content and call their init functions
6
5
  init(arg) {
7
6
  const target = arg instanceof Element ? arg : document;
@@ -116,6 +115,3 @@ const Pagy = {
116
115
  // Trim the ${page-param}=1 params in links
117
116
  trim: (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "")
118
117
  };
119
- // Toplevel var (needed for generating the production file)
120
- window.Pagy = Pagy;
121
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS1kZXYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcGFneS1kZXYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWlCQSxrQkFBa0I7QUFDbEIsTUFBTSxJQUFJLEdBQUc7SUFDVCxPQUFPLEVBQUUsT0FBTztJQUVoQiw2RkFBNkY7SUFDN0YsSUFBSSxDQUFDLEdBQWtCO1FBQ25CLE1BQU0sTUFBTSxHQUFLLEdBQUcsWUFBWSxPQUFPLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDO1FBQ3pELE1BQU0sUUFBUSxHQUFHLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQzdELE1BQU0sSUFBSSxHQUFPLENBQUMsRUFBVSxFQUFFLEdBQVcsRUFBRSxFQUFFLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxxQ0FBcUMsRUFBRSxFQUFFLEVBQUUsR0FBRyxDQUFDLENBQUM7UUFDM0csS0FBSyxNQUFNLE9BQU8sSUFBSSxRQUFRLEVBQUU7WUFDNUIsTUFBTSxJQUFJLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxnQkFBZ0IsQ0FBVyxDQUFDO1lBQzlELElBQUk7Z0JBQ0EsTUFBTSxDQUFDLE9BQU8sRUFBRSxHQUFHLElBQUksQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFhLENBQUM7Z0JBQ3hELElBQU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9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluay5yZXBsYWNlKC9fX3BhZ3lfcGFnZV9fL2csIHBhZ2UpLnJlcGxhY2UoL19fcGFneV9sYWJlbF9fL2csIGxhYmVsKTtcbiAgICAgICAgKGVsLnBhZ3lSZW5kZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gd2lkdGhzLmZpbmQodyA9PiB3IDwgY29udGFpbmVyLmNsaWVudFdpZHRoKSB8fCAwO1xuICAgICAgICAgICAgaWYgKHdpZHRoID09PSBsYXN0V2lkdGgpIHsgcmV0dXJuIH0gLy8gbm8gY2hhbmdlOiBhYm9ydFxuICAgICAgICAgICAgbGV0IGh0bWwgICAgID0gdGFncy5iZWZvcmU7XG4gICAgICAgICAgICBjb25zdCBzZXJpZXMgPSBzZXF1ZWxzW3dpZHRoLnRvU3RyaW5nKCldO1xuICAgICAgICAgICAgY29uc3QgbGFiZWxzID0gbGFiZWxTZXF1ZWxzPy5bd2lkdGgudG9TdHJpbmcoKV0gPz8gc2VyaWVzLm1hcChsID0+IGwudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGkgaW4gc2VyaWVzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgaXRlbSAgPSBzZXJpZXNbaV07XG4gICAgICAgICAgICAgICAgY29uc3QgbGFiZWwgPSBsYWJlbHNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgaXRlbSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBodG1sICs9IFBhZ3kudHJpbShmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKSwgdHJpbVBhcmFtKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gZmlsbEluKHRhZ3MubGluaywgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtID09PSBcImdhcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gdGFncy5nYXA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gYWN0aXZlIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5hY3RpdmUsIGl0ZW0sIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBodG1sICs9IHRhZ3MuYWZ0ZXI7ICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBhbGlnbi1hc3NpZ25tZW50cy9hbGlnbi1hc3NpZ25tZW50c1xuICAgICAgICAgICAgZWwuaW5uZXJIVE1MID0gXCJcIjtcbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICBsYXN0V2lkdGggPSB3aWR0aDtcbiAgICAgICAgfSkoKTtcbiAgICAgICAgaWYgKGVsLmNsYXNzTGlzdC5jb250YWlucyhcInBhZ3ktcmpzXCIpKSB7IFBhZ3kucmpzT2JzZXJ2ZXIub2JzZXJ2ZShjb250YWluZXIpIH1cbiAgICB9LFxuXG4gICAgLy8gVGhlIG9ic2VydmVyIGluc3RhbmNlIGZvciByZXNwb25zaXZlIG5hdnNcbiAgICByanNPYnNlcnZlcjogbmV3IFJlc2l6ZU9ic2VydmVyKGVudHJpZXMgPT4ge1xuICAgICAgICBlbnRyaWVzLmZpbHRlcihlID0+IGUuY29udGVudEJveFNpemUpXG4gICAgICAgICAgICAgICAuZm9yRWFjaChlID0+IGUudGFyZ2V0LnF1ZXJ5U2VsZWN0b3JBbGw8TmF2RWxlbWVudD4oXCIucGFneS1yanNcIilcbiAgICAgICAgICAgICAg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1wiY2hhbmdlXCIsIFwiZm9jdXNcIl0uZm9yRWFjaChlID0+IGlucHV0LmFkZEV2ZW50TGlzdGVuZXIoZSwgaW5wdXQuc2VsZWN0KSk7ICAgICAgICAvLyBhdXRvLXNlbGVjdFxuICAgICAgICBpbnB1dC5hZGRFdmVudExpc3RlbmVyKFwiZm9jdXNvdXRcIiwgYWN0aW9uKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0cmlnZ2VyIGFjdGlvblxuICAgICAgICBpbnB1dC5hZGRFdmVudExpc3RlbmVyKFwia2V5cHJlc3NcIiwgZSA9PiB7IGlmIChlLmtleSA9PT0gXCJFbnRlclwiKSB7IGFjdGlvbigpIH0gfSk7IC8vIHRyaWdnZXIgYWN0aW9uXG4gICAgfSxcblxuICAgIC8vIFRyaW0gdGhlICR7cGFnZS1wYXJhbX09MSBwYXJhbXMgaW4gbGlua3NcbiAgICB0cmltOiAobGluazpzdHJpbmcsIHBhcmFtOnN0cmluZykgPT4gbGluay5yZXBsYWNlKG5ldyBSZWdFeHAoYFs/Jl0ke3BhcmFtfT0xXFxcXGIoPyEmKXxcXFxcYiR7cGFyYW19PTEmYCksIFwiXCIpXG59O1xuXG4vLyBUb3BsZXZlbCB2YXIgKG5lZWRlZCBmb3IgZ2VuZXJhdGluZyB0aGUgcHJvZHVjdGlvbiBmaWxlKVxud2luZG93LlBhZ3kgPSBQYWd5O1xuIl19
@@ -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.2",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&")),"")}};window.Pagy=i}();
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.3",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}();
@@ -0,0 +1,118 @@
1
+ // The Pagy object
2
+ const Pagy = {
3
+ version: "5.7.3",
4
+ // Scan for "data-pagy-json" elements, parse their JSON content and call their init functions
5
+ init(arg) {
6
+ const target = arg instanceof Element ? arg : document;
7
+ const elements = target.querySelectorAll("[data-pagy-json]");
8
+ const warn = (el, err) => console.warn("Pagy.init() skipped element: %o\n%s", el, err);
9
+ for (const element of elements) {
10
+ const json = element.getAttribute("data-pagy-json");
11
+ try {
12
+ const [keyword, ...args] = JSON.parse(json);
13
+ if (keyword === "nav") {
14
+ Pagy.initNav(element, args);
15
+ }
16
+ else if (keyword === "combo") {
17
+ Pagy.initCombo(element, args);
18
+ }
19
+ else if (keyword === "selector") {
20
+ Pagy.initSelector(element, args);
21
+ }
22
+ else {
23
+ warn(element, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
24
+ }
25
+ }
26
+ catch (err) {
27
+ warn(element, err);
28
+ }
29
+ }
30
+ },
31
+ // Init the *_nav_js helpers
32
+ initNav(el, [tags, sequels, labelSequels, trimParam]) {
33
+ const container = el.parentElement ?? el;
34
+ const widths = Object.getOwnPropertyNames(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
35
+ let lastWidth = -1;
36
+ const fillIn = (link, page, label) => link.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
37
+ (el.pagyRender = function () {
38
+ const width = widths.find(w => w < container.clientWidth) || 0;
39
+ if (width === lastWidth) {
40
+ return;
41
+ } // no change: abort
42
+ let html = tags.before;
43
+ const series = sequels[width.toString()];
44
+ const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());
45
+ for (const i in series) {
46
+ const item = series[i];
47
+ const label = labels[i];
48
+ if (typeof trimParam === "string" && item === 1) {
49
+ html += Pagy.trim(fillIn(tags.link, item.toString(), label), trimParam);
50
+ }
51
+ else if (typeof item === "number") {
52
+ html += fillIn(tags.link, item.toString(), label);
53
+ }
54
+ else if (item === "gap") {
55
+ html += tags.gap;
56
+ }
57
+ else { // active page
58
+ html += fillIn(tags.active, item, label);
59
+ }
60
+ }
61
+ html += tags.after; // eslint-disable-line align-assignments/align-assignments
62
+ el.innerHTML = "";
63
+ el.insertAdjacentHTML("afterbegin", html);
64
+ lastWidth = width;
65
+ })();
66
+ if (el.classList.contains("pagy-rjs")) {
67
+ Pagy.rjsObserver.observe(container);
68
+ }
69
+ },
70
+ // The observer instance for responsive navs
71
+ rjsObserver: new ResizeObserver(entries => {
72
+ entries.filter(e => e.contentBoxSize)
73
+ .forEach(e => e.target.querySelectorAll(".pagy-rjs")
74
+ .forEach(rjs => rjs.pagyRender()));
75
+ }),
76
+ // Init the *_combo_nav_js helpers
77
+ initCombo(el, [link, trimParam]) {
78
+ Pagy.initInput(el, inputValue => [inputValue, link.replace(/__pagy_page__/, inputValue)], trimParam);
79
+ },
80
+ // Init the items_selector_js helper
81
+ initSelector(el, [from, link, trimParam]) {
82
+ Pagy.initInput(el, inputValue => {
83
+ const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();
84
+ const html = link.replace(/__pagy_page__/, page).replace(/__pagy_items__/, inputValue);
85
+ return [page, html];
86
+ }, trimParam);
87
+ },
88
+ // Init the input element
89
+ initInput(el, getVars, trimParam) {
90
+ const input = el.querySelector("input");
91
+ const initial = input.value;
92
+ const action = function () {
93
+ if (input.value === initial) {
94
+ return;
95
+ } // not changed
96
+ const [min, val, max] = [input.min, input.value, input.max].map(n => parseInt(n) || 0);
97
+ if (val < min || val > max) { // reset invalid/out-of-range
98
+ input.value = initial;
99
+ input.select();
100
+ return;
101
+ }
102
+ let [page, html] = getVars(input.value); // eslint-disable-line prefer-const
103
+ if (typeof trimParam === "string" && page === "1") {
104
+ html = Pagy.trim(html, trimParam);
105
+ }
106
+ el.insertAdjacentHTML("afterbegin", html);
107
+ el.querySelector("a").click();
108
+ };
109
+ ["change", "focus"].forEach(e => input.addEventListener(e, input.select)); // auto-select
110
+ input.addEventListener("focusout", action); // trigger action
111
+ input.addEventListener("keypress", e => { if (e.key === "Enter") {
112
+ action();
113
+ } }); // trigger action
114
+ },
115
+ // Trim the ${page-param}=1 params in links
116
+ trim: (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "")
117
+ };
118
+ export default Pagy;
data/lib/pagy.rb CHANGED
@@ -5,7 +5,7 @@ require 'pathname'
5
5
 
6
6
  # Core class
7
7
  class Pagy
8
- VERSION = '5.7.2'
8
+ VERSION = '5.7.3'
9
9
 
10
10
  # Root pathname to get the path of Pagy files like templates or dictionaries
11
11
  def self.root
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.2
4
+ version: 5.7.3
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 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Agnostic pagination in plain ruby. It does it all. Better.
14
14
  email:
@@ -21,6 +21,7 @@ files:
21
21
  - lib/config/pagy.rb
22
22
  - lib/javascripts/pagy-dev.js
23
23
  - lib/javascripts/pagy.js
24
+ - lib/javascripts/pagy.mjs
24
25
  - lib/locales/ar.yml
25
26
  - lib/locales/bg.yml
26
27
  - lib/locales/bs.yml