ui_bibz 2.0.0.alpha10 → 2.0.0.alpha11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -7
- data/app/assets/stylesheets/table.sass +2 -0
- data/app/assets/stylesheets/ui_bibz.sass +0 -2
- data/lib/ui_bibz/ui/core/alert.rb +4 -4
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +2 -2
- data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +2 -2
- data/lib/ui_bibz/ui/core/button/button.rb +10 -10
- data/lib/ui_bibz/ui/core/button/button_choice.rb +5 -5
- data/lib/ui_bibz/ui/core/button/button_dropdown.rb +3 -3
- data/lib/ui_bibz/ui/core/button/button_group.rb +5 -1
- data/lib/ui_bibz/ui/core/button/button_link.rb +2 -2
- data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +5 -5
- data/lib/ui_bibz/ui/core/card/card.rb +4 -4
- data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +7 -7
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +2 -2
- data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +6 -6
- data/lib/ui_bibz/ui/core/glyph.rb +3 -3
- data/lib/ui_bibz/ui/core/input/autocomplete_field.rb +7 -1
- data/lib/ui_bibz/ui/core/input/dropdown_select_field.rb +2 -2
- data/lib/ui_bibz/ui/core/input/formula_field.rb +1 -1
- data/lib/ui_bibz/ui/core/input/multi_select_field.rb +2 -2
- data/lib/ui_bibz/ui/core/input/surround_field.rb +9 -1
- data/lib/ui_bibz/ui/core/input/switch_field.rb +4 -4
- data/lib/ui_bibz/ui/core/label.rb +4 -4
- data/lib/ui_bibz/ui/core/list/components/list.rb +7 -7
- data/lib/ui_bibz/ui/core/list/list_group.rb +5 -5
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +2 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +3 -3
- data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/navbar.rb +3 -3
- data/lib/ui_bibz/ui/core/progress.rb +5 -5
- data/lib/ui_bibz/ui/core/stars.rb +3 -3
- data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
- data/lib/ui_bibz/ui/ux/table/components/as.rb +8 -4
- data/lib/ui_bibz/ui/ux/table/components/column.rb +17 -16
- data/lib/ui_bibz/ui/ux/table/components/thead.rb +4 -4
- data/lib/ui_bibz/ui/ux/table/table.rb +8 -8
- data/lib/ui_bibz/ui/ux/table/table_card.rb +4 -4
- data/lib/ui_bibz/version.rb +1 -1
- data/test/dummy/db/schema.rb +1 -1
- data/test/ui/breadcrumb_test.rb +2 -2
- data/test/ui/button_test.rb +24 -24
- data/test/ui/card_test.rb +5 -5
- data/test/ui/component_test.rb +2 -2
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/input_switch_field_test.rb +3 -3
- data/test/ui/inputs_test.rb +5 -5
- data/test/ui/list_group_test.rb +5 -5
- data/test/ui/nav_test.rb +3 -3
- data/test/ui/stars_test.rb +2 -2
- data/test/ui/table_test.rb +7 -7
- data/test/ui_helper_test.rb +16 -16
- data/ui_bibz.gemspec +2 -2
- metadata +5 -109
- data/doc/UiBibz.html +0 -129
- data/doc/UiBibz/Concerns.html +0 -115
- data/doc/UiBibz/Concerns/Models.html +0 -115
- data/doc/UiBibz/Concerns/Models/Searchable.html +0 -120
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +0 -174
- data/doc/UiBibz/Helpers.html +0 -115
- data/doc/UiBibz/Helpers/MetaHelper.html +0 -273
- data/doc/UiBibz/Helpers/UiCoreHelper.html +0 -1234
- data/doc/UiBibz/Helpers/UiUxHelper.html +0 -463
- data/doc/UiBibz/Helpers/UtilsHelper.html +0 -187
- data/doc/UiBibz/Rails.html +0 -115
- data/doc/UiBibz/Rails/Engine.html +0 -123
- data/doc/UiBibz/Ui.html +0 -119
- data/doc/UiBibz/Ui/Base.html +0 -304
- data/doc/UiBibz/Ui/Core.html +0 -128
- data/doc/UiBibz/Ui/Core/Alert.html +0 -383
- data/doc/UiBibz/Ui/Core/Bar.html +0 -372
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +0 -442
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +0 -369
- data/doc/UiBibz/Ui/Core/Button.html +0 -380
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +0 -401
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +0 -372
- data/doc/UiBibz/Ui/Core/ButtonLink.html +0 -382
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +0 -403
- data/doc/UiBibz/Ui/Core/Col.html +0 -373
- data/doc/UiBibz/Ui/Core/Component.html +0 -1087
- data/doc/UiBibz/Ui/Core/Dropdown.html +0 -663
- data/doc/UiBibz/Ui/Core/DropdownDivider.html +0 -301
- data/doc/UiBibz/Ui/Core/DropdownHeader.html +0 -355
- data/doc/UiBibz/Ui/Core/DropdownLink.html +0 -376
- data/doc/UiBibz/Ui/Core/DropdownList.html +0 -382
- data/doc/UiBibz/Ui/Core/Glyph.html +0 -385
- data/doc/UiBibz/Ui/Core/Jumbotron.html +0 -379
- data/doc/UiBibz/Ui/Core/Label.html +0 -379
- data/doc/UiBibz/Ui/Core/List.html +0 -528
- data/doc/UiBibz/Ui/Core/ListGroup.html +0 -474
- data/doc/UiBibz/Ui/Core/Modal.html +0 -543
- data/doc/UiBibz/Ui/Core/ModalBody.html +0 -353
- data/doc/UiBibz/Ui/Core/ModalFooter.html +0 -353
- data/doc/UiBibz/Ui/Core/ModalHeader.html +0 -359
- data/doc/UiBibz/Ui/Core/Nav.html +0 -515
- data/doc/UiBibz/Ui/Core/NavDropdown.html +0 -391
- data/doc/UiBibz/Ui/Core/NavLink.html +0 -364
- data/doc/UiBibz/Ui/Core/Navbar.html +0 -646
- data/doc/UiBibz/Ui/Core/NavbarForm.html +0 -364
- data/doc/UiBibz/Ui/Core/NavbarNav.html +0 -302
- data/doc/UiBibz/Ui/Core/NavbarText.html +0 -355
- data/doc/UiBibz/Ui/Core/Panel.html +0 -617
- data/doc/UiBibz/Ui/Core/ProgressBar.html +0 -462
- data/doc/UiBibz/Ui/Core/Row.html +0 -350
- data/doc/UiBibz/Ui/Core/Stars.html +0 -371
- data/doc/UiBibz/Ui/Ux.html +0 -128
- data/doc/UiBibz/Ui/Ux/Actionable.html +0 -478
- data/doc/UiBibz/Ui/Ux/Actions.html +0 -602
- data/doc/UiBibz/Ui/Ux/Column.html +0 -1249
- data/doc/UiBibz/Ui/Ux/Columns.html +0 -338
- data/doc/UiBibz/Ui/Ux/Grid.html +0 -485
- data/doc/UiBibz/Ui/Ux/Paginable.html +0 -381
- data/doc/UiBibz/Ui/Ux/Searchable.html +0 -376
- data/doc/UiBibz/Ui/Ux/Sortable.html +0 -300
- data/doc/UiBibz/Ui/Ux/Store.html +0 -1176
- data/doc/UiBibz/Ui/Ux/Table.html +0 -694
- data/doc/UiBibz/Ui/Ux/TableAction.html +0 -309
- data/doc/UiBibz/Ui/Ux/TablePagination.html +0 -342
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +0 -348
- data/doc/UiBibz/Ui/Ux/TablePanel.html +0 -680
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +0 -304
- data/doc/UiBibz/Utils.html +0 -115
- data/doc/UiBibz/Utils/Internationalization.html +0 -262
- data/doc/_index.html +0 -706
- data/doc/class_list.html +0 -58
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file.README.html +0 -1261
- data/doc/file_list.html +0 -60
- data/doc/frames.html +0 -26
- data/doc/images/alert.png +0 -0
- data/doc/images/breadcrumb.png +0 -0
- data/doc/images/button.png +0 -0
- data/doc/images/button_dropdown.png +0 -0
- data/doc/images/button_group.png +0 -0
- data/doc/images/button_link.png +0 -0
- data/doc/images/button_split_dropdown.png +0 -0
- data/doc/images/etiquette.png +0 -0
- data/doc/images/glyph.png +0 -0
- data/doc/images/list.png +0 -0
- data/doc/images/modal.png +0 -0
- data/doc/images/nav.png +0 -0
- data/doc/images/navbar.png +0 -0
- data/doc/images/panel.png +0 -0
- data/doc/images/progress_bar.png +0 -0
- data/doc/images/stars.png +0 -0
- data/doc/images/table.png +0 -0
- data/doc/images/table_pagination_per_page.png +0 -0
- data/doc/images/table_panel.png +0 -0
- data/doc/images/table_search_field.png +0 -0
- data/doc/images/ui-bibz-logo-without-border.gif +0 -0
- data/doc/images/ui-bibz-logo.gif +0 -0
- data/doc/index.html +0 -1261
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -181
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1329
- data/doc/top-level-namespace.html +0 -112
@@ -17,7 +17,7 @@ module UiBibz::Ui::Core
|
|
17
17
|
# * +name+ - String
|
18
18
|
# * +size+ - Integer
|
19
19
|
# * +type+ - Symbol
|
20
|
-
# * +
|
20
|
+
# * +status+ - Symbol
|
21
21
|
# (+:secondary+, +:primary+, +:info+, +:warning+, +:danger+)
|
22
22
|
#
|
23
23
|
# ==== Signatures
|
@@ -120,8 +120,8 @@ module UiBibz::Ui::Core
|
|
120
120
|
@options[:name] || @content
|
121
121
|
end
|
122
122
|
|
123
|
-
def
|
124
|
-
"glyph-#{ @options[:
|
123
|
+
def status
|
124
|
+
"glyph-#{ @options[:status] }" unless @options[:status].nil?
|
125
125
|
end
|
126
126
|
|
127
127
|
end
|
@@ -67,7 +67,9 @@ module UiBibz::Ui::Core
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def component_html_options
|
70
|
-
{ autocomplete: true, list: data_list_name }
|
70
|
+
args = { autocomplete: true, list: data_list_name }
|
71
|
+
args = args.merge(options[:state] == :disable ? { disabled: 'disabled' } : {})
|
72
|
+
args
|
71
73
|
end
|
72
74
|
|
73
75
|
def component_html_classes
|
@@ -78,5 +80,9 @@ module UiBibz::Ui::Core
|
|
78
80
|
@datalist ||= "#{ html_options[:id] || content }-datalist"
|
79
81
|
end
|
80
82
|
|
83
|
+
def status
|
84
|
+
"form-control-#{ options[:status] }" if options[:status]
|
85
|
+
end
|
86
|
+
|
81
87
|
end
|
82
88
|
end
|
@@ -15,7 +15,7 @@ module UiBibz::Ui::Core
|
|
15
15
|
#
|
16
16
|
# You can add HTML attributes using the +html_options+.
|
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
20
|
# * option_tags - Array, Object [required]
|
21
21
|
# * searchable - Boolean
|
@@ -91,7 +91,7 @@ module UiBibz::Ui::Core
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def style
|
94
|
-
add_html_data('style', "btn-#{ options[:
|
94
|
+
add_html_data('style', "btn-#{ options[:status]}") if options[:style]
|
95
95
|
end
|
96
96
|
|
97
97
|
def menu_size
|
@@ -77,7 +77,7 @@ module UiBibz::Ui::Core
|
|
77
77
|
|
78
78
|
def formula_field_alert
|
79
79
|
content_tag :span, class: 'formula_field_alert input-group-addon', data: { toggle: 'tooltip' } do
|
80
|
-
UiBibz::Ui::Core::Glyph.new('exclamation-triangle',
|
80
|
+
UiBibz::Ui::Core::Glyph.new('exclamation-triangle', status: :danger ).render
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -51,7 +51,7 @@ module UiBibz::Ui::Core
|
|
51
51
|
if options[:append].nil? && options[:prepend].nil?
|
52
52
|
text_field_input_tag
|
53
53
|
else
|
54
|
-
content_tag :div, class: join_classes('input-group', size) do
|
54
|
+
content_tag :div, class: join_classes('input-group', size, status) do
|
55
55
|
concat content_tag :span, options[:append], class: 'input-group-addon' unless options[:append].nil?
|
56
56
|
concat text_field_input_tag
|
57
57
|
concat content_tag :span, options[:prepend], class: 'input-group-addon' unless options[:prepend].nil?
|
@@ -79,5 +79,13 @@ module UiBibz::Ui::Core
|
|
79
79
|
"input-group-#{ options[:size] }" if options[:size]
|
80
80
|
end
|
81
81
|
|
82
|
+
def status
|
83
|
+
"has-#{ options[:status] }" if options[:status]
|
84
|
+
end
|
85
|
+
|
86
|
+
def component_html_options
|
87
|
+
options[:state] == :disable ? { disabled: 'disabled' } : {}
|
88
|
+
end
|
89
|
+
|
82
90
|
end
|
83
91
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +state+ - String
|
18
18
|
# * +animate+ - Boolean
|
19
19
|
# * +on_color+ - String
|
20
20
|
# * +off_color+ - String
|
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core
|
|
70
70
|
|
71
71
|
def component_html_data
|
72
72
|
size
|
73
|
-
|
73
|
+
state
|
74
74
|
animate
|
75
75
|
left_color
|
76
76
|
right_color
|
@@ -94,8 +94,8 @@ module UiBibz::Ui::Core
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# active, disabled => default : active
|
97
|
-
def
|
98
|
-
html_options[:disabled] = true if options[:
|
97
|
+
def state
|
98
|
+
html_options[:disabled] = true if options[:state] == 'disabled'
|
99
99
|
end
|
100
100
|
|
101
101
|
# 'primary', 'info', 'success', 'warning', 'danger', 'default' => default : default
|
@@ -15,7 +15,7 @@ module UiBibz::Ui::Core
|
|
15
15
|
#
|
16
16
|
# You can add HTML attributes using the +html_options+.
|
17
17
|
# You can pass arguments in options attribute:
|
18
|
-
# * +
|
18
|
+
# * +status+ - status of élement with symbol value:
|
19
19
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
20
20
|
# * +glyph+ - Add glyph with name or hash options
|
21
21
|
# * +name+ - String
|
@@ -34,7 +34,7 @@ module UiBibz::Ui::Core
|
|
34
34
|
#
|
35
35
|
# ==== Examples
|
36
36
|
#
|
37
|
-
# UiBibz::Ui::Core::Label.new(content,
|
37
|
+
# UiBibz::Ui::Core::Label.new(content, status: :success, type: :pill).render
|
38
38
|
#
|
39
39
|
# UiBibz::Ui::Core::Label.new() do
|
40
40
|
# #content
|
@@ -66,8 +66,8 @@ module UiBibz::Ui::Core
|
|
66
66
|
['label', type]
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
70
|
-
sym = @options[:
|
69
|
+
def status
|
70
|
+
sym = @options[:status] || :default
|
71
71
|
"label-#{ sym }"
|
72
72
|
end
|
73
73
|
|
@@ -16,11 +16,11 @@ module UiBibz::Ui::Core
|
|
16
16
|
#
|
17
17
|
# You can add HTML attributes using the +html_options+.
|
18
18
|
# You can pass arguments in options attribute:
|
19
|
-
# * +
|
19
|
+
# * +state+ - status of élement with symbol value:
|
20
20
|
# (+:active+, +:disable+)
|
21
21
|
# * +url+
|
22
22
|
# * +tap+ - Boolean to add header and body
|
23
|
-
# * +
|
23
|
+
# * +status+ - status of élement with symbol value:
|
24
24
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
25
25
|
# * +glyph+ - Add glyph with name or hash options
|
26
26
|
# * +name+ - String
|
@@ -42,13 +42,13 @@ module UiBibz::Ui::Core
|
|
42
42
|
#
|
43
43
|
# ==== Examples
|
44
44
|
#
|
45
|
-
# UiBibz::Ui::Core::List.new('Test',
|
45
|
+
# UiBibz::Ui::Core::List.new('Test', status: :success, url: '#test').render
|
46
46
|
#
|
47
|
-
# UiBibz::Ui::Core::List.new(
|
47
|
+
# UiBibz::Ui::Core::List.new(status: :primary) do
|
48
48
|
# 'Test 2'
|
49
49
|
# end.render
|
50
50
|
#
|
51
|
-
# UiBibz::Ui::Core::List.new(tap: true,
|
51
|
+
# UiBibz::Ui::Core::List.new(tap: true, state: :active) do |l|
|
52
52
|
# l.header 'My title', nil, class: 'my-title'
|
53
53
|
# l.body do
|
54
54
|
# 'My content'
|
@@ -116,8 +116,8 @@ module UiBibz::Ui::Core
|
|
116
116
|
@options[:type] == :button || @html_options[:type] == :button
|
117
117
|
end
|
118
118
|
|
119
|
-
def
|
120
|
-
"list-group-item-#{ @options[:
|
119
|
+
def status
|
120
|
+
"list-group-item-#{ @options[:status] }" unless @options[:status].nil?
|
121
121
|
end
|
122
122
|
|
123
123
|
end
|
@@ -29,16 +29,16 @@ module UiBibz::Ui::Core
|
|
29
29
|
# ==== Examples
|
30
30
|
#
|
31
31
|
# UiBibz::Ui::Core::ListGroup.new().tap do |d|
|
32
|
-
# d.list 'Test',
|
33
|
-
# d.list 'Test2',
|
32
|
+
# d.list 'Test', status: :success
|
33
|
+
# d.list 'Test2', status: :primary
|
34
34
|
# end.render
|
35
35
|
#
|
36
36
|
# UiBibz::Ui::Core::ListGroup.new(type: :link).tap do |d|
|
37
|
-
# d.list 'Test',
|
38
|
-
# d.list(
|
37
|
+
# d.list 'Test', status: :success, url: '#test'
|
38
|
+
# d.list(status: :primary) do
|
39
39
|
# 'Test 2'
|
40
40
|
# end
|
41
|
-
# d.list(tap: true,
|
41
|
+
# d.list(tap: true, state: :active) do |l|
|
42
42
|
# l.header 'My title', nil, class: 'my-title'
|
43
43
|
# l.body do
|
44
44
|
# 'My content'
|
@@ -15,7 +15,7 @@ module UiBibz::Ui::Core
|
|
15
15
|
#
|
16
16
|
# You can add HTML attributes using the +html_options+.
|
17
17
|
# You can pass arguments in options attribute:
|
18
|
-
# * +
|
18
|
+
# * +status+ - status of élement with symbol value:
|
19
19
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
20
20
|
# * +size+
|
21
21
|
# (+:xs+, +:sm+, +:lg+)
|
@@ -36,7 +36,7 @@ module UiBibz::Ui::Core
|
|
36
36
|
#
|
37
37
|
# ==== Examples
|
38
38
|
#
|
39
|
-
# UiBibz::Ui::Core::NavDropdown.new(name,
|
39
|
+
# UiBibz::Ui::Core::NavDropdown.new(name, status: :success).tap do |d|
|
40
40
|
# d.list link_to('test', '#')
|
41
41
|
# d.list link_to('test2', '#')
|
42
42
|
# end.render
|
@@ -16,7 +16,7 @@ module UiBibz::Ui::Core
|
|
16
16
|
#
|
17
17
|
# You can add HTML attributes using the +html_options+.
|
18
18
|
# You can pass arguments in options attribute:
|
19
|
-
# * +
|
19
|
+
# * +state+ - status of élement with symbol value:
|
20
20
|
# (+:active+)
|
21
21
|
# * +url+ - String
|
22
22
|
# * +badge+ - String
|
@@ -32,7 +32,7 @@ module UiBibz::Ui::Core
|
|
32
32
|
#
|
33
33
|
# ==== Examples
|
34
34
|
#
|
35
|
-
# UiBibz::Ui::Core::NavLink.new(content, { badge: 15, url: '/',
|
35
|
+
# UiBibz::Ui::Core::NavLink.new(content, { badge: 15, url: '/', state: :active, link_html_options: { class: 'link1' }},{ class: 'test' }).render
|
36
36
|
#
|
37
37
|
# UiBibz::Ui::Core::NavLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
|
38
38
|
# 'Home'
|
@@ -51,7 +51,7 @@ module UiBibz::Ui::Core
|
|
51
51
|
if options[:nav_type] == "nav-links"
|
52
52
|
content_htm
|
53
53
|
else
|
54
|
-
options.delete(:
|
54
|
+
options.delete(:state)
|
55
55
|
UiBibz::Ui::Core::NavLinkList.new(content_htm, options).render
|
56
56
|
end
|
57
57
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +state+ - status of élement with symbol value:
|
18
18
|
# (+:active+)
|
19
19
|
#
|
20
20
|
class NavLinkLink < Component
|
@@ -33,7 +33,7 @@ module UiBibz::Ui::Core
|
|
33
33
|
#
|
34
34
|
# UiBibz::Ui::Core::NavbarNav.new().tap do |n|
|
35
35
|
# n.link 'Test', url: '#test'
|
36
|
-
# n.link 'Test2', url: '#test2',
|
36
|
+
# n.link 'Test2', url: '#test2', state: :active
|
37
37
|
# end.render
|
38
38
|
#
|
39
39
|
class NavbarNav < Nav
|
@@ -35,7 +35,7 @@ module UiBibz::Ui::Core
|
|
35
35
|
#
|
36
36
|
# UiBibz::Ui::Core::Nav.new(type: :pills).tap do |n|
|
37
37
|
# n.link 'Test', url: '#test'
|
38
|
-
# n.link 'Test2', url: '#test2',
|
38
|
+
# n.link 'Test2', url: '#test2', state: :active
|
39
39
|
# n.dropdown('Action') do |d|
|
40
40
|
# d.list content = nil, options = nil, html_options = nil, &block
|
41
41
|
# end
|
@@ -21,7 +21,7 @@ module UiBibz::Ui::Core
|
|
21
21
|
# * +type+ - Symbol
|
22
22
|
# (+:light+, +:dark+)
|
23
23
|
# * +glyph+
|
24
|
-
# * +
|
24
|
+
# * +status+
|
25
25
|
# (+:secondary+, +:primary+, +:info+, +:warning+, +:danger+, +inverse+)
|
26
26
|
# * +position+ - Symbol
|
27
27
|
# (+:top+, +:bottom+)
|
@@ -149,8 +149,8 @@ module UiBibz::Ui::Core
|
|
149
149
|
"navbar-#{ @options[:type] || 'light' }"
|
150
150
|
end
|
151
151
|
|
152
|
-
def
|
153
|
-
"bg-#{ @options[:
|
152
|
+
def status
|
153
|
+
"bg-#{ @options[:status] }" unless @options[:status].nil?
|
154
154
|
end
|
155
155
|
|
156
156
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:secondary+, +:primary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +max+ - Max value (default: 100)
|
20
20
|
# * +value+ - Value of percentage (default: content)
|
@@ -34,9 +34,9 @@ module UiBibz::Ui::Core
|
|
34
34
|
#
|
35
35
|
# UiBibz::Ui::Core::Progress.new(50%, { value: 50})
|
36
36
|
# # or
|
37
|
-
# UiBibz::Ui::Core::Progress.new(10%, { value: 10,
|
37
|
+
# UiBibz::Ui::Core::Progress.new(10%, { value: 10, status: :success },{ class: 'test' }).render
|
38
38
|
# # or
|
39
|
-
# UiBibz::Ui::Core::Progress.new({ value: 10,
|
39
|
+
# UiBibz::Ui::Core::Progress.new({ value: 10, status: :success},{ class: 'test' }) do
|
40
40
|
# 10%
|
41
41
|
# end.render
|
42
42
|
#
|
@@ -90,8 +90,8 @@ module UiBibz::Ui::Core
|
|
90
90
|
options[:value] || content.to_i
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
"progress-#{ options[:
|
93
|
+
def status
|
94
|
+
"progress-#{ options[:status] }" unless options[:status].nil?
|
95
95
|
end
|
96
96
|
|
97
97
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +num+ - Integer, number of stars
|
20
20
|
#
|
@@ -28,7 +28,7 @@ module UiBibz::Ui::Core
|
|
28
28
|
#
|
29
29
|
# ==== Examples
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::Core::Stars.new(content,
|
31
|
+
# UiBibz::Ui::Core::Stars.new(content, status: :success).render
|
32
32
|
#
|
33
33
|
# UiBibz::Ui::Core::Stars.new({ num: 10 }) do
|
34
34
|
# #content
|
@@ -77,7 +77,7 @@ module UiBibz::Ui::Core
|
|
77
77
|
|
78
78
|
def glyph_opts
|
79
79
|
opts = {}
|
80
|
-
opts = opts.merge({
|
80
|
+
opts = opts.merge({ status: options[:status] }) unless options[:status].nil?
|
81
81
|
opts = opts.merge({ size: options[:size] }) unless options[:size].nil?
|
82
82
|
opts
|
83
83
|
end
|
@@ -4,10 +4,11 @@ module UiBibz::Ui::Ux
|
|
4
4
|
#
|
5
5
|
class As
|
6
6
|
|
7
|
-
def initialize col, record, content
|
7
|
+
def initialize col, record, content, table_options
|
8
8
|
@col = col
|
9
9
|
@record = record
|
10
10
|
@content = content
|
11
|
+
@form = table_options.try(:[], :form)
|
11
12
|
end
|
12
13
|
|
13
14
|
def render
|
@@ -16,6 +17,9 @@ module UiBibz::Ui::Ux
|
|
16
17
|
boolean_render
|
17
18
|
when :progress
|
18
19
|
progress_render
|
20
|
+
when :input
|
21
|
+
inp_options = (@col.input_options || {}).merge({ label: false })
|
22
|
+
@form.input @col.data_index, inp_options
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
@@ -23,15 +27,15 @@ module UiBibz::Ui::Ux
|
|
23
27
|
|
24
28
|
def boolean_render
|
25
29
|
if @content == true
|
26
|
-
glyph = UiBibz::Ui::Core::Glyph.new('check-circle',
|
30
|
+
glyph = UiBibz::Ui::Core::Glyph.new('check-circle', status: :success)
|
27
31
|
else
|
28
|
-
glyph = UiBibz::Ui::Core::Glyph.new('minus-circle',
|
32
|
+
glyph = UiBibz::Ui::Core::Glyph.new('minus-circle', status: :danger)
|
29
33
|
end
|
30
34
|
glyph.render
|
31
35
|
end
|
32
36
|
|
33
37
|
def progress_render
|
34
|
-
UiBibz::Ui::Core::Progress.new(@content,
|
38
|
+
UiBibz::Ui::Core::Progress.new(@content, status: (@col.status || :primary)).render
|
35
39
|
end
|
36
40
|
|
37
41
|
end
|
@@ -1,25 +1,26 @@
|
|
1
1
|
module UiBibz::Ui::Ux
|
2
2
|
class Column < UiBibz::Ui::Core::Component
|
3
3
|
|
4
|
-
attr_accessor :hidden, :link, :
|
4
|
+
attr_accessor :hidden, :link, :status, :name, :input_options, :class, :as, :data_index, :date_format, :sort, :format, :date_format, :count, :custom_sort, :parent, :id
|
5
5
|
|
6
6
|
def initialize content = nil, options = nil, html_options = nil, &block
|
7
7
|
super
|
8
|
-
@data_index
|
9
|
-
@id
|
10
|
-
@name
|
11
|
-
@link
|
12
|
-
@order
|
13
|
-
@date_format
|
14
|
-
@sort
|
15
|
-
@custom_sort
|
16
|
-
@parent
|
17
|
-
@count
|
18
|
-
@as
|
19
|
-
@format
|
20
|
-
@class
|
21
|
-
@hidden
|
22
|
-
@
|
8
|
+
@data_index = @content
|
9
|
+
@id = @options[:column_id] || @data_index
|
10
|
+
@name = @options[:name]
|
11
|
+
@link = @options[:link] # for show or edit action
|
12
|
+
@order = @options[:order]
|
13
|
+
@date_format = @options[:date_format]
|
14
|
+
@sort = @options[:sort]
|
15
|
+
@custom_sort = @options[:custom_sort]
|
16
|
+
@parent = @options[:parent]
|
17
|
+
@count = @options[:count]
|
18
|
+
@as = @options[:as]
|
19
|
+
@format = @options[:format]
|
20
|
+
@class = @options[:class]
|
21
|
+
@hidden = @options[:hidden]
|
22
|
+
@input_options = @options[:input_options]
|
23
|
+
@status = @options[:status]
|
23
24
|
end
|
24
25
|
|
25
26
|
def linkable?
|