govuk-components 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/govuk_component/accordion_component.rb +1 -1
- data/app/components/govuk_component/tab_component.rb +1 -1
- data/app/components/govuk_component/task_list_component/item_component.rb +6 -1
- data/app/components/govuk_component/task_list_component/status_component.rb +13 -6
- data/lib/govuk/components/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ea92186b060054ebbab68352b115d86c1a051ac637fa6cb2baf16299a0e1c9e
|
4
|
+
data.tar.gz: 4e230e506c271f6c905ae11f1b9703449d9cff10385b9722643865b55e135377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad1b1774616a6345aacda5a61d92d7a11f4074d72eb00a86f055db0ad1d77f98485b843892d1f482fa231513f9a163b01bbb54e07b5be44e58e0c8884a6cf8a3
|
7
|
+
data.tar.gz: 773ab4a3aa83dc5eff40e946ceea1a9fda5d414cbabcaf8bd3838140cc0525ea97b151b3d7b98bca6e638be820ee7b133cd8a9089c8b7dce2485a9319866bcac
|
@@ -3,7 +3,7 @@ class GovukComponent::AccordionComponent < GovukComponent::Base
|
|
3
3
|
GovukComponent::AccordionComponent::SectionComponent.new(
|
4
4
|
classes: classes,
|
5
5
|
expanded: expanded,
|
6
|
-
heading_level: heading_level,
|
6
|
+
heading_level: heading_level, # set once at parent level, passed to all children
|
7
7
|
html_attributes: html_attributes,
|
8
8
|
summary_text: summary_text,
|
9
9
|
heading_text: heading_text,
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module GovukComponent
|
2
2
|
class TaskListComponent::ItemComponent < GovukComponent::Base
|
3
|
-
renders_one :status, ->(text: nil, classes: [], html_attributes: {}, &block) do
|
3
|
+
renders_one :status, ->(text: nil, cannot_start_yet: false, classes: [], html_attributes: {}, &block) do
|
4
4
|
GovukComponent::TaskListComponent::StatusComponent.new(
|
5
5
|
id_prefix: @id_prefix,
|
6
6
|
count: @count,
|
7
7
|
text: text,
|
8
|
+
cannot_start_yet: cannot_start_yet,
|
8
9
|
classes: classes,
|
9
10
|
html_attributes: html_attributes,
|
10
11
|
&block
|
@@ -39,6 +40,10 @@ module GovukComponent
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def call
|
43
|
+
if href.presence && status_content.cannot_start_yet
|
44
|
+
fail(ArgumentError, "item cannot have a href with status where cannot_start_yet: true")
|
45
|
+
end
|
46
|
+
|
42
47
|
adjusted_html_attributes = if href.present? || title&.href.present?
|
43
48
|
html_attributes_with_link_class
|
44
49
|
else
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module GovukComponent
|
2
2
|
class TaskListComponent::StatusComponent < GovukComponent::Base
|
3
|
-
attr_reader :id_prefix, :text, :count
|
3
|
+
attr_reader :id_prefix, :text, :cannot_start_yet, :count
|
4
4
|
|
5
|
-
def initialize(text: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {})
|
6
|
-
@text
|
7
|
-
@count
|
8
|
-
@id_prefix
|
5
|
+
def initialize(text: nil, id_prefix: nil, count: nil, cannot_start_yet: false, classes: [], html_attributes: {})
|
6
|
+
@text = text
|
7
|
+
@count = count
|
8
|
+
@id_prefix = id_prefix
|
9
|
+
@cannot_start_yet = cannot_start_yet
|
9
10
|
|
10
11
|
super(classes: classes, html_attributes: html_attributes)
|
11
12
|
end
|
@@ -21,7 +22,13 @@ module GovukComponent
|
|
21
22
|
private
|
22
23
|
|
23
24
|
def default_attributes
|
24
|
-
{
|
25
|
+
{
|
26
|
+
class: class_names(
|
27
|
+
"govuk-task-list__status",
|
28
|
+
"govuk-task-list__status--cannot-start-yet" => cannot_start_yet,
|
29
|
+
),
|
30
|
+
id: [id_prefix, count, "status"].compact.join("-"),
|
31
|
+
}
|
25
32
|
end
|
26
33
|
|
27
34
|
def status_text
|
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: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DfE developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-attributes-utils
|
@@ -50,20 +50,20 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '3.
|
53
|
+
version: '3.9'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '3.
|
56
|
+
version: '3.10'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '3.
|
63
|
+
version: '3.9'
|
64
64
|
- - "<"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '3.
|
66
|
+
version: '3.10'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: deep_merge
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - '='
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 4.
|
129
|
+
version: 4.13.0
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - '='
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 4.
|
136
|
+
version: 4.13.0
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: sassc-rails
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|