govuk-components 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/components/govuk_component/pagination_component.rb +8 -3
- data/lib/govuk/components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb212d5aeb799affbe885b0a386f4f012e29938efeb71c7f4931c8ba5d16eb15
|
4
|
+
data.tar.gz: 45cb8082ee1df09af0a0528d1fb6f05e3113b2bd958bc334065e1c651017bff2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46fedf48b9bacd94e9c846cad6fbf7a1bcbb342aa01f6f2e06123131dcd1982c01b0420ad2a1b9f62a78298575b81fb6de8b2047ee1d75d43ad490837046e95a
|
7
|
+
data.tar.gz: 3913d6cadd186bf5d0c349e644bd27234a6a0aa94b7b45fe33ed30eec342addb6ef53e5b4d43ab5e89ae7bb361d1e2cecb1d7e10580db33ccb18d74ef19ad5df
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
[![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk-components)](https://github.com/DFE-Digital/govuk-components/blob/main/LICENSE)
|
9
9
|
[![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.2.0-brightgreen)](https://design-system.service.gov.uk)
|
10
10
|
[![Rails](https://img.shields.io/badge/Rails-6.1.5%20%E2%95%B1%207.0.3-E16D6D)](https://weblog.rubyonrails.org/releases/)
|
11
|
-
[![Ruby](https://img.shields.io/badge/Ruby-2.7.5%20%20%E2%95%B1%203.0.3%20%20%E2%95%B1%203.1.
|
11
|
+
[![Ruby](https://img.shields.io/badge/Ruby-2.7.5%20%20%E2%95%B1%203.0.3%20%20%E2%95%B1%203.1.2-E16D6D)](https://www.ruby-lang.org/en/downloads/)
|
12
12
|
|
13
13
|
This gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with GitHub’s [ViewComponent](https://github.com/github/view_component) framework.
|
14
14
|
|
@@ -30,6 +30,7 @@ The provided components are:
|
|
30
30
|
* [Inset text](https://govuk-components.netlify.app/components/inset-text)
|
31
31
|
* [Notification banner](https://govuk-components.netlify.app/components/notification-banner)
|
32
32
|
* [Panel](https://govuk-components.netlify.app/components/panel)
|
33
|
+
* [Pagination](https://govuk-components.netlify.app/components/pagination)
|
33
34
|
* [Phase banner](https://govuk-components.netlify.app/components/phase-banner)
|
34
35
|
* [Section break](https://govuk-components.netlify.app/components/section-break)
|
35
36
|
* [Start button](https://govuk-components.netlify.app/components/start-button)
|
@@ -49,13 +49,18 @@ class GovukComponent::PaginationComponent < GovukComponent::Base
|
|
49
49
|
@block_mode = block_mode
|
50
50
|
@landmark_label = landmark_label
|
51
51
|
|
52
|
-
build_items if pagy.present?
|
53
|
-
|
54
52
|
super(classes: classes, html_attributes: html_attributes)
|
55
53
|
end
|
56
54
|
|
57
55
|
def before_render
|
58
|
-
@page_items
|
56
|
+
@page_items = if pagy.present?
|
57
|
+
build_items
|
58
|
+
elsif items.any?
|
59
|
+
items
|
60
|
+
else
|
61
|
+
[]
|
62
|
+
end
|
63
|
+
|
59
64
|
@previous_content = previous_page || build_previous
|
60
65
|
@next_content = next_page || build_next
|
61
66
|
end
|