govuk-components 2.1.1 → 2.1.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a251ce9b412d46a7fd70155a08ba3cc2f6e9830baca832622bdeb459936b791f
|
|
4
|
+
data.tar.gz: 85cccf721573ce9c734d7156de9da9c1ceefc22cac05888d8163d9441420be7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c94357e58eee8a5ee0ae6e059f3177e340340d7af7cd19cfc3de607cc3b04e52d62e689a9291cc94ae568a1e1de809e224c566cb82a9b148986346773b45064b
|
|
7
|
+
data.tar.gz: 89494b6d782f7aaf2e4453fc317c917bb87e6dafabd21cd8b6d0d363ebba546ae2ffbdef43f129d8eaff875f0a3cd1b804a99f271f5a33779fca3ec8fddf2d0b
|
|
@@ -53,17 +53,20 @@ private
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
class NavigationItem < GovukComponent::Base
|
|
56
|
-
attr_reader :text, :href, :active
|
|
56
|
+
attr_reader :text, :href, :options, :active
|
|
57
57
|
|
|
58
|
-
def initialize(text:, href: nil, active:
|
|
58
|
+
def initialize(text:, href: nil, options: {}, active: nil, classes: [], html_attributes: {})
|
|
59
59
|
super(classes: classes, html_attributes: html_attributes)
|
|
60
60
|
|
|
61
|
-
@text
|
|
62
|
-
@href
|
|
63
|
-
@
|
|
61
|
+
@text = text
|
|
62
|
+
@href = href
|
|
63
|
+
@options = options
|
|
64
|
+
@active = active
|
|
64
65
|
end
|
|
65
66
|
|
|
66
67
|
def active?
|
|
68
|
+
return current_page?(href) if active.nil?
|
|
69
|
+
|
|
67
70
|
active
|
|
68
71
|
end
|
|
69
72
|
|
|
@@ -77,7 +80,7 @@ private
|
|
|
77
80
|
|
|
78
81
|
def call
|
|
79
82
|
if link?
|
|
80
|
-
link_to(text, href, class: "govuk-header__link")
|
|
83
|
+
link_to(text, href, **options, class: "govuk-header__link")
|
|
81
84
|
else
|
|
82
85
|
text
|
|
83
86
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk-components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DfE developers
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-09-
|
|
11
|
+
date: 2021-09-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -220,7 +220,7 @@ homepage: https://github.com/DFE-Digital/govuk-components
|
|
|
220
220
|
licenses:
|
|
221
221
|
- MIT
|
|
222
222
|
metadata: {}
|
|
223
|
-
post_install_message:
|
|
223
|
+
post_install_message:
|
|
224
224
|
rdoc_options: []
|
|
225
225
|
require_paths:
|
|
226
226
|
- lib
|
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
236
236
|
version: '0'
|
|
237
237
|
requirements: []
|
|
238
238
|
rubygems_version: 3.1.6
|
|
239
|
-
signing_key:
|
|
239
|
+
signing_key:
|
|
240
240
|
specification_version: 4
|
|
241
241
|
summary: Lightweight set of reusable GOV.UK Design System components
|
|
242
242
|
test_files: []
|