ui_bibz 2.0.0.alpha24 → 2.0.0.alpha26
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/CONTRIBUTORS.md +19 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +60 -55
- data/app/assets/javascripts/interface.coffee +11 -0
- data/app/assets/javascripts/ui_bibz.coffee +3 -1
- data/app/assets/stylesheets/table.sass +1 -2
- data/app/assets/stylesheets/ui_bibz.sass +2 -0
- data/app/inputs/custom_inputs/autocomplete_input.rb +3 -2
- data/app/inputs/custom_inputs/date_picker_input.rb +2 -2
- data/app/inputs/custom_inputs/dropdown_select_input.rb +2 -2
- data/app/inputs/custom_inputs/formula_input.rb +2 -2
- data/app/inputs/custom_inputs/markdown_editor_input.rb +2 -2
- data/app/inputs/custom_inputs/multi_column_input.rb +2 -2
- data/app/inputs/custom_inputs/multi_select_input.rb +2 -2
- data/app/inputs/custom_inputs/radios_input.rb +20 -0
- data/app/inputs/custom_inputs/surround_input.rb +2 -2
- data/app/inputs/custom_inputs/switch_input.rb +2 -2
- data/config/initializers/will_paginate.rb +79 -0
- data/lib/ui_bibz.rb +56 -30
- data/lib/ui_bibz/helpers/ui_core_helper.rb +45 -37
- data/lib/ui_bibz/ui/core/alert.rb +1 -2
- data/lib/ui_bibz/ui/core/{breadcrumb/breadcrumb.rb → breadcrumb.rb} +5 -5
- data/lib/ui_bibz/ui/core/cards/card.rb +6 -6
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_link.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_text.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/block/card_block_title.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_block.rb +4 -4
- data/lib/ui_bibz/ui/core/cards/components/card_footer.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_header.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_image.rb +1 -1
- data/lib/ui_bibz/ui/core/cards/components/card_list_group.rb +2 -2
- data/lib/ui_bibz/ui/core/component.rb +4 -51
- data/lib/ui_bibz/ui/core/component/glyph_extension.rb +19 -0
- data/lib/ui_bibz/ui/core/component/klass_extension.rb +38 -0
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_divider.rb +1 -1
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/components/dropdown_link.rb +2 -2
- data/lib/ui_bibz/ui/core/{dropdown → dropdowns}/dropdown.rb +11 -12
- data/lib/ui_bibz/ui/core/{buttons/button_split_dropdown.rb → dropdowns/split_dropdown.rb} +6 -10
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button.rb +5 -5
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_choice.rb +8 -8
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_group.rb +5 -5
- data/lib/ui_bibz/ui/core/{buttons → forms/buttons}/button_link.rb +13 -9
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +98 -0
- data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +98 -0
- data/lib/ui_bibz/ui/core/{inputs → forms/choices}/switch_field.rb +3 -3
- data/lib/ui_bibz/ui/core/{inputs → forms/dates}/date_picker_field.rb +6 -6
- data/lib/ui_bibz/ui/core/{inputs → forms/numbers}/formula_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/dropdown_select_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/multi_column_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/selects}/multi_select_field.rb +8 -8
- data/lib/ui_bibz/ui/core/{inputs → forms/textareas}/markdown_editor_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/texts}/autocomplete_field.rb +5 -5
- data/lib/ui_bibz/ui/core/{inputs → forms/texts}/surround_field.rb +5 -5
- data/lib/ui_bibz/ui/core/glyph.rb +2 -1
- data/lib/ui_bibz/ui/core/{list → lists}/components/list.rb +11 -11
- data/lib/ui_bibz/ui/core/{list/components → lists/components/list}/list_body.rb +2 -2
- data/lib/ui_bibz/ui/core/{list/components → lists/components/list}/list_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{list → lists}/list_group.rb +4 -4
- data/lib/ui_bibz/ui/core/navs/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navs/components/navbar_form.rb +3 -1
- data/lib/ui_bibz/ui/core/paths/breadcrumb.rb +109 -0
- data/lib/ui_bibz/ui/core/{breadcrumb → paths}/components/breadcrumb_link.rb +6 -6
- data/lib/ui_bibz/ui/core/{stars.rb → star.rb} +14 -14
- data/lib/ui_bibz/ui/core/tag.rb +1 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_body.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_footer.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/components/modal_header.rb +2 -2
- data/lib/ui_bibz/ui/core/{modal → windows}/modal.rb +8 -8
- data/lib/ui_bibz/ui/ux/tables/components/actions.rb +9 -9
- data/lib/ui_bibz/ui/ux/tables/extensions/actionable.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table_pagination.rb +5 -4
- data/lib/ui_bibz/version.rb +1 -1
- data/test/dummy/app/controllers/users_controller.rb +18 -0
- data/test/dummy/app/models/user.rb +1 -0
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/config/initializers/simple_form_bootstrap.rb +155 -0
- data/test/simple_form_test.rb +123 -0
- data/test/test_helper.rb +2 -2
- data/test/ui/breadcrumb_test.rb +2 -2
- data/test/ui/button_test.rb +13 -39
- data/test/ui/dropdown_test.rb +14 -1
- data/test/ui/glyph_test.rb +6 -0
- data/test/ui/input_dropdown_select_field_test.rb +9 -9
- data/test/ui/input_switch_field_test.rb +11 -11
- data/test/ui/inputs_test.rb +26 -12
- data/test/ui/list_group_test.rb +2 -2
- data/test/ui/{stars_test.rb → star_test.rb} +7 -7
- data/test/ui/table_test.rb +3 -3
- data/test/ui_helper_test.rb +6 -1
- data/ui_bibz.gemspec +4 -3
- data/vendor/assets/stylesheets/awesome-bootstrap-checkbox.scss +250 -0
- metadata +65 -39
- data/lib/ui_bibz/helpers/pagination_helper.rb +0 -55
- data/lib/ui_bibz/ui/core/buttons/button_dropdown.rb +0 -82
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::Buttons
|
1
|
+
module UiBibz::Ui::Core::Forms::Buttons
|
2
2
|
|
3
3
|
# Create a button
|
4
4
|
#
|
@@ -28,17 +28,17 @@ module UiBibz::Ui::Core::Buttons
|
|
28
28
|
#
|
29
29
|
# ==== Signatures
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::Core::Buttons::Button.new(content, options = nil, html_options = nil)
|
31
|
+
# UiBibz::Ui::Core::Forms::Buttons::Button.new(content, options = nil, html_options = nil)
|
32
32
|
#
|
33
|
-
# UiBibz::Ui::Core::Buttons::Button.new(options = nil, html_options = nil) do
|
33
|
+
# UiBibz::Ui::Core::Forms::Buttons::Button.new(options = nil, html_options = nil) do
|
34
34
|
# content
|
35
35
|
# end
|
36
36
|
#
|
37
37
|
# ==== Examples
|
38
38
|
#
|
39
|
-
# UiBibz::Ui::Core::Buttons::Button.new('test', type: :primary, size: :xs).render
|
39
|
+
# UiBibz::Ui::Core::Forms::Buttons::Button.new('test', type: :primary, size: :xs).render
|
40
40
|
#
|
41
|
-
# UiBibz::Ui::Core::Buttons::Button.new(type: :primary) do
|
41
|
+
# UiBibz::Ui::Core::Forms::Buttons::Button.new(type: :primary) do
|
42
42
|
# test
|
43
43
|
# end.render
|
44
44
|
#
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui::Core::Buttons
|
1
|
+
module UiBibz::Ui::Core::Forms::Buttons
|
2
2
|
|
3
3
|
# Create a button choice
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Core::Buttons::Button
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Forms::Buttons::Button
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -33,17 +33,17 @@ module UiBibz::Ui::Core::Buttons
|
|
33
33
|
#
|
34
34
|
# ==== Signatures
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::Core::Buttons::ButtonChoice.new(content, options = nil, html_options = nil)
|
36
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new(content, options = nil, html_options = nil)
|
37
37
|
#
|
38
|
-
# UiBibz::Ui::Core::Buttons::ButtonChoice.new(options = nil, html_options = nil) do
|
38
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new(options = nil, html_options = nil) do
|
39
39
|
# content
|
40
40
|
# end
|
41
41
|
#
|
42
42
|
# ==== Examples
|
43
43
|
#
|
44
|
-
# UiBibz::Ui::Core::Buttons::ButtonChoice.new('test', state: :active)
|
44
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new('test', state: :active)
|
45
45
|
#
|
46
|
-
# UiBibz::Ui::Core::Buttons::ButtonChoice.new({id: 'state', input_html_options: { class: 'state'}}, { class: 'lable-class'}) do
|
46
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new({id: 'state', input_html_options: { class: 'state'}}, { class: 'lable-class'}) do
|
47
47
|
# test
|
48
48
|
# end.render
|
49
49
|
#
|
@@ -55,9 +55,9 @@ module UiBibz::Ui::Core::Buttons
|
|
55
55
|
# content
|
56
56
|
# end
|
57
57
|
#
|
58
|
-
class ButtonChoice < UiBibz::Ui::Core::Buttons::Button
|
58
|
+
class ButtonChoice < UiBibz::Ui::Core::Forms::Buttons::Button
|
59
59
|
|
60
|
-
# See UiBibz::Ui::Core::Buttons::Button.initialize
|
60
|
+
# See UiBibz::Ui::Core::Forms::Buttons::Button.initialize
|
61
61
|
def initialize content = nil, options = nil, html_options = nil, &block
|
62
62
|
super
|
63
63
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::Buttons
|
1
|
+
module UiBibz::Ui::Core::Forms::Buttons
|
2
2
|
|
3
3
|
# Create a button group
|
4
4
|
#
|
@@ -23,15 +23,15 @@ module UiBibz::Ui::Core::Buttons
|
|
23
23
|
#
|
24
24
|
# ==== Signatures
|
25
25
|
#
|
26
|
-
# UiBibz::Ui::Core::Buttons::ButtonGroup.new(options = nil, html_options = nil) do
|
26
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(options = nil, html_options = nil) do
|
27
27
|
# ...
|
28
28
|
# end
|
29
29
|
#
|
30
30
|
# ==== Examples
|
31
31
|
#
|
32
|
-
# UiBibz::Ui::Core::Buttons::ButtonGroup.new(position: :vertical, size: :xs) do
|
33
|
-
# UiBibz::Ui::Core::Buttons.Button.new('test').render
|
34
|
-
# UiBibz::Ui::Core::Buttons.Button.new('test2').render
|
32
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(position: :vertical, size: :xs) do
|
33
|
+
# UiBibz::Ui::Core::Forms::Buttons.Button.new('test').render
|
34
|
+
# UiBibz::Ui::Core::Forms::Buttons.Button.new('test2').render
|
35
35
|
# end.render
|
36
36
|
#
|
37
37
|
# ==== Helper
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui::Core::Buttons
|
1
|
+
module UiBibz::Ui::Core::Forms::Buttons
|
2
2
|
|
3
3
|
# Create a button link
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Core::Buttons::Button.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Forms::Buttons::Button.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -29,17 +29,17 @@ module UiBibz::Ui::Core::Buttons
|
|
29
29
|
#
|
30
30
|
# ==== Signatures
|
31
31
|
#
|
32
|
-
# UiBibz::Ui::Core::Buttons::ButtonLink.new(content, options = nil, html_options = nil)
|
32
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(content, options = nil, html_options = nil)
|
33
33
|
#
|
34
|
-
# UiBibz::Ui::Core::Buttons::ButtonLink.new(options = nil, html_options = nil) do
|
34
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(options = nil, html_options = nil) do
|
35
35
|
# content
|
36
36
|
# end
|
37
37
|
#
|
38
38
|
# ==== Examples
|
39
39
|
#
|
40
|
-
# UiBibz::Ui::Core::Buttons::ButtonLink.new('test', type: :primary, url: '#')
|
40
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new('test', type: :primary, url: '#')
|
41
41
|
#
|
42
|
-
# UiBibz::Ui::Core::Buttons::ButtonLink.new(type: :primary, url: '#') do
|
42
|
+
# UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(type: :primary, url: '#') do
|
43
43
|
# test
|
44
44
|
# end.render
|
45
45
|
#
|
@@ -51,20 +51,24 @@ module UiBibz::Ui::Core::Buttons
|
|
51
51
|
# content
|
52
52
|
# end
|
53
53
|
#
|
54
|
-
class ButtonLink < UiBibz::Ui::Core::Buttons::Button
|
54
|
+
class ButtonLink < UiBibz::Ui::Core::Forms::Buttons::Button
|
55
55
|
|
56
|
-
# See UiBibz::Ui::Core::Buttons::Button
|
56
|
+
# See UiBibz::Ui::Core::Forms::Buttons::Button
|
57
57
|
def initialize content = nil, options = nil, html_options = nil, &block
|
58
58
|
super
|
59
59
|
end
|
60
60
|
|
61
61
|
# Render html tag
|
62
62
|
def render
|
63
|
-
link_to glyph_and_content_html,
|
63
|
+
link_to glyph_and_content_html, link_url, html_options
|
64
64
|
end
|
65
65
|
|
66
66
|
private
|
67
67
|
|
68
|
+
def link_url
|
69
|
+
options[:url] || "#"
|
70
|
+
end
|
71
|
+
|
68
72
|
def component_html_classes
|
69
73
|
['btn', size, type]
|
70
74
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module UiBibz::Ui::Core::Forms::Choices
|
2
|
+
|
3
|
+
# Create a checkbox
|
4
|
+
#
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
|
+
#
|
7
|
+
# ==== Attributes
|
8
|
+
#
|
9
|
+
# * +content+ - Content of element
|
10
|
+
# * +options+ - Options of element
|
11
|
+
# * +html_options+ - Html Options of element
|
12
|
+
#
|
13
|
+
# ==== Options
|
14
|
+
#
|
15
|
+
# You can add HTML attributes using the +html_options+.
|
16
|
+
# You can pass arguments in options attribute:
|
17
|
+
# * +value+ - String, Integer, Boolean [required]
|
18
|
+
# * +status+ - status of élement with symbol value:
|
19
|
+
# (+:default+, +:primary+, +:success+, +:info+, +:warning+, +:danger+)
|
20
|
+
# * +type+ - Symbol (:circle)
|
21
|
+
#
|
22
|
+
# ==== Signatures
|
23
|
+
#
|
24
|
+
# UiBibz::Ui::Core::Forms::CheckboxField.new(content, options = nil, html_options = nil)
|
25
|
+
#
|
26
|
+
# UiBibz::Ui::Core::Forms::CheckboxField.new(options = nil, html_options = nil) do
|
27
|
+
# content
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# ==== Examples
|
31
|
+
#
|
32
|
+
# UiBibz::Ui::Core::Forms::CheckboxField.new(content, { status: :success, type: :circle },{ class: 'test' }).render
|
33
|
+
#
|
34
|
+
# UiBibz::Ui::Core::Forms::CheckboxField.new({ status: :primary }, { class: 'test' }) do
|
35
|
+
# content
|
36
|
+
# end.render
|
37
|
+
#
|
38
|
+
# ==== Helper
|
39
|
+
#
|
40
|
+
# checkbox(content, options = {}, html_options = {})
|
41
|
+
#
|
42
|
+
# checkbox(options = {}, html_options = {}) do
|
43
|
+
# content
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
class CheckboxField < UiBibz::Ui::Core::Component
|
47
|
+
|
48
|
+
# See UiBibz::Ui::Core::Component.initialize
|
49
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
50
|
+
super
|
51
|
+
end
|
52
|
+
|
53
|
+
# Render html tag
|
54
|
+
def render
|
55
|
+
content_tag :div, html_options.except(:id) do
|
56
|
+
concat check_box_tag content, options[:value], options[:checked] || false, checkbox_html_options
|
57
|
+
concat label_tag label_name, label_content
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def checkbox_html_options
|
64
|
+
opts = { class: 'styled' }
|
65
|
+
opts = opts.merge({ disabled: true}) if options[:state] == :disabled
|
66
|
+
opts
|
67
|
+
end
|
68
|
+
|
69
|
+
def label_name
|
70
|
+
html_options[:id] || content
|
71
|
+
end
|
72
|
+
|
73
|
+
def label_content
|
74
|
+
options[:label] || content
|
75
|
+
end
|
76
|
+
|
77
|
+
def status
|
78
|
+
"abc-checkbox-#{ options[:status] || :default }"
|
79
|
+
end
|
80
|
+
|
81
|
+
def type
|
82
|
+
"abc-checkbox-circle" unless options[:type].nil?
|
83
|
+
end
|
84
|
+
|
85
|
+
def indeterminate
|
86
|
+
"indeterminate" unless options[:indeterminate].nil?
|
87
|
+
end
|
88
|
+
|
89
|
+
def inline
|
90
|
+
"checkbox-inline" unless options[:inline].nil?
|
91
|
+
end
|
92
|
+
|
93
|
+
def component_html_classes
|
94
|
+
["checkbox", "abc-checkbox", type, indeterminate, inline]
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module UiBibz::Ui::Core::Forms::Choices
|
2
|
+
|
3
|
+
# Create a radio
|
4
|
+
#
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
|
+
#
|
7
|
+
# ==== Attributes
|
8
|
+
#
|
9
|
+
# * +content+ - Content of element
|
10
|
+
# * +options+ - Options of element
|
11
|
+
# * +html_options+ - Html Options of element
|
12
|
+
#
|
13
|
+
# ==== Options
|
14
|
+
#
|
15
|
+
# You can add HTML attributes using the +html_options+.
|
16
|
+
# You can pass arguments in options attribute:
|
17
|
+
# * +value+ - String, Integer, Boolean [required]
|
18
|
+
# * +status+ - status of élement with symbol value:
|
19
|
+
# (+:default+, +:primary+, +:success+, +:info+, +:warning+, +:danger+)
|
20
|
+
# * +type+ - Symbol (:radio, :checkbox)
|
21
|
+
#
|
22
|
+
# ==== Signatures
|
23
|
+
#
|
24
|
+
# UiBibz::Ui::Core::Forms::RadioField.new(content, options = nil, html_options = nil)
|
25
|
+
#
|
26
|
+
# UiBibz::Ui::Core::Forms::RadioField.new(options = nil, html_options = nil) do
|
27
|
+
# content
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# ==== Examples
|
31
|
+
#
|
32
|
+
# UiBibz::Ui::Core::Forms::RadioField.new(content, { status: :success, type: :circle },{ class: 'test' }).render
|
33
|
+
#
|
34
|
+
# UiBibz::Ui::Core::Forms::RadioField.new({ status: :primary }, { class: 'test' }) do
|
35
|
+
# content
|
36
|
+
# end.render
|
37
|
+
#
|
38
|
+
# ==== Helper
|
39
|
+
#
|
40
|
+
# radio(content, options = {}, html_options = {})
|
41
|
+
#
|
42
|
+
# radio(options = {}, html_options = {}) do
|
43
|
+
# content
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
class RadioField < UiBibz::Ui::Core::Component
|
47
|
+
|
48
|
+
# See UiBibz::Ui::Core::Component.initialize
|
49
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
50
|
+
super
|
51
|
+
end
|
52
|
+
|
53
|
+
# Render html tag
|
54
|
+
def render
|
55
|
+
content_tag :div, html_options.except(:id) do
|
56
|
+
concat radio_button_tag content, options[:value], options[:checked] || false, checkbox_html_options
|
57
|
+
concat label_tag label_name, label_content
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def checkbox_html_options
|
64
|
+
opts = {}
|
65
|
+
opts = opts.merge({ disabled: true}) if options[:state] == :disabled
|
66
|
+
opts
|
67
|
+
end
|
68
|
+
|
69
|
+
def label_name
|
70
|
+
"#{ content }_#{ options[:value] }"
|
71
|
+
end
|
72
|
+
|
73
|
+
def label_content
|
74
|
+
options[:label] || content
|
75
|
+
end
|
76
|
+
|
77
|
+
def status
|
78
|
+
"abc-#{ type }-#{ options[:status] || :default }"
|
79
|
+
end
|
80
|
+
|
81
|
+
def type
|
82
|
+
if !options[:type].nil? && options[:type] == :square
|
83
|
+
:checkbox
|
84
|
+
else
|
85
|
+
:radio
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def inline
|
90
|
+
"#{ type }-inline" unless options[:inline].nil?
|
91
|
+
end
|
92
|
+
|
93
|
+
def component_html_classes
|
94
|
+
[type, "abc-#{ type }", inline]
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::
|
1
|
+
module UiBibz::Ui::Core::Forms::Choices
|
2
2
|
|
3
3
|
# Create a SurroundField
|
4
4
|
#
|
@@ -26,9 +26,9 @@ module UiBibz::Ui::Core::Inputs
|
|
26
26
|
#
|
27
27
|
# ==== Signatures
|
28
28
|
#
|
29
|
-
# UiBibz::Ui::Core::
|
29
|
+
# UiBibz::Ui::Core::Forms::SwitchField.new(content, options = {}, html_options = {}).render
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::Core::
|
31
|
+
# UiBibz::Ui::Core::Forms::SwitchField.new(options = {}, html_options = {}) do
|
32
32
|
# content
|
33
33
|
# end.render
|
34
34
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::
|
1
|
+
module UiBibz::Ui::Core::Forms::Dates
|
2
2
|
|
3
3
|
# Create a DatePickerField
|
4
4
|
#
|
@@ -24,17 +24,17 @@ module UiBibz::Ui::Core::Inputs
|
|
24
24
|
#
|
25
25
|
# ==== Signatures
|
26
26
|
#
|
27
|
-
# UiBibz::Ui::Core::
|
27
|
+
# UiBibz::Ui::Core::Forms::Dates::DatePickerField.new(content, options = {}, html_options = {}).render
|
28
28
|
#
|
29
|
-
# UiBibz::Ui::Core::
|
29
|
+
# UiBibz::Ui::Core::Forms::Dates::DatePickerField.new(options = {}, html_options = {}) do
|
30
30
|
# content
|
31
31
|
# end.render
|
32
32
|
#
|
33
33
|
# ==== Examples
|
34
34
|
#
|
35
|
-
# UiBibz::Ui::Core::
|
35
|
+
# UiBibz::Ui::Core::Forms::Dates::DatePickerField.new('date', { prepend: 'Prepend content', append: 'Append content' }, { class: 'test' })
|
36
36
|
#
|
37
|
-
# UiBibz::Ui::Core::
|
37
|
+
# UiBibz::Ui::Core::Forms::Dates::DatePickerField.new({ date_today_highlight: true, calendar_weeks: true, range: 'to' }, { class: 'test' }) do
|
38
38
|
# 'date'
|
39
39
|
# end
|
40
40
|
#
|
@@ -60,7 +60,7 @@ module UiBibz::Ui::Core::Inputs
|
|
60
60
|
concat content_tag :span, options[:prepend], class: 'input-group-addon' unless @options[:prepend].nil?
|
61
61
|
end
|
62
62
|
else
|
63
|
-
UiBibz::Ui::Core::
|
63
|
+
UiBibz::Ui::Core::Forms::Texts::SurroundField.new(content, options, html_options).render
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::
|
1
|
+
module UiBibz::Ui::Core::Forms::Numbers
|
2
2
|
|
3
3
|
# Create a FormulaField
|
4
4
|
#
|
@@ -18,17 +18,17 @@ module UiBibz::Ui::Core::Inputs
|
|
18
18
|
#
|
19
19
|
# ==== Signatures
|
20
20
|
#
|
21
|
-
# UiBibz::Ui::Core::
|
21
|
+
# UiBibz::Ui::Core::Forms::Numbers::FormulaField.new(content, options = {}, html_options = {}).render
|
22
22
|
#
|
23
|
-
# UiBibz::Ui::Core::
|
23
|
+
# UiBibz::Ui::Core::Forms::Numbers::FormulaField.new(options = {}, html_options = {}) do
|
24
24
|
# content
|
25
25
|
# end.render
|
26
26
|
#
|
27
27
|
# ==== Examples
|
28
28
|
#
|
29
|
-
# UiBibz::Ui::Core::
|
29
|
+
# UiBibz::Ui::Core::Forms::Numbers::FormulaField.new('value', { formula_field_name: :formula }, { class: 'test' })
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::Core::
|
31
|
+
# UiBibz::Ui::Core::Forms::Numbers::FormulaField.new do
|
32
32
|
# 'value'
|
33
33
|
# end
|
34
34
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module UiBibz::Ui::Core::
|
1
|
+
module UiBibz::Ui::Core::Forms::Selects
|
2
2
|
|
3
3
|
# Create a DropdownSelectField
|
4
4
|
#
|
@@ -30,17 +30,17 @@ module UiBibz::Ui::Core::Inputs
|
|
30
30
|
#
|
31
31
|
# ==== Signatures
|
32
32
|
#
|
33
|
-
# UiBibz::Ui::Core::
|
33
|
+
# UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options = {}, html_options = {}).render
|
34
34
|
#
|
35
|
-
# UiBibz::Ui::Core::
|
35
|
+
# UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(options = {}, html_options = {}) do
|
36
36
|
# content
|
37
37
|
# end.render
|
38
38
|
#
|
39
39
|
# ==== Examples
|
40
40
|
#
|
41
|
-
# UiBibz::Ui::Core::
|
41
|
+
# UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('fruits', { option_tags: list_of_fruits, searchable: true }, { class: 'test' })
|
42
42
|
#
|
43
|
-
# UiBibz::Ui::Core::
|
43
|
+
# UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new({ option_tags: list_of_fruits, actions_box: true }, { class: 'test' }) do
|
44
44
|
# 'fruits'
|
45
45
|
# end
|
46
46
|
#
|