govuk-design-system-rails 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d9c752c65f527e2c23a15a9955ab438f2d422581debc5ffe196af752af35ae8
|
4
|
+
data.tar.gz: eea66bc7582da74d5b46165644293bc011d4c7cc142a9b19ac02aad828b19059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 821f93c096c7c7dd5d334ae98a2184285a9cc33ba90c2cabb62deed84267fdb57894febceb0e3a59599fe707b28ae1499feb44a8251c55d5e1760df7208534a8
|
7
|
+
data.tar.gz: a845dbed683c15887574fb8ec6ac24714b8a11afa07b09d06eb6171352b826fa724a8dc590c2b7f70f88d68f79b830feb7964a885ae6455b36ed80eb8d76b324
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ You **must** include the [govuk-frontend](https://github.com/alphagov/govuk-fron
|
|
14
14
|
|
15
15
|
| This gem's version | Compatible with `govuk-frontend` version |
|
16
16
|
|--------------------| --- |
|
17
|
-
| 0.
|
17
|
+
| 0.9.7 | 4.3.1 |
|
18
18
|
| 0.9.0 | 4.1.0 |
|
19
19
|
| 0.8.2 | 3.14.0 |
|
20
20
|
|
@@ -96,10 +96,11 @@
|
|
96
96
|
</svg>
|
97
97
|
</button>
|
98
98
|
<% end %>
|
99
|
+
|
99
100
|
<script nonce="true">
|
100
|
-
|
101
|
-
window.callAutocompleteWhenReady(<%= local_assigns[:id].to_json %>, { showAllValues: <%= local_assigns[:show_all_values].to_json %> });
|
102
|
-
//]]>
|
101
|
+
// <![CDATA[
|
102
|
+
window.callAutocompleteWhenReady(<%= local_assigns[:id].to_json.html_safe %>, { showAllValues: <%= local_assigns[:show_all_values].to_json.html_safe %> });
|
103
|
+
// ]]>
|
103
104
|
</script>
|
104
105
|
<% else %>
|
105
106
|
<%= select %>
|
@@ -2,7 +2,7 @@ $LOAD_PATH.push File.expand_path("lib", __dir__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "govuk-design-system-rails"
|
5
|
-
s.version = "0.10.
|
5
|
+
s.version = "0.10.3"
|
6
6
|
s.authors = %w[govuk-ruby]
|
7
7
|
s.summary = "An implementation of the govuk-frontend macros in Ruby on Rails"
|
8
8
|
s.homepage = "https://github.com/govuk-ruby/govuk-design-system-rails"
|
@@ -81,5 +81,56 @@ RSpec.describe GovukDesignSystem::SelectHelper, type: :helper do
|
|
81
81
|
</div>
|
82
82
|
HTML
|
83
83
|
end
|
84
|
+
|
85
|
+
it "returns the correct HTML when the select element is an autocomplete element" do
|
86
|
+
html = helper.govukSelect({
|
87
|
+
id: "sort",
|
88
|
+
name: "sort",
|
89
|
+
label: {
|
90
|
+
text: "Sort by"
|
91
|
+
},
|
92
|
+
items: [
|
93
|
+
{
|
94
|
+
value: "published",
|
95
|
+
text: "Recently published"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
value: "updated",
|
99
|
+
text: "Recently updated",
|
100
|
+
selected: true
|
101
|
+
},
|
102
|
+
{
|
103
|
+
value: "views",
|
104
|
+
text: "Most views"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
value: "comments",
|
108
|
+
text: "Most comments"
|
109
|
+
}
|
110
|
+
],
|
111
|
+
is_autocomplete: true
|
112
|
+
})
|
113
|
+
|
114
|
+
expect(html).to match_html(<<~HTML)
|
115
|
+
<div class="govuk-form-group">
|
116
|
+
<label class="govuk-label" for="sort">
|
117
|
+
Sort by
|
118
|
+
</label>
|
119
|
+
<div class="">
|
120
|
+
<select class="govuk-select" id="sort" name="sort">
|
121
|
+
<option value="published">Recently published</option>
|
122
|
+
<option value="updated" selected="selected">Recently updated</option>
|
123
|
+
<option value="views">Most views</option>
|
124
|
+
<option value="comments">Most comments</option>
|
125
|
+
</select>
|
126
|
+
</div>
|
127
|
+
<script nonce="true">
|
128
|
+
// <![CDATA[
|
129
|
+
window.callAutocompleteWhenReady("sort", { showAllValues: null });
|
130
|
+
// ]]>
|
131
|
+
</script>
|
132
|
+
</div>
|
133
|
+
HTML
|
134
|
+
end
|
84
135
|
end
|
85
136
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk-design-system-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- govuk-ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compare-xml
|