nfg_ui 5.15.3 → 5.15.5

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: bc2e41b096acf0984f462d1c7b2058dbf4f7c14d183ced10061b70cad2c263fb
4
- data.tar.gz: 044aba97d396b80d60ab7dde7b6ed598f5f70c1c4c46366ac2db3a1ed9e27b81
3
+ metadata.gz: cfd1fc1521c2302f7fd6778bd4b5616347cc0e427724431aa0dfda0a535c6d85
4
+ data.tar.gz: 2c3e03d6b15eab080f3f3c387df89f7f657988ae816573ffd935b3c579dc2419
5
5
  SHA512:
6
- metadata.gz: 172b725c9ee35587851e1883b2f06c349c8cf6c438db6afe2c5b450dbd434f1bf3de610e6f64fd18e737c286beb0abe775f7a4522cc5259f4d15486c0035a93d
7
- data.tar.gz: a687c3edd6dd070bf6e4d511050019d4c302ab334e40da37d20c58cd9c6bdc3333cabd7991145491247ab81a28a90b036d88d19537f88def6e2bd2c920137d53
6
+ metadata.gz: aaca169f1f4939b316638485ff145995a8515e7c418e7c6da059f8b751b3927b14e9af0a926e2294f929c16c98455e4d9cfb637b67841a236836587ad1f74f4c
7
+ data.tar.gz: 492f6fdad64b0651752512e6965b34c7914237dbb66a47bd2ddce584401aacc09bf27317d50c8c9d711014fa248281219054db86c6295f77a86e21ce7053ef51
@@ -33,6 +33,8 @@ $page-header-height-public: (($spacer * 6.75) + 1); // 21.7rem (adds 1px for wid
33
33
  }
34
34
 
35
35
  // this renders as body.nfg_ui_onboarder .page-header + .page-content specifying when the view is in a public onboarding status i.e. fundraiser onboarder in Fundraising Pages
36
- body.nfg_ui_onboarder & + .page-content { padding-top: $page-header-height-public; }
36
+ body.nfg_ui_onboarder &, body.create_fundraiser & {
37
+ + .page-content { padding-top: $page-header-height-public; }
38
+ }
37
39
  }
38
40
  }
@@ -15,16 +15,42 @@ module NfgUi
15
15
 
16
16
  include NfgUi::Components::Traits::Collapse
17
17
 
18
+ # Because it is common to forget to add the required :id
19
+ # to the component options when doing a "speed built"
20
+ # collapse, example:
21
+ # = ui.nfg :collapse, :collapsed, body: 'Collapse body content', heading: 'My Link'
22
+ #
23
+ # Send in a random string that is carried through
24
+ # from the speed built heading / button AND
25
+ # to the collapse component.
26
+ def component_initialize
27
+ # Only create and supply a random ID this when a :heading is present
28
+ return unless heading
29
+ new_id = options[:id].nil? ? random_id : options[:id]
30
+ options[:id] = new_id
31
+ end
32
+
18
33
  def render
19
34
  capture do
20
35
  if heading
21
- opts = { collapse: "##{id}", body: heading, icon: 'caret-down', class: 'pl-0 text-left' }
36
+ icon = options.fetch(:icon, 'caret-down')
37
+ opts = { collapse: "##{html_options[:id]}", body: heading, icon: icon, class: 'pl-0 text-left' }
22
38
  opts.merge!(traits: [:link, :block])
23
39
  concat(NfgUi::Components::Elements::Button.new(opts, view_context).render)
24
40
  end
25
41
  concat(super)
26
42
  end
27
43
  end
44
+
45
+ private
46
+
47
+ # Generate a string of random letters
48
+ # We must insert a random letter before SecureRandom because
49
+ # if a css ID starts with a number, it seems to break
50
+ # the collapse JS functionality.
51
+ def random_id
52
+ "#{('a'..'z').to_a.sample}-#{SecureRandom.alphanumeric(6)}"
53
+ end
28
54
  end
29
55
  end
30
56
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '5.15.3'
4
+ VERSION = '5.15.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfg_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.15.3
4
+ version: 5.15.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Roehm
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-11-01 00:00:00.000000000 Z
12
+ date: 2022-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap