govuk_publishing_components 52.0.0 → 52.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +12 -0
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +8 -6
- data/app/views/govuk_publishing_components/components/_table.html.erb +6 -4
- data/app/views/govuk_publishing_components/components/docs/table.yml +32 -1
- data/lib/govuk_publishing_components/app_helpers/table_helper.rb +1 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65d358986b5bbd3ce3b30799d7cf7222b529b5c423633090273f08edb53b0bba
|
4
|
+
data.tar.gz: f9552e528d85ae9ba87045e65527e82a47eb13847713f8d8a7d6f2557e0e8328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6d4f5ed822cef7d67afcf398939c6e900bc1da3c35aa2701832680363aede5b7a8e882c64d744c771e1dbf9de683a4412353c7e7fdead23a6b4243425cf18f1
|
7
|
+
data.tar.gz: 52242c912e87ea2e6f7f0f6a4ed8ca91ea67b25ad485d0065b87659b44fd03ef3cd66ac58297a6e6ea1df082aa3e45c929f5c25bce323e0ffd9543f27aa74618
|
@@ -5,13 +5,15 @@
|
|
5
5
|
local_assigns[:margin_bottom] ||= 6
|
6
6
|
|
7
7
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
8
|
-
component_helper.add_class("gem-c-inset-text
|
8
|
+
component_helper.add_class("gem-c-inset-text gem-c-force-print-link-styles-within")
|
9
9
|
component_helper.set_id(id)
|
10
10
|
%>
|
11
11
|
<%= tag.div(**component_helper.all_attributes) do %>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
<div class="govuk-inset-text">
|
13
|
+
<% if defined? text %>
|
14
|
+
<%= text %>
|
15
|
+
<% elsif block_given? %>
|
16
|
+
<%= yield %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
17
19
|
<% end %>
|
@@ -9,6 +9,7 @@
|
|
9
9
|
sortable ||= false
|
10
10
|
filterable ||= false
|
11
11
|
label ||= t("components.table.filter_label")
|
12
|
+
margin_bottom ||= nil
|
12
13
|
|
13
14
|
table_id = "table-id-#{SecureRandom.hex(4)}"
|
14
15
|
filter_count_id = "filter-count-id-#{SecureRandom.hex(4)}"
|
@@ -16,10 +17,11 @@
|
|
16
17
|
|
17
18
|
<% @table = capture do %>
|
18
19
|
<%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
|
19
|
-
sortable
|
20
|
-
filterable
|
21
|
-
caption_classes
|
22
|
-
table_id
|
20
|
+
sortable:,
|
21
|
+
filterable:,
|
22
|
+
caption_classes:,
|
23
|
+
table_id:,
|
24
|
+
margin_bottom:,
|
23
25
|
}) do |t| %>
|
24
26
|
|
25
27
|
<% if head.any? %>
|
@@ -140,7 +140,7 @@ examples:
|
|
140
140
|
- text: £80
|
141
141
|
format: numeric
|
142
142
|
with_filter:
|
143
|
-
description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the
|
143
|
+
description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the component is rendered via the `label` key. If this is not set a fallback value will display.
|
144
144
|
data:
|
145
145
|
filterable: true
|
146
146
|
label: Filter months
|
@@ -169,3 +169,34 @@ examples:
|
|
169
169
|
format: numeric
|
170
170
|
- text: £125
|
171
171
|
format: numeric
|
172
|
+
with_custom_margin_bottom:
|
173
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). By default, this component has a margin bottom of `30px`, as determined by the design system styles.
|
174
|
+
data:
|
175
|
+
margin_bottom: 0
|
176
|
+
filterable: true
|
177
|
+
label: Filter months
|
178
|
+
head:
|
179
|
+
- text: Month you apply
|
180
|
+
- text: Rate for bicycles
|
181
|
+
format: numeric
|
182
|
+
- text: Rate for vehicles
|
183
|
+
format: numeric
|
184
|
+
rows:
|
185
|
+
-
|
186
|
+
- text: January
|
187
|
+
- text: £85
|
188
|
+
format: numeric
|
189
|
+
- text: £95
|
190
|
+
format: numeric
|
191
|
+
-
|
192
|
+
- text: February
|
193
|
+
- text: £75
|
194
|
+
format: numeric
|
195
|
+
- text: £55
|
196
|
+
format: numeric
|
197
|
+
-
|
198
|
+
- text: March
|
199
|
+
- text: £165
|
200
|
+
format: numeric
|
201
|
+
- text: £125
|
202
|
+
format: numeric
|
@@ -8,6 +8,7 @@ module GovukPublishingComponents
|
|
8
8
|
|
9
9
|
classes = %w[gem-c-table govuk-table]
|
10
10
|
classes << "govuk-table--sortable" if opt[:sortable]
|
11
|
+
classes << "govuk-!-margin-bottom-#{opt[:margin_bottom]}" if [*0..9].include?(opt[:margin_bottom])
|
11
12
|
|
12
13
|
caption_classes = %w[govuk-table__caption]
|
13
14
|
caption_classes << opt[:caption_classes] if opt[:caption_classes]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 52.
|
4
|
+
version: 52.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: govuk_app_config
|
@@ -1997,7 +1997,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1997
1997
|
- !ruby/object:Gem::Version
|
1998
1998
|
version: '0'
|
1999
1999
|
requirements: []
|
2000
|
-
rubygems_version: 3.6.
|
2000
|
+
rubygems_version: 3.6.5
|
2001
2001
|
specification_version: 4
|
2002
2002
|
summary: A gem to document components in GOV.UK frontend applications
|
2003
2003
|
test_files: []
|