nfg_ui 0.11.13 → 0.11.14

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: daf4547573e4c837fb956ba4ef8e19ec0bba1f6ec098a24037b02e60e22f3a39
4
- data.tar.gz: ffa880a10c15f196391590c836aa315523e10341443e071f05d0b8b9cef3efe2
3
+ metadata.gz: a19a2d2be8af2061aceb6bbbd42641a0b453ae9745c4254ab6390569381d9152
4
+ data.tar.gz: 57e290d78782475a9eca5b6e11c280b8b2e189facbf8da111cd20a1485e8ca34
5
5
  SHA512:
6
- metadata.gz: 59f0fa7a08b5eca8fe301d28ea71b35c2b50d4b1eb00b68f217230ef526c42358d0370113622e3535d9a85f6b547927bfbda77936a1c7f9ac86212adccf9b07c
7
- data.tar.gz: 2316439d9ebbb6ad27254179ac28ecb300aac14eeab1624c356ceeb3599c5773385dc63ddd39e9a6a522f5e00c787043288c01496bfab97ef4a1ee135a622355
6
+ metadata.gz: f11e73646e3b34e74a94567d8ad8b9d072a0de1e7715818c23bcc21d8e7c3195e4a0a41a8e7badcaf27c290bbd84d5584b91c3c3ccf6251e7aca39415fc1e573
7
+ data.tar.gz: '059c130c6a825eae43ad51279f211d3ae5ed3a4576e503380f91c93926e8cf3f5bfab3c29f0ff4f786aacbc3e924dd91f7514257ce838a79430f91a8de5538c9'
@@ -43,12 +43,14 @@ module NfgUi
43
43
  end
44
44
 
45
45
  def render
46
+ @body = yield if block_given?
47
+
46
48
  if tooltip && disabled
47
49
  content_tag(:span, disabled_component_tooltip_wrapper_html_options) do
48
50
  content_tag(as, html_options) do
49
51
  capture do
50
52
  concat(left_icon_component) if left_icon
51
- concat(block_given? ? yield : body)
53
+ concat(body)
52
54
  concat(right_icon_component) if icon
53
55
  end
54
56
  end
@@ -58,7 +60,7 @@ module NfgUi
58
60
  content_tag(as, html_options) do
59
61
  capture do
60
62
  concat(left_icon_component) if left_icon
61
- concat(block_given? ? yield : body)
63
+ concat(body)
62
64
  concat(right_icon_component) if icon
63
65
  end
64
66
  end
@@ -76,10 +78,14 @@ module NfgUi
76
78
 
77
79
  def right_icon_component
78
80
  NfgUi::Components::Foundations::Icon.new({ traits: [icon, :right],
79
- class: NfgUi::Components::Foundations::Icon::RIGHT_ICON_SPACER_CSS_CLASS },
81
+ class: right_icon_class },
80
82
  view_context).render
81
83
  end
82
84
 
85
+ def right_icon_class
86
+ NfgUi::Components::Foundations::Icon::RIGHT_ICON_SPACER_CSS_CLASS if body.present?
87
+ end
88
+
83
89
  def base_element
84
90
  as
85
91
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.11.13'
4
+ VERSION = '0.11.14'
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: 0.11.13
4
+ version: 0.11.14
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: 2021-03-02 00:00:00.000000000 Z
12
+ date: 2021-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap