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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6802029dc7bf2e5fbe3d38344ce15197d3e7d07a8c44f2e10eae8f575df451c0
4
- data.tar.gz: a8cfeb648351da3bd5de72858c61856f12db918e850b4de1cd8888627d01ee61
3
+ metadata.gz: 22a47bedba29fe5d2d72109c855c6ec1cd72853b3c1fcc90a769bb886d8113f5
4
+ data.tar.gz: fce48744632137a2f4af3b35614f7f53c609082f5de96964e7eff2f92e27d466
5
5
  SHA512:
6
- metadata.gz: f31107cab21fecd8e128f6dfb7d2d7cd96693e4d03ac0763546dc2521fc2d5404a2f084d3d69ed3ea640eb5a14fcc04be0e354784eee74c4f7db3988f806b555
7
- data.tar.gz: bd20de801e88703e041a98adb4398b74a99cb9459626af8fdd5fdcde3b673dc124d9022bcac5a4feb2827ed8179b6491635e169a8e658168c27088ac28e97d6d
6
+ metadata.gz: d09f627c325fbe2967bc5cc49dca340d50cf488844735ea8f4f85ade2f0421948413b4786b23d4e56e374249d449547ea31311c0a2df47d730d0eef2f1f7699e
7
+ data.tar.gz: 72696cc87832ffb93a3d28be7671ee4a32386bad9df6172619503efc762f4ae123d809f7932d0494651378d553a9217c823012c9ca7e4bf5b24bba3c144decf5
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ Gemfile.lock
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Clearwater::VirtualList
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/clearwater/virtual_list`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/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.
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/[USERNAME]/clearwater-virtual_list/blob/master/CODE_OF_CONDUCT.md).
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).
@@ -1,5 +1,5 @@
1
1
  module Clearwater
2
2
  module VirtualList
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ module Clearwater
15
15
  box_sizing: 'border-box',
16
16
  },
17
17
  item_style: {
18
- height: "#{@item_height}px",
18
+ height: "#{height}px",
19
19
  box_sizing: 'border-box',
20
20
  },
21
21
  )
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.0
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-25 00:00:00.000000000 Z
11
+ date: 2018-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler