turbo-scroll 0.1.2 → 0.1.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: 795c13de80b15a25b9b37dcd9944855ac52c8b5270b0acfce62a959feddb5bec
4
- data.tar.gz: 758a95cedc0db75a01c2619bc0eae553bc94afdabd514333c04d547942952cc4
3
+ metadata.gz: 32d21797cebb4fe6b6f5dc02130949f2d83ba899d1d30d41bbcc1e90cca76a02
4
+ data.tar.gz: 334e100f9fa988dc2bac5467470d6a33634e00ccfafd488b4a61a6d8e6000983
5
5
  SHA512:
6
- metadata.gz: 8353ba4300980c23841f3ea261b871fe33f26a9766a4b6ba5892c876b8c6c57d5f321a012b5965d40f4b5f5a07292cdb20ac55b278ab455b4b2d998301ab4763
7
- data.tar.gz: 0d2c3b2866a548b54b2cf79c8cc8b1953f1b4f399b7599f72b2f37e481f331ac63d1db7e6bd2d29b9ed40893cb0af3b2715736063e13d536c387bf549d8bc7cf
6
+ metadata.gz: aeb2e54b0e4777b84053e154be686cba079ae7278661128c1bc34d8bab4d1b3cd910d2d1d4ca0d5c17d2b69c2e06f2dedf21934276638f13a4088a109ad7570c
7
+ data.tar.gz: eea9623e8f432b508fb7dd7e236c620cc414a0f016a41928a0c30bd82b3e7e950866c1ed75a351eb9a739e268e24c2858436ec11e0e321a9264e83e78d41214e
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/turbo-scroll.svg)](https://badge.fury.io/rb/turbo-scroll)
2
+
1
3
  # TurboScroll
2
4
 
3
5
  TurboScroll is a minimalistic gem that provides infinite scrolling for Rails based applications
@@ -22,13 +24,13 @@ Underlying it depends on ViewComponent and Slim but these are not forced upon th
22
24
 
23
25
  Make sure your index action responds both to html and turbo_stream
24
26
 
25
- ```
26
- @articles = Article.scoped.page(params[:page]) # next-pageable
27
+ ```rb
28
+ @articles = Article.scoped.paginate(params[:page]) # next-pageable
27
29
 
28
- respond_to do |format|
29
- format.html
30
- format.turbo_stream
31
- end
30
+ respond_to do |format|
31
+ format.html
32
+ format.turbo_stream
33
+ end
32
34
  ```
33
35
 
34
36
  ### index.html.erb|slim
@@ -51,7 +53,7 @@ When the loader component becomes visible, it will do 2 things
51
53
 
52
54
  #### Slim Example
53
55
 
54
- ```
56
+ ```slim
55
57
  #infinite
56
58
  / render your page fragment here in whatever structure you desire
57
59
  / and extract it into a partial or a component to avoid repition, if desired.
@@ -72,7 +74,7 @@ loader for the next page.
72
74
  When using the [next-pageable](https://github.com/allcrux/next-pageable) gem
73
75
  the next_page_index is already present on the collection when a next page exists.
74
76
 
75
- ```
77
+ ```slim
76
78
  = turbo_scroll_update page: @articles.next_page_index
77
79
  / render your page fragment here in whatever structure you desire
78
80
  / and extract it into a partial or a component to avoid repition, if desired.
@@ -85,7 +87,7 @@ the next_page_index is already present on the collection when a next page exists
85
87
  As HTML is pretty picky on the tags allowed inside 'table', 'tr', 'td', etc you
86
88
  can consider using CSS grid as an alternative.
87
89
 
88
- ```
90
+ ```css
89
91
  .articles-table {
90
92
  display: grid;
91
93
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 8fr) minmax(0, 2fr) minmax(0, 1fr) 3em;
@@ -114,7 +116,7 @@ can consider using CSS grid as an alternative.
114
116
 
115
117
  which would go hand in hand with this partial for a record row
116
118
 
117
- ```
119
+ ```css
118
120
  .col.col-striped = article.articlenumber
119
121
  .col.col-striped = article.barcode
120
122
  .col.col-striped = article.description
@@ -136,7 +138,7 @@ DOM ID is `#scroll`.
136
138
 
137
139
  index.html.slim
138
140
 
139
- ```
141
+ ```slim
140
142
  #scroll
141
143
  - @articles.each do |article|
142
144
  = article
@@ -146,7 +148,7 @@ index.html.slim
146
148
 
147
149
  index.turbo_stream.slim
148
150
 
149
- ```
151
+ ```slim
150
152
  = turbo_scroll_update page: @articles.next_page_index, infinite_dom_id: :scroll
151
153
  - @articles.each do |article|
152
154
  = article
data/lib/locales/en.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  en:
3
- click_here: Click <a href="%{next_page_path}">here<a> to force load the next page.
3
+ click_here: Click <a href="%{next_page_path}">here</a> to force load the next page.
data/lib/locales/fr.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  fr:
3
- click_here: Cliquez <a href="%{next_page_path}">ici<a> pour charger la page suivante.
3
+ click_here: Cliquez <a href="%{next_page_path}">ici</a> pour charger la page suivante.
data/lib/locales/nl.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  nl:
3
- click_here: Klik <a href="%{next_page_path}">hier<a> voor de volgende pagina.
3
+ click_here: Klik <a href="%{next_page_path}">hier</a> voor de volgende pagina.
data/lib/locales/ro.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  ro:
3
- click_here: Faceți clic <a href="%{next_page_path}">aici<a> pentru a încărca pagina următoare.
3
+ click_here: Faceți clic <a href="%{next_page_path}">aici</a> pentru a încărca pagina următoare.
data/lib/locales/vn.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  ---
2
- fr:
3
- click_here: Nhấp vào <a href="%{next_page_path}">đây<a> để tải trang tiếp theo.
2
+ vn:
3
+ click_here: Nhấp vào <a href="%{next_page_path}">đây</a> để tải trang tiếp theo.
@@ -1,3 +1,3 @@
1
1
  module TurboScroll
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-scroll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koen handekyn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-15 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties