ui_bibz 2.0.0.beta2.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -7
- data/Gemfile.lock +63 -63
- data/app/assets/javascripts/interface.coffee +6 -1
- data/app/assets/javascripts/ui_bibz.coffee +1 -0
- data/app/assets/stylesheets/_custom_variables.sass +20 -0
- data/app/assets/stylesheets/_panel.scss +314 -0
- data/app/assets/stylesheets/boxes.sass +5 -0
- data/app/assets/stylesheets/containers.sass +2 -0
- data/app/assets/stylesheets/fix-bootstrap-4.sass +4 -0
- data/app/assets/stylesheets/fix-dropdown-select.sass +1 -0
- data/app/assets/stylesheets/fix_addon.sass +187 -0
- data/app/assets/stylesheets/forms.sass +60 -0
- data/app/assets/stylesheets/navigations.sass +11 -0
- data/app/assets/stylesheets/notifications.sass +10 -0
- data/app/assets/stylesheets/{table.sass → tables.sass} +0 -0
- data/app/assets/stylesheets/ui_bibz.sass +11 -91
- data/config/initializers/ui_bibz.rb +6 -4
- data/lib/ui_bibz.rb +5 -0
- data/lib/ui_bibz/helpers/ui/ux_helper.rb +4 -0
- data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +38 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/auto_complete_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/base_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/collection_input.rb +15 -11
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/string_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_auto_complete_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_choice_group_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_date_picker_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_dropdown_select_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_formula_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_markdown_editor_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_multi_column_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_multi_select_field_input.rb +0 -0
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_number_field_input.rb +10 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_radio_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_select_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_switch_field_input.rb +0 -0
- data/{app → lib/ui_bibz}/inputs/ui_bibz_inputs/ui_text_field_input.rb +0 -0
- data/lib/ui_bibz/rails/engine.rb +3 -9
- data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_column.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_deck.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_link.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_text.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_title.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_footer.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_header.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/jumbotron.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +34 -3
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +11 -7
- data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +5 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +7 -2
- data/lib/ui_bibz/ui/core/forms/numbers/number_field.rb +63 -0
- data/lib/ui_bibz/ui/core/forms/selects/abstract_select.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +5 -1
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_refresh.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/texts/text_field.rb +7 -3
- data/lib/ui_bibz/ui/core/icons/glyph.rb +10 -2
- data/lib/ui_bibz/ui/core/icons/star.rb +1 -1
- data/lib/ui_bibz/ui/core/layouts/col.rb +1 -1
- data/lib/ui_bibz/ui/core/layouts/container.rb +1 -1
- data/lib/ui_bibz/ui/core/layouts/row.rb +1 -1
- data/lib/ui_bibz/ui/core/lists/components/list.rb +1 -1
- data/lib/ui_bibz/ui/core/lists/components/list/list_body.rb +1 -1
- data/lib/ui_bibz/ui/core/lists/components/list/list_header.rb +1 -1
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_list.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/navbar_brand.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +19 -17
- data/lib/ui_bibz/ui/core/navigations/components/navbar_text.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/pagination_link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/link.rb +8 -2
- data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +10 -5
- data/lib/ui_bibz/ui/core/navigations/pagination.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +5 -8
- data/lib/ui_bibz/ui/core/notifications/alert.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/badge.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/alert_body.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/bar.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +1 -1
- data/lib/ui_bibz/ui/core/windows/components/modal_body.rb +1 -1
- data/lib/ui_bibz/ui/core/windows/components/modal_footer.rb +1 -1
- data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -1
- data/lib/ui_bibz/ui/core/windows/modal.rb +1 -1
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +22 -4
- data/lib/ui_bibz/ui/ux/containers/components/panel_body.rb +51 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +48 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +50 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_footer.rb +52 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +46 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +61 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_toolbar.rb +38 -0
- data/lib/ui_bibz/ui/ux/containers/panel.rb +104 -0
- data/lib/ui_bibz/ui/ux/tables/components/thead.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table_card.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/lib/ui_bibz/utils/internationalization.rb +3 -0
- data/lib/ui_bibz/version.rb +1 -1
- data/test/factories/user.rb +1 -1
- data/test/simple_form_test.rb +2 -2
- data/test/support/factory_bot.rb +9 -0
- data/test/test_helper.rb +0 -1
- data/test/ui/core/boxes/card_test.rb +1 -1
- data/test/ui/core/component_test.rb +8 -1
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -2
- data/test/ui/core/forms/choices/choice_group_test.rb +1 -1
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- 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/surrounds/surround_field_test.rb +3 -3
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/forms/texts/text_field_test.rb +1 -1
- data/test/ui/core/icons/glyph_test.rb +6 -4
- data/test/ui/core/icons/star_test.rb +6 -6
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/navbar_test.rb +1 -1
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +2 -2
- data/test/ui/ux/containers/panel_test.rb +143 -0
- data/test/ui/ux/tables/table_test.rb +3 -3
- data/ui_bibz.gemspec +3 -12
- data/vendor/assets/javascripts/bootstrap-markdown.js +12 -12
- data/vendor/assets/javascripts/jquery-ui.min.js +6 -0
- data/vendor/assets/stylesheets/jquery-ui.min.css +6 -0
- metadata +63 -27
- data/app/inputs/ui_bibz_form/ui_bibz_form_builder.rb +0 -36
- data/test/support/factory_girl.rb +0 -6
@@ -44,14 +44,14 @@ module UiBibz::Ui::Core::Forms::Numbers
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# Render html tag
|
47
|
-
def
|
47
|
+
def pre_render
|
48
48
|
formula_field_html_tag
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
53
|
def formula_field_html_tag
|
54
|
-
UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(class: join_classes('formula_field', status)).tap do |sf|
|
54
|
+
UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(class: join_classes('formula_field', status, size)).tap do |sf|
|
55
55
|
sf.text_field formula_field_name, nil, text_field_formula_html_options
|
56
56
|
sf.addon '=', class: 'formula-field-sign'
|
57
57
|
sf.text_field content, nil, text_field_input_html_options
|
@@ -94,5 +94,10 @@ module UiBibz::Ui::Core::Forms::Numbers
|
|
94
94
|
"has-#{ options[:status] }" if options[:status]
|
95
95
|
end
|
96
96
|
|
97
|
+
# :lg, :sm or :xs
|
98
|
+
def size
|
99
|
+
"input-group-#{ options[:size] }" if options[:size]
|
100
|
+
end
|
101
|
+
|
97
102
|
end
|
98
103
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'ui_bibz/ui/extensions/core/forms/surround_extension'
|
2
|
+
module UiBibz::Ui::Core::Forms::Numbers
|
3
|
+
|
4
|
+
# Create a NumberField
|
5
|
+
#
|
6
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
7
|
+
#
|
8
|
+
# ==== Attributes
|
9
|
+
#
|
10
|
+
# * +content+ - Content of element
|
11
|
+
# * +options+ - Options of element
|
12
|
+
# * +html_options+ - Html Options of element
|
13
|
+
#
|
14
|
+
# ==== Options
|
15
|
+
#
|
16
|
+
# You can add HTML attributes using the +html_options+.
|
17
|
+
# You can pass arguments in options attribute:
|
18
|
+
# * +prepend+ - String, Html
|
19
|
+
# * +append+ - String, Html
|
20
|
+
#
|
21
|
+
# ==== Signatures
|
22
|
+
#
|
23
|
+
# UiBibz::Ui::Core::Forms::Numbers::NumberField.new(content, options = {}, html_options = {}).render
|
24
|
+
#
|
25
|
+
# UiBibz::Ui::Core::Forms::Numbers::NumberField.new(options = {}, html_options = {}) do
|
26
|
+
# content
|
27
|
+
# end.render
|
28
|
+
#
|
29
|
+
# ==== Examples
|
30
|
+
#
|
31
|
+
# UiBibz::Ui::Core::Forms::Numbers::NumberField.new('search', prepend: 'Prepend content', append: 'Append content', class: 'test')
|
32
|
+
#
|
33
|
+
# UiBibz::Ui::Core::Forms::Numbers::NumberField.new(prepend: glyph('pencil'), append: glyph('camera-retro')) do
|
34
|
+
# #content
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# ==== Helper
|
38
|
+
#
|
39
|
+
# ui_number_field(options = {}, html_options = {}) do
|
40
|
+
# # content
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
class NumberField < UiBibz::Ui::Core::Forms::Texts::TextField
|
44
|
+
|
45
|
+
# See UiBibz::Ui::Core::Component.initialize
|
46
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
47
|
+
super
|
48
|
+
end
|
49
|
+
|
50
|
+
# Render html tag
|
51
|
+
def pre_render
|
52
|
+
surround_field number_field_input_tag
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# Simple_form or not
|
58
|
+
def number_field_input_tag
|
59
|
+
number_field_tag content, options[:value] || html_options[:value], html_options
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -75,12 +75,16 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
75
75
|
private
|
76
76
|
|
77
77
|
def component_html_classes
|
78
|
-
super << ["select-field", "form-control"]
|
78
|
+
super << ["select-field", "form-control", size]
|
79
79
|
end
|
80
80
|
|
81
81
|
def component_options
|
82
82
|
options[:status].nil? ? super : super.merge({ surrounded: true })
|
83
83
|
end
|
84
84
|
|
85
|
+
def size
|
86
|
+
"form-control-#{ options[:size] }" unless options[:size].nil?
|
87
|
+
end
|
88
|
+
|
85
89
|
end
|
86
90
|
end
|
@@ -49,7 +49,7 @@ module UiBibz::Ui::Core::Forms::Texts
|
|
49
49
|
end
|
50
50
|
|
51
51
|
# Render html tag
|
52
|
-
def
|
52
|
+
def pre_render
|
53
53
|
surround_field text_field_input_tag
|
54
54
|
end
|
55
55
|
|
@@ -66,16 +66,20 @@ module UiBibz::Ui::Core::Forms::Texts
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def component_html_classes
|
69
|
-
['form-control', status]
|
69
|
+
super << ['form-control', status, size]
|
70
70
|
end
|
71
71
|
|
72
72
|
def component_html_options
|
73
73
|
options[:state] == :disabled ? { disabled: 'disabled' } : {}
|
74
74
|
end
|
75
|
-
|
75
|
+
62+9
|
76
76
|
def status
|
77
77
|
"form-control-#{ options[:status] }" unless options[:status].nil?
|
78
78
|
end
|
79
79
|
|
80
|
+
def size
|
81
|
+
"form-control-#{ options[:size] }" unless options[:size].nil?
|
82
|
+
end
|
83
|
+
|
80
84
|
end
|
81
85
|
end
|
@@ -63,7 +63,7 @@ module UiBibz::Ui::Core::Icons
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Render html tag
|
66
|
-
def
|
66
|
+
def pre_render
|
67
67
|
[content_tag(:i, '', html_options), options[:label]].compact.join(' ').html_safe
|
68
68
|
end
|
69
69
|
|
@@ -74,7 +74,7 @@ module UiBibz::Ui::Core::Icons
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def classes
|
77
|
-
cls = ["glyph",
|
77
|
+
cls = ["glyph", style, "fa-#{ content }"]
|
78
78
|
cls << "fa-#{ size }x" unless size.nil?
|
79
79
|
cls << "fa-rotate-#{ rotate }" unless rotate.nil?
|
80
80
|
cls << "fa-flip-#{ flip }" unless flip.nil?
|
@@ -97,6 +97,10 @@ module UiBibz::Ui::Core::Icons
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
def style
|
101
|
+
match_style[@options[:style] || :solid]
|
102
|
+
end
|
103
|
+
|
100
104
|
def stack
|
101
105
|
@options[:stack]
|
102
106
|
end
|
@@ -125,5 +129,9 @@ module UiBibz::Ui::Core::Icons
|
|
125
129
|
"glyph-#{ @options[:status] }" unless @options[:status].nil?
|
126
130
|
end
|
127
131
|
|
132
|
+
def match_style
|
133
|
+
{solid: 'fas', regular: 'far', light: 'fal', brands: 'fab'}
|
134
|
+
end
|
135
|
+
|
128
136
|
end
|
129
137
|
end
|
@@ -38,7 +38,7 @@ module UiBibz::Ui::Core::Navigations::Components
|
|
38
38
|
# 'Home'
|
39
39
|
# end.render
|
40
40
|
#
|
41
|
-
class BreadcrumbLink < UiBibz::Ui::Core::
|
41
|
+
class BreadcrumbLink < UiBibz::Ui::Core::Navigations::Link
|
42
42
|
|
43
43
|
# See UiBibz::Ui::Core::Component.initialize
|
44
44
|
def initialize content = nil, options = nil, html_options = nil, &block
|
@@ -46,7 +46,7 @@ module UiBibz::Ui::Core::Navigations::Components
|
|
46
46
|
end
|
47
47
|
|
48
48
|
# Render html tag
|
49
|
-
def
|
49
|
+
def pre_render
|
50
50
|
content_tag :li, link_html, html_options
|
51
51
|
end
|
52
52
|
|
@@ -58,7 +58,7 @@ module UiBibz::Ui::Core::Navigations::Components
|
|
58
58
|
|
59
59
|
def link_html
|
60
60
|
if options[:url]
|
61
|
-
link_to glyph_and_content_html, options[:url]
|
61
|
+
link_to glyph_and_content_html, options[:url] || '#'
|
62
62
|
else
|
63
63
|
glyph_and_content_html
|
64
64
|
end
|