effective_form_inputs 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/effective_select/overrides.scss +0 -6
- data/app/models/inputs/effective_date_picker/input.rb +4 -0
- data/app/models/inputs/effective_date_picker_input.rb +1 -0
- data/app/models/inputs/effective_date_time_picker/input.rb +4 -0
- data/app/models/inputs/effective_date_time_picker_input.rb +1 -0
- data/app/models/inputs/effective_select_input.rb +0 -3
- data/app/models/inputs/effective_static_control_input.rb +1 -0
- data/app/views/effective/style_guide/_form_default.html.haml +2 -2
- data/lib/effective_form_inputs/version.rb +1 -1
- data/lib/effective_form_inputs.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f903f343a6b2612545534ce9a86fa00e953bb50
|
4
|
+
data.tar.gz: 81bafa3159d6e521f38dca2b5f31f3970b638ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d09274264261dcb884eaccb193926de684985ebac1bbc20c34948dbfd7ee95bca244d36eb72b764672c106dba726cfd1cb4e7a15b2a6003cf5be230fbfeb353
|
7
|
+
data.tar.gz: d29abe9f25363244106b176a81be578f86c4b11563276a84f28a165073b405c87110d2847abfc2d7e7bb365412fcea4d1fbee5a8e673abdfcc39afaeb5d25270
|
@@ -12,6 +12,10 @@ module Inputs
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_html
|
15
|
+
if options.delete(:input_group) == false
|
16
|
+
return text_field_tag(field_name, value, options)
|
17
|
+
end
|
18
|
+
|
15
19
|
content_tag(:div, :class => 'input-group') do
|
16
20
|
content_tag(:span, :class => 'input-group-addon') do
|
17
21
|
content_tag(:i, '', :class => 'glyphicon glyphicon-calendar').html_safe
|
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
|
|
6
6
|
class EffectiveDatePickerInput < SimpleForm::Inputs::StringInput
|
7
7
|
def input(wrapper_options = nil)
|
8
8
|
options = merge_wrapper_options(input_html_options, wrapper_options) || {}
|
9
|
+
options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
|
9
10
|
options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
|
10
11
|
|
11
12
|
Inputs::EffectiveDatePicker::Input.new(object, object_name, template, attribute_name, options).to_html
|
@@ -12,6 +12,10 @@ module Inputs
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_html
|
15
|
+
if options.delete(:input_group) == false
|
16
|
+
return text_field_tag(field_name, value, options)
|
17
|
+
end
|
18
|
+
|
15
19
|
content_tag(:div, :class => 'input-group') do
|
16
20
|
content_tag(:span, :class => 'input-group-addon') do
|
17
21
|
content_tag(:i, '', :class => 'glyphicon glyphicon-calendar').html_safe
|
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
|
|
6
6
|
class EffectiveDateTimePickerInput < SimpleForm::Inputs::StringInput
|
7
7
|
def input(wrapper_options = nil)
|
8
8
|
options = merge_wrapper_options(input_html_options, wrapper_options) || {}
|
9
|
+
options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
|
9
10
|
options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
|
10
11
|
|
11
12
|
Inputs::EffectiveDateTimePicker::Input.new(object, object_name, template, attribute_name, options).to_html
|
@@ -8,10 +8,7 @@ if defined?(SimpleForm)
|
|
8
8
|
label_method, value_method = detect_collection_methods
|
9
9
|
|
10
10
|
options = merge_wrapper_options(input_html_options, wrapper_options) || {}
|
11
|
-
|
12
|
-
# This gives us multiple and include_blank properly
|
13
11
|
options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
|
14
|
-
|
15
12
|
options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
|
16
13
|
|
17
14
|
options[:collection] = collection
|
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
|
|
6
6
|
class EffectiveStaticControlInput < SimpleForm::Inputs::StringInput
|
7
7
|
def input(wrapper_options = nil)
|
8
8
|
options = merge_wrapper_options(input_html_options, wrapper_options) || {}
|
9
|
+
options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
|
9
10
|
options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
|
10
11
|
|
11
12
|
Inputs::EffectiveStaticControl::Input.new(object, object_name, template, attribute_name, options).to_html
|
@@ -3,5 +3,5 @@
|
|
3
3
|
= form_for Effective::StyleGuide.new(:category => 'Category 2'), :url => '/' do |f|
|
4
4
|
= f.effective_date_time_picker :updated_at
|
5
5
|
= f.effective_date_picker :updated_at
|
6
|
-
= f.select :category, 10.times.map { |x| "Category #{x}"}, :include_blank =>
|
7
|
-
= f.effective_select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => false, :placeholder => 'Pleze chooze', :
|
6
|
+
= f.select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => true
|
7
|
+
= f.effective_select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => false, :placeholder => 'Pleze chooze', :input_group => false
|
@@ -2,5 +2,5 @@ require "effective_form_inputs/engine"
|
|
2
2
|
require "effective_form_inputs/version"
|
3
3
|
|
4
4
|
module EffectiveFormInputs
|
5
|
-
REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection, :multiple, :include_blank, :label_method, :value_method]
|
5
|
+
REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection, :multiple, :include_blank, :label_method, :value_method, :input_group]
|
6
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_form_inputs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
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: 2015-06-
|
11
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|