dxw_govuk_frontend_rails 3.3.1 → 3.4.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +3 -3
- data/package.json +1 -1
- data/vendor/assets/javascripts/govuk_frontend_rails.js +19 -38
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +14 -11
- data/vendor/assets/stylesheets/objects/_width-container.scss +23 -5
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 665a2cf46a22c74d9db17906cdc8ad3582ea81bf03d96961f29e3f46ccb4f4a6
|
4
|
+
data.tar.gz: a734d82b07c896ef3af09306721b8088628801f6931e78f5c142d85ab7be0430
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 030eac8904fb2fec2d2a62c378722b22430a70e3b3ff311856d4711bb9d900e9fdc1869638751b1bceed600f2b43468a751ffffdef85aff9a685c480022cf66f
|
7
|
+
data.tar.gz: 3b554b48352295441e18a1e30a5c5cc1428fa1713c887526b3621d114100b628d594ef3e1bbad9b1bc031eefc76b4ee46c6222abb0d663e3485daee7734e552b
|
data/Gemfile.lock
CHANGED
data/package-lock.json
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
"requires": true,
|
6
6
|
"dependencies": {
|
7
7
|
"govuk-frontend": {
|
8
|
-
"version": "3.
|
9
|
-
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.
|
10
|
-
"integrity": "sha512-
|
8
|
+
"version": "3.4.0",
|
9
|
+
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.4.0.tgz",
|
10
|
+
"integrity": "sha512-rmYPtcCtWgz92QBejYwOnfSxbPGYfvSruLwB4CBk/yJtySHRY0whG1e2/iFRRSj0pMx1Bu+zh/IqCTo+84hbFw=="
|
11
11
|
}
|
12
12
|
}
|
13
13
|
}
|
data/package.json
CHANGED
@@ -1497,6 +1497,9 @@ Details.prototype.polyfillHandleInputs = function (node, callback) {
|
|
1497
1497
|
function CharacterCount ($module) {
|
1498
1498
|
this.$module = $module;
|
1499
1499
|
this.$textarea = $module.querySelector('.govuk-js-character-count');
|
1500
|
+
if (this.$textarea) {
|
1501
|
+
this.$countMessage = $module.querySelector('[id=' + this.$textarea.id + '-info]');
|
1502
|
+
}
|
1500
1503
|
}
|
1501
1504
|
|
1502
1505
|
CharacterCount.prototype.defaults = {
|
@@ -1509,10 +1512,16 @@ CharacterCount.prototype.init = function () {
|
|
1509
1512
|
// Check for module
|
1510
1513
|
var $module = this.$module;
|
1511
1514
|
var $textarea = this.$textarea;
|
1512
|
-
|
1515
|
+
var $countMessage = this.$countMessage;
|
1516
|
+
|
1517
|
+
if (!$textarea || !$countMessage) {
|
1513
1518
|
return
|
1514
1519
|
}
|
1515
1520
|
|
1521
|
+
// We move count message right after the field
|
1522
|
+
// Kept for backwards compatibility
|
1523
|
+
$textarea.insertAdjacentElement('afterend', $countMessage);
|
1524
|
+
|
1516
1525
|
// Read options set using dataset ('data-' values)
|
1517
1526
|
this.options = this.getDataset($module);
|
1518
1527
|
|
@@ -1530,23 +1539,16 @@ CharacterCount.prototype.init = function () {
|
|
1530
1539
|
return
|
1531
1540
|
}
|
1532
1541
|
|
1533
|
-
//
|
1534
|
-
|
1535
|
-
this.countMessage = boundCreateCountMessage();
|
1542
|
+
// Remove hard limit if set
|
1543
|
+
$module.removeAttribute('maxlength');
|
1536
1544
|
|
1537
|
-
//
|
1538
|
-
|
1539
|
-
|
1540
|
-
$module.removeAttribute('maxlength');
|
1545
|
+
// Bind event changes to the textarea
|
1546
|
+
var boundChangeEvents = this.bindChangeEvents.bind(this);
|
1547
|
+
boundChangeEvents();
|
1541
1548
|
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
// Update count message
|
1547
|
-
var boundUpdateCountMessage = this.updateCountMessage.bind(this);
|
1548
|
-
boundUpdateCountMessage();
|
1549
|
-
}
|
1549
|
+
// Update count message
|
1550
|
+
var boundUpdateCountMessage = this.updateCountMessage.bind(this);
|
1551
|
+
boundUpdateCountMessage();
|
1550
1552
|
};
|
1551
1553
|
|
1552
1554
|
// Read data attributes
|
@@ -1577,27 +1579,6 @@ CharacterCount.prototype.count = function (text) {
|
|
1577
1579
|
return length
|
1578
1580
|
};
|
1579
1581
|
|
1580
|
-
// Generate count message and bind it to the input
|
1581
|
-
// returns reference to the generated element
|
1582
|
-
CharacterCount.prototype.createCountMessage = function () {
|
1583
|
-
var countElement = this.$textarea;
|
1584
|
-
var elementId = countElement.id;
|
1585
|
-
// Check for existing info count message
|
1586
|
-
var countMessage = document.getElementById(elementId + '-info');
|
1587
|
-
// If there is no existing info count message we add one right after the field
|
1588
|
-
if (elementId && !countMessage) {
|
1589
|
-
countElement.insertAdjacentHTML('afterend', '<span id="' + elementId + '-info" class="govuk-hint govuk-character-count__message" aria-live="polite"></span>');
|
1590
|
-
this.describedBy = countElement.getAttribute('aria-describedby');
|
1591
|
-
this.describedByInfo = this.describedBy + ' ' + elementId + '-info';
|
1592
|
-
countElement.setAttribute('aria-describedby', this.describedByInfo);
|
1593
|
-
countMessage = document.getElementById(elementId + '-info');
|
1594
|
-
} else {
|
1595
|
-
// If there is an existing info count message we move it right after the field
|
1596
|
-
countElement.insertAdjacentElement('afterend', countMessage);
|
1597
|
-
}
|
1598
|
-
return countMessage
|
1599
|
-
};
|
1600
|
-
|
1601
1582
|
// Bind input propertychange to the elements and update based on the change
|
1602
1583
|
CharacterCount.prototype.bindChangeEvents = function () {
|
1603
1584
|
var $textarea = this.$textarea;
|
@@ -1624,7 +1605,7 @@ CharacterCount.prototype.checkIfValueChanged = function () {
|
|
1624
1605
|
CharacterCount.prototype.updateCountMessage = function () {
|
1625
1606
|
var countElement = this.$textarea;
|
1626
1607
|
var options = this.options;
|
1627
|
-
var countMessage = this
|
1608
|
+
var countMessage = this.$countMessage;
|
1628
1609
|
|
1629
1610
|
// Determine the remaining number of characters/words
|
1630
1611
|
var currentLength = this.count(countElement.value);
|
@@ -17,7 +17,10 @@
|
|
17
17
|
|
18
18
|
// Allow space for the arrow
|
19
19
|
padding-left: 14px;
|
20
|
+
}
|
20
21
|
|
22
|
+
// Only add a custom underline if the component is linkable
|
23
|
+
.govuk-back-link[href] {
|
21
24
|
// Use border-bottom rather than text-decoration so that the arrow is
|
22
25
|
// underlined as well.
|
23
26
|
border-bottom: 1px solid govuk-colour("black");
|
@@ -30,22 +33,22 @@
|
|
30
33
|
&:focus {
|
31
34
|
border-bottom-color: transparent;
|
32
35
|
}
|
36
|
+
}
|
33
37
|
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
// Prepend left pointing arrow
|
39
|
+
.govuk-back-link:before {
|
40
|
+
@include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
|
37
41
|
|
38
|
-
|
42
|
+
content: "";
|
39
43
|
|
40
|
-
|
41
|
-
|
44
|
+
// Vertically align with the parent element
|
45
|
+
position: absolute;
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
47
|
+
top: 0;
|
48
|
+
bottom: 0;
|
49
|
+
left: 0;
|
46
50
|
|
47
|
-
|
48
|
-
}
|
51
|
+
margin: auto;
|
49
52
|
}
|
50
53
|
|
51
54
|
@if $govuk-use-legacy-font {
|
@@ -2,9 +2,27 @@
|
|
2
2
|
@import "../tools/all";
|
3
3
|
@import "../helpers/all";
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
////
|
6
|
+
/// @group objects
|
7
|
+
////
|
8
|
+
|
9
|
+
/// Width container mixin
|
10
|
+
///
|
11
|
+
/// Used to create page width and custom width container classes.
|
12
|
+
///
|
13
|
+
/// @param {String} $width [$govuk-page-width] - Width in pixels
|
14
|
+
///
|
15
|
+
/// @example scss - Creating a 1200px wide container class
|
16
|
+
/// .app-width-container--wide {
|
17
|
+
/// @include govuk-width-container(1200px);
|
18
|
+
/// }
|
19
|
+
///
|
20
|
+
/// @access public
|
21
|
+
|
22
|
+
@mixin govuk-width-container($width: $govuk-page-width) {
|
23
|
+
|
24
|
+
// By default, limit the width of the container to the page width
|
25
|
+
max-width: $width;
|
8
26
|
|
9
27
|
// On mobile, add half width gutters
|
10
28
|
margin: 0 $govuk-gutter-half;
|
@@ -38,7 +56,7 @@
|
|
38
56
|
|
39
57
|
// As soon as the viewport is greater than the width of the page plus the
|
40
58
|
// gutters, just centre the content instead of adding gutters.
|
41
|
-
@include govuk-media-query($and: "(min-width: #{($
|
59
|
+
@include govuk-media-query($and: "(min-width: #{($width + $govuk-gutter * 2)})") {
|
42
60
|
margin: 0 auto;
|
43
61
|
|
44
62
|
// Since a safe area may have previously been set above,
|
@@ -49,7 +67,7 @@
|
|
49
67
|
}
|
50
68
|
|
51
69
|
@include govuk-if-ie8 {
|
52
|
-
width: $
|
70
|
+
width: $width;
|
53
71
|
// Since media queries are not supported in IE8,
|
54
72
|
// we need to duplicate this margin that centers the page.
|
55
73
|
margin: 0 auto;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dxw_govuk_frontend_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mec
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|