govuk_publishing_components 29.15.3 → 30.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1093c2ff6d40fae820a8b90e7a349d7e8dd78b10fca660453365343d7968749c
4
- data.tar.gz: 3607d6e31004a9697a60a6c7075124b085b2c7a592c6f159e9540fa9ed7c0ad6
3
+ metadata.gz: a9d5601a07939b79ec5f1d7f4251d9b7ad00628225282405c6e17bb95b3f7552
4
+ data.tar.gz: 866b2f17bc9cc6bab9e7a29bec0fbc9f5f72e96f99742556bed1d5ff8811e3b2
5
5
  SHA512:
6
- metadata.gz: 126afbff6dcbcab4a12c6551ab3546c2727841a9454df9a2eafae820bf8dcb483ad578b041e3250f085b3ba34534eabbb80727715f706391fdc2530d975da97a
7
- data.tar.gz: ea8bdcc6c1f05fc3f469de5fe182ff304ea58e228ad9caf8c89ecf8f66cc8ad8c279a5ff4d5556f09fbed75f88cd5cbd5cc46c21afc2dd1249befcbe16af8dd6
6
+ metadata.gz: a4cac8f96d558bf72da3a0f016d40341ea211a9e3895401b7980a260c125f4ccd898b720968e7c207c227128400440237ad0f1d4f6739834aac1923200b4e4a0
7
+ data.tar.gz: e97320af9673d84fd8324c66d88dc6d64b0fb9708a41fe9e42573a33cfca2deea1b6e34400e546c762485141b38c6a088a15be4e5425283206bdfef37141178a
@@ -108,11 +108,3 @@
108
108
  @include govuk-link-style-inverse;
109
109
  }
110
110
  }
111
-
112
- // This helper class is for use by the primary links js module
113
- // We have this custom helper here with a single rule over using the design system helper class govuk-!-display-none
114
- // because jasmine tests don't like the "!" in the distributed helper class
115
-
116
- .primary-links--display-none {
117
- display: none;
118
- }
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "29.15.3".freeze
2
+ VERSION = "30.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.15.3
4
+ version: 30.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-27 00:00:00.000000000 Z
11
+ date: 2022-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -495,7 +495,6 @@ files:
495
495
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js
496
496
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
497
497
  - app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js
498
- - app/assets/javascripts/govuk_publishing_components/lib/primary-links.js
499
498
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
500
499
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
501
500
  - app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js
@@ -1932,7 +1931,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1932
1931
  - !ruby/object:Gem::Version
1933
1932
  version: '0'
1934
1933
  requirements: []
1935
- rubygems_version: 3.3.18
1934
+ rubygems_version: 3.3.19
1936
1935
  signing_key:
1937
1936
  specification_version: 4
1938
1937
  summary: A gem to document components in GOV.UK frontend applications
@@ -1,74 +0,0 @@
1
- // migrated from govuk_frontend_toolkit
2
- ;(function (global) {
3
- 'use strict'
4
-
5
- var GOVUK = global.GOVUK || {}
6
-
7
- // Only show the first {n} items in a list, documentation is in the README.md
8
- var PrimaryList = function (el, selector) {
9
- this.el = el
10
- this.extraLinks = this.el.querySelectorAll('li:not(' + selector + ')')
11
- // only hide more than one extra link
12
- if (this.extraLinks.length > 1) {
13
- this.addToggleLink()
14
- this.hideExtraLinks()
15
- }
16
- }
17
-
18
- PrimaryList.prototype = {
19
- toggleText: function () {
20
- if (this.extraLinks.length > 1) {
21
- return '+' + this.extraLinks.length + ' others'
22
- } else {
23
- return '+' + this.extraLinks.length + ' other'
24
- }
25
- },
26
- addToggleLink: function () {
27
- this.toggleLink = document.createElement('a')
28
- this.toggleLink.href = '#'
29
- this.toggleLink.setAttribute('aria-expanded', 'false')
30
- this.toggleLink.innerText = this.toggleText()
31
-
32
- this.el.parentNode.insertBefore(this.toggleLink, this.el.nextSibling)
33
- this.toggleLink.addEventListener('click', this.toggleLinks.bind(this))
34
- },
35
- toggleLinks: function (e) {
36
- e.preventDefault()
37
- this.toggleLink.remove()
38
- this.showExtraLinks()
39
- },
40
- hideExtraLinks: function () {
41
- for (var i = 0; i < this.extraLinks.length; i++) {
42
- this.extraLinks[i].className = 'primary-links--display-none'
43
- }
44
- },
45
- showExtraLinks: function () {
46
- for (var i = 0; i < this.extraLinks.length; i++) {
47
- this.extraLinks[i].className = ''
48
- }
49
- }
50
- }
51
-
52
- GOVUK.PrimaryList = PrimaryList
53
-
54
- GOVUK.primaryLinks = {
55
- init: function (selector) {
56
- var allListItems = document.querySelectorAll(selector)
57
- var AllLists = []
58
-
59
- for (var i = 0; i < allListItems.length; i++) {
60
- var parent = allListItems[i].parentNode
61
-
62
- if (AllLists.indexOf(parent) < 0) {
63
- AllLists.push(parent)
64
- }
65
- }
66
-
67
- AllLists.forEach(function (el, i) {
68
- new GOVUK.PrimaryList(el, selector) // eslint-disable-line no-new
69
- })
70
- }
71
- }
72
-
73
- global.GOVUK = GOVUK
74
- })(window)