clearwater-virtual_list 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +35 -6
- data/lib/clearwater/virtual_list/version.rb +1 -1
- data/opal/clearwater/virtual_list.rb +1 -1
- 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: 22a47bedba29fe5d2d72109c855c6ec1cd72853b3c1fcc90a769bb886d8113f5
|
4
|
+
data.tar.gz: fce48744632137a2f4af3b35614f7f53c609082f5de96964e7eff2f92e27d466
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09f627c325fbe2967bc5cc49dca340d50cf488844735ea8f4f85ade2f0421948413b4786b23d4e56e374249d449547ea31311c0a2df47d730d0eef2f1f7699e
|
7
|
+
data.tar.gz: 72696cc87832ffb93a3d28be7671ee4a32386bad9df6172619503efc762f4ae123d809f7932d0494651378d553a9217c823012c9ca7e4bf5b24bba3c144decf5
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Clearwater::VirtualList
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Render a virtual list of Clearwater components where list items outside of the visible area of the page are not rendered. They are inserted just in time while scrolling and removed when they are no longer visible.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,38 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Inside your Clearwater app:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'clearwater/virtual_list'
|
27
|
+
|
28
|
+
# Define the virtual list component in terms of your regular list component
|
29
|
+
MyVirtualList = Clearwater::VirtualList.create do |items:, list_style:, item_style:|
|
30
|
+
MyList.new(
|
31
|
+
items: items,
|
32
|
+
list_style: list_style,
|
33
|
+
item_style: item_style,
|
34
|
+
)
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
Use the `items` and `item_height` keyword arguments to the component when using it:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
class Layout
|
42
|
+
include Clearwater::Component
|
43
|
+
|
44
|
+
def render
|
45
|
+
div([
|
46
|
+
h1('My list of things'),
|
47
|
+
MyVirtualList.new(
|
48
|
+
items: all_the_things, # The full list of items
|
49
|
+
item_height: 100, # The height of each item in pixels
|
50
|
+
),
|
51
|
+
])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
```
|
26
55
|
|
27
56
|
## Development
|
28
57
|
|
@@ -32,7 +61,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
61
|
|
33
62
|
## Contributing
|
34
63
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/clearwater-rb/clearwater-virtual_list. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
65
|
|
37
66
|
## License
|
38
67
|
|
@@ -40,4 +69,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
69
|
|
41
70
|
## Code of Conduct
|
42
71
|
|
43
|
-
Everyone interacting in the Clearwater::VirtualList project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
72
|
+
Everyone interacting in the Clearwater::VirtualList project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/clearwater-rb/clearwater-virtual_list/blob/master/CODE_OF_CONDUCT.md).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearwater-virtual_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Gaskins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|