effective_bootstrap 0.3.11 → 0.3.12

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
  SHA1:
3
- metadata.gz: a4ec43f24a86db3d6d7a24e365db93e9163d037c
4
- data.tar.gz: 06d5baab43386a3a3f8b5e0ed742f7ee659766ab
3
+ metadata.gz: a413a43fe8afc26a398fada64c130819a1914a46
4
+ data.tar.gz: 62bb5c67a83990375e733cbc30ed4a712638ae65
5
5
  SHA512:
6
- metadata.gz: 4762161acb5b6293f613c847455a4258900703f614033ddb6bbaab501184b90046f01209176a834921e99b19ce1704509a9ddd792416b6e2480432b7c1c7ee69
7
- data.tar.gz: a614847bda10fe72c9f117de71bed0bb5a0604584c5923b88253f48a6d53538e49bf47a1d0fca7d01d7f934fb89da3e73722468efd6d8f132aa068e4b1ff9718
6
+ metadata.gz: 41ac345f9d6b0d8a6ba4488e14cf1fb9fe81b7fa79f010accabe30f006cf76d5f5150cd2b0ebcf6f8659d43d3a3a87b1f3f900cc06b68a36e448c9fbd5076947
7
+ data.tar.gz: b05a8b54efe3aaeb1bc556c9fafcf125210c3e020de2a70fd807665be56dd6f653a557800126d973ef69864772f7edc0c51ebbc60b2a60b2b30c276ec0b2b707
@@ -368,7 +368,7 @@ module Effective
368
368
  obj.reverse_merge!(defaults)
369
369
  obj
370
370
  else
371
- raise 'unexpected object'
371
+ defaults.merge(text: obj.to_s)
372
372
  end
373
373
  end
374
374
 
@@ -19,9 +19,21 @@ module Effective
19
19
 
20
20
  def build_check_box_wrap(&block)
21
21
  if custom?
22
- content_tag(:div, yield, class: 'form-group custom-control custom-checkbox' + (inline? ? ' custom-control-inline' : ''))
22
+ content_tag(:div, yield, options[:wrapper])
23
23
  else
24
- content_tag(:div, yield, class: 'form-check' + (inline? ? ' form-check-inline' : ''))
24
+ content_tag(:div, yield, options[:wrapper])
25
+ end
26
+ end
27
+
28
+ def wrapper_options
29
+ if custom? && inline?
30
+ { class: 'form-group custom-control custom-checkbox custom-control-inline' }
31
+ elsif custom?
32
+ { class: 'form-group custom-control custom-checkbox' }
33
+ elsif inline?
34
+ { class: 'form-check form-check-inline' }
35
+ else
36
+ { class: 'form-check' }
25
37
  end
26
38
  end
27
39
 
@@ -45,7 +57,7 @@ module Effective
45
57
 
46
58
  def inline? # default false
47
59
  return @inline unless @inline.nil?
48
- @inline = (options[:input].delete(:inline) == true)
60
+ @inline = ((options[:input] || {}).delete(:inline) == true)
49
61
  end
50
62
 
51
63
  def custom? # default true
@@ -29,11 +29,14 @@ module Effective
29
29
  end
30
30
 
31
31
  def input_js_options
32
+ placeholder = options.delete(:placeholder)
33
+ placeholder = '' if placeholder == false
34
+
32
35
  opts = {
33
36
  theme: 'bootstrap',
34
37
  minimumResultsForSearch: 6,
35
38
  width: 'style',
36
- placeholder: (options.delete(:placeholder) || 'Please choose'),
39
+ placeholder: (placeholder || 'Please choose'),
37
40
  allowClear: (true if include_blank?),
38
41
  tokenSeparators: ([',', ';', '\n', '\t'] if tags?),
39
42
  tags: (true if tags?),
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.3.11'.freeze
2
+ VERSION = '0.3.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails