ui_bibz 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.gitignore +1 -1
- data/.yardoc/checksums +52 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +11 -21
- data/README.md +359 -239
- data/Rakefile +12 -13
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +174 -0
- data/doc/UiBibz/Concerns/Models/Searchable.html +120 -0
- data/doc/UiBibz/Helpers/MetaHelper.html +218 -0
- data/doc/UiBibz/Helpers/UiCoreHelper.html +1130 -0
- data/doc/UiBibz/Helpers/UiUxHelper.html +463 -0
- data/doc/UiBibz/Helpers/UtilsHelper.html +187 -0
- data/doc/UiBibz/Rails/Engine.html +123 -0
- data/doc/UiBibz/Rails.html +115 -0
- data/doc/UiBibz/Ui/Base.html +304 -0
- data/doc/UiBibz/Ui/Core/Alert.html +367 -0
- data/doc/UiBibz/Ui/Core/Bar.html +356 -0
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +427 -0
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +354 -0
- data/doc/UiBibz/Ui/Core/Button.html +363 -0
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +385 -0
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +356 -0
- data/doc/UiBibz/Ui/Core/ButtonLink.html +365 -0
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +387 -0
- data/doc/UiBibz/Ui/Core/Col.html +357 -0
- data/doc/UiBibz/Ui/Core/Component.html +1144 -0
- data/doc/UiBibz/Ui/Core/Dropdown.html +877 -0
- data/doc/UiBibz/Ui/Core/DropdownList.html +369 -0
- data/doc/UiBibz/Ui/Core/Glyph.html +742 -0
- data/doc/UiBibz/Ui/Core/Jumbotron.html +363 -0
- data/doc/UiBibz/Ui/Core/Label.html +361 -0
- data/doc/UiBibz/Ui/Core/List.html +486 -0
- data/doc/UiBibz/Ui/Core/ListGroup.html +446 -0
- data/doc/UiBibz/Ui/Core/Nav.html +474 -0
- data/doc/UiBibz/Ui/Core/NavDropdown.html +376 -0
- data/doc/UiBibz/Ui/Core/NavLink.html +347 -0
- data/doc/UiBibz/Ui/Core/Navbar.html +535 -0
- data/doc/UiBibz/Ui/Core/NavbarForm.html +341 -0
- data/doc/UiBibz/Ui/Core/NavbarNav.html +301 -0
- data/doc/UiBibz/Ui/Core/NavbarText.html +341 -0
- data/doc/UiBibz/Ui/Core/Panel.html +806 -0
- data/doc/UiBibz/Ui/Core/ProgressBar.html +433 -0
- data/doc/UiBibz/Ui/Core/Row.html +335 -0
- data/doc/UiBibz/Ui/Core.html +117 -0
- data/doc/UiBibz/Ui/Ux/Actionable.html +478 -0
- data/doc/UiBibz/Ui/Ux/Actions.html +314 -0
- data/doc/UiBibz/Ui/Ux/Column.html +1177 -0
- data/doc/UiBibz/Ui/Ux/Columns.html +312 -0
- data/doc/UiBibz/Ui/Ux/Grid.html +823 -0
- data/doc/UiBibz/Ui/Ux/Paginable.html +368 -0
- data/doc/UiBibz/Ui/Ux/Searchable.html +363 -0
- data/doc/UiBibz/Ui/Ux/Sortable.html +289 -0
- data/doc/UiBibz/Ui/Ux/Store.html +968 -0
- data/doc/UiBibz/Ui/Ux/Table.html +957 -0
- data/doc/UiBibz/Ui/Ux/TableAction.html +309 -0
- data/doc/UiBibz/Ui/Ux/TablePagination.html +319 -0
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +331 -0
- data/doc/UiBibz/Ui/Ux/TablePanel.html +576 -0
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +291 -0
- data/doc/UiBibz/Ui/Ux.html +117 -0
- data/doc/UiBibz/Ui.html +117 -0
- data/doc/UiBibz/Utils/Internationalization.html +262 -0
- data/doc/UiBibz/Utils.html +115 -0
- data/doc/UiBibz.html +129 -0
- data/doc/_index.html +635 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +1022 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/images/navbar.png +0 -0
- data/doc/index.html +1022 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1335 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/ui_bibz/helpers/ui_core_helper.rb +94 -0
- data/lib/ui_bibz/helpers/ui_ux_helper.rb +43 -0
- data/lib/ui_bibz/rails/engine.rb +2 -1
- data/lib/ui_bibz/ui/{ui.rb → base.rb} +1 -1
- data/lib/ui_bibz/ui/{alert.rb → core/alert.rb} +15 -7
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +71 -0
- data/lib/ui_bibz/ui/{breadcrumb → core/breadcrumb}/components/breadcrumb_link.rb +6 -6
- data/lib/ui_bibz/ui/{button → core/button}/button.rb +13 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_dropdown.rb +15 -4
- data/lib/ui_bibz/ui/{button → core/button}/button_group.rb +14 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_link.rb +14 -6
- data/lib/ui_bibz/ui/{button → core/button}/button_split_dropdown.rb +15 -4
- data/lib/ui_bibz/ui/{grid/components → core}/col.rb +12 -6
- data/lib/ui_bibz/ui/{component.rb → core/component.rb} +7 -7
- data/lib/ui_bibz/ui/{dropdown → core/dropdown}/components/dropdown_list.rb +7 -7
- data/lib/ui_bibz/ui/{dropdown → core/dropdown}/dropdown.rb +18 -7
- data/lib/ui_bibz/ui/{glyph.rb → core/glyph.rb} +18 -10
- data/lib/ui_bibz/ui/{jumbotron.rb → core/jumbotron.rb} +14 -6
- data/lib/ui_bibz/ui/{label.rb → core/label.rb} +14 -6
- data/lib/ui_bibz/ui/{list → core/list}/components/list.rb +8 -8
- data/lib/ui_bibz/ui/{list → core/list}/list_group.rb +28 -6
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +64 -0
- data/lib/ui_bibz/ui/{nav → core/nav}/components/nav_link.rb +6 -6
- data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +56 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/nav.rb +90 -0
- data/lib/ui_bibz/ui/core/nav/navbar.rb +121 -0
- data/lib/ui_bibz/ui/{panel.rb → core/panel.rb} +36 -8
- data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/components/bar.rb +7 -7
- data/lib/ui_bibz/ui/{progress_bar → core/progress_bar}/progress_bar.rb +20 -9
- data/lib/ui_bibz/ui/{grid/components → core}/row.rb +12 -4
- data/lib/ui_bibz/ui/{grid → ux}/grid.rb +17 -8
- data/lib/ui_bibz/ui/{table → ux/table}/components/actions.rb +5 -5
- data/lib/ui_bibz/ui/ux/table/components/column.rb +34 -0
- data/lib/ui_bibz/ui/ux/table/components/columns.rb +16 -0
- data/lib/ui_bibz/ui/{table → ux/table}/components/store.rb +4 -4
- data/lib/ui_bibz/ui/{table → ux/table}/components/table_action.rb +2 -2
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/actionable.rb +3 -3
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/paginable.rb +5 -5
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/searchable.rb +4 -4
- data/lib/ui_bibz/ui/{table/ux → ux/table/extensions}/sortable.rb +3 -3
- data/lib/ui_bibz/ui/{table → ux/table}/table.rb +40 -22
- data/lib/ui_bibz/ui/ux/table/table_pagination.rb +51 -0
- data/lib/ui_bibz/ui/{table → ux/table}/table_pagination_per_page.rb +26 -4
- data/lib/ui_bibz/ui/ux/table/table_panel.rb +155 -0
- data/lib/ui_bibz/ui/{table → ux/table}/table_search_field.rb +7 -7
- data/lib/ui_bibz/version.rb +1 -1
- data/lib/ui_bibz.rb +40 -29
- data/test/store_test.rb +2 -2
- data/test/ui/button_test.rb +6 -6
- data/test/ui/component_test.rb +2 -2
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/glyph_test.rb +3 -3
- data/test/ui/grid_test.rb +4 -4
- data/test/ui/list_group_test.rb +2 -2
- data/test/ui/nav_test.rb +3 -4
- data/test/ui/panel_test.rb +4 -4
- data/test/ui/table_test.rb +32 -32
- data/test/ui_helper_test.rb +18 -2
- data/ui_bibz.gemspec +1 -0
- data/vendor/assets/stylesheets/ui_bibz.sass +3 -0
- metadata +166 -132
- data/README.rdoc +0 -0
- data/lib/ui_bibz/helpers/ui_helper.rb +0 -119
- data/lib/ui_bibz/ui/breadcrumb/breadcrumb.rb +0 -54
- data/lib/ui_bibz/ui/nav/nav.rb +0 -65
- data/lib/ui_bibz/ui/table/components/column.rb +0 -34
- data/lib/ui_bibz/ui/table/components/columns.rb +0 -16
- data/lib/ui_bibz/ui/table/table_pagination.rb +0 -29
- data/lib/ui_bibz/ui/table/table_panel.rb +0 -66
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'haml'
|
2
|
-
module UiBibz::Ui
|
2
|
+
module UiBibz::Ui::Core
|
3
3
|
|
4
4
|
# Creates a component of the given +name+ using options created by the set of +options+.
|
5
5
|
#
|
@@ -22,21 +22,21 @@ module UiBibz::Ui
|
|
22
22
|
#
|
23
23
|
# ==== Signatures
|
24
24
|
#
|
25
|
-
# UiBibz::Ui::Component.new(content, options = nil, html_options = nil)
|
25
|
+
# UiBibz::Ui::Core::Component.new(content, options = nil, html_options = nil)
|
26
26
|
#
|
27
|
-
# UiBibz::Ui::Component.new(options = nil, html_options = nil) do
|
27
|
+
# UiBibz::Ui::Core::Component.new(options = nil, html_options = nil) do
|
28
28
|
# content
|
29
29
|
# end
|
30
30
|
#
|
31
31
|
# ==== Examples
|
32
32
|
#
|
33
|
-
# UiBibz::Ui::Component.new(content, { type: :success, glyph: 'eye' },{ class: 'test' })
|
33
|
+
# UiBibz::Ui::Core::Component.new(content, { type: :success, glyph: 'eye' },{ class: 'test' })
|
34
34
|
# # or
|
35
|
-
# UiBibz::Ui::Component.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
35
|
+
# UiBibz::Ui::Core::Component.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
36
36
|
# content
|
37
37
|
# end
|
38
38
|
#
|
39
|
-
class Component < Ui
|
39
|
+
class Component < UiBibz::Ui::Base
|
40
40
|
|
41
41
|
attr_accessor :content, :html_options, :options
|
42
42
|
|
@@ -121,7 +121,7 @@ module UiBibz::Ui
|
|
121
121
|
def states
|
122
122
|
if @states.nil?
|
123
123
|
states = {}
|
124
|
-
%w(default success primary info
|
124
|
+
%w(default success primary info warning danger).each do |s|
|
125
125
|
states = states.merge(Hash[s.to_sym, s])
|
126
126
|
end
|
127
127
|
@states = states
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create DropdownList
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
# Use '---' in content to add a separator
|
7
7
|
#
|
8
8
|
# ==== Attributes
|
@@ -25,21 +25,21 @@ module UiBibz::Ui
|
|
25
25
|
#
|
26
26
|
# ==== Signatures
|
27
27
|
#
|
28
|
-
# UiBibz::Ui::DropdownList.new(content, options = nil, html_options = nil)
|
28
|
+
# UiBibz::Ui::Core::DropdownList.new(content, options = nil, html_options = nil)
|
29
29
|
#
|
30
|
-
# UiBibz::Ui::DropdownList.new(options = nil, html_options = nil) do
|
30
|
+
# UiBibz::Ui::Core::DropdownList.new(options = nil, html_options = nil) do
|
31
31
|
# content
|
32
32
|
# end
|
33
33
|
#
|
34
34
|
# ==== Examples
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::DropdownList.new('Home', { glyph: 'home', status: :active },{ class: 'test' }).render
|
36
|
+
# UiBibz::Ui::Core::DropdownList.new('Home', { glyph: 'home', status: :active },{ class: 'test' }).render
|
37
37
|
#
|
38
|
-
# UiBibz::Ui::DropdownList.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
38
|
+
# UiBibz::Ui::Core::DropdownList.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
39
39
|
# 'Home'
|
40
40
|
# end.render
|
41
41
|
#
|
42
|
-
# UiBibz::
|
42
|
+
# UiBibz::Ui::CoreBibz::DropdownList.new('---').render # To add a separator
|
43
43
|
#
|
44
44
|
class DropdownList < Component
|
45
45
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'ui_bibz/ui/dropdown/components/dropdown_list'
|
2
|
-
module UiBibz::Ui
|
1
|
+
require 'ui_bibz/ui/core/dropdown/components/dropdown_list'
|
2
|
+
module UiBibz::Ui::Core
|
3
3
|
|
4
4
|
# Create a dropdown
|
5
5
|
#
|
6
|
-
# This element is an extend of UiBibz::Ui::Component.
|
6
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
7
7
|
# You can use tap method to add list items.
|
8
8
|
#
|
9
9
|
# ==== Attributes
|
@@ -27,7 +27,7 @@ module UiBibz::Ui
|
|
27
27
|
#
|
28
28
|
# ==== Signatures
|
29
29
|
#
|
30
|
-
# UiBibz::Ui::Dropdown.new(options = nil, html_options = nil).tap do |d|
|
30
|
+
# UiBibz::Ui::Core::Dropdown.new(options = nil, html_options = nil).tap do |d|
|
31
31
|
# d.list content = nil, options = nil, html_options = nil, &block
|
32
32
|
# d.list content = nil, options = nil, html_options = nil, &block
|
33
33
|
# d.list content = nil, options = nil, html_options = nil, &block
|
@@ -36,11 +36,22 @@ module UiBibz::Ui
|
|
36
36
|
#
|
37
37
|
# ==== Examples
|
38
38
|
#
|
39
|
-
# UiBibz::Ui::Dropdown.new(name, state: :success).tap do |d|
|
39
|
+
# UiBibz::Ui::Core::Dropdown.new(name, state: :success).tap do |d|
|
40
40
|
# d.list link_to('test', '#')
|
41
|
+
# d.list('---')
|
42
|
+
# d.list('Header 1', { type: :header })
|
41
43
|
# d.list link_to('test2', '#')
|
42
44
|
# end.render
|
43
45
|
#
|
46
|
+
# ==== Helper
|
47
|
+
#
|
48
|
+
# dropdown(name, options = { tap: true }, html_options = {}) do |d|
|
49
|
+
# d.list(content, options = {}, html_options = {})
|
50
|
+
# d.list(options = {}, html_options = {}) do
|
51
|
+
# content
|
52
|
+
# end
|
53
|
+
# end
|
54
|
+
#
|
44
55
|
class Dropdown < Component
|
45
56
|
|
46
57
|
def initialize content, options = nil, html_options = nil, &block
|
@@ -56,12 +67,12 @@ module UiBibz::Ui
|
|
56
67
|
end
|
57
68
|
end
|
58
69
|
|
59
|
-
# See UiBibz::Ui::DropdownList
|
70
|
+
# See UiBibz::Ui::Core::DropdownList
|
60
71
|
def list content = nil, options = nil, html_options = nil, &block
|
61
72
|
@lists << DropdownList.new(content, options, html_options, &block).render
|
62
73
|
end
|
63
74
|
|
64
|
-
|
75
|
+
protected
|
65
76
|
|
66
77
|
def button_content
|
67
78
|
[glyph_with_space, @content, ' ', caret].compact.join.html_safe
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create a glyph
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -20,30 +20,38 @@ module UiBibz::Ui
|
|
20
20
|
#
|
21
21
|
# ==== Signatures
|
22
22
|
#
|
23
|
-
# UiBibz::Ui::Glyph.new content = nil, options = nil, html_options = nil,
|
23
|
+
# UiBibz::Ui::Core::Glyph.new content = nil, options = nil, html_options = nil,
|
24
24
|
# &block
|
25
25
|
#
|
26
|
-
# UiBibz::Ui::Glyph.new(options = nil, html_options = nil) do
|
26
|
+
# UiBibz::Ui::Core::Glyph.new(options = nil, html_options = nil) do
|
27
27
|
# content
|
28
28
|
# end
|
29
29
|
#
|
30
|
-
# UiBibz::Ui::Glyph.new content = {}
|
30
|
+
# UiBibz::Ui::Core::Glyph.new content = {}
|
31
31
|
#
|
32
|
-
# UiBibz::Ui::Glyph.new content, options = {}, html_options = {}
|
32
|
+
# UiBibz::Ui::Core::Glyph.new content, options = {}, html_options = {}
|
33
33
|
#
|
34
34
|
# ==== Exemples
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::Glyph.new('eye').render
|
36
|
+
# UiBibz::Ui::Core::Glyph.new('eye').render
|
37
37
|
#
|
38
|
-
# UiBibz::Ui::Glyph.new() do
|
38
|
+
# UiBibz::Ui::Core::Glyph.new() do
|
39
39
|
# name
|
40
40
|
# end.render
|
41
41
|
#
|
42
|
-
# UiBibz::Ui::Glyph.new('eye', { size: 3, type: 'fw' }).render
|
42
|
+
# UiBibz::Ui::Core::Glyph.new('eye', { size: 3, type: 'fw' }).render
|
43
43
|
#
|
44
|
-
# UiBibz::Ui::Glyph.new({ name: 'eye', size: 3, type: 'fw' }).render
|
44
|
+
# UiBibz::Ui::Core::Glyph.new({ name: 'eye', size: 3, type: 'fw' }).render
|
45
45
|
#
|
46
|
+
# ==== Helper
|
46
47
|
#
|
48
|
+
# glyph(options = {})
|
49
|
+
#
|
50
|
+
# glyph(name, options = {}, html_options = {})
|
51
|
+
#
|
52
|
+
# glyph(options = {}, html_options = {}) do
|
53
|
+
# name
|
54
|
+
# end
|
47
55
|
class Glyph < Component
|
48
56
|
|
49
57
|
def initialize content, options = nil, html_options = nil, &block
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create a jumbotron
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -18,20 +18,28 @@ module UiBibz::Ui
|
|
18
18
|
#
|
19
19
|
# ==== Signatures
|
20
20
|
#
|
21
|
-
# UiBibz::Ui::Jumbotron.new(content, options = nil, html_options = nil)
|
21
|
+
# UiBibz::Ui::Core::Jumbotron.new(content, options = nil, html_options = nil)
|
22
22
|
#
|
23
|
-
# UiBibz::Ui::Jumbotron.new(options = nil, html_options = nil) do
|
23
|
+
# UiBibz::Ui::Core::Jumbotron.new(options = nil, html_options = nil) do
|
24
24
|
# content
|
25
25
|
# end
|
26
26
|
#
|
27
27
|
# ==== Examples
|
28
28
|
#
|
29
|
-
# UiBibz::Ui::Jumbotron.new(content, full_width: true).render
|
29
|
+
# UiBibz::Ui::Core::Jumbotron.new(content, full_width: true).render
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::Jumbotron.new() do
|
31
|
+
# UiBibz::Ui::Core::Jumbotron.new() do
|
32
32
|
# #content
|
33
33
|
# end.render
|
34
34
|
#
|
35
|
+
# ==== Helper
|
36
|
+
#
|
37
|
+
# jumbotron(content, options = {} , html_options = {})
|
38
|
+
#
|
39
|
+
# jumbotron(options = {}, html_options = {}) do
|
40
|
+
# content
|
41
|
+
# end
|
42
|
+
#
|
35
43
|
class Jumbotron < Component
|
36
44
|
|
37
45
|
def initialize content = nil, options = nil, html_options = nil, &block
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create a label
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -23,20 +23,28 @@ module UiBibz::Ui
|
|
23
23
|
#
|
24
24
|
# ==== Signatures
|
25
25
|
#
|
26
|
-
# UiBibz::Ui::Label.new(content, options = nil, html_options = nil)
|
26
|
+
# UiBibz::Ui::Core::Label.new(content, options = nil, html_options = nil)
|
27
27
|
#
|
28
|
-
# UiBibz::Ui::Label.new(options = nil, html_options = nil) do
|
28
|
+
# UiBibz::Ui::Core::Label.new(options = nil, html_options = nil) do
|
29
29
|
# content
|
30
30
|
# end
|
31
31
|
#
|
32
32
|
# ==== Examples
|
33
33
|
#
|
34
|
-
# UiBibz::Ui::Label.new(content, state: :success).render
|
34
|
+
# UiBibz::Ui::Core::Label.new(content, state: :success).render
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::Label.new() do
|
36
|
+
# UiBibz::Ui::Core::Label.new() do
|
37
37
|
# #content
|
38
38
|
# end.render
|
39
39
|
#
|
40
|
+
# ==== Helper
|
41
|
+
#
|
42
|
+
# etiquette(content, options = {}, html_options = {})
|
43
|
+
#
|
44
|
+
# etiquette(options = {}, html_options = {}) do
|
45
|
+
# content
|
46
|
+
# end
|
47
|
+
#
|
40
48
|
class Label < Component
|
41
49
|
|
42
50
|
def initialize content = nil, options = nil, html_options = nil, &block
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create a list
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -27,26 +27,26 @@ module UiBibz::Ui
|
|
27
27
|
#
|
28
28
|
# ==== Signatures
|
29
29
|
#
|
30
|
-
# UiBibz::Ui::List.new(tap: true) do |l|
|
30
|
+
# UiBibz::Ui::Core::List.new(tap: true) do |l|
|
31
31
|
# l.header content = nil, options = nil, html_options = nil, &block
|
32
32
|
# l.body content = nil, options = nil, html_options = nil, &block
|
33
33
|
# end
|
34
34
|
#
|
35
|
-
# UiBibz::Ui::List.new content, options = nil, html_options = nil
|
35
|
+
# UiBibz::Ui::Core::List.new content, options = nil, html_options = nil
|
36
36
|
#
|
37
|
-
# UiBibz::Ui::List.new options = nil, html_options = nil do
|
37
|
+
# UiBibz::Ui::Core::List.new options = nil, html_options = nil do
|
38
38
|
# content
|
39
39
|
# end
|
40
40
|
#
|
41
41
|
# ==== Examples
|
42
42
|
#
|
43
|
-
# UiBibz::Ui::List.new('Test', state: :success, url: '#test').render
|
43
|
+
# UiBibz::Ui::Core::List.new('Test', state: :success, url: '#test').render
|
44
44
|
#
|
45
|
-
# UiBibz::Ui::List.new(state: :primary) do
|
45
|
+
# UiBibz::Ui::Core::List.new(state: :primary) do
|
46
46
|
# 'Test 2'
|
47
47
|
# end.render
|
48
48
|
#
|
49
|
-
# UiBibz::Ui::List.new(tap: true, status: :active) do |l|
|
49
|
+
# UiBibz::Ui::Core::List.new(tap: true, status: :active) do |l|
|
50
50
|
# l.header 'My title', nil, class: 'my-title'
|
51
51
|
# l.body do
|
52
52
|
# 'My content'
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require "ui_bibz/ui/list/components/list"
|
2
|
-
module UiBibz::Ui
|
1
|
+
require "ui_bibz/ui/core/list/components/list"
|
2
|
+
module UiBibz::Ui::Core
|
3
3
|
|
4
4
|
# Create a list group
|
5
5
|
#
|
6
|
-
# This element is an extend of UiBibz::Ui::Component.
|
6
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
7
7
|
#
|
8
8
|
# ==== Attributes
|
9
9
|
#
|
@@ -20,7 +20,7 @@ module UiBibz::Ui
|
|
20
20
|
#
|
21
21
|
# ==== Signatures
|
22
22
|
#
|
23
|
-
# UiBibz::Ui::ListGroup.new().tap |lg|
|
23
|
+
# UiBibz::Ui::Core::ListGroup.new().tap |lg|
|
24
24
|
# ...
|
25
25
|
# lg.list content = nil, options = nil, html_options = nil, &block
|
26
26
|
# ...
|
@@ -28,12 +28,12 @@ module UiBibz::Ui
|
|
28
28
|
#
|
29
29
|
# ==== Examples
|
30
30
|
#
|
31
|
-
# UiBibz::Ui::ListGroup.new().tap do |d|
|
31
|
+
# UiBibz::Ui::Core::ListGroup.new().tap do |d|
|
32
32
|
# d.list 'Test', state: :success
|
33
33
|
# d.list 'Test2', state: :primary
|
34
34
|
# end.render
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::ListGroup.new(type: :link).tap do |d|
|
36
|
+
# UiBibz::Ui::Core::ListGroup.new(type: :link).tap do |d|
|
37
37
|
# d.list 'Test', state: :success, url: '#test'
|
38
38
|
# d.list(state: :primary) do
|
39
39
|
# 'Test 2'
|
@@ -46,6 +46,28 @@ module UiBibz::Ui
|
|
46
46
|
# end
|
47
47
|
# end.render
|
48
48
|
#
|
49
|
+
# ==== Helper
|
50
|
+
#
|
51
|
+
# list_group( options = { tap: true }, html_options = {}) do |l|
|
52
|
+
# l.list(content, options = {}, html_options = {})
|
53
|
+
# l.list(options = {}, html_options = {}) do
|
54
|
+
# content
|
55
|
+
# end
|
56
|
+
# l.list(options = { tap: true }, html_options = {}) do |li|
|
57
|
+
# li.header(content, options = {}, html_options = {})
|
58
|
+
# # or
|
59
|
+
# li.header(options = {}, html_options = {}) do
|
60
|
+
# content
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# li.body(content, options = {}, html_options = {})
|
64
|
+
# # or
|
65
|
+
# li.body(options = {}, html_options = {}) do
|
66
|
+
# content
|
67
|
+
# end
|
68
|
+
# end
|
69
|
+
# end
|
70
|
+
#
|
49
71
|
class ListGroup < Component
|
50
72
|
|
51
73
|
def initialize content = nil, options = nil, html_options = nil, &block
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module UiBibz::Ui::Core
|
2
|
+
|
3
|
+
# Create a dropdown
|
4
|
+
#
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
|
+
# You can use tap method to add list items.
|
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
|
+
# * +state+ - State of élement with symbol value:
|
19
|
+
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
20
|
+
# * +size+
|
21
|
+
# (+:xs+, +:sm+, +:lg+)
|
22
|
+
# * +glyph+ - Add glyph with name or hash options
|
23
|
+
# * +name+ - String
|
24
|
+
# * +size+ - Integer
|
25
|
+
# * +type+ - Symbol
|
26
|
+
#
|
27
|
+
# ==== Signatures
|
28
|
+
#
|
29
|
+
# UiBibz::Ui::Core::Dropdown.new(options = nil, html_options = nil).tap do |d|
|
30
|
+
# ...
|
31
|
+
# d.list content = nil, options = nil, html_options = nil, &block
|
32
|
+
# d.list content = nil, options = nil, html_options = nil, &block
|
33
|
+
# d.list content = nil, options = nil, html_options = nil, &block
|
34
|
+
# ...
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# ==== Examples
|
38
|
+
#
|
39
|
+
# UiBibz::Ui::Core::Dropdown.new(name, state: :success).tap do |d|
|
40
|
+
# d.list link_to('test', '#')
|
41
|
+
# d.list link_to('test2', '#')
|
42
|
+
# end.render
|
43
|
+
#
|
44
|
+
class NavDropdown < Dropdown
|
45
|
+
|
46
|
+
def initialize content, options = nil, html_options = nil, &block
|
47
|
+
super
|
48
|
+
end
|
49
|
+
|
50
|
+
def render
|
51
|
+
content_tag :li, class_and_html_options(type) do
|
52
|
+
concat link_html
|
53
|
+
concat ul_html
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def link_html
|
60
|
+
link_to button_content, "#", class: add_classes(size, "dropdown-toggle"), "data-toggle" => 'dropdown', "aria-expanded" => false
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module UiBibz::Ui
|
1
|
+
module UiBibz::Ui::Core
|
2
2
|
|
3
3
|
# Create a NavLink
|
4
4
|
#
|
5
|
-
# This element is an extend of UiBibz::Ui::Component.
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
6
6
|
#
|
7
7
|
# ==== Attributes
|
8
8
|
#
|
@@ -21,17 +21,17 @@ module UiBibz::Ui
|
|
21
21
|
#
|
22
22
|
# ==== Signatures
|
23
23
|
#
|
24
|
-
# UiBibz::Ui::NavLink.new(content, options = nil, html_options = nil)
|
24
|
+
# UiBibz::Ui::Core::NavLink.new(content, options = nil, html_options = nil)
|
25
25
|
#
|
26
|
-
# UiBibz::Ui::NavLink.new(options = nil, html_options = nil) do
|
26
|
+
# UiBibz::Ui::Core::NavLink.new(options = nil, html_options = nil) do
|
27
27
|
# content
|
28
28
|
# end
|
29
29
|
#
|
30
30
|
# ==== Examples
|
31
31
|
#
|
32
|
-
# UiBibz::Ui::NavLink.new(content, { badge: 15, url: '/', status: :active },{ class: 'test' }).render
|
32
|
+
# UiBibz::Ui::Core::NavLink.new(content, { badge: 15, url: '/', status: :active },{ class: 'test' }).render
|
33
33
|
#
|
34
|
-
# UiBibz::Ui::NavLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
|
34
|
+
# UiBibz::Ui::Core::NavLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
|
35
35
|
# 'Home'
|
36
36
|
# end.render
|
37
37
|
#
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UiBibz::Ui::Core
|
2
|
+
|
3
|
+
# Create a NavbarForm
|
4
|
+
#
|
5
|
+
# This element is an extend of ActionView::Helpers::FormHelper::FormFor to Rails
|
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
|
+
#
|
18
|
+
# http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for
|
19
|
+
#
|
20
|
+
# ==== Signatures
|
21
|
+
#
|
22
|
+
# UiBibz::Ui::Core::NavbarForm.new(options = nil, html_options = nil) do |f|
|
23
|
+
# f.text_field :field
|
24
|
+
# f.submit 'Submit'
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
# ==== Examples
|
28
|
+
#
|
29
|
+
# UiBibz::Ui::Core::NavbarForm.new(position: :right) do |f|
|
30
|
+
# f.text_field :field
|
31
|
+
# f.submit 'Submit'
|
32
|
+
# end.render
|
33
|
+
#
|
34
|
+
class NavbarForm < Component
|
35
|
+
|
36
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
37
|
+
@form = form_for(content, options, html_options, &block)
|
38
|
+
end
|
39
|
+
|
40
|
+
def render
|
41
|
+
@form
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module UiBibz::Ui::Core
|
2
|
+
|
3
|
+
# Create a NavbarNav
|
4
|
+
#
|
5
|
+
# This element is an extend of UiBibz::Ui::Core::Nav.
|
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
|
+
# * +type+ - Symbol
|
18
|
+
# (+:pills+, +:tab+)
|
19
|
+
# * +position+ - Symbol
|
20
|
+
# (+:right+, +:left+)
|
21
|
+
#
|
22
|
+
# ==== Signatures
|
23
|
+
#
|
24
|
+
# UiBibz::Ui::Core::NavbarNav.new(content, options = nil, html_options = nil)
|
25
|
+
#
|
26
|
+
# UiBibz::Ui::Core::NavbarNav.new(options = nil, html_options = nil).tap do |n|
|
27
|
+
# ...
|
28
|
+
# n.link content = nil, options = nil, html_options = nil, block
|
29
|
+
# ...
|
30
|
+
# end
|
31
|
+
#
|
32
|
+
# ==== Examples
|
33
|
+
#
|
34
|
+
# UiBibz::Ui::Core::NavbarNav.new().tap do |n|
|
35
|
+
# n.link 'Test', url: '#test'
|
36
|
+
# n.link 'Test2', url: '#test2', status: :active
|
37
|
+
# end.render
|
38
|
+
#
|
39
|
+
class NavbarNav < Nav
|
40
|
+
|
41
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
42
|
+
super
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def type
|
48
|
+
'navbar-nav'
|
49
|
+
end
|
50
|
+
|
51
|
+
def position
|
52
|
+
"navbar-#{ @options[:position] }" unless @options[:position].nil?
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UiBibz::Ui::Core
|
2
|
+
|
3
|
+
# Create a NavbarText
|
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
|
+
# * +position+ - Symbol
|
16
|
+
# (+:right+, +:left+)
|
17
|
+
#
|
18
|
+
# ==== Signatures
|
19
|
+
#
|
20
|
+
# UiBibz::Ui::Core::NavbarText.new(content, options = nil, html_options = nil)
|
21
|
+
#
|
22
|
+
# UiBibz::Ui::Core::NavbarText.new(options = nil, html_options = nil) do
|
23
|
+
# content
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# ==== Examples
|
27
|
+
#
|
28
|
+
# UiBibz::Ui::Core::NavbarText.new('Exemple).render
|
29
|
+
#
|
30
|
+
# UiBibz::Ui::Core::NavbarText.new(position: :right) do
|
31
|
+
# 'Exemple'
|
32
|
+
# end.render
|
33
|
+
#
|
34
|
+
class NavbarText < Component
|
35
|
+
|
36
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
37
|
+
super
|
38
|
+
end
|
39
|
+
|
40
|
+
def render
|
41
|
+
content_tag :ul, @content, class_and_html_options(["navbar-text", position])
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|