pagy 8.4.2 → 8.4.4

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: d283e0b1a2f28d6e05156089b3284b22c3e488626d5501093fdee506260a9825
4
- data.tar.gz: c426766d510f8f229da57fedf0866b9ce9c2b213467a6548fbc760568b3ba973
3
+ metadata.gz: 19b44b228b761cd4b129ee71381cc7d51055988a8974440779d7ab40afd0907c
4
+ data.tar.gz: 5c0a5f51b2d9ad9ce3f75b67bbb366450084f648ba76d98b334de54b7a3f712f
5
5
  SHA512:
6
- metadata.gz: a7009de54deb7819bee599dc5a621f15e12c5de9a1e56c68a4136fb486d5214201f0ad626ec3bf979f3ba0eaadf267f902cc90da67214768a591b53b597ab931
7
- data.tar.gz: fbfc64b79436c808b218166d0efd5448f0ec8d66446091dc6d5a9e70872ae37868dabb92d67224224d2fa41e7c0f87ad294c6bfd67c34c97c492e947a480a562
6
+ metadata.gz: 568929af560338c0c80d4885d9836a95d092b39c3d2578c0b0a0cf8e581df448ed80d04b0d591e8d66eb19f3cb4df97e7c411f7284502c1fedcbc4b5c13cfdcd
7
+ data.tar.gz: c99271f09edc76717b636ef6335cb9bad2bb68b57eadab6a9b1911b2ff9a0091d978db7ad5a73947f9e6d7bc4b9baa8868acf2d70d30b08d29068bef873583ee
data/apps/calendar.ru CHANGED
@@ -18,7 +18,7 @@
18
18
  # DOC
19
19
  # https://ddnexus.github.io/pagy/playground/#4-calendar-app
20
20
 
21
- VERSION = '8.4.2'
21
+ VERSION = '8.4.4'
22
22
 
23
23
  require 'bundler/inline'
24
24
  require 'bundler'
data/apps/demo.ru CHANGED
@@ -18,7 +18,7 @@
18
18
  # DOC
19
19
  # https://ddnexus.github.io/pagy/playground/#3-demo-app
20
20
 
21
- VERSION = '8.4.2'
21
+ VERSION = '8.4.4'
22
22
 
23
23
  require 'bundler/inline'
24
24
  require 'bundler'
@@ -69,7 +69,12 @@ class PagyDemo < Sinatra::Base
69
69
  end
70
70
 
71
71
  get('/javascripts/:file') do
72
- content_type 'application/javascript'
72
+ format = params[:file].split('.').last
73
+ if format == 'js'
74
+ content_type 'application/javascript'
75
+ elsif format == 'map'
76
+ content_type 'application/json'
77
+ end
73
78
  send_file Pagy.root.join('javascripts', params[:file])
74
79
  end
75
80
 
@@ -233,7 +238,7 @@ __END__
233
238
  <html lang="en">
234
239
  <head>
235
240
  <title>Pagy Demo App</title>
236
- <script src="<%= %(/javascripts/#{"pagy#{'-dev' if ENV['DEBUG']}.js"}) %>"></script>
241
+ <script src="/javascripts/pagy.min.js"></script>
237
242
  <script>
238
243
  window.addEventListener("load", Pagy.init);
239
244
  </script>
@@ -242,7 +247,7 @@ __END__
242
247
  <style type="text/css">
243
248
  @media screen { html, body {
244
249
  font-size: 1rem;
245
- line-heigth: 1.2s;
250
+ line-height: 1.2s;
246
251
  padding: 0;
247
252
  margin: 0;
248
253
  } }
@@ -293,7 +298,7 @@ __END__
293
298
  margin-top: .3rem;
294
299
  margin-bottom: 1rem;
295
300
  font-size: .8rem !important;
296
- line-heigth: 1rem !important;
301
+ line-height: 1rem !important;
297
302
  color: white;
298
303
  background-color: rgb(30 30 30);
299
304
  padding: 1rem;
data/apps/rails.ru CHANGED
@@ -15,7 +15,7 @@
15
15
  # DOC
16
16
  # https://ddnexus.github.io/pagy/playground/#2-rails-app
17
17
 
18
- VERSION = '8.4.2'
18
+ VERSION = '8.4.4'
19
19
 
20
20
  # Gemfile
21
21
  require 'bundler/inline'
@@ -46,7 +46,7 @@ class PagyRails < Rails::Application # :nodoc:
46
46
 
47
47
  routes.draw do
48
48
  root to: 'comments#index'
49
- get '/javascript' => 'pagy#javascript'
49
+ get '/javascripts/:file', to: 'pagy#javascripts', file: /.*/
50
50
  end
51
51
  end
52
52
 
@@ -116,9 +116,13 @@ end
116
116
 
117
117
  # You don't need this in real rails apps (see https://ddnexus.github.io/pagy/docs/api/javascript/setup/#2-configure)
118
118
  class PagyController < ActionController::Base
119
- def javascript
120
- file = "pagy#{'-dev' if ENV['DEBUG']}.js"
121
- render js: Pagy.root.join('javascripts', file).read
119
+ def javascripts
120
+ format = params[:file].split('.').last
121
+ if format == 'js'
122
+ render js: Pagy.root.join('javascripts', params[:file]).read
123
+ elsif format == 'map'
124
+ render json: Pagy.root.join('javascripts', params[:file]).read
125
+ end
122
126
  end
123
127
  end
124
128
 
@@ -130,7 +134,7 @@ TEMPLATE = <<~ERB
130
134
  <html>
131
135
  <head>
132
136
  <title>Pagy Rails App</title>
133
- <script src="/javascript"></script>
137
+ <script src="/javascripts/pagy.min.js"></script>
134
138
  <script>
135
139
  window.addEventListener("load", Pagy.init);
136
140
  </script>
@@ -138,7 +142,7 @@ TEMPLATE = <<~ERB
138
142
  <style type="text/css">
139
143
  @media screen { html, body {
140
144
  font-size: 1rem;
141
- line-heigth: 1.2s;
145
+ line-height: 1.2s;
142
146
  padding: 0;
143
147
  margin: 0;
144
148
  } }
data/apps/repro.ru CHANGED
@@ -15,7 +15,7 @@
15
15
  # DOC
16
16
  # https://ddnexus.github.io/pagy/playground/#1-repro-app
17
17
 
18
- VERSION = '8.4.2'
18
+ VERSION = '8.4.4'
19
19
 
20
20
  require 'bundler/inline'
21
21
  require 'bundler'
@@ -40,17 +40,21 @@ Pagy::DEFAULT.freeze
40
40
  require 'sinatra/base'
41
41
  # Sinatra application
42
42
  class PagyRepro < Sinatra::Base
43
- PAGY_JS = "pagy#{'-dev' if ENV['DEBUG']}.js".freeze
44
-
45
43
  configure do
46
44
  enable :inline_templates
47
45
  end
48
46
  include Pagy::Backend
49
- # Serve pagy.js or pagy-dev.js
50
- get("/#{PAGY_JS}") do
51
- content_type 'application/javascript'
52
- send_file Pagy.root.join('javascripts', PAGY_JS)
47
+
48
+ get('/javascripts/:file') do
49
+ format = params[:file].split('.').last
50
+ if format == 'js'
51
+ content_type 'application/javascript'
52
+ elsif format == 'map'
53
+ content_type 'application/json'
54
+ end
55
+ send_file Pagy.root.join('javascripts', params[:file])
53
56
  end
57
+
54
58
  # Edit this action as needed
55
59
  get '/' do
56
60
  collection = MockCollection.new
@@ -96,7 +100,7 @@ __END__
96
100
  <html>
97
101
  <head>
98
102
  <title>Pagy Repro App</title>
99
- <script src="<%= %(/#{PAGY_JS}) %>"></script>
103
+ <script src="javascripts/pagy.min.js"></script>
100
104
  <script>
101
105
  window.addEventListener("load", Pagy.init);
102
106
  </script>
@@ -104,7 +108,7 @@ __END__
104
108
  <style type="text/css">
105
109
  @media screen { html, body {
106
110
  font-size: 1rem;
107
- line-heigth: 1.2s;
111
+ line-height: 1.2s;
108
112
  padding: 0;
109
113
  margin: 0;
110
114
  } }
data/bin/pagy CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- VERSION = '8.4.2'
4
+ VERSION = '8.4.4'
5
5
  APPS = %w[repro rails demo calendar].freeze
6
6
  LINUX = RbConfig::CONFIG['host_os'].include?('linux')
7
7
 
data/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (8.4.2)
3
+ # Pagy initializer file (8.4.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
 
@@ -13,8 +13,7 @@ const Pagy = (() => {
13
13
  let html = tokens.before;
14
14
  const series = sequels[width.toString()];
15
15
  const labels = labelSequels?.[width.toString()] ?? series.map((l) => l.toString());
16
- for (const i in series) {
17
- const item = series[i];
16
+ series.forEach((item, i) => {
18
17
  const label = labels[i];
19
18
  let filled;
20
19
  if (typeof item === "number") {
@@ -25,7 +24,7 @@ const Pagy = (() => {
25
24
  filled = fillIn(tokens.current, item, label);
26
25
  }
27
26
  html += typeof trimParam === "string" && item == 1 ? trim(filled, trimParam) : filled;
28
- }
27
+ });
29
28
  html += tokens.after;
30
29
  el.innerHTML = "";
31
30
  el.insertAdjacentHTML("afterbegin", html);
@@ -64,7 +63,7 @@ const Pagy = (() => {
64
63
  link.href = url;
65
64
  link.click();
66
65
  };
67
- ["change", "focus"].forEach((e) => input.addEventListener(e, input.select));
66
+ ["change", "focus"].forEach((e) => input.addEventListener(e, () => input.select()));
68
67
  input.addEventListener("focusout", action);
69
68
  input.addEventListener("keypress", (e) => {
70
69
  if (e.key === "Enter") {
@@ -74,7 +73,7 @@ const Pagy = (() => {
74
73
  };
75
74
  const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
76
75
  return {
77
- version: "8.4.2",
76
+ version: "8.4.4",
78
77
  init(arg) {
79
78
  const target = arg instanceof Element ? arg : document;
80
79
  const elements = target.querySelectorAll("[data-pagy]");
data/javascripts/pagy.js CHANGED
@@ -1 +1,4 @@
1
- window.Pagy=(()=>{const x=new ResizeObserver((B)=>B.forEach((D)=>D.target.querySelectorAll(".pagy-rjs").forEach((E)=>E.pagyRender()))),A=(B,[D,E,z,G])=>{const F=B.parentElement??B,K=Object.keys(E).map((H)=>parseInt(H)).sort((H,M)=>M-H);let L=-1;const T=(H,M,Q)=>H.replace(/__pagy_page__/g,M).replace(/__pagy_label__/g,Q);if((B.pagyRender=function(){const H=K.find((R)=>R<F.clientWidth)||0;if(H===L)return;let M=D.before;const Q=E[H.toString()],Y=z?.[H.toString()]??Q.map((R)=>R.toString());for(let R in Q){const U=Q[R],j=Y[R];let X;if(typeof U==="number")X=T(D.a,U.toString(),j);else if(U==="gap")X=D.gap;else X=T(D.current,U,j);M+=typeof G==="string"&&U==1?$(X,G):X}M+=D.after,B.innerHTML="",B.insertAdjacentHTML("afterbegin",M),L=H})(),B.classList.contains("pagy-rjs"))x.observe(F)},C=(B,[D,E])=>Z(B,(z)=>[z,D.replace(/__pagy_page__/,z)],E),J=(B,[D,E,z])=>{Z(B,(G)=>{const F=Math.max(Math.ceil(D/parseInt(G)),1).toString(),K=E.replace(/__pagy_page__/,F).replace(/__pagy_items__/,G);return[F,K]},z)},Z=(B,D,E)=>{const z=B.querySelector("input"),G=B.querySelector("a"),F=z.value,K=function(){if(z.value===F)return;const[L,T,H]=[z.min,z.value,z.max].map((Y)=>parseInt(Y)||0);if(T<L||T>H){z.value=F,z.select();return}let[M,Q]=D(z.value);if(typeof E==="string"&&M==="1")Q=$(Q,E);G.href=Q,G.click()};["change","focus"].forEach((L)=>z.addEventListener(L,z.select)),z.addEventListener("focusout",K),z.addEventListener("keypress",(L)=>{if(L.key==="Enter")K()})},$=(B,D)=>B.replace(new RegExp(`[?&]${D}=1\\b(?!&)|\\b${D}=1&`),"");return{version:"8.4.2",init(B){const E=(B instanceof Element?B:document).querySelectorAll("[data-pagy]");for(let z of E)try{const G=Uint8Array.from(atob(z.getAttribute("data-pagy")),(L)=>L.charCodeAt(0)),[F,...K]=JSON.parse((new TextDecoder()).decode(G));if(F==="nav")A(z,K);else if(F==="combo")C(z,K);else if(F==="selector")J(z,K);else console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",z,F)}catch(G){console.warn("Skipped Pagy.init() for: %o\n%s",z,G)}}}})();
1
+ window.Pagy=(()=>{const j=new ResizeObserver((B)=>B.forEach((D)=>D.target.querySelectorAll(".pagy-rjs").forEach((E)=>E.pagyRender()))),x=(B,[D,E,z,G])=>{const F=B.parentElement??B,K=Object.keys(E).map((H)=>parseInt(H)).sort((H,M)=>M-H);let L=-1;const T=(H,M,R)=>H.replace(/__pagy_page__/g,M).replace(/__pagy_label__/g,R);if((B.pagyRender=function(){const H=K.find((Q)=>Q<F.clientWidth)||0;if(H===L)return;let M=D.before;const R=E[H.toString()],X=z?.[H.toString()]??R.map((Q)=>Q.toString());R.forEach((Q,J)=>{const $=X[J];let U;if(typeof Q==="number")U=T(D.a,Q.toString(),$);else if(Q==="gap")U=D.gap;else U=T(D.current,Q,$);M+=typeof G==="string"&&Q==1?Z(U,G):U}),M+=D.after,B.innerHTML="",B.insertAdjacentHTML("afterbegin",M),L=H})(),B.classList.contains("pagy-rjs"))j.observe(F)},A=(B,[D,E])=>Y(B,(z)=>[z,D.replace(/__pagy_page__/,z)],E),C=(B,[D,E,z])=>{Y(B,(G)=>{const F=Math.max(Math.ceil(D/parseInt(G)),1).toString(),K=E.replace(/__pagy_page__/,F).replace(/__pagy_items__/,G);return[F,K]},z)},Y=(B,D,E)=>{const z=B.querySelector("input"),G=B.querySelector("a"),F=z.value,K=function(){if(z.value===F)return;const[L,T,H]=[z.min,z.value,z.max].map((X)=>parseInt(X)||0);if(T<L||T>H){z.value=F,z.select();return}let[M,R]=D(z.value);if(typeof E==="string"&&M==="1")R=Z(R,E);G.href=R,G.click()};["change","focus"].forEach((L)=>z.addEventListener(L,()=>z.select())),z.addEventListener("focusout",K),z.addEventListener("keypress",(L)=>{if(L.key==="Enter")K()})},Z=(B,D)=>B.replace(new RegExp(`[?&]${D}=1\\b(?!&)|\\b${D}=1&`),"");return{version:"8.4.4",init(B){const E=(B instanceof Element?B:document).querySelectorAll("[data-pagy]");for(let z of E)try{const G=Uint8Array.from(atob(z.getAttribute("data-pagy")),(L)=>L.charCodeAt(0)),[F,...K]=JSON.parse((new TextDecoder()).decode(G));if(F==="nav")x(z,K);else if(F==="combo")A(z,K);else if(F==="selector")C(z,K);else console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",z,F)}catch(G){console.warn("Skipped Pagy.init() for: %o\n%s",z,G)}}}})();
2
+
3
+ //# debugId=42F7B0D379AB673764756e2164756e21
4
+ //# sourceMappingURL=pagy.min.js.map
@@ -0,0 +1,4 @@
1
+ window.Pagy=(()=>{const j=new ResizeObserver((B)=>B.forEach((D)=>D.target.querySelectorAll(".pagy-rjs").forEach((E)=>E.pagyRender()))),x=(B,[D,E,z,G])=>{const F=B.parentElement??B,K=Object.keys(E).map((H)=>parseInt(H)).sort((H,M)=>M-H);let L=-1;const T=(H,M,R)=>H.replace(/__pagy_page__/g,M).replace(/__pagy_label__/g,R);if((B.pagyRender=function(){const H=K.find((Q)=>Q<F.clientWidth)||0;if(H===L)return;let M=D.before;const R=E[H.toString()],X=z?.[H.toString()]??R.map((Q)=>Q.toString());R.forEach((Q,J)=>{const $=X[J];let U;if(typeof Q==="number")U=T(D.a,Q.toString(),$);else if(Q==="gap")U=D.gap;else U=T(D.current,Q,$);M+=typeof G==="string"&&Q==1?Z(U,G):U}),M+=D.after,B.innerHTML="",B.insertAdjacentHTML("afterbegin",M),L=H})(),B.classList.contains("pagy-rjs"))j.observe(F)},A=(B,[D,E])=>Y(B,(z)=>[z,D.replace(/__pagy_page__/,z)],E),C=(B,[D,E,z])=>{Y(B,(G)=>{const F=Math.max(Math.ceil(D/parseInt(G)),1).toString(),K=E.replace(/__pagy_page__/,F).replace(/__pagy_items__/,G);return[F,K]},z)},Y=(B,D,E)=>{const z=B.querySelector("input"),G=B.querySelector("a"),F=z.value,K=function(){if(z.value===F)return;const[L,T,H]=[z.min,z.value,z.max].map((X)=>parseInt(X)||0);if(T<L||T>H){z.value=F,z.select();return}let[M,R]=D(z.value);if(typeof E==="string"&&M==="1")R=Z(R,E);G.href=R,G.click()};["change","focus"].forEach((L)=>z.addEventListener(L,()=>z.select())),z.addEventListener("focusout",K),z.addEventListener("keypress",(L)=>{if(L.key==="Enter")K()})},Z=(B,D)=>B.replace(new RegExp(`[?&]${D}=1\\b(?!&)|\\b${D}=1&`),"");return{version:"8.4.4",init(B){const E=(B instanceof Element?B:document).querySelectorAll("[data-pagy]");for(let z of E)try{const G=Uint8Array.from(atob(z.getAttribute("data-pagy")),(L)=>L.charCodeAt(0)),[F,...K]=JSON.parse((new TextDecoder()).decode(G));if(F==="nav")x(z,K);else if(F==="combo")A(z,K);else if(F==="selector")C(z,K);else console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",z,F)}catch(G){console.warn("Skipped Pagy.init() for: %o\n%s",z,G)}}}})();
2
+
3
+ //# debugId=42F7B0D379AB673764756e2164756e21
4
+ //# sourceMappingURL=pagy.min.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/pagy.ts"],
4
+ "sourcesContent": [
5
+ "type NavArgs = readonly [Tokens, Sequels, null | LabelSequels, string?]\ntype ComboArgs = readonly [string, string?]\ntype SelectorArgs = readonly [number, string, string?]\ntype JsonArgs = ['nav', NavArgs] | ['combo', ComboArgs] | ['selector', SelectorArgs]\n\ninterface Tokens {\n readonly before:string\n readonly a:string\n readonly current:string\n readonly gap:string\n readonly after:string\n}\ninterface Sequels {readonly [width:string]:(string | number)[]}\ninterface LabelSequels {readonly [width:string]:string[]}\ninterface NavElement extends Element {pagyRender():void}\n\nconst Pagy = (() => {\n // The observer instance for responsive navs\n const rjsObserver = new ResizeObserver(\n entries => entries.forEach(e => e.target.querySelectorAll<NavElement>(\".pagy-rjs\")\n .forEach(el => el.pagyRender())));\n // Init the *_nav_js helpers\n const initNav = (el:NavElement, [tokens, sequels, labelSequels, trimParam]:NavArgs) => {\n const container = el.parentElement ?? el;\n const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);\n let lastWidth = -1;\n const fillIn = (a:string, page:string, label:string):string =>\n a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);\n (el.pagyRender = function () {\n const width = widths.find(w => w < container.clientWidth) || 0;\n if (width === lastWidth) { return } // no change: abort\n let html = tokens.before; // already trimmed in html\n const series = sequels[width.toString()];\n const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());\n series.forEach((item, i) => {\n const label = labels[i];\n let filled;\n if (typeof item === \"number\") {\n filled = fillIn(tokens.a, item.toString(), label);\n } else if (item === \"gap\") {\n filled = tokens.gap;\n } else { // active page\n filled = fillIn(tokens.current, item, label);\n }\n html += (typeof trimParam === \"string\" && item == 1) ? trim(filled, trimParam) : filled;\n });\n html += tokens.after;\n el.innerHTML = \"\";\n el.insertAdjacentHTML(\"afterbegin\", html);\n lastWidth = width;\n })();\n if (el.classList.contains(\"pagy-rjs\")) { rjsObserver.observe(container) }\n };\n\n // Init the *_combo_nav_js helpers\n const initCombo = (el:Element, [url_token, trimParam]:ComboArgs) =>\n initInput(el, inputValue => [inputValue, url_token.replace(/__pagy_page__/, inputValue)], trimParam);\n\n // Init the items_selector_js helper\n const initSelector = (el:Element, [from, url_token, trimParam]:SelectorArgs) => {\n initInput(el, inputValue => {\n const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();\n const url = url_token.replace(/__pagy_page__/, page).replace(/__pagy_items__/, inputValue);\n return [page, url];\n }, trimParam);\n };\n\n // Init the input element\n const initInput = (el:Element, getVars:(v:string) => [string, string], trimParam?:string) => {\n const input = el.querySelector(\"input\") as HTMLInputElement;\n const link = el.querySelector(\"a\") as HTMLAnchorElement;\n const initial = input.value;\n const action = function () {\n if (input.value === initial) { return } // not changed\n const [min, val, max] = [input.min, input.value, input.max].map(n => parseInt(n) || 0);\n if (val < min || val > max) { // reset invalid/out-of-range\n input.value = initial;\n input.select();\n return;\n }\n let [page, url] = getVars(input.value); // eslint-disable-line prefer-const\n if (typeof trimParam === \"string\" && page === \"1\") { url = trim(url, trimParam) }\n link.href = url;\n link.click();\n };\n [\"change\", \"focus\"].forEach(e => input.addEventListener(e, () => input.select())); // auto-select\n input.addEventListener(\"focusout\", action); // trigger action\n input.addEventListener(\"keypress\", e => { if (e.key === \"Enter\") { action() } }); // trigger action\n };\n\n // Trim the ${page-param}=1 params in links\n const trim = (a:string, param:string) =>\n a.replace(new RegExp(`[?&]${param}=1\\\\b(?!&)|\\\\b${param}=1&`), \"\");\n\n // Public interface\n return {\n version: \"8.4.4\",\n\n // Scan for elements with a \"data-pagy\" attribute and call their init functions with the decoded args\n init(arg?:Element) {\n const target = arg instanceof Element ? arg : document;\n const elements = target.querySelectorAll(\"[data-pagy]\");\n for (const el of elements) {\n try {\n const uint8array = Uint8Array.from(atob(el.getAttribute(\"data-pagy\") as string), c => c.charCodeAt(0));\n const [keyword, ...args] = JSON.parse((new TextDecoder()).decode(uint8array)) as JsonArgs; // base64-utf8 -> JSON -> Array\n if (keyword === \"nav\") {\n initNav(el as NavElement, args as unknown as NavArgs);\n } else if (keyword === \"combo\") {\n initCombo(el, args as unknown as ComboArgs);\n } else if (keyword === \"selector\") {\n initSelector(el, args as unknown as SelectorArgs);\n } else {\n console.warn(\"Skipped Pagy.init() for: %o\\nUnknown keyword '%s'\", el, keyword);\n }\n } catch (err) { console.warn(\"Skipped Pagy.init() for: %o\\n%s\", el, err) }\n }\n }\n };\n})();\n\nexport default Pagy;\n"
6
+ ],
7
+ "mappings": "AAgBA,IAAM,GAAQ,IAAM,CAElB,MAAM,EAAc,IAAI,eACpB,KAAW,EAAQ,QAAQ,KAAK,EAAE,OAAO,iBAA6B,WAAW,EAC/C,QAAQ,KAAM,EAAG,WAAW,CAAC,CAAC,CAAC,EAE/D,EAAU,CAAC,GAAgB,EAAQ,EAAS,EAAc,KAAuB,CACrF,MAAM,EAAY,EAAG,eAAiB,EAChC,EAAY,OAAO,KAAK,CAAO,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,EAAG,IAAM,EAAI,CAAC,EACjF,IAAI,GAAc,EAClB,MAAM,EAAY,CAAC,EAAU,EAAa,IACtC,EAAE,QAAQ,iBAAkB,CAAI,EAAE,QAAQ,kBAAmB,CAAK,EAwBtE,IAvBC,EAAG,mBAAsB,EAAG,CAC3B,MAAM,EAAQ,EAAO,KAAK,KAAK,EAAI,EAAU,WAAW,GAAK,EAC7D,GAAI,IAAU,EAAa,OAC3B,IAAI,EAAW,EAAO,OACtB,MAAM,EAAS,EAAQ,EAAM,SAAS,GAChC,EAAS,IAAe,EAAM,SAAS,IAAM,EAAO,IAAI,KAAK,EAAE,SAAS,CAAC,EAC/E,EAAO,QAAQ,CAAC,EAAM,IAAM,CAC1B,MAAM,EAAQ,EAAO,GACrB,IAAI,EACJ,UAAW,IAAS,SAClB,EAAS,EAAO,EAAO,EAAG,EAAK,SAAS,EAAG,CAAK,UACvC,IAAS,MAClB,EAAS,EAAO,QAEhB,GAAS,EAAO,EAAO,QAAS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AAY,CAAM,EACzC,EAAM,iBAAiB,WAAY,KAAK,CAAE,GAAI,EAAE,MAAQ,QAAW,EAAO,EAAK,GAI3E,EAAO,CAAC,EAAU,IACpB,EAAE,QAAQ,IAAI,OAAO,OAAO,kBAAsB,MAAU,EAAG,EAAE,EAGrE,MAAO,CACL,QAAS,QAGT,IAAI,CAAC,EAAc,CAEjB,MAAM,GADW,aAAe,QAAU,EAAM,UACxB,iBAAiB,aAAa,EACtD,QAAW,KAAM,EACf,GAAI,CACF,MAAM,EAAqB,WAAW,KAAK,KAAK,EAAG,aAAa,WAAW,CAAW,EAAG,KAAK,EAAE,WAAW,CAAC,CAAC,GACtG,KAAY,GAAQ,KAAK,OAAO,IAAI,YAAY,GAAG,OAAO,CAAU,CAAC,EAC5E,GAAI,IAAY,MACd,EAAQ,EAAkB,CAA0B,UAC3C,IAAY,QACrB,EAAU,EAAI,CAA4B,UACjC,IAAY,WACrB,EAAa,EAAI,CAA+B,MAEhD,SAAQ,KAAK,oDAAqD,EAAI,CAAO,QAExE,EAAP,CAAc,QAAQ,KAAK,kCAAmC,EAAI,CAAG,GAG7E,IACC",
8
+ "debugId": "42F7B0D379AB673764756e2164756e21",
9
+ "names": []
10
+ }
@@ -0,0 +1,100 @@
1
+ const Pagy = (() => {
2
+ const rjsObserver = new ResizeObserver((entries) => entries.forEach((e) => e.target.querySelectorAll(".pagy-rjs").forEach((el) => el.pagyRender())));
3
+ const initNav = (el, [tokens, sequels, labelSequels, trimParam]) => {
4
+ const container = el.parentElement ?? el;
5
+ const widths = Object.keys(sequels).map((w) => parseInt(w)).sort((a, b) => b - a);
6
+ let lastWidth = -1;
7
+ const fillIn = (a, page, label) => a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
8
+ (el.pagyRender = function() {
9
+ const width = widths.find((w) => w < container.clientWidth) || 0;
10
+ if (width === lastWidth) {
11
+ return;
12
+ }
13
+ let html = tokens.before;
14
+ const series = sequels[width.toString()];
15
+ const labels = labelSequels?.[width.toString()] ?? series.map((l) => l.toString());
16
+ series.forEach((item, i) => {
17
+ const label = labels[i];
18
+ let filled;
19
+ if (typeof item === "number") {
20
+ filled = fillIn(tokens.a, item.toString(), label);
21
+ } else if (item === "gap") {
22
+ filled = tokens.gap;
23
+ } else {
24
+ filled = fillIn(tokens.current, item, label);
25
+ }
26
+ html += typeof trimParam === "string" && item == 1 ? trim(filled, trimParam) : filled;
27
+ });
28
+ html += tokens.after;
29
+ el.innerHTML = "";
30
+ el.insertAdjacentHTML("afterbegin", html);
31
+ lastWidth = width;
32
+ })();
33
+ if (el.classList.contains("pagy-rjs")) {
34
+ rjsObserver.observe(container);
35
+ }
36
+ };
37
+ const initCombo = (el, [url_token, trimParam]) => initInput(el, (inputValue) => [inputValue, url_token.replace(/__pagy_page__/, inputValue)], trimParam);
38
+ const initSelector = (el, [from, url_token, trimParam]) => {
39
+ initInput(el, (inputValue) => {
40
+ const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();
41
+ const url = url_token.replace(/__pagy_page__/, page).replace(/__pagy_items__/, inputValue);
42
+ return [page, url];
43
+ }, trimParam);
44
+ };
45
+ const initInput = (el, getVars, trimParam) => {
46
+ const input = el.querySelector("input");
47
+ const link = el.querySelector("a");
48
+ const initial = input.value;
49
+ const action = function() {
50
+ if (input.value === initial) {
51
+ return;
52
+ }
53
+ const [min, val, max] = [input.min, input.value, input.max].map((n) => parseInt(n) || 0);
54
+ if (val < min || val > max) {
55
+ input.value = initial;
56
+ input.select();
57
+ return;
58
+ }
59
+ let [page, url] = getVars(input.value);
60
+ if (typeof trimParam === "string" && page === "1") {
61
+ url = trim(url, trimParam);
62
+ }
63
+ link.href = url;
64
+ link.click();
65
+ };
66
+ ["change", "focus"].forEach((e) => input.addEventListener(e, () => input.select()));
67
+ input.addEventListener("focusout", action);
68
+ input.addEventListener("keypress", (e) => {
69
+ if (e.key === "Enter") {
70
+ action();
71
+ }
72
+ });
73
+ };
74
+ const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
75
+ return {
76
+ version: "8.4.4",
77
+ init(arg) {
78
+ const target = arg instanceof Element ? arg : document;
79
+ const elements = target.querySelectorAll("[data-pagy]");
80
+ for (const el of elements) {
81
+ try {
82
+ const uint8array = Uint8Array.from(atob(el.getAttribute("data-pagy")), (c) => c.charCodeAt(0));
83
+ const [keyword, ...args] = JSON.parse(new TextDecoder().decode(uint8array));
84
+ if (keyword === "nav") {
85
+ initNav(el, args);
86
+ } else if (keyword === "combo") {
87
+ initCombo(el, args);
88
+ } else if (keyword === "selector") {
89
+ initSelector(el, args);
90
+ } else {
91
+ console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'", el, keyword);
92
+ }
93
+ } catch (err) {
94
+ console.warn("Skipped Pagy.init() for: %o\n%s", el, err);
95
+ }
96
+ }
97
+ }
98
+ };
99
+ })();
100
+ 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 = '8.4.2'
8
+ VERSION = '8.4.4'
9
9
 
10
10
  # Gem root pathname to get the path of Pagy files stylesheets, javascripts, apps, locales, etc.
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: 8.4.2
4
+ version: 8.4.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: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Agnostic pagination in plain ruby. It does it all. Better.
14
14
  email:
@@ -25,10 +25,12 @@ files:
25
25
  - apps/repro.ru
26
26
  - bin/pagy
27
27
  - config/pagy.rb
28
- - javascripts/pagy-dev.js
29
- - javascripts/pagy-module.d.ts
30
28
  - javascripts/pagy-module.js
29
+ - javascripts/pagy.d.ts
31
30
  - javascripts/pagy.js
31
+ - javascripts/pagy.min.js
32
+ - javascripts/pagy.min.js.map
33
+ - javascripts/pagy.mjs
32
34
  - lib/optimist.rb
33
35
  - lib/pagy.rb
34
36
  - lib/pagy/backend.rb
@@ -105,7 +107,6 @@ files:
105
107
  - locales/zh-CN.yml
106
108
  - locales/zh-HK.yml
107
109
  - locales/zh-TW.yml
108
- - pkg/pagy-8.4.2.gem
109
110
  - stylesheets/pagy.css
110
111
  - stylesheets/pagy.scss
111
112
  - stylesheets/pagy.tailwind.css
@@ -124,6 +125,8 @@ post_install_message: |
124
125
  The foundation, materialize, semantic and uikit CSS extras
125
126
  have been discontinued and will be removed in v9
126
127
  https://github.com/ddnexus/pagy/discussions/672
128
+ The javascript files have been deprecated/renamed
129
+ https://ddnexus.github.io/pagy/changelog/#deprecations
127
130
  *************************************************************
128
131
  rdoc_options: []
129
132
  require_paths:
@@ -1,104 +0,0 @@
1
- // pagy.ts
2
- window.Pagy = (() => {
3
- const rjsObserver = new ResizeObserver((entries) => entries.forEach((e) => e.target.querySelectorAll(".pagy-rjs").forEach((el) => el.pagyRender())));
4
- const initNav = (el, [tokens, sequels, labelSequels, trimParam]) => {
5
- const container = el.parentElement ?? el;
6
- const widths = Object.keys(sequels).map((w) => parseInt(w)).sort((a, b) => b - a);
7
- let lastWidth = -1;
8
- const fillIn = (a, page, label) => a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
9
- (el.pagyRender = function() {
10
- const width = widths.find((w) => w < container.clientWidth) || 0;
11
- if (width === lastWidth) {
12
- return;
13
- }
14
- let html = tokens.before;
15
- const series = sequels[width.toString()];
16
- const labels = labelSequels?.[width.toString()] ?? series.map((l) => l.toString());
17
- for (const i in series) {
18
- const item = series[i];
19
- const label = labels[i];
20
- let filled;
21
- if (typeof item === "number") {
22
- filled = fillIn(tokens.a, item.toString(), label);
23
- } else if (item === "gap") {
24
- filled = tokens.gap;
25
- } else {
26
- filled = fillIn(tokens.current, item, label);
27
- }
28
- html += typeof trimParam === "string" && item == 1 ? trim(filled, trimParam) : filled;
29
- }
30
- html += tokens.after;
31
- el.innerHTML = "";
32
- el.insertAdjacentHTML("afterbegin", html);
33
- lastWidth = width;
34
- })();
35
- if (el.classList.contains("pagy-rjs")) {
36
- rjsObserver.observe(container);
37
- }
38
- };
39
- const initCombo = (el, [url_token, trimParam]) => initInput(el, (inputValue) => [inputValue, url_token.replace(/__pagy_page__/, inputValue)], trimParam);
40
- const initSelector = (el, [from, url_token, trimParam]) => {
41
- initInput(el, (inputValue) => {
42
- const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();
43
- const url = url_token.replace(/__pagy_page__/, page).replace(/__pagy_items__/, inputValue);
44
- return [page, url];
45
- }, trimParam);
46
- };
47
- const initInput = (el, getVars, trimParam) => {
48
- const input = el.querySelector("input");
49
- const link = el.querySelector("a");
50
- const initial = input.value;
51
- const action = function() {
52
- if (input.value === initial) {
53
- return;
54
- }
55
- const [min, val, max] = [input.min, input.value, input.max].map((n) => parseInt(n) || 0);
56
- if (val < min || val > max) {
57
- input.value = initial;
58
- input.select();
59
- return;
60
- }
61
- let [page, url] = getVars(input.value);
62
- if (typeof trimParam === "string" && page === "1") {
63
- url = trim(url, trimParam);
64
- }
65
- link.href = url;
66
- link.click();
67
- };
68
- ["change", "focus"].forEach((e) => input.addEventListener(e, input.select));
69
- input.addEventListener("focusout", action);
70
- input.addEventListener("keypress", (e) => {
71
- if (e.key === "Enter") {
72
- action();
73
- }
74
- });
75
- };
76
- const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
77
- return {
78
- version: "8.4.2",
79
- init(arg) {
80
- const target = arg instanceof Element ? arg : document;
81
- const elements = target.querySelectorAll("[data-pagy]");
82
- for (const el of elements) {
83
- try {
84
- const uint8array = Uint8Array.from(atob(el.getAttribute("data-pagy")), (c) => c.charCodeAt(0));
85
- const [keyword, ...args] = JSON.parse(new TextDecoder().decode(uint8array));
86
- if (keyword === "nav") {
87
- initNav(el, args);
88
- } else if (keyword === "combo") {
89
- initCombo(el, args);
90
- } else if (keyword === "selector") {
91
- initSelector(el, args);
92
- } else {
93
- console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'", el, keyword);
94
- }
95
- } catch (err) {
96
- console.warn("Skipped Pagy.init() for: %o\n%s", el, err);
97
- }
98
- }
99
- }
100
- };
101
- })();
102
-
103
- //# debugId=22425B3DDA38810464756e2164756e21
104
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsicGFneS50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsKICAgICJ0eXBlIE5hdkFyZ3MgPSByZWFkb25seSBbVG9rZW5zLCBTZXF1ZWxzLCBudWxsIHwgTGFiZWxTZXF1ZWxzLCBzdHJpbmc/XVxudHlwZSBDb21ib0FyZ3MgPSByZWFkb25seSBbc3RyaW5nLCBzdHJpbmc/XVxudHlwZSBTZWxlY3RvckFyZ3MgPSByZWFkb25seSBbbnVtYmVyLCBzdHJpbmcsIHN0cmluZz9dXG5cbmludGVyZmFjZSBUb2tlbnMge1xuICAgIHJlYWRvbmx5IGJlZm9yZTpzdHJpbmdcbiAgICByZWFkb25seSBhOnN0cmluZ1xuICAgIHJlYWRvbmx5IGN1cnJlbnQ6c3RyaW5nXG4gICAgcmVhZG9ubHkgZ2FwOnN0cmluZ1xuICAgIHJlYWRvbmx5IGFmdGVyOnN0cmluZ1xufVxuXG5pbnRlcmZhY2UgU2VxdWVscyB7cmVhZG9ubHkgW3dpZHRoOnN0cmluZ106KHN0cmluZyB8IG51bWJlcilbXX1cblxuaW50ZXJmYWNlIExhYmVsU2VxdWVscyB7cmVhZG9ubHkgW3dpZHRoOnN0cmluZ106c3RyaW5nW119XG5cbmludGVyZmFjZSBOYXZFbGVtZW50IGV4dGVuZHMgRWxlbWVudCB7cGFneVJlbmRlcigpOnZvaWR9XG5cbmNv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gKCkge1xuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSB3aWR0aHMuZmluZCh3ID0+IHcgPCBjb250YWluZXIuY2xpZW50V2lkdGgpIHx8IDA7XG4gICAgICAgICAgICBpZiAod2lkdGggPT09IGxhc3RXaWR0aCkgeyByZXR1cm4gfSAvLyBubyBjaGFuZ2U6IGFib3J0XG4gICAgICAgICAgICBsZXQgaHRtbCAgICAgPSB0b2tlbnMuYmVmb3JlOyAgLy8gYWxyZWFkeSB0cmltbWVkIGluIGh0bWxcbiAgICAgICAgICAgIGNvbnN0IHNlcmllcyA9IHNlcXVlbHNbd2lkdGgudG9TdHJpbmcoKV07XG4gICAgICAgICAgICBjb25zdCBsYWJlbHMgPSBsYWJlbFNlcXVlbHM/Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtICA9IHNlcmllc1tpXTtcbiAgICAgICAgICAgICAgICBjb25zdCBsYWJlbCA9IGxhYmVsc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaXRlbSA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSBmaWxsSW4odG9rZW5zLmEsIGl0ZW0udG9TdHJpbmcoKSwgbGFiZWwpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRlbSA9PT0gXCJnYXBcIikge1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSB0b2tlbnMuZ2FwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIGFjdGl2ZSBwYWdlXG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGZpbGxJbih0b2tlbnMuY3VycmVudCwgaXRlbSwgbGFiZWwpO1xuICAgICAgIC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yZCA9PT0gXCJuYXZcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdE5hdihlbCBhcyBOYXZFbGVtZW50LCBhcmdzIGFzIE5hdkFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwiY29tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbWJvKGVsLCBhcmdzIGFzIENvbWJvQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VsZWN0b3IoZWwsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlNraXBwZWQgUGFneS5pbml0KCkgZm9yOiAlb1xcblVua25vd24ga2V5d29yZCAnJXMnXCIsIGVsLCBrZXl3b3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgeyBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG4lc1wiLCBlbCwgZXJyKSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkoKTtcblxuZXhwb3J0IGRlZmF1bHQgUGFneTtcbiIKICBdLAogICJtYXBwaW5ncyI6ICI7QUFrQkEsSUFBTSxRQUFRLE1BQU07QUFFaEIsUUFBTSxjQUFjLElBQUksZUFBZSxhQUNJLFFBQVEsUUFBUSxPQUFLLEVBQUUsT0FBTyxpQkFBNkIsV0FBVyxFQUFFLFFBQ3BFLFFBQU0sR0FBRyxXQUFXLENBQUMsQ0FBQyxDQUFDO0FBR3RFLFFBQU0sVUFBVSxDQUFDLEtBQWdCLFFBQVEsU0FBUyxjQUFjLG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