govuk_publishing_components 38.3.2 → 38.4.0

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: b4722ee8913bce56729719e8dde26b88d7958e23fd8c6177a12bcfb67b91a0c6
4
- data.tar.gz: 77afa0a3c76a84f04523dbd435d18dc92feb1615a106efe301e3e9e78f743c69
3
+ metadata.gz: e7ea0b6a93379ec1e7cb8e5b7194c5cc16e237129cdbe224b9a099d79f4ca7ff
4
+ data.tar.gz: 567e2f625bd4b773a48f56c13c15d383f4fcdba5c44c9369ae327b8cf5772419
5
5
  SHA512:
6
- metadata.gz: 8861808afb26f285beb8cf3c8a91bd19a7cf076b44a784bf6da5167e24e10c643eb744bd5c0b87cbaf65c358d525a81441fd25d477e14c16b7233428b2fd7e61
7
- data.tar.gz: 4baa708a0bede0ac54705a63d0fc2bc2a8d957ccae3d4b59b35e2dd8fa75ce62db1e4a7b0c4f6bedbf3c3e1751878732112b0fef1beba648a2a5d4a3abf5287b
6
+ metadata.gz: 4b0bd17834a7658027b98c43cf2b2514f4bdb3ee06974e21bd27932a81e4f4ce4a7785468623d92511026e8773ae9af78dccca88c3c1ba0ba88ee89ff06b81aa
7
+ data.tar.gz: 1544edbfac9e4d2f5723f220aadd5619b86ff3386dae982d6b53ee9d8e20ba264a52f54ee44a6194b9ae912d8f0684d2a20bd3f0ff33d8d0775ca09cae3b8d86
@@ -36,15 +36,20 @@
36
36
  var moduleName = camelCaseAndCapitalise(moduleNames[j])
37
37
  var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
38
38
  if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
39
- // Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend Modules
40
- if (GOVUK.Modules[moduleName].prototype.init) {
41
- try {
39
+ try {
40
+ if (GOVUK.Modules[moduleName].prototype.init) {
41
+ // Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend V4 Modules
42
42
  new GOVUK.Modules[moduleName](element).init()
43
- element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
44
- } catch (e) {
45
- // if there's a problem with the module, catch the error to allow other modules to start
46
- console.error('Error starting ' + moduleName + ' component JS: ', e, window.location)
43
+ } else {
44
+ // GOV.UK Frontend V5 Modules - removed component init() methods and initialise in constructor
45
+ // https://github.com/alphagov/govuk-design-system-architecture/blob/main/decision-records/010-remove-init-method.md
46
+ /* eslint-disable no-new */
47
+ new GOVUK.Modules[moduleName](element)
47
48
  }
49
+ element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
50
+ } catch (e) {
51
+ // if there's a problem with the module, catch the error to allow other modules to start
52
+ console.error('Error starting ' + moduleName + ' component JS: ', e, window.location)
48
53
  }
49
54
  }
50
55
  }
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "38.3.2".freeze
2
+ VERSION = "38.4.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: 38.3.2
4
+ version: 38.4.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: 2024-05-17 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config