nfg_ui 0.9.20 → 0.9.21

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: beaebf28b8def0b396c4ccbf6fc1da011c242ae431d8bc1d1c6f2c4ac1acd4bf
4
- data.tar.gz: a3ebaef400c9a2d66e603fc3b5876f285c2f5713294979b8f73add19579a0c33
3
+ metadata.gz: 423409d97cf89a1bf8a09522fb166a59c81cbf9b8a4cdae14553447d3f0096c5
4
+ data.tar.gz: 68a1afec5cc27e072aef3ac67ab56c15c289984c557f8df746e91888deec4663
5
5
  SHA512:
6
- metadata.gz: e2ce5ba64240fe53419e5bd3077826fceaf9b6239ecde1c92e11a406fff9daac73802e7fc6011e9b803029c89463dd28889e89b6c4e91d7cea2fb3e557b87e3f
7
- data.tar.gz: 7e9aa7d7b07bee151bf37bc8c55d183ee092ba74fed3e56213977794072651c4481b73d419420c353d509d33b6eb468d18a3e3362e9e4fa70c890096a32e87c5
6
+ metadata.gz: 784851e753616711c6dd400c25f231ca9aaba721b85e3f798cb6488a515d36081b3043bba618fd62e25bdcd071ad70183e929838c7fa542698d38b2460d5359c
7
+ data.tar.gz: 427fb9dbc7479345cfea016465014365e2c7022edf24352b40cdda21e591da88e3a731f428ab5a18c8946a90a0227f292bcd43d87d44dacd540af6859126d68b
@@ -13,12 +13,16 @@ module NfgUi
13
13
  include NfgUi::Components::Traits::Size
14
14
  include NfgUi::Components::Traits::Table
15
15
 
16
+ def caption
17
+ options.fetch(:caption, default_caption)
18
+ end
19
+
16
20
  def render
17
21
  # We manually embed this caption as a typeface component
18
22
  # as part of the design pattern.
19
- if responsive
23
+ if caption.present?
20
24
  capture do
21
- concat(NfgUi::Components::Foundations::Typeface.new({caption: I18n.t('nfg_ui.components.elements.table.responsive_caption').to_s, class: 'mb-1 text-right', traits: [:muted]}, view_context).render)
25
+ concat(NfgUi::Components::Foundations::Typeface.new({caption: caption.to_s, class: 'mb-1 text-right', traits: [:muted]}, view_context).render)
22
26
 
23
27
  concat(super)
24
28
  end
@@ -26,6 +30,17 @@ module NfgUi
26
30
  super
27
31
  end
28
32
  end
33
+
34
+ private
35
+
36
+ # By default, when responsive: supply a pre-written caption to the table
37
+ def default_caption
38
+ responsive ? I18n.t('nfg_ui.components.elements.table.responsive_caption') : ''
39
+ end
40
+
41
+ def non_html_attribute_options
42
+ super.push(:caption)
43
+ end
29
44
  end
30
45
  end
31
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.9.20'
4
+ VERSION = '0.9.21'
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.9.20
4
+ version: 0.9.21
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: 2019-10-17 00:00:00.000000000 Z
12
+ date: 2019-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap