ui_bibz 2.0.0.alpha27 → 2.0.0.alpha28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +38 -40
- data/app/assets/stylesheets/fix-dropdown-select.sass +4 -1
- data/lib/ui_bibz.rb +1 -0
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +81 -0
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +41 -15
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +10 -3
- data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +30 -6
- data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +29 -27
- data/lib/ui_bibz/version.rb +1 -1
- data/test/ui/{card_test.rb → core/cards/card_test.rb} +0 -0
- data/test/ui/{dropdown_test.rb → core/dropdowns/dropdown_test.rb} +0 -0
- data/test/ui/core/forms/buttons/button_choice_test.rb +20 -0
- data/test/ui/{button_test.rb → core/forms/buttons/button_group_test.rb} +1 -36
- data/test/ui/core/forms/buttons/button_link_test.rb +12 -0
- data/test/ui/core/forms/buttons/button_refresh_test.rb +13 -0
- data/test/ui/core/forms/buttons/button_test.rb +19 -0
- data/test/ui/core/forms/choices/checkbox_field_test.rb +12 -0
- data/test/ui/core/forms/choices/radio_field_test.rb +12 -0
- data/test/ui/{input_switch_field_test.rb → core/forms/choices/switch_field_test.rb} +2 -2
- data/test/ui/core/forms/dates/date_picker_field_test.rb +19 -0
- data/test/ui/core/forms/numbers/formula_field_test.rb +12 -0
- data/test/ui/{input_dropdown_select_field_test.rb → core/forms/selects/dropdown_select_field_test.rb} +16 -10
- data/test/ui/core/forms/selects/multi_column_field_test.rb +25 -0
- data/test/ui/core/forms/selects/multi_select_field_test.rb +32 -0
- data/test/ui/core/forms/selects/select_field_test.rb +22 -0
- data/test/ui/core/forms/textareas/markdown_editor_field_test.rb +13 -0
- data/test/ui/core/forms/texts/autocomplete_field_test.rb +14 -0
- data/test/ui/core/forms/texts/surround_field_test.rb +26 -0
- data/test/ui/{list_group_test.rb → core/lists/list_group_test.rb} +0 -0
- data/test/ui/{nav_test.rb → core/navs/nav_test.rb} +0 -0
- data/test/ui/{breadcrumb_test.rb → core/paths/breadcrumb_test.rb} +2 -1
- data/test/ui/{table_test.rb → ux/tables/table_test.rb} +0 -0
- data/vendor/assets/stylesheets/bootstrap-select.min.css +1 -1
- metadata +49 -22
- data/test/ui/inputs_test.rb +0 -118
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87cacb8d8195be40dd87fb7c98dea34e21d46504
|
4
|
+
data.tar.gz: 9e4ec75e0689f6e6684b37347c1778733cc6205a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7978cf0ba0599e40319ee265823262d610c5c129a430f6baf5806d640e3be09ab4ffa8325c82d0ec7ce48d345cf1ad078bae4e2b045f333e51e6e6557681f505
|
7
|
+
data.tar.gz: bbaf9a314e70ccfcf5ada6429e864ae316a2515d2a336a19f761c0efdbfa00b09d7ae5acb54fddce75ca67aee13494d3fc0e2297a467e8e8a09b67e3374a0029
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (2.0.0.
|
4
|
+
ui_bibz (2.0.0.alpha28)
|
5
5
|
bootstrap (= 4.0.0.alpha5)
|
6
6
|
font-awesome-sass
|
7
7
|
haml
|
@@ -15,54 +15,53 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
-
actioncable (5.0.
|
19
|
-
actionpack (= 5.0.
|
20
|
-
nio4r (
|
18
|
+
actioncable (5.0.2)
|
19
|
+
actionpack (= 5.0.2)
|
20
|
+
nio4r (>= 1.2, < 3.0)
|
21
21
|
websocket-driver (~> 0.6.1)
|
22
|
-
actionmailer (5.0.
|
23
|
-
actionpack (= 5.0.
|
24
|
-
actionview (= 5.0.
|
25
|
-
activejob (= 5.0.
|
22
|
+
actionmailer (5.0.2)
|
23
|
+
actionpack (= 5.0.2)
|
24
|
+
actionview (= 5.0.2)
|
25
|
+
activejob (= 5.0.2)
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
|
-
actionpack (5.0.
|
29
|
-
actionview (= 5.0.
|
30
|
-
activesupport (= 5.0.
|
28
|
+
actionpack (5.0.2)
|
29
|
+
actionview (= 5.0.2)
|
30
|
+
activesupport (= 5.0.2)
|
31
31
|
rack (~> 2.0)
|
32
32
|
rack-test (~> 0.6.3)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
35
|
-
actionview (5.0.
|
36
|
-
activesupport (= 5.0.
|
35
|
+
actionview (5.0.2)
|
36
|
+
activesupport (= 5.0.2)
|
37
37
|
builder (~> 3.1)
|
38
38
|
erubis (~> 2.7.0)
|
39
39
|
rails-dom-testing (~> 2.0)
|
40
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
41
|
-
activejob (5.0.
|
42
|
-
activesupport (= 5.0.
|
40
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
41
|
+
activejob (5.0.2)
|
42
|
+
activesupport (= 5.0.2)
|
43
43
|
globalid (>= 0.3.6)
|
44
|
-
activemodel (5.0.
|
45
|
-
activesupport (= 5.0.
|
46
|
-
activerecord (5.0.
|
47
|
-
activemodel (= 5.0.
|
48
|
-
activesupport (= 5.0.
|
44
|
+
activemodel (5.0.2)
|
45
|
+
activesupport (= 5.0.2)
|
46
|
+
activerecord (5.0.2)
|
47
|
+
activemodel (= 5.0.2)
|
48
|
+
activesupport (= 5.0.2)
|
49
49
|
arel (~> 7.0)
|
50
|
-
activesupport (5.0.
|
50
|
+
activesupport (5.0.2)
|
51
51
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
52
52
|
i18n (~> 0.7)
|
53
53
|
minitest (~> 5.1)
|
54
54
|
tzinfo (~> 1.1)
|
55
55
|
arel (7.1.4)
|
56
|
-
autoprefixer-rails (6.7.
|
56
|
+
autoprefixer-rails (6.7.6)
|
57
57
|
execjs
|
58
|
-
awesome_print (1.7.0)
|
59
58
|
bootstrap (4.0.0.alpha5)
|
60
59
|
autoprefixer-rails (>= 6.0.3)
|
61
60
|
sass (>= 3.4.19)
|
62
61
|
builder (3.2.3)
|
63
62
|
codeclimate-test-reporter (1.0.6)
|
64
63
|
simplecov
|
65
|
-
concurrent-ruby (1.0.
|
64
|
+
concurrent-ruby (1.0.5)
|
66
65
|
docile (1.1.5)
|
67
66
|
erubis (2.7.0)
|
68
67
|
execjs (2.7.0)
|
@@ -100,32 +99,32 @@ GEM
|
|
100
99
|
mime-types-data (3.2016.0521)
|
101
100
|
mini_portile2 (2.1.0)
|
102
101
|
minitest (5.10.1)
|
103
|
-
nio4r (
|
102
|
+
nio4r (2.0.0)
|
104
103
|
nokogiri (1.7.0.1)
|
105
104
|
mini_portile2 (~> 2.1.0)
|
106
105
|
rack (2.0.1)
|
107
106
|
rack-test (0.6.3)
|
108
107
|
rack (>= 1.0)
|
109
|
-
rails (5.0.
|
110
|
-
actioncable (= 5.0.
|
111
|
-
actionmailer (= 5.0.
|
112
|
-
actionpack (= 5.0.
|
113
|
-
actionview (= 5.0.
|
114
|
-
activejob (= 5.0.
|
115
|
-
activemodel (= 5.0.
|
116
|
-
activerecord (= 5.0.
|
117
|
-
activesupport (= 5.0.
|
108
|
+
rails (5.0.2)
|
109
|
+
actioncable (= 5.0.2)
|
110
|
+
actionmailer (= 5.0.2)
|
111
|
+
actionpack (= 5.0.2)
|
112
|
+
actionview (= 5.0.2)
|
113
|
+
activejob (= 5.0.2)
|
114
|
+
activemodel (= 5.0.2)
|
115
|
+
activerecord (= 5.0.2)
|
116
|
+
activesupport (= 5.0.2)
|
118
117
|
bundler (>= 1.3.0, < 2.0)
|
119
|
-
railties (= 5.0.
|
118
|
+
railties (= 5.0.2)
|
120
119
|
sprockets-rails (>= 2.0.0)
|
121
120
|
rails-dom-testing (2.0.2)
|
122
121
|
activesupport (>= 4.2.0, < 6.0)
|
123
122
|
nokogiri (~> 1.6)
|
124
123
|
rails-html-sanitizer (1.0.3)
|
125
124
|
loofah (~> 2.0)
|
126
|
-
railties (5.0.
|
127
|
-
actionpack (= 5.0.
|
128
|
-
activesupport (= 5.0.
|
125
|
+
railties (5.0.2)
|
126
|
+
actionpack (= 5.0.2)
|
127
|
+
activesupport (= 5.0.2)
|
129
128
|
method_source
|
130
129
|
rake (>= 0.8.7)
|
131
130
|
thor (>= 0.18.1, < 2.0)
|
@@ -173,7 +172,6 @@ PLATFORMS
|
|
173
172
|
ruby
|
174
173
|
|
175
174
|
DEPENDENCIES
|
176
|
-
awesome_print
|
177
175
|
codeclimate-test-reporter
|
178
176
|
factory_girl_rails (~> 4.0)
|
179
177
|
minitest
|
data/lib/ui_bibz.rb
CHANGED
@@ -53,6 +53,7 @@ module UiBibz
|
|
53
53
|
autoload :ButtonChoice, "ui_bibz/ui/core/forms/buttons/button_choice"
|
54
54
|
autoload :ButtonGroup, "ui_bibz/ui/core/forms/buttons/button_group"
|
55
55
|
autoload :ButtonLink, "ui_bibz/ui/core/forms/buttons/button_link"
|
56
|
+
autoload :ButtonRefresh, "ui_bibz/ui/core/forms/buttons/button_refresh"
|
56
57
|
end
|
57
58
|
|
58
59
|
module Texts
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module UiBibz::Ui::Core::Forms::Buttons
|
2
|
+
|
3
|
+
# Create a Button Refrash
|
4
|
+
#
|
5
|
+
# ==== Attributes
|
6
|
+
#
|
7
|
+
# * +content+ - Content of element
|
8
|
+
# * +options+ - Options of element
|
9
|
+
# * +html_options+ - Html Options of element
|
10
|
+
#
|
11
|
+
# ==== Options
|
12
|
+
#
|
13
|
+
# You can add HTML attributes using the +html_options+.
|
14
|
+
# You can pass arguments in options attribute:
|
15
|
+
# * +status+ - status of élement with symbol value:
|
16
|
+
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
|
17
|
+
# * +size+
|
18
|
+
# (+:xs+, +:sm+, +:lg+)
|
19
|
+
# * +outline+ - Boolean
|
20
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
21
|
+
# * +type+ - Symbol (+:outline)
|
22
|
+
# * +glyph+ - Add glyph with name or hash options
|
23
|
+
# * +name+ - String
|
24
|
+
# * +size+ - Integer
|
25
|
+
# * +type+ - Symbol
|
26
|
+
# * +connect+ - Hash
|
27
|
+
# * +event+ - String
|
28
|
+
# * +mode+ - String
|
29
|
+
# * +target+ - Hash
|
30
|
+
# * +selector+ - String
|
31
|
+
# * +data+ - Array
|
32
|
+
# * +url+ - String
|
33
|
+
#
|
34
|
+
# ==== Signatures
|
35
|
+
#
|
36
|
+
# UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(content, options = nil, html_options = nil)
|
37
|
+
#
|
38
|
+
# UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(options = nil, html_options = nil) do
|
39
|
+
# content
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# ==== Examples
|
43
|
+
#
|
44
|
+
# UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new('test', type: :primary, size: :xs).render
|
45
|
+
#
|
46
|
+
# UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(type: :primary) do
|
47
|
+
# test
|
48
|
+
# end.render
|
49
|
+
#
|
50
|
+
class ButtonRefresh < UiBibz::Ui::Core::Forms::Buttons::Button
|
51
|
+
|
52
|
+
# See UiBibz::Ui::Core::Component.initialize
|
53
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
54
|
+
super
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def component_options
|
60
|
+
options[:connect] = connect_options
|
61
|
+
{ glyph: 'refresh', status: options[:status] }
|
62
|
+
end
|
63
|
+
|
64
|
+
def component_html_classes
|
65
|
+
['input-refresh-button', 'btn']
|
66
|
+
end
|
67
|
+
|
68
|
+
def connect_options
|
69
|
+
{
|
70
|
+
events: options[:connect].try(:[], :events) || "click",
|
71
|
+
mode: options[:connect].try(:[], :type) || "remote",
|
72
|
+
target: {
|
73
|
+
selector: options[:connect].try(:[], :target).try(:[], :selector) || "",
|
74
|
+
url: options[:connect].try(:[], :target).try(:[], :url) || "",
|
75
|
+
data: options[:connect].try(:[], :target).try(:[], :data) || []
|
76
|
+
}
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -17,16 +17,30 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
17
17
|
# You can pass arguments in options attribute:
|
18
18
|
# * +status+ - status of élement with symbol value:
|
19
19
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
|
20
|
-
# * option_tags - Array, Object [required]
|
21
|
-
# * searchable - Boolean
|
22
|
-
# * max_options - Integer
|
23
|
-
# * selected_text_format - String
|
24
|
-
# * menu_size - Integer
|
25
|
-
# * header - String
|
26
|
-
# * actions_box - Boolean
|
27
|
-
# * show_tick - Boolean
|
28
|
-
# * show_menu_arrow - Boolean
|
29
|
-
# * dropup - Boolean
|
20
|
+
# * +option_tags+ - Array, Object [required]
|
21
|
+
# * +searchable+ - Boolean
|
22
|
+
# * +max_options+ - Integer
|
23
|
+
# * +selected_text_format+ - String
|
24
|
+
# * +menu_size+ - Integer
|
25
|
+
# * +header+ - String
|
26
|
+
# * +actions_box+ - Boolean
|
27
|
+
# * +show_tick+ - Boolean
|
28
|
+
# * +show_menu_arrow+ - Boolean
|
29
|
+
# * +dropup+ - Boolean
|
30
|
+
# * +connect+ - Hash
|
31
|
+
# * +event+ - String
|
32
|
+
# * +mode+ - String
|
33
|
+
# * +target+ - Hash
|
34
|
+
# * +selector+ - String
|
35
|
+
# * +data+ - Array
|
36
|
+
# * +url+ - String
|
37
|
+
# * +refresh+ - Hash
|
38
|
+
# * +event+ - String
|
39
|
+
# * +mode+ - String
|
40
|
+
# * +target+ - Hash
|
41
|
+
# * +selector+ - String
|
42
|
+
# * +data+ - Array
|
43
|
+
# * +url+ - String
|
30
44
|
#
|
31
45
|
# ==== Signatures
|
32
46
|
#
|
@@ -57,7 +71,14 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
57
71
|
|
58
72
|
# Render html tag
|
59
73
|
def render
|
60
|
-
|
74
|
+
if options[:refresh]
|
75
|
+
content_tag :div, class: 'input-group select-field-refresh' do
|
76
|
+
concat select_tag content, options[:option_tags], html_options
|
77
|
+
concat content_tag(:span, UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('', connect: connect_opts).render, class: 'input-group-btn')
|
78
|
+
end
|
79
|
+
else
|
80
|
+
select_tag content, options[:option_tags], html_options
|
81
|
+
end
|
61
82
|
end
|
62
83
|
|
63
84
|
private
|
@@ -81,12 +102,13 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
81
102
|
options[:state] == :disabled ? { disabled: 'disabled' } : {}
|
82
103
|
end
|
83
104
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
add_html_data('connect', options[:connect]) if options[:connect]
|
105
|
+
def connect_opts
|
106
|
+
options[:refresh][:target].merge!({ selector: "##{ content.parameterize.underscore }" })
|
107
|
+
options[:refresh]
|
88
108
|
end
|
89
109
|
|
110
|
+
############################ Data html options
|
111
|
+
|
90
112
|
def max_options
|
91
113
|
add_html_data('max_options', options[:max_options]) if options[:max_options]
|
92
114
|
end
|
@@ -115,6 +137,10 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
115
137
|
add_html_data('header', options[:header]) if options[:header]
|
116
138
|
end
|
117
139
|
|
140
|
+
def connect_options
|
141
|
+
add_html_data('connect', options[:connect]) if options[:connect]
|
142
|
+
end
|
143
|
+
|
118
144
|
|
119
145
|
############################# Css classes
|
120
146
|
|
@@ -14,9 +14,16 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * option_tags - Array, Object [required]
|
18
|
-
# * selectable_opt_group - Boolean
|
19
|
-
# * searchable - Boolean
|
17
|
+
# * +option_tags+ - Array, Object [required]
|
18
|
+
# * +selectable_opt_group+ - Boolean
|
19
|
+
# * +searchable+ - Boolean
|
20
|
+
# * +connect+ - Hash
|
21
|
+
# * +event+ - String
|
22
|
+
# * +mode+ - String
|
23
|
+
# * +target+ - Hash
|
24
|
+
# * +selector+ - String
|
25
|
+
# * +data+ - Array
|
26
|
+
# * +url+ - String
|
20
27
|
#
|
21
28
|
# ==== Signatures
|
22
29
|
#
|
@@ -15,11 +15,18 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
15
15
|
#
|
16
16
|
# You can add HTML attributes using the +html_options+.
|
17
17
|
# You can pass arguments in options attribute:
|
18
|
-
# * option_tags - Array, Object [required]
|
19
|
-
# * clickable_opt_group - Boolean
|
20
|
-
# * collapsible_opt_group - Boolean
|
21
|
-
# * searchable - Boolean
|
22
|
-
# * select_all_option - Boolean
|
18
|
+
# * +option_tags+ - Array, Object [required]
|
19
|
+
# * +clickable_opt_group+ - Boolean
|
20
|
+
# * +collapsible_opt_group+ - Boolean
|
21
|
+
# * +searchable+ - Boolean
|
22
|
+
# * +select_all_option+ - Boolean
|
23
|
+
# * +connect+ - Hash
|
24
|
+
# * +event+ - String
|
25
|
+
# * +mode+ - String
|
26
|
+
# * +target+ - Hash
|
27
|
+
# * +selector+ - String
|
28
|
+
# * +data+ - Array
|
29
|
+
# * +url+ - String
|
23
30
|
#
|
24
31
|
# ==== Signatures
|
25
32
|
#
|
@@ -50,7 +57,14 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
50
57
|
|
51
58
|
# Render html tag
|
52
59
|
def render
|
53
|
-
|
60
|
+
if options[:refresh]
|
61
|
+
content_tag :div, class: 'input-group select-field-refresh' do
|
62
|
+
concat select_tag content, options[:option_tags], html_options
|
63
|
+
concat content_tag(:span, UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('', connect: connect_opts).render, class: 'input-group-btn')
|
64
|
+
end
|
65
|
+
else
|
66
|
+
select_tag content, options[:option_tags], html_options
|
67
|
+
end
|
54
68
|
end
|
55
69
|
|
56
70
|
private
|
@@ -69,6 +83,7 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
69
83
|
collapsible_opt_group
|
70
84
|
searchable
|
71
85
|
select_all_option
|
86
|
+
connect_options
|
72
87
|
end
|
73
88
|
|
74
89
|
def clickable_opt_group
|
@@ -91,5 +106,14 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
91
106
|
options[:status].nil? ? 'btn-secondary' : "btn-#{ options[:status] }"
|
92
107
|
end
|
93
108
|
|
109
|
+
def connect_opts
|
110
|
+
options[:refresh][:target].merge!({ selector: "##{ content.parameterize.underscore }" })
|
111
|
+
options[:refresh]
|
112
|
+
end
|
113
|
+
|
114
|
+
def connect_options
|
115
|
+
add_html_data('connect', options[:connect]) if options[:connect]
|
116
|
+
end
|
117
|
+
|
94
118
|
end
|
95
119
|
end
|
@@ -17,16 +17,31 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
17
17
|
# You can pass arguments in options attribute:
|
18
18
|
# * +status+ - status of élement with symbol value:
|
19
19
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
|
20
|
-
# * option_tags - Array, Object [required]
|
21
|
-
# * searchable - Boolean
|
22
|
-
# * max_options - Integer
|
23
|
-
# * selected_text_format - String
|
24
|
-
# * menu_size - Integer
|
25
|
-
# * header - String
|
26
|
-
# * actions_box - Boolean
|
27
|
-
# * show_tick - Boolean
|
28
|
-
# * show_menu_arrow - Boolean
|
29
|
-
# * dropup - Boolean
|
20
|
+
# * +option_tags+ - Array, Object [required]
|
21
|
+
# * +searchable+ - Boolean
|
22
|
+
# * +max_options+ - Integer
|
23
|
+
# * +selected_text_format+ - String
|
24
|
+
# * +menu_size+ - Integer
|
25
|
+
# * +header+ - String
|
26
|
+
# * +actions_box+ - Boolean
|
27
|
+
# * +show_tick+ - Boolean
|
28
|
+
# * +show_menu_arrow+ - Boolean
|
29
|
+
# * +dropup+ - Boolean
|
30
|
+
# * +connect+ - Hash
|
31
|
+
# * +event+ - String
|
32
|
+
# * +mode+ - String
|
33
|
+
# * +target+ - Hash
|
34
|
+
# * +selector+ - String
|
35
|
+
# * +data+ - Array
|
36
|
+
# * +url+ - String
|
37
|
+
# * +refresh+ - Hash
|
38
|
+
# * +event+ - String
|
39
|
+
# * +mode+ - String
|
40
|
+
# * +target+ - Hash
|
41
|
+
# * +selector+ - String
|
42
|
+
# * +data+ - Array
|
43
|
+
# * +url+ - String
|
44
|
+
#
|
30
45
|
#
|
31
46
|
# ==== Signatures
|
32
47
|
#
|
@@ -60,7 +75,7 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
60
75
|
if options[:refresh]
|
61
76
|
content_tag :div, class: 'input-group select-field-refresh' do
|
62
77
|
concat select_tag content, options[:option_tags], html_options
|
63
|
-
concat
|
78
|
+
concat content_tag(:span, UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('', connect: connect_opts).render, class: 'input-group-btn')
|
64
79
|
end
|
65
80
|
else
|
66
81
|
select_tag content, options[:option_tags], html_options
|
@@ -73,22 +88,9 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
73
88
|
['select-field', 'form-control']
|
74
89
|
end
|
75
90
|
|
76
|
-
def
|
77
|
-
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
def connect_options
|
82
|
-
connect = options[:refresh] || {}
|
83
|
-
{
|
84
|
-
events: connect.try(:[], :events) || "click",
|
85
|
-
mode: connect.try(:[], :type) || "remote",
|
86
|
-
target: {
|
87
|
-
selector: connect.try(:[], :target).try(:[], :selector) || "##{ content.parameterize.underscore }",
|
88
|
-
url: connect.try(:[], :target).try(:[], :url) || "",
|
89
|
-
data: connect.try(:[], :target).try(:[], :data) || []
|
90
|
-
}
|
91
|
-
}
|
91
|
+
def connect_opts
|
92
|
+
options[:refresh][:target].merge!({ selector: "##{ content.parameterize.underscore }" })
|
93
|
+
options[:refresh]
|
92
94
|
end
|
93
95
|
|
94
96
|
end
|