nfg_ui 0.9.19.1 → 0.9.20

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: a4fd6c431a2093c5d41bae530dad3eaf88b3e51fc2a5913a20f82e09507f4eb1
4
- data.tar.gz: 21bd2f0c40b88c6045e22645605c767ce19579528395e40670cab140210ddf56
3
+ metadata.gz: beaebf28b8def0b396c4ccbf6fc1da011c242ae431d8bc1d1c6f2c4ac1acd4bf
4
+ data.tar.gz: a3ebaef400c9a2d66e603fc3b5876f285c2f5713294979b8f73add19579a0c33
5
5
  SHA512:
6
- metadata.gz: da65edf3ccfb87c9511427e75986d490fcb0d9900f52510d5e91847b9fbb707e2c84d52d91621fb3f1d585825d234e687d6200d10a1aee5c52467b9971f95449
7
- data.tar.gz: b8969cbae79c2356b7ca0b391a01a17c8f8c772ff3205b5313dfec59c4f8c292940c8624270420c9043ddd013ee778a9d8e6bd5479336273b10868d355cc763e
6
+ metadata.gz: e2ce5ba64240fe53419e5bd3077826fceaf9b6239ecde1c92e11a406fff9daac73802e7fc6011e9b803029c89463dd28889e89b6c4e91d7cea2fb3e557b87e3f
7
+ data.tar.gz: 7e9aa7d7b07bee151bf37bc8c55d183ee092ba74fed3e56213977794072651c4481b73d419420c353d509d33b6eb468d18a3e3362e9e4fa70c890096a32e87c5
@@ -25,7 +25,7 @@ module NfgUi
25
25
 
26
26
  def render
27
27
  super do
28
- content_tag(:div, class: 'modal-dialog', role: 'document') do
28
+ content_tag(:div, class: modal_dialog_css_classes, role: 'document') do
29
29
  content_tag(:div, class: 'modal-content') do
30
30
  capture do
31
31
  concat(NfgUi::Bootstrap::Components::ModalHeader.new({ title: title }, view_context).render)
@@ -47,14 +47,36 @@ module NfgUi
47
47
  options.fetch(:render_in_body, true)
48
48
  end
49
49
 
50
+ def size
51
+ options.fetch(:size, nil)
52
+ end
53
+
50
54
  private
51
55
 
52
56
  def css_classes
53
- super + ' fade'
57
+ [
58
+ component_css_class,
59
+ 'fade'
60
+ ].join(' ')
61
+ end
62
+
63
+ def modal_dialog_css_classes
64
+ [
65
+ 'modal-dialog',
66
+ (size_css_class if resized?)
67
+ ].join(' ').squish
54
68
  end
55
69
 
56
70
  def non_html_attribute_options
57
- super.push((:footer if footer.present?), (:title if title.present?))
71
+ super.push((:footer if footer.present?), (:title if title.present?), :size)
72
+ end
73
+
74
+ def resized?
75
+ [:sm, :lg, :xl].include?(size)
76
+ end
77
+
78
+ def size_css_class
79
+ "#{component_css_class}-#{size}"
58
80
  end
59
81
 
60
82
  def assistive_html_attributes
@@ -9,6 +9,8 @@ module NfgUi
9
9
  include NfgUi::Components::Utilities::Describable
10
10
  include NfgUi::Components::Utilities::Renderable
11
11
  include NfgUi::Components::Utilities::Titleable
12
+
13
+ include NfgUi::Components::Traits::Size
12
14
  end
13
15
  end
14
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.9.19.1'
4
+ VERSION = '0.9.20'
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.19.1
4
+ version: 0.9.20
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-11 00:00:00.000000000 Z
12
+ date: 2019-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap