govuk_publishing_components 41.1.1 → 42.0.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/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +0 -2
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +0 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/lib.js +0 -1
- data/app/assets/stylesheets/component_guide/application.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +12 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +8 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +22 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +12 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +6 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +14 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +24 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +32 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +34 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +25 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +17 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +11 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +1 -1
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +6 -1
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -5
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_table.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/_thumbnail_external.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +9 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +1 -1
- data/config/initializers/assets.rb +1 -8
- data/lib/govuk_publishing_components/presenters/attachment_helper.rb +4 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +4 -30
- data/app/assets/config/govuk_publishing_components_sassc-rails_manifest.js +0 -90
- data/app/assets/javascripts/govuk_publishing_components/ie.js +0 -2
- data/app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js +0 -4
- data/app/assets/javascripts/govuk_publishing_components/vendor/json2.js +0 -487
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/closest.js +0 -23
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/indexOf.js +0 -9
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/DOMTokenList.js +0 -273
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Date/now.js +0 -21
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Document.js +0 -34
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/classList.js +0 -592
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/closest.js +0 -57
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/dataset.js +0 -303
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/matches.js +0 -32
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/nextElementSibling.js +0 -257
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/previousElementSibling.js +0 -257
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element.js +0 -148
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Event.js +0 -506
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Function/prototype/bind.js +0 -253
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Object/defineProperty.js +0 -94
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/String/prototype/trim.js +0 -22
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Window.js +0 -28
@@ -1,273 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
-
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
-
(factory());
|
5
|
-
}(this, (function () { 'use strict';
|
6
|
-
|
7
|
-
// @ts-nocheck
|
8
|
-
(function (undefined) {
|
9
|
-
|
10
|
-
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/detect.js
|
11
|
-
var detect = (
|
12
|
-
'DOMTokenList' in this && (function (x) {
|
13
|
-
return 'classList' in x ? !x.classList.toggle('x', false) && !x.className : true;
|
14
|
-
})(document.createElement('x'))
|
15
|
-
);
|
16
|
-
|
17
|
-
if (detect) return
|
18
|
-
|
19
|
-
// Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/polyfill.js
|
20
|
-
(function (global) {
|
21
|
-
var nativeImpl = "DOMTokenList" in global && global.DOMTokenList;
|
22
|
-
|
23
|
-
if (
|
24
|
-
!nativeImpl ||
|
25
|
-
(
|
26
|
-
!!document.createElementNS &&
|
27
|
-
!!document.createElementNS('http://www.w3.org/2000/svg', 'svg') &&
|
28
|
-
!(document.createElementNS("http://www.w3.org/2000/svg", "svg").classList instanceof DOMTokenList)
|
29
|
-
)
|
30
|
-
) {
|
31
|
-
global.DOMTokenList = (function() { // eslint-disable-line no-unused-vars
|
32
|
-
var dpSupport = true;
|
33
|
-
var defineGetter = function (object, name, fn, configurable) {
|
34
|
-
if (Object.defineProperty)
|
35
|
-
Object.defineProperty(object, name, {
|
36
|
-
configurable: false === dpSupport ? true : !!configurable,
|
37
|
-
get: fn
|
38
|
-
});
|
39
|
-
|
40
|
-
else object.__defineGetter__(name, fn);
|
41
|
-
};
|
42
|
-
|
43
|
-
/** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */
|
44
|
-
try {
|
45
|
-
defineGetter({}, "support");
|
46
|
-
}
|
47
|
-
catch (e) {
|
48
|
-
dpSupport = false;
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
var _DOMTokenList = function (el, prop) {
|
53
|
-
var that = this;
|
54
|
-
var tokens = [];
|
55
|
-
var tokenMap = {};
|
56
|
-
var length = 0;
|
57
|
-
var maxLength = 0;
|
58
|
-
var addIndexGetter = function (i) {
|
59
|
-
defineGetter(that, i, function () {
|
60
|
-
preop();
|
61
|
-
return tokens[i];
|
62
|
-
}, false);
|
63
|
-
|
64
|
-
};
|
65
|
-
var reindex = function () {
|
66
|
-
|
67
|
-
/** Define getter functions for array-like access to the tokenList's contents. */
|
68
|
-
if (length >= maxLength)
|
69
|
-
for (; maxLength < length; ++maxLength) {
|
70
|
-
addIndexGetter(maxLength);
|
71
|
-
}
|
72
|
-
};
|
73
|
-
|
74
|
-
/** Helper function called at the start of each class method. Internal use only. */
|
75
|
-
var preop = function () {
|
76
|
-
var error;
|
77
|
-
var i;
|
78
|
-
var args = arguments;
|
79
|
-
var rSpace = /\s+/;
|
80
|
-
|
81
|
-
/** Validate the token/s passed to an instance method, if any. */
|
82
|
-
if (args.length)
|
83
|
-
for (i = 0; i < args.length; ++i)
|
84
|
-
if (rSpace.test(args[i])) {
|
85
|
-
error = new SyntaxError('String "' + args[i] + '" ' + "contains" + ' an invalid character');
|
86
|
-
error.code = 5;
|
87
|
-
error.name = "InvalidCharacterError";
|
88
|
-
throw error;
|
89
|
-
}
|
90
|
-
|
91
|
-
|
92
|
-
/** Split the new value apart by whitespace*/
|
93
|
-
if (typeof el[prop] === "object") {
|
94
|
-
tokens = ("" + el[prop].baseVal).replace(/^\s+|\s+$/g, "").split(rSpace);
|
95
|
-
} else {
|
96
|
-
tokens = ("" + el[prop]).replace(/^\s+|\s+$/g, "").split(rSpace);
|
97
|
-
}
|
98
|
-
|
99
|
-
/** Avoid treating blank strings as single-item token lists */
|
100
|
-
if ("" === tokens[0]) tokens = [];
|
101
|
-
|
102
|
-
/** Repopulate the internal token lists */
|
103
|
-
tokenMap = {};
|
104
|
-
for (i = 0; i < tokens.length; ++i)
|
105
|
-
tokenMap[tokens[i]] = true;
|
106
|
-
length = tokens.length;
|
107
|
-
reindex();
|
108
|
-
};
|
109
|
-
|
110
|
-
/** Populate our internal token list if the targeted attribute of the subject element isn't empty. */
|
111
|
-
preop();
|
112
|
-
|
113
|
-
/** Return the number of tokens in the underlying string. Read-only. */
|
114
|
-
defineGetter(that, "length", function () {
|
115
|
-
preop();
|
116
|
-
return length;
|
117
|
-
});
|
118
|
-
|
119
|
-
/** Override the default toString/toLocaleString methods to return a space-delimited list of tokens when typecast. */
|
120
|
-
that.toLocaleString =
|
121
|
-
that.toString = function () {
|
122
|
-
preop();
|
123
|
-
return tokens.join(" ");
|
124
|
-
};
|
125
|
-
|
126
|
-
that.item = function (idx) {
|
127
|
-
preop();
|
128
|
-
return tokens[idx];
|
129
|
-
};
|
130
|
-
|
131
|
-
that.contains = function (token) {
|
132
|
-
preop();
|
133
|
-
return !!tokenMap[token];
|
134
|
-
};
|
135
|
-
|
136
|
-
that.add = function () {
|
137
|
-
preop.apply(that, args = arguments);
|
138
|
-
|
139
|
-
for (var args, token, i = 0, l = args.length; i < l; ++i) {
|
140
|
-
token = args[i];
|
141
|
-
if (!tokenMap[token]) {
|
142
|
-
tokens.push(token);
|
143
|
-
tokenMap[token] = true;
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
/** Update the targeted attribute of the attached element if the token list's changed. */
|
148
|
-
if (length !== tokens.length) {
|
149
|
-
length = tokens.length >>> 0;
|
150
|
-
if (typeof el[prop] === "object") {
|
151
|
-
el[prop].baseVal = tokens.join(" ");
|
152
|
-
} else {
|
153
|
-
el[prop] = tokens.join(" ");
|
154
|
-
}
|
155
|
-
reindex();
|
156
|
-
}
|
157
|
-
};
|
158
|
-
|
159
|
-
that.remove = function () {
|
160
|
-
preop.apply(that, args = arguments);
|
161
|
-
|
162
|
-
/** Build a hash of token names to compare against when recollecting our token list. */
|
163
|
-
for (var args, ignore = {}, i = 0, t = []; i < args.length; ++i) {
|
164
|
-
ignore[args[i]] = true;
|
165
|
-
delete tokenMap[args[i]];
|
166
|
-
}
|
167
|
-
|
168
|
-
/** Run through our tokens list and reassign only those that aren't defined in the hash declared above. */
|
169
|
-
for (i = 0; i < tokens.length; ++i)
|
170
|
-
if (!ignore[tokens[i]]) t.push(tokens[i]);
|
171
|
-
|
172
|
-
tokens = t;
|
173
|
-
length = t.length >>> 0;
|
174
|
-
|
175
|
-
/** Update the targeted attribute of the attached element. */
|
176
|
-
if (typeof el[prop] === "object") {
|
177
|
-
el[prop].baseVal = tokens.join(" ");
|
178
|
-
} else {
|
179
|
-
el[prop] = tokens.join(" ");
|
180
|
-
}
|
181
|
-
reindex();
|
182
|
-
};
|
183
|
-
|
184
|
-
that.toggle = function (token, force) {
|
185
|
-
preop.apply(that, [token]);
|
186
|
-
|
187
|
-
/** Token state's being forced. */
|
188
|
-
if (undefined !== force) {
|
189
|
-
if (force) {
|
190
|
-
that.add(token);
|
191
|
-
return true;
|
192
|
-
} else {
|
193
|
-
that.remove(token);
|
194
|
-
return false;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
|
198
|
-
/** Token already exists in tokenList. Remove it, and return FALSE. */
|
199
|
-
if (tokenMap[token]) {
|
200
|
-
that.remove(token);
|
201
|
-
return false;
|
202
|
-
}
|
203
|
-
|
204
|
-
/** Otherwise, add the token and return TRUE. */
|
205
|
-
that.add(token);
|
206
|
-
return true;
|
207
|
-
};
|
208
|
-
|
209
|
-
return that;
|
210
|
-
};
|
211
|
-
|
212
|
-
return _DOMTokenList;
|
213
|
-
}());
|
214
|
-
}
|
215
|
-
|
216
|
-
// Add second argument to native DOMTokenList.toggle() if necessary
|
217
|
-
(function () {
|
218
|
-
var e = document.createElement('span');
|
219
|
-
if (!('classList' in e)) return;
|
220
|
-
e.classList.toggle('x', false);
|
221
|
-
if (!e.classList.contains('x')) return;
|
222
|
-
e.classList.constructor.prototype.toggle = function toggle(token /*, force*/) {
|
223
|
-
var force = arguments[1];
|
224
|
-
if (force === undefined) {
|
225
|
-
var add = !this.contains(token);
|
226
|
-
this[add ? 'add' : 'remove'](token);
|
227
|
-
return add;
|
228
|
-
}
|
229
|
-
force = !!force;
|
230
|
-
this[force ? 'add' : 'remove'](token);
|
231
|
-
return force;
|
232
|
-
};
|
233
|
-
}());
|
234
|
-
|
235
|
-
// Add multiple arguments to native DOMTokenList.add() if necessary
|
236
|
-
(function () {
|
237
|
-
var e = document.createElement('span');
|
238
|
-
if (!('classList' in e)) return;
|
239
|
-
e.classList.add('a', 'b');
|
240
|
-
if (e.classList.contains('b')) return;
|
241
|
-
var native = e.classList.constructor.prototype.add;
|
242
|
-
e.classList.constructor.prototype.add = function () {
|
243
|
-
var args = arguments;
|
244
|
-
var l = arguments.length;
|
245
|
-
for (var i = 0; i < l; i++) {
|
246
|
-
native.call(this, args[i]);
|
247
|
-
}
|
248
|
-
};
|
249
|
-
}());
|
250
|
-
|
251
|
-
// Add multiple arguments to native DOMTokenList.remove() if necessary
|
252
|
-
(function () {
|
253
|
-
var e = document.createElement('span');
|
254
|
-
if (!('classList' in e)) return;
|
255
|
-
e.classList.add('a');
|
256
|
-
e.classList.add('b');
|
257
|
-
e.classList.remove('a', 'b');
|
258
|
-
if (!e.classList.contains('b')) return;
|
259
|
-
var native = e.classList.constructor.prototype.remove;
|
260
|
-
e.classList.constructor.prototype.remove = function () {
|
261
|
-
var args = arguments;
|
262
|
-
var l = arguments.length;
|
263
|
-
for (var i = 0; i < l; i++) {
|
264
|
-
native.call(this, args[i]);
|
265
|
-
}
|
266
|
-
};
|
267
|
-
}());
|
268
|
-
|
269
|
-
}(this));
|
270
|
-
|
271
|
-
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
272
|
-
|
273
|
-
})));
|
@@ -1,21 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
-
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
-
(factory());
|
5
|
-
}(this, (function () { 'use strict';
|
6
|
-
|
7
|
-
// @ts-nocheck
|
8
|
-
(function (undefined) {
|
9
|
-
|
10
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/v3.111.0/polyfills/Date/now/detect.js
|
11
|
-
var detect = ('Date' in self && 'now' in self.Date && 'getTime' in self.Date.prototype);
|
12
|
-
|
13
|
-
if (detect) return
|
14
|
-
|
15
|
-
Date.now = function () {
|
16
|
-
return new Date().getTime();
|
17
|
-
};
|
18
|
-
|
19
|
-
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
20
|
-
|
21
|
-
})));
|
@@ -1,34 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
-
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
-
(factory());
|
5
|
-
}(this, (function () { 'use strict';
|
6
|
-
|
7
|
-
// @ts-nocheck
|
8
|
-
(function (undefined) {
|
9
|
-
|
10
|
-
// Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Document/detect.js
|
11
|
-
var detect = ("Document" in this);
|
12
|
-
|
13
|
-
if (detect) return
|
14
|
-
|
15
|
-
if ((typeof WorkerGlobalScope === "undefined") && (typeof importScripts !== "function")) {
|
16
|
-
|
17
|
-
if (this.HTMLDocument) { // IE8
|
18
|
-
|
19
|
-
// HTMLDocument is an extension of Document. If the browser has HTMLDocument but not Document, the former will suffice as an alias for the latter.
|
20
|
-
this.Document = this.HTMLDocument;
|
21
|
-
|
22
|
-
} else {
|
23
|
-
|
24
|
-
// Create an empty function to act as the missing constructor for the document object, attach the document object as its prototype. The function needs to be anonymous else it is hoisted and causes the feature detect to prematurely pass, preventing the assignments below being made.
|
25
|
-
this.Document = this.HTMLDocument = document.constructor = (new Function('return function Document() {}')());
|
26
|
-
this.Document.prototype = document;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
})
|
32
|
-
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
33
|
-
|
34
|
-
})));
|