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 +4 -4
- data/lib/nfg_ui/components/elements/table.rb +17 -2
- data/lib/nfg_ui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 423409d97cf89a1bf8a09522fb166a59c81cbf9b8a4cdae14553447d3f0096c5
|
4
|
+
data.tar.gz: 68a1afec5cc27e072aef3ac67ab56c15c289984c557f8df746e91888deec4663
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
23
|
+
if caption.present?
|
20
24
|
capture do
|
21
|
-
concat(NfgUi::Components::Foundations::Typeface.new({caption:
|
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
|
data/lib/nfg_ui/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2019-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap
|