pagy 5.7.5 → 5.7.6

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: c5bc1c84a1f90fa31a110f50b24de244340c92aa5802af474c7fce568ac8c8ed
4
- data.tar.gz: bbaa9a6574a34d2e02f9ca058a685269da0d17826f198fcc2b5ac1fd3ea49c2b
3
+ metadata.gz: c2ba89b39ddd05c962a460896985db21b50b0e04c7d291eae8152b378e8a74d1
4
+ data.tar.gz: 727367875688206becbc6da61dec35853be418eadbed1474176fa4285cd0b58c
5
5
  SHA512:
6
- metadata.gz: 21bca1edbbfd7a2fad5310b50fa6e6e09168e6e357d4f76017d2d6af2d47c6f0e93ed1cf5daecd5b456bb0ef27398b25de61cd40873dc896eda252d0a0b4f703
7
- data.tar.gz: d46828e39f61c057f286e724960949b2dc875a41bfeec20e55f80e6cd7856661f6f3e7ce601d437f076a090462832d7ef0d538a5378470792e8429fc2c5db8f1
6
+ metadata.gz: f304e8f7f82e8efad5eceba127c3678b5a86a1b82d2c20336880364ef53665c45581aa6f5d6d7687c567139c692575a89d704ed3c8c705950fa83dcea534cce3
7
+ data.tar.gz: 1e61bc678f6580ad5afa3fdf5b88059cc209be6ccc6ff3443f532a0f5667e12345013129ebdafe23cb7f46f4493fc90a453fca8fd3b2ee2048694daf3061cf1b
data/lib/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (5.7.5)
3
+ # Pagy initializer file (5.7.6)
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,15 +1,14 @@
1
1
  "use strict";
2
2
  const Pagy = {
3
- version: "5.7.5",
3
+ version: "5.7.6",
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;
7
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
8
  for (const element of elements) {
10
- const json = element.getAttribute("data-pagy-json");
11
9
  try {
12
- const [keyword, ...args] = JSON.parse(json);
10
+ const jsonString = element.getAttribute("data-pagy-json");
11
+ const [keyword, ...args] = JSON.parse(jsonString);
13
12
  if (keyword === "nav") {
14
13
  Pagy.initNav(element, args);
15
14
  }
@@ -20,18 +19,19 @@ const Pagy = {
20
19
  Pagy.initSelector(element, args);
21
20
  }
22
21
  else {
23
- warn(element, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
22
+ Pagy.initWarn(element, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
24
23
  }
25
24
  }
26
25
  catch (err) {
27
- warn(element, err);
26
+ Pagy.initWarn(element, err);
28
27
  }
29
28
  }
30
29
  },
30
+ initWarn(el, err) { console.warn("Pagy.init() skipped element: %o\n%s", el, err); },
31
31
  // Init the *_nav_js helpers
32
32
  initNav(el, [tags, sequels, labelSequels, trimParam]) {
33
33
  const container = el.parentElement ?? el;
34
- const widths = Object.getOwnPropertyNames(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
34
+ const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
35
35
  let lastWidth = -1;
36
36
  const fillIn = (link, page, label) => link.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
37
37
  (el.pagyRender = function () {
@@ -69,9 +69,7 @@ const Pagy = {
69
69
  },
70
70
  // The observer instance for responsive navs
71
71
  rjsObserver: new ResizeObserver(entries => {
72
- entries.filter(e => e.contentBoxSize)
73
- .forEach(e => e.target.querySelectorAll(".pagy-rjs")
74
- .forEach(rjs => rjs.pagyRender()));
72
+ entries.forEach(e => e.target.querySelectorAll(".pagy-rjs").forEach(el => el.pagyRender()));
75
73
  }),
76
74
  // Init the *_combo_nav_js helpers
77
75
  initCombo(el, [link, trimParam]) {
@@ -115,4 +113,4 @@ const Pagy = {
115
113
  // Trim the ${page-param}=1 params in links
116
114
  trim: (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "")
117
115
  };
118
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWVBLE1BQU0sSUFBSSxHQUFHO0lBQ1QsT0FBTyxFQUFFLE9BQU87SUFFaEIsNkZBQTZGO0lBQzdGLElBQUksQ0FBQyxHQUFrQjtRQUNuQixNQUFNLE1BQU0sR0FBSyxHQUFHLFlBQVksT0FBTyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztRQUN6RCxNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsZ0JBQWdCLENBQUMsa0JBQWtCLENBQUMsQ0FBQztRQUM3RCxNQUFNLElBQUksR0FBTyxDQUFDLEVBQVUsRUFBRSxHQUFXLEVBQUUsRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMscUNBQXFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsQ0FBQyxDQUFDO1FBQzNHLEtBQUssTUFBTSxPQUFPLElBQUksUUFBUSxFQUFFO1lBQzVCLE1BQU0sSUFBSSxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsZ0JBQWdCLENBQVcsQ0FBQztZQUM5RCxJQUFJO2dCQUNBLE1BQU0sQ0FBQyxPQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBYSxDQUFDO2dCQUN4RCxJQUFJLE9BQU8sS0FBSyxLQUFLLEVBQUU7b0JBQ25CLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBcUIsRUFBRSxJQUF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XJnZXQgICA9IGFyZyBpbnN0YW5jZW9mIEVsZW1lbnQgPyBhcmcgOiBkb2N1bWVudDtcbiAgICAgICAgY29uc3QgZWxlbWVudHMgPSB0YXJnZXQucXVlcnlTZWxlY3RvckFsbChcIltkYXRhLXBhZ3ktanNvbl1cIik7XG4gICAgICAgIGNvbnN0IHdhcm4gICAgID0gKGVsOkVsZW1lbnQsIGVycjp1bmtub3duKSA9PiBjb25zb2xlLndhcm4oXCJQYWd5LmluaXQoKSBza2lwcGVkIGVsZW1lbnQ6ICVvXFxuJXNcIiwgZWwsIGVycik7XG4gICAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiBlbGVtZW50cykge1xuICAgICAgICAgICAgY29uc3QganNvbiA9IGVsZW1lbnQuZ2V0QXR0cmlidXRlKFwiZGF0YS1wYWd5LWpzb25cIikgYXMgc3RyaW5nO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKGpzb24pIGFzIFBhZ3lKU09OO1xuICAgICAgICAgICAgICAgIGlmIChrZXl3b3JkID09PSBcIm5hdlwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdE5hdihlbGVtZW50IGFzIE5hdkVsZW1lbnQsIGFyZ3MgYXMgTmF2QXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgUGFneS5pbml0Q29tYm8oZWxlbWVudCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdFNlbGVjdG9yKGVsZW1lbnQsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge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gaWYgKHdpZHRoID09PSBsYXN0V2lkdGgpIHsgcmV0dXJuIH0gLy8gbm8gY2hhbmdlOiBhYm9ydFxuICAgICAgICAgICAgbGV0IGh0bWwgICAgID0gdGFncy5iZWZvcmU7XG4gICAgICAgICAgICBjb25zdCBzZXJpZXMgPSBzZXF1ZWxzW3dpZHRoLnRvU3RyaW5nKCldO1xuICAgICAgICAgICAgY29uc3QgbGFiZWxzID0gbGFiZWxTZXF1ZWxzPy5bd2lkdGgudG9TdHJpbmcoKV0gPz8gc2VyaWVzLm1hcChsID0+IGwudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGkgaW4gc2VyaWVzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgaXRlbSAgPSBzZXJpZXNbaV07XG4gICAgICAgICAgICAgICAgY29uc3QgbGFiZWwgPSBsYWJlbHNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgaXRlbSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBodG1sICs9IFBhZ3kudHJpbShmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKSwgdHJpbVBhcmFtKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gZmlsbEluKHRhZ3MubGluaywgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtID09PSBcImdhcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gdGFncy5nYXA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gYWN0aXZlIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5hY3RpdmUsIGl0ZW0sIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBodG1sICs9IHRhZ3MuYWZ0ZXI7ICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBhbGlnbi1hc3NpZ25tZW50cy9hbGlnbi1hc3NpZ25tZW50c1xuICAgICAgICAgICAgZWwuaW5uZXJIVE1MID0gXCJcIjtcbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICBsYXN0V2lkdGggPSB3aWR0aDtcbiAgICAgICAgfSkoKTtcbiAgICAgICAgaWYgKGVsLmNsYXNzTGlzdC5jb250YWlucyhcInBhZ3ktcmpzXCIpKSB7IFBhZ3kucmpzT2JzZXJ2ZXIub2JzZXJ2ZShjb250YWluZXIpIH1cbiAgICB9LFxuXG4gICAgLy8gVGhlIG9ic2VydmVyIGluc3RhbmNlIGZvciByZXNwb25zaXZlIG5hdnNcbiAgICByanNPYnNlcnZlcjogbmV3IFJlc2l6ZU9ic2VydmVyKGVudHJpZXMgPT4ge1xuICAgICAgICBlbnRyaWVzLmZpbHRlcihlID0+IGUuY29udGVudEJveFNpemUpXG4gICAgICAgICAgICAgICAuZm9yRWFjaChlID0+IGUudGFyZ2V0LnF1ZXJ5U2VsZWN0b3JBbGw8TmF2RWxlbWVudD4oXCIucGFneS1yanNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZm9yRWFjaChyanMgPT4gcmpzLnBhZ3lSZW5kZXIoKSkpO1xuICAgIH0pLFxuXG4gICAgLy8gSW5pdCB0aGUgKl9jb21ib19uYXZfanMgaGVscGVyc1xuICAgIGluaXRDb21ibyhlbDpFbGVtZW50LCBbbGluaywgdHJpbVBhcmFtXTpDb21ib0FyZ3MpIHtcbiAgICAgICAgUGFneS5pbml0SW5wdXQoZWwsIGlucHV0VmFsdWUgPT4gW2lucHV0VmFsdWUsIGxpbmsucmVwbGFj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LXBhZ3ktanNvblwiIGVsZW1lbnRzLCBwYXJzZSB0aGVpciBKU09OIGNvbnRlbnQgYW5kIGNhbGwgdGhlaXIgaW5pdCBmdW5jdGlvbnNcbiAgICBpbml0KGFyZz86RWxlbWVudHxuZXZlcikge1xuICAgICAgICBjb25zdCB0YXJnZXQgICA9IGFyZyBpbnN0YW5jZW9mIEVsZW1lbnQgPyBhcmcgOiBkb2N1bWVudDtcbiAgICAgICAgY29uc3QgZWxlbWVudHMgPSB0YXJnZXQucXVlcnlTZWxlY3RvckFsbChcIltkYXRhLXBhZ3ktanNvbl1cIik7XG4gICAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiBlbGVtZW50cykge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBjb25zdCBqc29uU3RyaW5nICAgICAgICAgPSBlbGVtZW50LmdldEF0dHJpYnV0ZShcImRhdGEtcGFneS1qc29uXCIpIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKGpzb25TdHJpbmcpIGFzIFBhZ3lKU09OO1xuICAgICAgICAgICAgICAgIGlmIChrZXl3b3JkID09PSBcIm5hdlwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdE5hdihlbGVtZW50IGFzIE5hdkVsZW1lbnQsIGFyZ3MgYXMgTmF2QXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgUGFneS5pbml0Q29tYm8oZWxlbWVudCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIFBhZ3kuaW5pdFNlbGVjdG9yKGVsZW1lbnQsIGFyZ3MgYXMgU2VsZWN0b3JBcmdz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1xuICAgICAgICAoZWwucGFneVJlbmRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSB3aWR0aHMuZmluZCh3ID0+IHcgPCBjb250YWluZXIuY2xpZW50V2lkdGgpIHx8IDA7XG4gICAgICAgICAgICBpZiAod2lkdGggPT09IGxhc3RXaWR0aCkgeyByZXR1cm4gfSAvLyBubyBjaGFuZ2U6IGFib3J0XG4gICAgICAgICAgICBsZXQgaHRtbCAgICAgPSB0YWdzLmJlZm9yZTtcbiAgICAgICAgICAgIGNvbnN0IHNlcmllcyA9IHNlcXVlbHNbd2lkdGgudG9TdHJpbmcoKV07XG4gICAgICAgICAgICBjb25zdCBsYWJlbHMgPSBsYWJlbFNlcXVlbHM/Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtICA9IHNlcmllc1tpXTtcbiAgICAgICAgICAgICAgICBjb25zdCBsYWJlbCA9IGxhYmVsc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyaW1QYXJhbSA9PT0gXCJzdHJpbmdcIiAmJiBpdGVtID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gUGFneS50cmltKGZpbGxJbih0YWdzLmxpbmssIGl0ZW0udG9TdHJpbmcoKSwgbGFiZWwpLCB0cmltUGFyYW0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGl0ZW0gPT09IFwibnVtYmVyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSBmaWxsSW4odGFncy5saW5rLCBpdGVtLnRvU3RyaW5nKCksIGxhYmVsKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGl0ZW0gPT09IFwiZ2FwXCIpIHtcbiAgICAgICAg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gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBhY3Rpb25cbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImtleXByZXNzXCIsIGUgPT4geyBpZiAoZS5rZXkgPT09IFwiRW50ZXJcIikgeyBhY3Rpb24oKSB9IH0pOyAvLyB0cmlnZ2VyIGFjdGlvblxuICAgIH0sXG5cbiAgICAvLyBUcmltIHRoZSAke3BhZ2UtcGFyYW19PTEgcGFyYW1zIGluIGxpbmtzXG4gICAgdHJpbTogKGxpbms6c3RyaW5nLCBwYXJhbTpzdHJpbmcpID0+IGxpbmsucmVwbGFjZShuZXcgUmVnRXhwKGBbPyZdJHtwYXJhbX09MVxcXFxiKD8hJil8XFxcXGIke3BhcmFtfT0xJmApLCBcIlwiKVxufTtcbiJdfQ==
@@ -20,6 +20,7 @@ interface NavElement extends Element {
20
20
  declare const Pagy: {
21
21
  version: string;
22
22
  init(arg?: Element | never): void;
23
+ initWarn(el: Element, err: unknown): void;
23
24
  initNav(el: NavElement, [tags, sequels, labelSequels, trimParam]: NavArgs): void;
24
25
  rjsObserver: ResizeObserver;
25
26
  initCombo(el: Element, [link, trimParam]: ComboArgs): void;
@@ -1,14 +1,13 @@
1
1
  const Pagy = {
2
- version: "5.7.5",
2
+ version: "5.7.6",
3
3
  // Scan for "data-pagy-json" elements, parse their JSON content and call their init functions
4
4
  init(arg) {
5
5
  const target = arg instanceof Element ? arg : document;
6
6
  const elements = target.querySelectorAll("[data-pagy-json]");
7
- const warn = (el, err) => console.warn("Pagy.init() skipped element: %o\n%s", el, err);
8
7
  for (const element of elements) {
9
- const json = element.getAttribute("data-pagy-json");
10
8
  try {
11
- const [keyword, ...args] = JSON.parse(json);
9
+ const jsonString = element.getAttribute("data-pagy-json");
10
+ const [keyword, ...args] = JSON.parse(jsonString);
12
11
  if (keyword === "nav") {
13
12
  Pagy.initNav(element, args);
14
13
  }
@@ -19,18 +18,19 @@ const Pagy = {
19
18
  Pagy.initSelector(element, args);
20
19
  }
21
20
  else {
22
- warn(element, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
21
+ Pagy.initWarn(element, `Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "${keyword}"`);
23
22
  }
24
23
  }
25
24
  catch (err) {
26
- warn(element, err);
25
+ Pagy.initWarn(element, err);
27
26
  }
28
27
  }
29
28
  },
29
+ initWarn(el, err) { console.warn("Pagy.init() skipped element: %o\n%s", el, err); },
30
30
  // Init the *_nav_js helpers
31
31
  initNav(el, [tags, sequels, labelSequels, trimParam]) {
32
32
  const container = el.parentElement ?? el;
33
- const widths = Object.getOwnPropertyNames(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
33
+ const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
34
34
  let lastWidth = -1;
35
35
  const fillIn = (link, page, label) => link.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
36
36
  (el.pagyRender = function () {
@@ -68,9 +68,7 @@ const Pagy = {
68
68
  },
69
69
  // The observer instance for responsive navs
70
70
  rjsObserver: new ResizeObserver(entries => {
71
- entries.filter(e => e.contentBoxSize)
72
- .forEach(e => e.target.querySelectorAll(".pagy-rjs")
73
- .forEach(rjs => rjs.pagyRender()));
71
+ entries.forEach(e => e.target.querySelectorAll(".pagy-rjs").forEach(el => el.pagyRender()));
74
72
  }),
75
73
  // Init the *_combo_nav_js helpers
76
74
  initCombo(el, [link, trimParam]) {
@@ -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.5",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}();
1
+ !function(){function n(n){if(Array.isArray(n))return n}function t(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(r,i){return n(r)||t(r)||e()}var i={version:"5.7.6",init:function(r){var a,o=(r instanceof Element?r:document).querySelectorAll("[data-pagy-json]"),c=!0,u=!1,l=void 0;try{for(var f,s=o[Symbol.iterator]();!(c=(f=s.next()).done);c=!0){var p=f.value;try{var v=p.getAttribute("data-pagy-json"),g=n(a=JSON.parse(v))||t(a)||e(),y=g[0],d=g.slice(1);"nav"===y?i.initNav(p,d):"combo"===y?i.initCombo(p,d):"selector"===y?i.initSelector(p,d):i.initWarn(p,'Illegal PagyJSON keyword: expected "nav"|"combo"|"selector", got "'.concat(y,'"'))}catch(n){i.initWarn(p,n)}}}catch(n){u=!0,l=n}finally{try{c||null==s.return||s.return()}finally{if(u)throw l}}},initWarn:function(n,t){console.warn("Pagy.init() skipped element: %o\n%s",n,t)},initNav:function(n,t){var e,a=r(t),o=a[0],c=a[1],u=a[2],l=a[3],f=null!==(e=n.parentElement)&&void 0!==e?e:n,s=Object.keys(c).map((function(n){return parseInt(n)})).sort((function(n,t){return t-n})),p=-1,v=function(n,t,e){return n.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,e)};(n.pagyRender=function(){var t=s.find((function(n){return n<f.clientWidth}))||0;if(t!==p){var e,r=o.before,a=c[t.toString()],g=null!==(e=null==u?void 0:u[t.toString()])&&void 0!==e?e:a.map((function(n){return n.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,n.innerHTML="",n.insertAdjacentHTML("afterbegin",r),p=t}})(),n.classList.contains("pagy-rjs")&&i.rjsObserver.observe(f)},rjsObserver:new ResizeObserver((function(n){n.forEach((function(n){return n.target.querySelectorAll(".pagy-rjs").forEach((function(n){return n.pagyRender()}))}))})),initCombo:function(n,t){var e=r(t),a=e[0],o=e[1];i.initInput(n,(function(n){return[n,a.replace(/__pagy_page__/,n)]}),o)},initSelector:function(n,t){var e=r(t),a=e[0],o=e[1],c=e[2];i.initInput(n,(function(n){var t=Math.max(Math.ceil(a/parseInt(n)),1).toString();return[t,o.replace(/__pagy_page__/,t).replace(/__pagy_items__/,n)]}),c)},initInput:function(n,t,e){var a=n.querySelector("input"),o=a.value,c=function(){if(a.value!==o){var c=r([a.min,a.value,a.max].map((function(n){return parseInt(n)||0}))),u=c[0],l=c[1],f=c[2];if(l<u||l>f)return a.value=o,void a.select();var s=r(t(a.value)),p=s[0],v=s[1];"string"==typeof e&&"1"===p&&(v=i.trim(v,e)),n.insertAdjacentHTML("afterbegin",v),n.querySelector("a").click()}};["change","focus"].forEach((function(n){return a.addEventListener(n,a.select)})),a.addEventListener("focusout",c),a.addEventListener("keypress",(function(n){"Enter"===n.key&&c()}))},trim:function(n,t){return n.replace(new RegExp("[?&]".concat(t,"=1\\b(?!&)|\\b").concat(t,"=1&")),"")}},a=i;window.Pagy=a}();
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.5'
8
+ VERSION = '5.7.6'
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.5
4
+ version: 5.7.6
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-13 00:00:00.000000000 Z
11
+ date: 2022-01-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Agnostic pagination in plain ruby. It does it all. Better.
14
14
  email: