govuk-components 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7d91723138110b84d128cc377b0c458ee7dca3714b77708581ffc2ce7c55e8e
4
- data.tar.gz: 784446ce4999d80eefe5c176ce17d4e4952163cd460996b9530a01e6a51d17e1
3
+ metadata.gz: bb212d5aeb799affbe885b0a386f4f012e29938efeb71c7f4931c8ba5d16eb15
4
+ data.tar.gz: 45cb8082ee1df09af0a0528d1fb6f05e3113b2bd958bc334065e1c651017bff2
5
5
  SHA512:
6
- metadata.gz: 106c70d02e199030904967f1a814baa564d6c4397978d99b1afdbcbe80f8414d94589a83c39317c80a0fa75fa0841d835090f49b76b2597956f0838ec763824f
7
- data.tar.gz: 5aa69c78b7879be82256aac6d6e7ba967de6179ae4ba9386501d4f31179a5b0b07cd2d16648e0c135d2cf32b5462725a2a7931433a4af08bb2133f9889dbef4d
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.0-E16D6D)](https://www.ruby-lang.org/en/downloads/)
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 = items || build_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
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '3.1.0'.freeze
3
+ VERSION = '3.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers