turbo-scroll 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turbo-scroll/auto.rb +1 -1
- data/lib/turbo-scroll/auto_stream.rb +1 -1
- data/lib/turbo-scroll/more.rb +1 -1
- data/lib/turbo-scroll/more_stream.rb +1 -1
- data/lib/turbo-scroll/railtie.rb +7 -5
- data/lib/turbo-scroll/spin_loader.slim +8 -8
- data/lib/turbo-scroll/version.rb +1 -1
- data/lib/turbo-scroll.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ed03eee912eb13ef2ad5fca52c16030ebecf3f8cea94ad1b67a349a2ede8cd
|
4
|
+
data.tar.gz: abaaff4452192d92b244e6ef7bcdc0dfa5cb9d43ce859012d39bee0c16fab1cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23028478ad69fe8927fae26c4a7209ef27533acfa3beff8faf54c972e39c24a71f07080c153d877d3a407b04a765e5e9fa89235c0b913cd34201467e76284af1
|
7
|
+
data.tar.gz: b5f9c28be794ae767b3256907540a8ca29e3acfcee7fcc4fb549ae9722610676566660daa9ea5dee7ed244e9aed5ff85c556f75ebc29d90cdf86225ec93ce5be
|
data/lib/turbo-scroll/auto.rb
CHANGED
@@ -7,7 +7,7 @@ class TurboScroll::Auto < ViewComponent::Base
|
|
7
7
|
|
8
8
|
attr_reader :page, :loader_dom_id, :loading_indicator
|
9
9
|
|
10
|
-
def initialize(page:, loader_dom_id: :
|
10
|
+
def initialize(page:, loader_dom_id: :turbo_loader, loading_indicator: true)
|
11
11
|
@page = page
|
12
12
|
@loader_dom_id = loader_dom_id
|
13
13
|
@loading_indicator = loading_indicator
|
@@ -8,7 +8,7 @@ class TurboScroll::AutoStream < ViewComponent::Base
|
|
8
8
|
|
9
9
|
attr_reader :page, :loader_dom_id, :infinite_dom_id, :loading_indicator
|
10
10
|
|
11
|
-
def initialize(page:, loader_dom_id: :
|
11
|
+
def initialize(page:, loader_dom_id: :turbo_loader, loading_indicator:, infinite_dom_id: :infinite)
|
12
12
|
@page = page
|
13
13
|
@infinite_dom_id = infinite_dom_id
|
14
14
|
@loading_indicator = loading_indicator
|
data/lib/turbo-scroll/more.rb
CHANGED
@@ -8,7 +8,7 @@ class TurboScroll::MoreStream < ViewComponent::Base
|
|
8
8
|
|
9
9
|
attr_reader :page, :loader_dom_id, :infinite_dom_id
|
10
10
|
|
11
|
-
def initialize(page:, loader_dom_id: :
|
11
|
+
def initialize(page:, loader_dom_id: :turbo_loader, infinite_dom_id: :infinite)
|
12
12
|
@page = page
|
13
13
|
@loader_dom_id = loader_dom_id
|
14
14
|
@infinite_dom_id = infinite_dom_id
|
data/lib/turbo-scroll/railtie.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
module TurboScroll
|
2
2
|
class Railtie < ::Rails::Railtie
|
3
3
|
initializer "turbo-scrolls.load_components" do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
ActiveSupport.on_load(:action_view) do
|
5
|
+
require_relative "auto"
|
6
|
+
require_relative "auto_stream"
|
7
|
+
require_relative "more"
|
8
|
+
require_relative "more_stream"
|
9
|
+
require_relative "spin_loader"
|
10
|
+
end
|
9
11
|
end
|
10
12
|
initializer "turbo-scrolls.view_helpers" do |app|
|
11
13
|
ActiveSupport.on_load(:action_view) do
|
@@ -1,12 +1,12 @@
|
|
1
1
|
css:
|
2
|
-
.
|
2
|
+
.turbo_loader {
|
3
3
|
display: inline-block;
|
4
4
|
position: relative;
|
5
5
|
width: 45px;
|
6
6
|
height: 45px;
|
7
7
|
margin: auto;
|
8
8
|
}
|
9
|
-
.
|
9
|
+
.turbo_loader div {
|
10
10
|
box-sizing: border-box;
|
11
11
|
display: block;
|
12
12
|
position: absolute;
|
@@ -15,16 +15,16 @@ css:
|
|
15
15
|
margin: 8px 0px;
|
16
16
|
border: 3px solid #00afd4;
|
17
17
|
border-radius: 50%;
|
18
|
-
animation:
|
18
|
+
animation: turbo_loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
19
19
|
border-color: #00afd4 transparent transparent transparent;
|
20
20
|
}
|
21
|
-
.
|
21
|
+
.turbo_loader div:nth-child(1) {
|
22
22
|
animation-delay: -0.45s;
|
23
23
|
}
|
24
|
-
.
|
24
|
+
.turbo_loader div:nth-child(2) {
|
25
25
|
animation-delay: -0.3s;
|
26
26
|
}
|
27
|
-
.
|
27
|
+
.turbo_loader div:nth-child(3) {
|
28
28
|
animation-delay: -0.15s;
|
29
29
|
}
|
30
30
|
.page-loading {
|
@@ -34,7 +34,7 @@ css:
|
|
34
34
|
align-items: center;
|
35
35
|
}
|
36
36
|
|
37
|
-
@keyframes
|
37
|
+
@keyframes turbo_loader {
|
38
38
|
0% {
|
39
39
|
transform: rotate(0deg);
|
40
40
|
}
|
@@ -43,7 +43,7 @@ css:
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
|
46
|
-
.
|
46
|
+
.turbo_loader
|
47
47
|
div
|
48
48
|
div
|
49
49
|
div
|
data/lib/turbo-scroll/version.rb
CHANGED
data/lib/turbo-scroll.rb
CHANGED
@@ -5,7 +5,7 @@ module TurboScroll
|
|
5
5
|
module ViewHelpers
|
6
6
|
|
7
7
|
#
|
8
|
-
def turbo_scroll_auto(page:, loader_dom_id: :
|
8
|
+
def turbo_scroll_auto(page:, loader_dom_id: :turbo_loader, loading_indicator: true, id: :infinite, &block)
|
9
9
|
if block_given?
|
10
10
|
safe_concat(%{<div id="#{id}">})
|
11
11
|
concat(capture(&block))
|
@@ -15,7 +15,7 @@ module TurboScroll
|
|
15
15
|
end
|
16
16
|
|
17
17
|
#
|
18
|
-
def turbo_scroll_more(page:, loader_dom_id: :
|
18
|
+
def turbo_scroll_more(page:, loader_dom_id: :turbo_loader, id: :infinite, &block)
|
19
19
|
if block_given?
|
20
20
|
safe_concat(%{<div id="#{id}">})
|
21
21
|
concat(capture(&block))
|
@@ -25,7 +25,7 @@ module TurboScroll
|
|
25
25
|
end
|
26
26
|
|
27
27
|
#
|
28
|
-
def turbo_scroll_auto_stream(page:, loader_dom_id: :
|
28
|
+
def turbo_scroll_auto_stream(page:, loader_dom_id: :turbo_loader, infinite_dom_id: :infinite, loading_indicator: true, &block)
|
29
29
|
render(
|
30
30
|
TurboScroll::AutoStream.new(
|
31
31
|
page: page,
|
@@ -38,7 +38,7 @@ module TurboScroll
|
|
38
38
|
end
|
39
39
|
|
40
40
|
#
|
41
|
-
def turbo_scroll_more_stream(page:, loader_dom_id: :
|
41
|
+
def turbo_scroll_more_stream(page:, loader_dom_id: :turbo_loader, infinite_dom_id: :infinite, &block)
|
42
42
|
render(
|
43
43
|
TurboScroll::MoreStream.new(
|
44
44
|
page: page,
|
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.
|
4
|
+
version: 0.1.6
|
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-
|
11
|
+
date: 2022-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|