pagy 9.4.0 → 43.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/apps/calendar.ru +566 -562
- data/apps/demo.ru +246 -182
- data/apps/enable_rails_page_segment.rb +56 -0
- data/apps/index.rb +4 -2
- data/apps/keynav+root_key.ru +316 -0
- data/apps/keynav.ru +255 -0
- data/apps/{keyset_ar.ru → keyset.ru} +33 -42
- data/apps/{keyset_s.ru → keyset_sequel.ru} +32 -40
- data/apps/rails.ru +57 -58
- data/apps/repro.ru +54 -51
- data/bin/pagy +2 -95
- data/config/pagy.rb +33 -207
- data/javascripts/ai_widget.js +90 -0
- data/javascripts/pagy.js +166 -0
- data/javascripts/pagy.min.js +2 -4
- data/javascripts/pagy.mjs +126 -67
- data/javascripts/wand.js +1172 -0
- data/lib/pagy/classes/calendar/calendar.rb +101 -0
- data/lib/pagy/{calendar → classes/calendar}/day.rb +7 -11
- data/lib/pagy/{calendar → classes/calendar}/month.rb +5 -10
- data/lib/pagy/{calendar → classes/calendar}/quarter.rb +10 -15
- data/lib/pagy/classes/calendar/unit.rb +93 -0
- data/lib/pagy/{calendar → classes/calendar}/week.rb +5 -9
- data/lib/pagy/{calendar → classes/calendar}/year.rb +5 -6
- data/lib/pagy/classes/exceptions.rb +26 -0
- data/lib/pagy/classes/keyset/adapters/active_record.rb +50 -0
- data/lib/pagy/classes/keyset/adapters/sequel.rb +62 -0
- data/lib/pagy/classes/keyset/keynav.rb +85 -0
- data/lib/pagy/classes/keyset/keyset.rb +155 -0
- data/lib/pagy/classes/offset/countish.rb +17 -0
- data/lib/pagy/classes/offset/countless.rb +63 -0
- data/lib/pagy/classes/offset/offset.rb +63 -0
- data/lib/pagy/classes/offset/search.rb +34 -0
- data/lib/pagy/classes/request.rb +48 -0
- data/lib/pagy/cli.rb +122 -0
- data/lib/pagy/console.rb +5 -20
- data/lib/pagy/deprecated.rb +84 -0
- data/lib/pagy/modules/abilities/configurable.rb +37 -0
- data/lib/pagy/modules/abilities/countable.rb +23 -0
- data/lib/pagy/modules/abilities/linkable.rb +72 -0
- data/lib/pagy/modules/abilities/rangeable.rb +14 -0
- data/lib/pagy/modules/abilities/shiftable.rb +12 -0
- data/lib/pagy/{b64.rb → modules/b64.rb} +4 -2
- data/lib/pagy/modules/console.rb +33 -0
- data/lib/pagy/modules/i18n/i18n.rb +72 -0
- data/lib/pagy/modules/i18n/p11n/arabic.rb +30 -0
- data/lib/pagy/modules/i18n/p11n/east_slavic.rb +27 -0
- data/lib/pagy/modules/i18n/p11n/one_other.rb +15 -0
- data/lib/pagy/modules/i18n/p11n/one_upto_two_other.rb +15 -0
- data/lib/pagy/modules/i18n/p11n/other.rb +13 -0
- data/lib/pagy/modules/i18n/p11n/polish.rb +27 -0
- data/lib/pagy/modules/i18n/p11n/west_slavic.rb +22 -0
- data/lib/pagy/modules/i18n/p11n.rb +16 -0
- data/lib/pagy/modules/searcher.rb +20 -0
- data/lib/pagy/next.rb +25 -0
- data/lib/pagy/tasks/sync.rb +20 -0
- data/lib/pagy/toolbox/helpers/anchor_tags.rb +19 -0
- data/lib/pagy/toolbox/helpers/bootstrap/input_nav_js.rb +28 -0
- data/lib/pagy/toolbox/helpers/bootstrap/previous_next_html.rb +19 -0
- data/lib/pagy/toolbox/helpers/bootstrap/series_nav.rb +32 -0
- data/lib/pagy/toolbox/helpers/bootstrap/series_nav_js.rb +24 -0
- data/lib/pagy/toolbox/helpers/bulma/input_nav_js.rb +25 -0
- data/lib/pagy/toolbox/helpers/bulma/previous_next_html.rb +20 -0
- data/lib/pagy/toolbox/helpers/bulma/series_nav.rb +31 -0
- data/lib/pagy/toolbox/helpers/bulma/series_nav_js.rb +23 -0
- data/lib/pagy/toolbox/helpers/data_hash.rb +29 -0
- data/lib/pagy/toolbox/helpers/headers_hash.rb +30 -0
- data/lib/pagy/toolbox/helpers/info_tag.rb +30 -0
- data/lib/pagy/toolbox/helpers/input_nav_js.rb +22 -0
- data/lib/pagy/toolbox/helpers/limit_tag_js.rb +25 -0
- data/lib/pagy/toolbox/helpers/loaders.rb +58 -0
- data/lib/pagy/toolbox/helpers/page_url.rb +16 -0
- data/lib/pagy/toolbox/helpers/series_nav.rb +30 -0
- data/lib/pagy/toolbox/helpers/series_nav_js.rb +20 -0
- data/lib/pagy/toolbox/helpers/support/a_lambda.rb +36 -0
- data/lib/pagy/toolbox/helpers/support/data_pagy_attribute.rb +19 -0
- data/lib/pagy/toolbox/helpers/support/nav_aria_label_attribute.rb +10 -0
- data/lib/pagy/toolbox/helpers/support/series.rb +37 -0
- data/lib/pagy/toolbox/helpers/support/wrap_input_nav_js.rb +18 -0
- data/lib/pagy/toolbox/helpers/support/wrap_series_nav.rb +15 -0
- data/lib/pagy/toolbox/helpers/support/wrap_series_nav_js.rb +38 -0
- data/lib/pagy/toolbox/helpers/urls_hash.rb +12 -0
- data/lib/pagy/toolbox/paginators/calendar.rb +34 -0
- data/lib/pagy/toolbox/paginators/countish.rb +38 -0
- data/lib/pagy/toolbox/paginators/countless.rb +22 -0
- data/lib/pagy/toolbox/paginators/elasticsearch_rails.rb +56 -0
- data/lib/pagy/toolbox/paginators/keynav_js.rb +26 -0
- data/lib/pagy/toolbox/paginators/keyset.rb +15 -0
- data/lib/pagy/toolbox/paginators/meilisearch.rb +34 -0
- data/lib/pagy/toolbox/paginators/method.rb +38 -0
- data/lib/pagy/toolbox/paginators/offset.rb +24 -0
- data/lib/pagy/toolbox/paginators/searchkick.rb +34 -0
- data/lib/pagy/toolbox/paginators/typesense_rails.rb +34 -0
- data/lib/pagy.rb +79 -89
- data/locales/ar.yml +9 -6
- data/locales/be.yml +9 -6
- data/locales/bg.yml +9 -6
- data/locales/bs.yml +9 -6
- data/locales/ca.yml +9 -6
- data/locales/ckb.yml +8 -6
- data/locales/cs.yml +9 -6
- data/locales/da.yml +9 -6
- data/locales/de.yml +9 -6
- data/locales/dz.yml +9 -6
- data/locales/en.yml +9 -6
- data/locales/es.yml +9 -6
- data/locales/fr.yml +9 -6
- data/locales/hr.yml +9 -6
- data/locales/hu.yml +24 -0
- data/locales/id.yml +10 -9
- data/locales/it.yml +9 -6
- data/locales/ja.yml +10 -9
- data/locales/km.yml +10 -9
- data/locales/ko.yml +9 -6
- data/locales/nb.yml +9 -6
- data/locales/nl.yml +9 -6
- data/locales/nn.yml +9 -6
- data/locales/pl.yml +9 -6
- data/locales/pt-BR.yml +10 -7
- data/locales/pt.yml +10 -7
- data/locales/ru.yml +9 -6
- data/locales/sk.yml +9 -6
- data/locales/sr.yml +9 -6
- data/locales/sv-SE.yml +9 -6
- data/locales/sv.yml +9 -6
- data/locales/sw.yml +12 -9
- data/locales/ta.yml +9 -6
- data/locales/tr.yml +17 -12
- data/locales/uk.yml +9 -6
- data/locales/vi.yml +9 -6
- data/locales/zh-CN.yml +9 -6
- data/locales/zh-HK.yml +9 -6
- data/locales/zh-TW.yml +9 -6
- data/stylesheets/pagy-tailwind.css +68 -0
- data/stylesheets/pagy.css +64 -27
- metadata +134 -53
- data/javascripts/pagy.min.js.map +0 -10
- data/lib/optimist.rb +0 -1022
- data/lib/pagy/backend.rb +0 -44
- data/lib/pagy/calendar/unit.rb +0 -103
- data/lib/pagy/calendar.rb +0 -84
- data/lib/pagy/countless.rb +0 -38
- data/lib/pagy/exceptions.rb +0 -25
- data/lib/pagy/extras/arel.rb +0 -28
- data/lib/pagy/extras/array.rb +0 -19
- data/lib/pagy/extras/bootstrap.rb +0 -97
- data/lib/pagy/extras/bulma.rb +0 -93
- data/lib/pagy/extras/calendar.rb +0 -79
- data/lib/pagy/extras/countless.rb +0 -32
- data/lib/pagy/extras/elasticsearch_rails.rb +0 -71
- data/lib/pagy/extras/gearbox.rb +0 -55
- data/lib/pagy/extras/headers.rb +0 -54
- data/lib/pagy/extras/i18n.rb +0 -26
- data/lib/pagy/extras/js_tools.rb +0 -70
- data/lib/pagy/extras/jsonapi.rb +0 -88
- data/lib/pagy/extras/keyset.rb +0 -30
- data/lib/pagy/extras/limit.rb +0 -63
- data/lib/pagy/extras/meilisearch.rb +0 -57
- data/lib/pagy/extras/metadata.rb +0 -42
- data/lib/pagy/extras/overflow.rb +0 -81
- data/lib/pagy/extras/pagy.rb +0 -82
- data/lib/pagy/extras/searchkick.rb +0 -59
- data/lib/pagy/extras/size.rb +0 -40
- data/lib/pagy/extras/standalone.rb +0 -60
- data/lib/pagy/extras/trim.rb +0 -29
- data/lib/pagy/frontend.rb +0 -99
- data/lib/pagy/i18n.rb +0 -167
- data/lib/pagy/keyset/active_record.rb +0 -44
- data/lib/pagy/keyset/sequel.rb +0 -57
- data/lib/pagy/keyset.rb +0 -118
- data/lib/pagy/shared_methods.rb +0 -26
- data/lib/pagy/url_helpers.rb +0 -26
- data/stylesheets/pagy.scss +0 -48
- data/stylesheets/pagy.tailwind.css +0 -21
metadata
CHANGED
|
@@ -1,15 +1,57 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pagy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 43.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Domizio Demichelis
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
-
dependencies:
|
|
12
|
-
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: json
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: uri
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: yaml
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
description: Agnostic pagination in plain ruby.
|
|
13
55
|
email:
|
|
14
56
|
- dd.nexus@gmail.com
|
|
15
57
|
executables:
|
|
@@ -20,60 +62,99 @@ files:
|
|
|
20
62
|
- LICENSE.txt
|
|
21
63
|
- apps/calendar.ru
|
|
22
64
|
- apps/demo.ru
|
|
65
|
+
- apps/enable_rails_page_segment.rb
|
|
23
66
|
- apps/index.rb
|
|
24
|
-
- apps/
|
|
25
|
-
- apps/
|
|
67
|
+
- apps/keynav+root_key.ru
|
|
68
|
+
- apps/keynav.ru
|
|
69
|
+
- apps/keyset.ru
|
|
70
|
+
- apps/keyset_sequel.ru
|
|
26
71
|
- apps/rails.ru
|
|
27
72
|
- apps/repro.ru
|
|
28
73
|
- bin/pagy
|
|
29
74
|
- config/pagy.rb
|
|
75
|
+
- javascripts/ai_widget.js
|
|
30
76
|
- javascripts/pagy.d.ts
|
|
77
|
+
- javascripts/pagy.js
|
|
31
78
|
- javascripts/pagy.min.js
|
|
32
|
-
- javascripts/pagy.min.js.map
|
|
33
79
|
- javascripts/pagy.mjs
|
|
34
|
-
-
|
|
80
|
+
- javascripts/wand.js
|
|
35
81
|
- lib/pagy.rb
|
|
36
|
-
- lib/pagy/
|
|
37
|
-
- lib/pagy/
|
|
38
|
-
- lib/pagy/calendar.rb
|
|
39
|
-
- lib/pagy/calendar/
|
|
40
|
-
- lib/pagy/calendar/
|
|
41
|
-
- lib/pagy/calendar/
|
|
42
|
-
- lib/pagy/calendar/
|
|
43
|
-
- lib/pagy/
|
|
44
|
-
- lib/pagy/
|
|
82
|
+
- lib/pagy/classes/calendar/calendar.rb
|
|
83
|
+
- lib/pagy/classes/calendar/day.rb
|
|
84
|
+
- lib/pagy/classes/calendar/month.rb
|
|
85
|
+
- lib/pagy/classes/calendar/quarter.rb
|
|
86
|
+
- lib/pagy/classes/calendar/unit.rb
|
|
87
|
+
- lib/pagy/classes/calendar/week.rb
|
|
88
|
+
- lib/pagy/classes/calendar/year.rb
|
|
89
|
+
- lib/pagy/classes/exceptions.rb
|
|
90
|
+
- lib/pagy/classes/keyset/adapters/active_record.rb
|
|
91
|
+
- lib/pagy/classes/keyset/adapters/sequel.rb
|
|
92
|
+
- lib/pagy/classes/keyset/keynav.rb
|
|
93
|
+
- lib/pagy/classes/keyset/keyset.rb
|
|
94
|
+
- lib/pagy/classes/offset/countish.rb
|
|
95
|
+
- lib/pagy/classes/offset/countless.rb
|
|
96
|
+
- lib/pagy/classes/offset/offset.rb
|
|
97
|
+
- lib/pagy/classes/offset/search.rb
|
|
98
|
+
- lib/pagy/classes/request.rb
|
|
99
|
+
- lib/pagy/cli.rb
|
|
45
100
|
- lib/pagy/console.rb
|
|
46
|
-
- lib/pagy/
|
|
47
|
-
- lib/pagy/
|
|
48
|
-
- lib/pagy/
|
|
49
|
-
- lib/pagy/
|
|
50
|
-
- lib/pagy/
|
|
51
|
-
- lib/pagy/
|
|
52
|
-
- lib/pagy/
|
|
53
|
-
- lib/pagy/
|
|
54
|
-
- lib/pagy/
|
|
55
|
-
- lib/pagy/
|
|
56
|
-
- lib/pagy/
|
|
57
|
-
- lib/pagy/
|
|
58
|
-
- lib/pagy/
|
|
59
|
-
- lib/pagy/
|
|
60
|
-
- lib/pagy/
|
|
61
|
-
- lib/pagy/
|
|
62
|
-
- lib/pagy/
|
|
63
|
-
- lib/pagy/
|
|
64
|
-
- lib/pagy/
|
|
65
|
-
- lib/pagy/
|
|
66
|
-
- lib/pagy/
|
|
67
|
-
- lib/pagy/
|
|
68
|
-
- lib/pagy/
|
|
69
|
-
- lib/pagy/
|
|
70
|
-
- lib/pagy/
|
|
71
|
-
- lib/pagy/
|
|
72
|
-
- lib/pagy/
|
|
73
|
-
- lib/pagy/
|
|
74
|
-
- lib/pagy/
|
|
75
|
-
- lib/pagy/
|
|
76
|
-
- lib/pagy/
|
|
101
|
+
- lib/pagy/deprecated.rb
|
|
102
|
+
- lib/pagy/modules/abilities/configurable.rb
|
|
103
|
+
- lib/pagy/modules/abilities/countable.rb
|
|
104
|
+
- lib/pagy/modules/abilities/linkable.rb
|
|
105
|
+
- lib/pagy/modules/abilities/rangeable.rb
|
|
106
|
+
- lib/pagy/modules/abilities/shiftable.rb
|
|
107
|
+
- lib/pagy/modules/b64.rb
|
|
108
|
+
- lib/pagy/modules/console.rb
|
|
109
|
+
- lib/pagy/modules/i18n/i18n.rb
|
|
110
|
+
- lib/pagy/modules/i18n/p11n.rb
|
|
111
|
+
- lib/pagy/modules/i18n/p11n/arabic.rb
|
|
112
|
+
- lib/pagy/modules/i18n/p11n/east_slavic.rb
|
|
113
|
+
- lib/pagy/modules/i18n/p11n/one_other.rb
|
|
114
|
+
- lib/pagy/modules/i18n/p11n/one_upto_two_other.rb
|
|
115
|
+
- lib/pagy/modules/i18n/p11n/other.rb
|
|
116
|
+
- lib/pagy/modules/i18n/p11n/polish.rb
|
|
117
|
+
- lib/pagy/modules/i18n/p11n/west_slavic.rb
|
|
118
|
+
- lib/pagy/modules/searcher.rb
|
|
119
|
+
- lib/pagy/next.rb
|
|
120
|
+
- lib/pagy/tasks/sync.rb
|
|
121
|
+
- lib/pagy/toolbox/helpers/anchor_tags.rb
|
|
122
|
+
- lib/pagy/toolbox/helpers/bootstrap/input_nav_js.rb
|
|
123
|
+
- lib/pagy/toolbox/helpers/bootstrap/previous_next_html.rb
|
|
124
|
+
- lib/pagy/toolbox/helpers/bootstrap/series_nav.rb
|
|
125
|
+
- lib/pagy/toolbox/helpers/bootstrap/series_nav_js.rb
|
|
126
|
+
- lib/pagy/toolbox/helpers/bulma/input_nav_js.rb
|
|
127
|
+
- lib/pagy/toolbox/helpers/bulma/previous_next_html.rb
|
|
128
|
+
- lib/pagy/toolbox/helpers/bulma/series_nav.rb
|
|
129
|
+
- lib/pagy/toolbox/helpers/bulma/series_nav_js.rb
|
|
130
|
+
- lib/pagy/toolbox/helpers/data_hash.rb
|
|
131
|
+
- lib/pagy/toolbox/helpers/headers_hash.rb
|
|
132
|
+
- lib/pagy/toolbox/helpers/info_tag.rb
|
|
133
|
+
- lib/pagy/toolbox/helpers/input_nav_js.rb
|
|
134
|
+
- lib/pagy/toolbox/helpers/limit_tag_js.rb
|
|
135
|
+
- lib/pagy/toolbox/helpers/loaders.rb
|
|
136
|
+
- lib/pagy/toolbox/helpers/page_url.rb
|
|
137
|
+
- lib/pagy/toolbox/helpers/series_nav.rb
|
|
138
|
+
- lib/pagy/toolbox/helpers/series_nav_js.rb
|
|
139
|
+
- lib/pagy/toolbox/helpers/support/a_lambda.rb
|
|
140
|
+
- lib/pagy/toolbox/helpers/support/data_pagy_attribute.rb
|
|
141
|
+
- lib/pagy/toolbox/helpers/support/nav_aria_label_attribute.rb
|
|
142
|
+
- lib/pagy/toolbox/helpers/support/series.rb
|
|
143
|
+
- lib/pagy/toolbox/helpers/support/wrap_input_nav_js.rb
|
|
144
|
+
- lib/pagy/toolbox/helpers/support/wrap_series_nav.rb
|
|
145
|
+
- lib/pagy/toolbox/helpers/support/wrap_series_nav_js.rb
|
|
146
|
+
- lib/pagy/toolbox/helpers/urls_hash.rb
|
|
147
|
+
- lib/pagy/toolbox/paginators/calendar.rb
|
|
148
|
+
- lib/pagy/toolbox/paginators/countish.rb
|
|
149
|
+
- lib/pagy/toolbox/paginators/countless.rb
|
|
150
|
+
- lib/pagy/toolbox/paginators/elasticsearch_rails.rb
|
|
151
|
+
- lib/pagy/toolbox/paginators/keynav_js.rb
|
|
152
|
+
- lib/pagy/toolbox/paginators/keyset.rb
|
|
153
|
+
- lib/pagy/toolbox/paginators/meilisearch.rb
|
|
154
|
+
- lib/pagy/toolbox/paginators/method.rb
|
|
155
|
+
- lib/pagy/toolbox/paginators/offset.rb
|
|
156
|
+
- lib/pagy/toolbox/paginators/searchkick.rb
|
|
157
|
+
- lib/pagy/toolbox/paginators/typesense_rails.rb
|
|
77
158
|
- locales/ar.yml
|
|
78
159
|
- locales/be.yml
|
|
79
160
|
- locales/bg.yml
|
|
@@ -88,6 +169,7 @@ files:
|
|
|
88
169
|
- locales/es.yml
|
|
89
170
|
- locales/fr.yml
|
|
90
171
|
- locales/hr.yml
|
|
172
|
+
- locales/hu.yml
|
|
91
173
|
- locales/id.yml
|
|
92
174
|
- locales/it.yml
|
|
93
175
|
- locales/ja.yml
|
|
@@ -112,9 +194,8 @@ files:
|
|
|
112
194
|
- locales/zh-CN.yml
|
|
113
195
|
- locales/zh-HK.yml
|
|
114
196
|
- locales/zh-TW.yml
|
|
197
|
+
- stylesheets/pagy-tailwind.css
|
|
115
198
|
- stylesheets/pagy.css
|
|
116
|
-
- stylesheets/pagy.scss
|
|
117
|
-
- stylesheets/pagy.tailwind.css
|
|
118
199
|
homepage: https://github.com/ddnexus/pagy
|
|
119
200
|
licenses:
|
|
120
201
|
- MIT
|
|
@@ -123,7 +204,7 @@ metadata:
|
|
|
123
204
|
homepage_uri: https://github.com/ddnexus/pagy
|
|
124
205
|
documentation_uri: https://ddnexus.github.io/pagy
|
|
125
206
|
bug_tracker_uri: https://github.com/ddnexus/pagy/issues
|
|
126
|
-
changelog_uri: https://github.
|
|
207
|
+
changelog_uri: https://ddnexus.github.io/pagy/changelog/
|
|
127
208
|
support: https://github.com/ddnexus/pagy/discussions/categories/q-a
|
|
128
209
|
rdoc_options: []
|
|
129
210
|
require_paths:
|
|
@@ -132,14 +213,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
132
213
|
requirements:
|
|
133
214
|
- - ">="
|
|
134
215
|
- !ruby/object:Gem::Version
|
|
135
|
-
version: '3.
|
|
216
|
+
version: '3.3'
|
|
136
217
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
218
|
requirements:
|
|
138
219
|
- - ">="
|
|
139
220
|
- !ruby/object:Gem::Version
|
|
140
221
|
version: '0'
|
|
141
222
|
requirements: []
|
|
142
|
-
rubygems_version:
|
|
223
|
+
rubygems_version: 4.0.6
|
|
143
224
|
specification_version: 4
|
|
144
|
-
summary:
|
|
225
|
+
summary: "Pagy \U0001F438 The Leaping Gem!"
|
|
145
226
|
test_files: []
|
data/javascripts/pagy.min.js.map
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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 limit_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_limit__/, 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: \"9.4.0\",\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,Q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