playbook_ui 11.11.0.pre.alpha.paginate1 → 11.11.0.pre.alpha.paginate2

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: c6b41796c2693b117dbbb0b3f6df657d367060abfd50fc55c4db6e3f1ed6c971
4
- data.tar.gz: 7215f63899347c3044650422911ee5224b63f3858591dd5a0a17d555085aca3f
3
+ metadata.gz: 3f887ccce9480d7010b8c3e0c558a48fb9b7a9b1a9fcb0c9960e5954ecacdfe4
4
+ data.tar.gz: e28e2e224fc6150467c0bd40fb3b2df2fa00685e4588e8e3aa0b5e71a93584d3
5
5
  SHA512:
6
- metadata.gz: 8fb4dd90e9216feb799fdbfd3167d6b5088d7e54843030e916976f512607ecf12f5f09db978ae93b1ebb3d733ffd2e487acbc78996fc4b27d1be710a246ec8e9
7
- data.tar.gz: 64fcecd54d4630c3001e5341a0382cb378d0bcad69631c7a5c872513a94592ae1c00d830fe41760fd205ffa6f42e98de9c57e105eccc9ad41ad15cfc1f339e19
6
+ metadata.gz: '09b7285572384c038996fe2a2ddaa9c4992a67200aea2ea787ae9c5a59eb4509e3b360ded81c994e1dbe9b93ff93217d43a4a6847bbc82c6640a037147f47e60'
7
+ data.tar.gz: 0253c8a0e18f9c18a0152b3fe1dc0328c85cdb5c1d62f8cf88577567b09d45d38692ec16012794160dd02e4a4251e68cc2dd249a9f1b3a896f2306f92929a508
@@ -27,26 +27,26 @@
27
27
  margin-left: 1px;
28
28
  margin-right: 1px;
29
29
 
30
- &:hover {
31
- background-color: $active_light;
32
- color: $primary !important;
33
- border-radius: $border_rad_light;
34
- }
30
+ &:hover {
31
+ background-color: $active_light;
32
+ color: $primary !important;
33
+ border-radius: $border_rad_light;
34
+ }
35
35
 
36
- &:focus {
37
- outline: 1px solid $primary !important;
38
- border-radius: $border_rad_light;
39
- outline-offset: -1px;
40
- }
41
- }
42
- .active > span {
43
- background-color: $primary;
36
+ &:focus {
37
+ outline: 1px solid $primary !important;
44
38
  border-radius: $border_rad_light;
45
- margin-left: 1px;
46
- margin-right: 1px;
39
+ outline-offset: -1px;
40
+ }
41
+ }
42
+ .active > span {
43
+ background-color: $primary !important;
44
+ border-radius: $border_rad_light;
45
+ margin-left: 1px;
46
+ margin-right: 1px;
47
47
 
48
- &:hover {
49
- box-shadow: $shadow_deeper;
50
- }
48
+ &:hover {
49
+ box-shadow: $shadow_deeper;
51
50
  }
51
+ }
52
52
  }
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "will_paginate/view_helpers/action_view"
4
+
5
+ module Playbook
6
+ module Pagination
7
+ class LinkRenderer < WillPaginate::ActionView::LinkRenderer
8
+ def container_attributes
9
+ { class: "pb_pagination pagination" }
10
+ end
11
+
12
+ def page_number(page)
13
+ if page == current_page
14
+ tag("li", tag("span", page), class: "active")
15
+ else
16
+ tag("li", link(page, page, rel: rel_value(page)))
17
+ end
18
+ end
19
+
20
+ def previous_or_next_page(page, text, classname)
21
+ if page
22
+ tag("li", link(text, page), class: classname)
23
+ else
24
+ tag("li", tag("span", text), class: "%s disabled")
25
+ end
26
+ end
27
+
28
+ def gap
29
+ tag("li", tag("span", "&hellip;"), class: "disabled")
30
+ end
31
+
32
+ def previous_page
33
+ num = @collection.current_page > 1 && @collection.current_page - 1
34
+ previous_or_next_page(num, "<i class='far fa-chevron-left'></i>", "prev")
35
+ end
36
+
37
+ def next_page
38
+ num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
39
+ previous_or_next_page(num, "<i class='far fa-chevron-right'></i>", "next")
40
+ end
41
+ end
42
+ end
43
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "11.11.0"
5
- VERSION = "11.11.0.pre.alpha.paginate1"
5
+ VERSION = "11.11.0.pre.alpha.paginate2"
6
6
  end
data/lib/playbook.rb CHANGED
@@ -12,6 +12,7 @@ require "playbook/pb_doc_helper"
12
12
  require "playbook/kit_base"
13
13
  require "playbook/kit_resolver"
14
14
  require "playbook/markdown"
15
+ require "playbook/pagination_renderer"
15
16
 
16
17
  module Playbook
17
18
  ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.11.0.pre.alpha.paginate1
4
+ version: 11.11.0.pre.alpha.paginate2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-11-09 00:00:00.000000000 Z
12
+ date: 2022-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -123,6 +123,20 @@ dependencies:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: 0.3.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: will_paginate
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '3.3'
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '3.3'
126
140
  - !ruby/object:Gem::Dependency
127
141
  name: byebug
128
142
  requirement: !ruby/object:Gem::Requirement
@@ -2299,7 +2313,7 @@ files:
2299
2313
  - lib/playbook/markdown/template_handler.rb
2300
2314
  - lib/playbook/number_spacing.rb
2301
2315
  - lib/playbook/order.rb
2302
- - lib/playbook/pagination/pagination_renderer.rb
2316
+ - lib/playbook/pagination_renderer.rb
2303
2317
  - lib/playbook/pb_doc_helper.rb
2304
2318
  - lib/playbook/pb_forms_helper.rb
2305
2319
  - lib/playbook/pb_kit_helper.rb
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Playbook
4
- class LinkRenderer < WillPaginate::ActionView::LinkRenderer
5
- def container_attributes
6
- { class: "pb_pagination pagination" }
7
- end
8
-
9
- def page_number(page)
10
- if page == current_page
11
- tag("li", tag("span", page), class: "active")
12
- else
13
- tag("li", link(page, page, rel: rel_value(page)))
14
- end
15
- end
16
-
17
- def previous_or_next_page(page, text, classname)
18
- if page
19
- tag("li", link(text, page), class: classname)
20
- else
21
- tag("li", tag("span", text), class: "%s disabled")
22
- end
23
- end
24
-
25
- def gap
26
- tag("li", tag("span", "&hellip;"), class: "disabled")
27
- end
28
-
29
- def previous_page
30
- num = @collection.current_page > 1 && @collection.current_page - 1
31
- previous_or_next_page(num, "<i class='far fa-chevron-left'></i>", "prev")
32
- end
33
-
34
- def next_page
35
- num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
36
- previous_or_next_page(num, "<i class='far fa-chevron-right'></i>", "next")
37
- end
38
- end
39
- end