effective_bootstrap 0.9.44 → 0.9.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap/logic.js.coffee +9 -10
- data/app/models/effective/form_input.rb +17 -2
- data/app/models/effective/form_inputs/article_editor.rb +2 -0
- data/app/models/effective/form_inputs/check_box.rb +2 -0
- data/app/models/effective/form_inputs/checks.rb +2 -0
- data/app/models/effective/form_inputs/ck_editor.rb +2 -0
- data/app/models/effective/form_inputs/clear.rb +2 -0
- data/app/models/effective/form_inputs/collection_input.rb +2 -0
- data/app/models/effective/form_inputs/date_field.rb +2 -0
- data/app/models/effective/form_inputs/datetime_field.rb +2 -0
- data/app/models/effective/form_inputs/delete.rb +2 -0
- data/app/models/effective/form_inputs/editor.rb +2 -0
- data/app/models/effective/form_inputs/email_cc_field.rb +2 -0
- data/app/models/effective/form_inputs/email_field.rb +2 -0
- data/app/models/effective/form_inputs/error_field.rb +3 -1
- data/app/models/effective/form_inputs/file_field.rb +2 -0
- data/app/models/effective/form_inputs/float_field.rb +2 -0
- data/app/models/effective/form_inputs/form_group.rb +2 -0
- data/app/models/effective/form_inputs/has_many.rb +2 -0
- data/app/models/effective/form_inputs/hidden_field.rb +2 -0
- data/app/models/effective/form_inputs/integer_field.rb +2 -0
- data/app/models/effective/form_inputs/number_field.rb +2 -0
- data/app/models/effective/form_inputs/number_text_field.rb +2 -0
- data/app/models/effective/form_inputs/password_field.rb +2 -0
- data/app/models/effective/form_inputs/percent_field.rb +2 -0
- data/app/models/effective/form_inputs/phone_field.rb +2 -0
- data/app/models/effective/form_inputs/price_field.rb +2 -0
- data/app/models/effective/form_inputs/radios.rb +2 -0
- data/app/models/effective/form_inputs/remote_link_to.rb +2 -0
- data/app/models/effective/form_inputs/reset.rb +2 -0
- data/app/models/effective/form_inputs/rich_text_area.rb +2 -0
- data/app/models/effective/form_inputs/save.rb +2 -0
- data/app/models/effective/form_inputs/search_field.rb +2 -0
- data/app/models/effective/form_inputs/select.rb +2 -0
- data/app/models/effective/form_inputs/select_or_text.rb +2 -0
- data/app/models/effective/form_inputs/static_field.rb +2 -0
- data/app/models/effective/form_inputs/submit.rb +4 -1
- data/app/models/effective/form_inputs/text_area.rb +2 -0
- data/app/models/effective/form_inputs/text_field.rb +2 -0
- data/app/models/effective/form_inputs/time_field.rb +2 -0
- data/app/models/effective/form_inputs/time_zone_select.rb +2 -0
- data/app/models/effective/form_inputs/url_field.rb +2 -0
- data/app/models/effective/form_logics/hide_if.rb +2 -0
- data/app/models/effective/form_logics/show_if.rb +2 -0
- data/app/models/effective/form_logics/show_if_any.rb +2 -0
- data/lib/effective_bootstrap/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: da46c75a27275d4efcc243c43a23aa48cb648d1468504455401ff0f0cfd1b359
|
4
|
+
data.tar.gz: 8bbe1fbf6fb3fc4c5ae9f629f70b68a35688c9607c1d3567eaa6237b30271a66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04511ccc048cffc701deb7e60c4a282288b3916fd8aaeb6cd9a401436d29b02c2526024413e179731022e75b2a36a05152905c75d64be0ee4e36236b0035242
|
7
|
+
data.tar.gz: ea6241b0a004f16a6ebd2c61303cd3b7b3944cfff3f327d6871556864f3ca3cec84685eed559811ae05604b24d76d96264c0d5e2e96da638049c310f3716b799
|
@@ -11,14 +11,14 @@
|
|
11
11
|
|
12
12
|
if matches
|
13
13
|
$element.hide()
|
14
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
14
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
15
15
|
else
|
16
16
|
$element.fadeIn()
|
17
|
-
$element.find('input,textarea,select').removeAttr('disabled')
|
17
|
+
$element.find('input,textarea,select,button').removeAttr('disabled')
|
18
18
|
|
19
19
|
# Maybe disable it now
|
20
20
|
if options.needDisable
|
21
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
21
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
22
22
|
|
23
23
|
|
24
24
|
(this.EffectiveBootstrap || {}).effective_show_if = ($element, options) ->
|
@@ -34,14 +34,14 @@
|
|
34
34
|
|
35
35
|
if matches
|
36
36
|
$element.fadeIn()
|
37
|
-
$element.find('input,textarea,select').removeAttr('disabled')
|
37
|
+
$element.find('input,textarea,select,button').removeAttr('disabled')
|
38
38
|
else
|
39
39
|
$element.hide()
|
40
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
40
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
41
41
|
|
42
42
|
# Maybe disable it now
|
43
43
|
if options.needDisable
|
44
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
44
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
45
45
|
|
46
46
|
(this.EffectiveBootstrap || {}).effective_show_if_any = ($element, options) ->
|
47
47
|
$affects = $element.closest('form').find("input[name='#{options.name}'],select[name='#{options.name}']")
|
@@ -53,12 +53,11 @@
|
|
53
53
|
|
54
54
|
if found
|
55
55
|
$element.fadeIn()
|
56
|
-
$element.find('input,textarea,select').removeAttr('disabled')
|
56
|
+
$element.find('input,textarea,select,button').removeAttr('disabled')
|
57
57
|
else
|
58
58
|
$element.hide()
|
59
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
59
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
60
60
|
|
61
61
|
# Maybe disable it now
|
62
62
|
if options.needDisable
|
63
|
-
$element.find('input,textarea,select').prop('disabled', true)
|
64
|
-
|
63
|
+
$element.find('input,textarea,select,button').prop('disabled', true)
|
@@ -8,7 +8,7 @@ module Effective
|
|
8
8
|
EMPTY_HASH = {}
|
9
9
|
|
10
10
|
EXCLUSIVE_CLASS_PREFIXES = [] # None
|
11
|
-
EXCLUSIVE_CLASS_SUFFIXES = ['-primary', '-secondary', '-success', '-danger', '-warning', '-info', '-light', '-dark']
|
11
|
+
EXCLUSIVE_CLASS_SUFFIXES = ['-primary', '-secondary', '-success', '-danger', '-warning', '-info', '-light', '-dark', '-link']
|
12
12
|
|
13
13
|
DEFAULT_INPUT_GROUP_OPTIONS = { input_group: { class: 'input-group' }, prepend: false, append: false }
|
14
14
|
|
@@ -371,7 +371,22 @@ module Effective
|
|
371
371
|
when String
|
372
372
|
defaults.merge(text: obj)
|
373
373
|
when Hash
|
374
|
-
obj.
|
374
|
+
html_classes = ((obj[:class] || '').split(' ') + (defaults[:class] || '').split(' ')).uniq
|
375
|
+
|
376
|
+
# Try to smart merge bootstrap classes
|
377
|
+
if (exclusive = html_classes.select { |c| c.include?('-') }).length > 1
|
378
|
+
EXCLUSIVE_CLASS_PREFIXES.each do |prefix|
|
379
|
+
prefixed = exclusive.select { |c| c.start_with?(prefix) }
|
380
|
+
prefixed[1..-1].each { |c| html_classes.delete(c) } if prefixed.length > 1
|
381
|
+
end
|
382
|
+
|
383
|
+
suffixed = exclusive.select { |c| EXCLUSIVE_CLASS_SUFFIXES.any? { |suffix| c.end_with?(suffix) } }
|
384
|
+
suffixed[1..-1].each { |c| html_classes.delete(c) } if suffixed.length > 1
|
385
|
+
end
|
386
|
+
|
387
|
+
obj[:class] = html_classes.join(' ') if html_classes.present?
|
388
|
+
obj.reverse_merge!(defaults)
|
389
|
+
obj
|
375
390
|
else
|
376
391
|
defaults.merge(text: obj.to_s)
|
377
392
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Effective
|
2
4
|
module FormInputs
|
3
5
|
class ErrorField < Effective::FormInput
|
@@ -32,7 +34,7 @@ module Effective
|
|
32
34
|
end
|
33
35
|
)
|
34
36
|
|
35
|
-
content_tag(:div, content, options[:input])
|
37
|
+
content_tag(:div, content.html_safe, options[:input])
|
36
38
|
end
|
37
39
|
|
38
40
|
private
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select
|
2
4
|
# select(object, method, choices = nil, options = {}, html_options = {}, &block)
|
3
5
|
# ActionView::Helpers::FormBuilder.instance_method(:check_box).bind(self).call(m, opts, v)`
|
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Effective
|
2
4
|
module FormInputs
|
3
5
|
class Submit < Effective::FormInput
|
4
6
|
|
5
7
|
def to_html(&block)
|
6
|
-
return
|
8
|
+
return nil if form_readonly?
|
9
|
+
super()
|
7
10
|
end
|
8
11
|
|
9
12
|
def build_input(&block)
|
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.9.
|
4
|
+
version: 0.9.48
|
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: 2021-
|
11
|
+
date: 2021-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|