ui_bibz 2.0.0.alpha30 → 2.0.0.alpha31
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/Gemfile.lock +1 -1
- data/app/assets/javascripts/input-connected.coffee +3 -2
- data/app/assets/javascripts/ui_bibz.coffee +4 -1
- data/app/assets/stylesheets/fix-dropdown-select.sass +24 -1
- data/app/inputs/custom_inputs/base_input.rb +13 -0
- data/app/inputs/custom_inputs/collection_input.rb +1 -1
- data/app/inputs/custom_inputs/date_picker_field_input.rb +1 -1
- data/app/inputs/custom_inputs/string_input.rb +24 -7
- data/app/inputs/custom_inputs/switch_field_input.rb +10 -2
- data/lib/ui_bibz/ui/core/component.rb +2 -2
- data/lib/ui_bibz/ui/core/connected_component.rb +9 -2
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +5 -0
- data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +3 -4
- data/lib/ui_bibz/version.rb +1 -1
- data/test/simple_form_test.rb +3 -2
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/choices/switch_field_test.rb +10 -10
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +1 -1
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bcc7220776d975adbd661d537c13b9727cfd3d8
|
4
|
+
data.tar.gz: fbdee8fa7ce7e5045d859a9e09a11c34c5cd335a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 733c9b8f914032774af8ee3d368f8840d00a410875c35eb7f3c89ea3739bb785043646b715ab976fba0ac02b23806676d8255db2f9851c53e94968dc7f51044d
|
7
|
+
data.tar.gz: 6ed6f3b804da6623b4ccac0410179a6f879cec95f238691c33891041b88e479c6f7de952a4d6c5c9e1e0e4e0c57127f5211f1d4a33cfc3437c8c917106d695a1
|
data/Gemfile.lock
CHANGED
@@ -70,8 +70,9 @@
|
|
70
70
|
values = component.val()
|
71
71
|
|
72
72
|
name = component.attr('name')
|
73
|
-
name = if name? then name.replace(' ', '_').split('[')[0] else "id"
|
74
|
-
name = if
|
73
|
+
#name = if name? then name.replace(' ', '_').split('[')[0] else "id"
|
74
|
+
name = if name? then name else "id"
|
75
|
+
#name = if Array.isArray(values) then "#{ name }s" else name
|
75
76
|
|
76
77
|
if mode == "remote"
|
77
78
|
params = { "#{ name }": values }
|
@@ -54,4 +54,7 @@ ready = ->
|
|
54
54
|
|
55
55
|
# turbolinks:load and ready together load twice time javascript
|
56
56
|
#$(document).on('ready turbolinks:load page:change', ready) # catch event for turbolinks and fix in ready() function
|
57
|
-
|
57
|
+
if Turbolinks?
|
58
|
+
$(document).on('turbolinks:load page:change', ready) # catch event for turbolinks and fix in ready() function
|
59
|
+
else
|
60
|
+
$(document).on('ready', ready) # catch event for turbolinks and fix in ready() function
|
@@ -238,7 +238,7 @@ div.bootstrap-select
|
|
238
238
|
li
|
239
239
|
padding-left: 16px
|
240
240
|
.hidden
|
241
|
-
display: none
|
241
|
+
display: none !important
|
242
242
|
|
243
243
|
.field-refresh
|
244
244
|
.input-refresh-button
|
@@ -246,3 +246,26 @@ div.bootstrap-select
|
|
246
246
|
|
247
247
|
.multiselect-container > li > a > label
|
248
248
|
padding: 3px 1.5rem
|
249
|
+
|
250
|
+
.bootstrap-select > .dropdown-menu > .dropdown-menu li a
|
251
|
+
display: block
|
252
|
+
width: 100%
|
253
|
+
padding: 3px 1.5rem
|
254
|
+
clear: both
|
255
|
+
font-weight: 400
|
256
|
+
color: #292b2c
|
257
|
+
text-align: inherit
|
258
|
+
white-space: nowrap
|
259
|
+
background: 0 0
|
260
|
+
border: 0px
|
261
|
+
min-height: 2rem
|
262
|
+
|
263
|
+
.bootstrap-select > .dropdown-menu > .dropdown-menu li a:focus
|
264
|
+
outline: none
|
265
|
+
|
266
|
+
.bootstrap-select > .dropdown-menu > .dropdown-menu li:hover, .bootstrap-select > .dropdown-menu > .dropdown-menu li.selected
|
267
|
+
color: white
|
268
|
+
background-color: $brand-primary
|
269
|
+
a
|
270
|
+
color: white
|
271
|
+
border: 0px
|
@@ -1,13 +1,30 @@
|
|
1
1
|
module CustomInputs
|
2
|
-
class StringInput < SimpleForm::Inputs::
|
2
|
+
class StringInput < SimpleForm::Inputs::Base
|
3
3
|
|
4
|
-
|
5
|
-
super
|
6
|
-
end
|
4
|
+
enable :placeholder, :maxlength, :minlength, :pattern
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
def input(wrapper_options = nil)
|
7
|
+
unless string?
|
8
|
+
input_html_classes.unshift("string")
|
9
|
+
input_html_options[:type] ||= input_type if html5?
|
10
|
+
end
|
11
|
+
|
12
|
+
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
|
13
|
+
|
14
|
+
@builder.text_field(attribute_name, merged_input_options)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def string?
|
20
|
+
input_type == :string
|
21
|
+
end
|
22
|
+
|
23
|
+
protected
|
24
|
+
|
25
|
+
def input_attribute_name
|
26
|
+
"#{ @builder.object.class.to_s.parameterize.underscore }[#{ attribute_name }]"
|
27
|
+
end
|
11
28
|
|
12
29
|
end
|
13
30
|
end
|
@@ -1,9 +1,17 @@
|
|
1
1
|
module CustomInputs
|
2
|
-
class SwitchFieldInput <
|
2
|
+
class SwitchFieldInput < BaseInput
|
3
3
|
include UiBibz::Ui::Core::Forms::Choices
|
4
4
|
|
5
5
|
def input(wrapper_options)
|
6
|
-
UiBibz::Ui::Core::Forms::Choices::SwitchField.new(input_attribute_name, options,
|
6
|
+
UiBibz::Ui::Core::Forms::Choices::SwitchField.new(input_attribute_name, options, new_input_html_options).render
|
7
|
+
end
|
8
|
+
|
9
|
+
def new_input_html_options
|
10
|
+
input_html_options.merge({ checked: value.nil? ? false : value })
|
11
|
+
end
|
12
|
+
|
13
|
+
def value
|
14
|
+
@value ||= @builder.object.send(attribute_name)
|
7
15
|
end
|
8
16
|
|
9
17
|
end
|
@@ -39,8 +39,8 @@ module UiBibz::Ui::Core
|
|
39
39
|
# end
|
40
40
|
#
|
41
41
|
class Component < UiBibz::Ui::Base
|
42
|
-
include
|
43
|
-
include
|
42
|
+
include KlassExtension
|
43
|
+
include GlyphExtension
|
44
44
|
|
45
45
|
attr_accessor :content, :html_options, :options
|
46
46
|
|
@@ -65,11 +65,18 @@ module UiBibz::Ui::Core
|
|
65
65
|
def connect_opts
|
66
66
|
selector = options[:refresh][:target][:selector]
|
67
67
|
options[:refresh][:target][:selector] = selector.blank? ? "##{ content.to_s.parameterize.underscore }" : selector
|
68
|
-
|
68
|
+
|
69
|
+
options[:refresh].merge({
|
70
|
+
connect: {
|
71
|
+
target: options[:refresh].delete(:target),
|
72
|
+
event: options[:refresh].delete(:event),
|
73
|
+
mode: options[:refresh].delete(:mode)
|
74
|
+
}
|
75
|
+
})
|
69
76
|
end
|
70
77
|
|
71
78
|
def refresh_btn_html
|
72
|
-
content_tag(:span, UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('',
|
79
|
+
content_tag(:span, UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('', connect_opts).render, class: 'input-group-btn')
|
73
80
|
end
|
74
81
|
|
75
82
|
def connect_options
|
@@ -51,10 +51,9 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
51
51
|
|
52
52
|
# Render html tag
|
53
53
|
def render
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
options[:builder].check_box(content, html_options)
|
54
|
+
content_tag :div, class: 'switch-field-container' do
|
55
|
+
concat hidden_field_tag content, '0'
|
56
|
+
concat check_box_tag content, '1', html_options[:checked], html_options
|
58
57
|
end
|
59
58
|
end
|
60
59
|
|
data/lib/ui_bibz/version.rb
CHANGED
data/test/simple_form_test.rb
CHANGED
@@ -132,11 +132,12 @@ class SimpleFormTest < ActionView::TestCase
|
|
132
132
|
end
|
133
133
|
|
134
134
|
test 'switch field input in simple form' do
|
135
|
+
@user.active = true
|
135
136
|
actual = simple_form_for @user do |f|
|
136
137
|
f.input :active, as: :switch_field, collection: @users, label_method: :name_fr
|
137
138
|
end
|
138
139
|
|
139
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group switch_field optional user_active\"><label class=\"control-label switch_field optional\" for=\"user_active\">Active</label><input type=\"checkbox\" name=\"user[active]\" id=\"user_active\" class=\"switch_field optional switch-field\" /></div></form>"
|
140
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group switch_field optional user_active\"><label class=\"control-label switch_field optional\" for=\"user_active\">Active</label><div class=\"switch-field-container\"><input type=\"hidden\" name=\"user[active]\" id=\"user_active\" value=\"0\" /><input type=\"checkbox\" name=\"user[active]\" id=\"user_active\" value=\"1\" class=\"switch_field optional switch-field\" checked=\"checked\" /></div></div></form>"
|
140
141
|
|
141
142
|
assert_equal expected, actual
|
142
143
|
end
|
@@ -168,7 +169,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
168
169
|
end
|
169
170
|
|
170
171
|
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group select_field optional user_name_fr\"><label class=\"control-label select_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"input-group field-refresh\"><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"select_field optional select-field form-control\"><option value=\"1\">test1</option>
|
171
|
-
<option value=\"2\">test2</option></select><span class=\"input-group-btn\"><
|
172
|
+
<option value=\"2\">test2</option></select><span class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#user_name_fr","url":"","data":[]}}\" class=\"btn-primary ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> </span></span></div></div></form>"
|
172
173
|
|
173
174
|
assert_equal expected, actual
|
174
175
|
end
|
@@ -5,7 +5,7 @@ class ButtonRefreshTest < ActionView::TestCase
|
|
5
5
|
|
6
6
|
test "button" do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('state', status: :success, connect: { target: { url: '/'}}).render
|
8
|
-
expected = "<
|
8
|
+
expected = "<span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"/","data":[]}}\" class=\"btn-success ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> state</span>"
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -6,7 +6,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
6
6
|
# OK
|
7
7
|
test 'switch_field size' do
|
8
8
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', size: :lg).render
|
9
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-size=\"large\" class=\"switch-field\"
|
9
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-size=\"large\" class=\"switch-field\" /></div>"
|
10
10
|
|
11
11
|
assert_equal expected, actual
|
12
12
|
end
|
@@ -14,7 +14,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
14
14
|
# OK
|
15
15
|
test 'switch_field animate' do
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', animate: false).render
|
17
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-animate=\"false\" class=\"switch-field\"
|
17
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-animate=\"false\" class=\"switch-field\" /></div>"
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -22,7 +22,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
22
22
|
# OK
|
23
23
|
test 'switch_field checked' do
|
24
24
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', {}, checked: true).render
|
25
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" checked=\"checked\" class=\"switch-field\"
|
25
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" checked=\"checked\" class=\"switch-field\" /></div>"
|
26
26
|
|
27
27
|
assert_equal expected, actual
|
28
28
|
end
|
@@ -30,7 +30,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
30
30
|
# OK
|
31
31
|
test 'switch_field state' do
|
32
32
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', {}, state: "disabled").render
|
33
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" state=\"disabled\" class=\"switch-field\"
|
33
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" state=\"disabled\" class=\"switch-field\" /></div>"
|
34
34
|
|
35
35
|
assert_equal expected, actual
|
36
36
|
end
|
@@ -38,7 +38,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
38
38
|
# NON FONCTIONNEL
|
39
39
|
test 'switch_field readonly' do
|
40
40
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', {}, readonly: true).render
|
41
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" readonly=\"readonly\" class=\"switch-field\"
|
41
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" readonly=\"readonly\" class=\"switch-field\" /></div>"
|
42
42
|
|
43
43
|
assert_equal expected, actual
|
44
44
|
end
|
@@ -46,7 +46,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
46
46
|
# OK
|
47
47
|
test 'switch_field left_color' do
|
48
48
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', left_color: "success").render
|
49
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-on-color=\"success\" class=\"switch-field\"
|
49
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-on-color=\"success\" class=\"switch-field\" /></div>"
|
50
50
|
|
51
51
|
assert_equal expected, actual
|
52
52
|
end
|
@@ -54,7 +54,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
54
54
|
# OK
|
55
55
|
test 'switch_field right_color' do
|
56
56
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', right_color: "info").render
|
57
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-off-color=\"info\" class=\"switch-field\"
|
57
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-off-color=\"info\" class=\"switch-field\" /></div>"
|
58
58
|
|
59
59
|
assert_equal expected, actual
|
60
60
|
end
|
@@ -62,7 +62,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
62
62
|
# OK
|
63
63
|
test 'switch_field middle_text' do
|
64
64
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', middle_text: "testlabeltext").render
|
65
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-label-text=\"testlabeltext\" class=\"switch-field\"
|
65
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-label-text=\"testlabeltext\" class=\"switch-field\" /></div>"
|
66
66
|
|
67
67
|
assert_equal expected, actual
|
68
68
|
end
|
@@ -70,7 +70,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
70
70
|
# OK
|
71
71
|
test 'switch_field left_text' do
|
72
72
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', left_text: 'testonlabel').render
|
73
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-on-text=\"testonlabel\" class=\"switch-field\"
|
73
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-on-text=\"testonlabel\" class=\"switch-field\" /></div>"
|
74
74
|
|
75
75
|
assert_equal expected, actual
|
76
76
|
end
|
@@ -78,7 +78,7 @@ class SwitchFieldTest < ActionView::TestCase
|
|
78
78
|
# OK
|
79
79
|
test 'switch_field right_text' do
|
80
80
|
actual = UiBibz::Ui::Core::Forms::Choices::SwitchField.new('test', right_text: "testofflabel").render
|
81
|
-
expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" data-off-text=\"testofflabel\" class=\"switch-field\"
|
81
|
+
expected = "<div class=\"switch-field-container\"><input type=\"hidden\" name=\"test\" id=\"test\" value=\"0\" /><input type=\"checkbox\" name=\"test\" id=\"test\" value=\"1\" data-off-text=\"testofflabel\" class=\"switch-field\" /></div>"
|
82
82
|
|
83
83
|
assert_equal expected, actual
|
84
84
|
end
|
@@ -77,7 +77,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
77
77
|
|
78
78
|
test 'dropdown_select_field refresh' do
|
79
79
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { refresh: { mode: 'local', target: { data: [] }}}).render
|
80
|
-
expected = "<div class=\"input-group field-refresh\"><select name=\"test\" id=\"test\" class=\"dropdown-select-field\"></select><span class=\"input-group-btn\"><
|
80
|
+
expected = "<div class=\"input-group field-refresh\"><select name=\"test\" id=\"test\" class=\"dropdown-select-field\"></select><span class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"local","target":{"selector":"#test","url":"","data":[]}}\" class=\"btn-primary ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> </span></span></div>"
|
81
81
|
|
82
82
|
assert_equal expected, actual
|
83
83
|
end
|
@@ -25,7 +25,7 @@ class MultiSelectFieldTest < ActionView::TestCase
|
|
25
25
|
|
26
26
|
test 'Multi select Field refresh option' do
|
27
27
|
actual = UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new('test', { refresh: { target: { url: '/'}}}).render
|
28
|
-
expected = "<div class=\"input-group field-refresh\"><select name=\"test[]\" id=\"test\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span class=\"input-group-btn\"><
|
28
|
+
expected = "<div class=\"input-group field-refresh\"><select name=\"test[]\" id=\"test\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-primary ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> </span></span></div>"
|
29
29
|
|
30
30
|
assert_equal expected, actual
|
31
31
|
end
|
@@ -14,7 +14,7 @@ class SelectFieldTest < ActionView::TestCase
|
|
14
14
|
|
15
15
|
test "Select Field refresh" do
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', refresh: { target: { url: '/' }}).render
|
17
|
-
expected = "<div class=\"input-group field-refresh\"><select name=\"example\" id=\"example\" class=\"select-field form-control\"></select><span class=\"input-group-btn\"><
|
17
|
+
expected = "<div class=\"input-group field-refresh\"><select name=\"example\" id=\"example\" class=\"select-field form-control\"></select><span class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-primary ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> </span></span></div>"
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -16,7 +16,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
16
16
|
options = options_for_select(2.times.map{ |i| "option #{i}" })
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, refresh: { target: { url: '/'}} }, { id: 'test' }).render
|
18
18
|
expected = "<div class=\"input-group field-refresh\"><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
19
|
-
<option value=\"option 1\">option 1</option></datalist><span class=\"input-group-btn\"><
|
19
|
+
<option value=\"option 1\">option 1</option></datalist><span class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-primary ui-bibz-connect input-refresh-button btn\"><i class=\"glyph fa fa-refresh\"></i> </span></span></div>"
|
20
20
|
|
21
21
|
assert_equal expected, actual
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.alpha31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- app/assets/stylesheets/table.sass
|
235
235
|
- app/assets/stylesheets/ui_bibz.sass
|
236
236
|
- app/inputs/custom_inputs/auto_complete_field_input.rb
|
237
|
+
- app/inputs/custom_inputs/base_input.rb
|
237
238
|
- app/inputs/custom_inputs/collection_input.rb
|
238
239
|
- app/inputs/custom_inputs/date_picker_field_input.rb
|
239
240
|
- app/inputs/custom_inputs/dropdown_select_field_input.rb
|