ui_bibz 1.2.5.3 → 2.0.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -7
- data/README.md +8 -1042
- data/app/assets/javascripts/multi_column.coffee +45 -0
- data/app/assets/javascripts/{ui_bibz.js.coffee → ui_bibz.coffee} +16 -3
- data/app/assets/stylesheets/fix-bootstrap-4.sass +2 -0
- data/app/assets/stylesheets/ui_bibz.sass +22 -9
- data/app/inputs/custom_inputs/date_picker_input.rb +10 -0
- data/app/inputs/custom_inputs/date_picker_input_old.rb +61 -0
- data/app/inputs/custom_inputs/multi_column_input.rb +18 -0
- data/app/inputs/custom_inputs/multi_select_input.rb +15 -0
- data/app/inputs/custom_inputs/surround_input.rb +10 -0
- data/doc/UiBibz.html +2 -2
- data/doc/UiBibz/Concerns.html +1 -1
- data/doc/UiBibz/Concerns/Models.html +1 -1
- data/doc/UiBibz/Concerns/Models/Searchable.html +1 -1
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +5 -5
- data/doc/UiBibz/Helpers.html +1 -1
- data/doc/UiBibz/Helpers/MetaHelper.html +1 -1
- data/doc/UiBibz/Helpers/UiCoreHelper.html +1 -1
- data/doc/UiBibz/Helpers/UiUxHelper.html +1 -1
- data/doc/UiBibz/Helpers/UtilsHelper.html +1 -1
- data/doc/UiBibz/Rails.html +1 -1
- data/doc/UiBibz/Rails/Engine.html +1 -1
- data/doc/UiBibz/Ui.html +1 -1
- data/doc/UiBibz/Ui/Base.html +1 -1
- data/doc/UiBibz/Ui/Core.html +1 -1
- data/doc/UiBibz/Ui/Core/Alert.html +1 -1
- data/doc/UiBibz/Ui/Core/Bar.html +1 -1
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +1 -1
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Button.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonLink.html +1 -1
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/Col.html +1 -1
- data/doc/UiBibz/Ui/Core/Component.html +1 -1
- data/doc/UiBibz/Ui/Core/Dropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownDivider.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownHeader.html +1 -1
- data/doc/UiBibz/Ui/Core/DropdownLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Glyph.html +1 -1
- data/doc/UiBibz/Ui/Core/Jumbotron.html +1 -1
- data/doc/UiBibz/Ui/Core/Label.html +1 -1
- data/doc/UiBibz/Ui/Core/List.html +1 -1
- data/doc/UiBibz/Ui/Core/ListGroup.html +1 -1
- data/doc/UiBibz/Ui/Core/Modal.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalBody.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalFooter.html +1 -1
- data/doc/UiBibz/Ui/Core/ModalHeader.html +1 -1
- data/doc/UiBibz/Ui/Core/Nav.html +1 -1
- data/doc/UiBibz/Ui/Core/NavDropdown.html +1 -1
- data/doc/UiBibz/Ui/Core/NavLink.html +1 -1
- data/doc/UiBibz/Ui/Core/Navbar.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarForm.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarNav.html +1 -1
- data/doc/UiBibz/Ui/Core/NavbarText.html +1 -1
- data/doc/UiBibz/Ui/Core/Panel.html +1 -1
- data/doc/UiBibz/Ui/Core/ProgressBar.html +1 -1
- data/doc/UiBibz/Ui/Core/Row.html +1 -1
- data/doc/UiBibz/Ui/Core/Stars.html +1 -1
- data/doc/UiBibz/Ui/Ux.html +1 -1
- data/doc/UiBibz/Ui/Ux/Actionable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Actions.html +1 -1
- data/doc/UiBibz/Ui/Ux/Column.html +1 -1
- data/doc/UiBibz/Ui/Ux/Columns.html +1 -1
- data/doc/UiBibz/Ui/Ux/Grid.html +1 -1
- data/doc/UiBibz/Ui/Ux/Paginable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Searchable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Sortable.html +1 -1
- data/doc/UiBibz/Ui/Ux/Store.html +18 -70
- data/doc/UiBibz/Ui/Ux/Table.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePagination.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +1 -1
- data/doc/UiBibz/Ui/Ux/TablePanel.html +1 -1
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +1 -1
- data/doc/UiBibz/Utils.html +1 -1
- data/doc/UiBibz/Utils/Internationalization.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +47 -51
- data/doc/index.html +47 -51
- data/doc/method_list.html +69 -75
- data/doc/top-level-namespace.html +1 -1
- data/lib/ui_bibz.rb +14 -7
- data/lib/ui_bibz/helpers/ui_core_helper.rb +46 -11
- data/lib/ui_bibz/helpers/ui_ux_helper.rb +7 -3
- data/lib/ui_bibz/rails/engine.rb +2 -2
- data/lib/ui_bibz/ui/base.rb +5 -0
- data/lib/ui_bibz/ui/core/alert.rb +15 -6
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +37 -2
- data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +3 -3
- data/lib/ui_bibz/ui/core/button/button.rb +39 -6
- data/lib/ui_bibz/ui/core/button/button_choice.rb +104 -0
- data/lib/ui_bibz/ui/core/button/button_dropdown.rb +15 -2
- data/lib/ui_bibz/ui/core/button/button_group.rb +17 -5
- data/lib/ui_bibz/ui/core/button/button_link.rb +8 -11
- data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +15 -5
- data/lib/ui_bibz/ui/core/card/card.rb +158 -0
- data/lib/ui_bibz/ui/core/card/card_column.rb +60 -0
- data/lib/ui_bibz/ui/core/card/card_deck.rb +62 -0
- data/lib/ui_bibz/ui/core/card/card_group.rb +60 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_link.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/block/card_block_title.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/card_block.rb +67 -0
- data/lib/ui_bibz/ui/core/card/components/card_footer.rb +55 -0
- data/lib/ui_bibz/ui/core/card/components/card_header.rb +51 -0
- data/lib/ui_bibz/ui/core/card/components/card_image.rb +57 -0
- data/lib/ui_bibz/ui/core/card/components/card_list_group.rb +47 -0
- data/lib/ui_bibz/ui/core/component.rb +78 -32
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_divider.rb +1 -1
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb +11 -1
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +11 -4
- data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +14 -6
- data/lib/ui_bibz/ui/core/glyph.rb +22 -4
- data/lib/ui_bibz/ui/core/input/date_picker_field.rb +125 -0
- data/lib/ui_bibz/ui/core/input/multi_column_field.rb +77 -0
- data/lib/ui_bibz/ui/core/input/multi_select_field.rb +89 -0
- data/lib/ui_bibz/ui/core/input/surround_field.rb +74 -0
- data/lib/ui_bibz/ui/core/jumbotron.rb +10 -6
- data/lib/ui_bibz/ui/core/label.rb +13 -3
- data/lib/ui_bibz/ui/core/{col.rb → layout/col.rb} +38 -18
- data/lib/ui_bibz/ui/core/layout/container.rb +65 -0
- data/lib/ui_bibz/ui/core/{row.rb → layout/row.rb} +7 -1
- data/lib/ui_bibz/ui/core/list/components/list.rb +26 -11
- data/lib/ui_bibz/ui/core/list/components/list_body.rb +36 -0
- data/lib/ui_bibz/ui/core/list/components/list_header.rb +36 -0
- data/lib/ui_bibz/ui/core/list/list_group.rb +7 -3
- data/lib/ui_bibz/ui/core/modal/components/modal_body.rb +7 -1
- data/lib/ui_bibz/ui/core/modal/components/modal_footer.rb +7 -1
- data/lib/ui_bibz/ui/core/modal/components/modal_header.rb +5 -2
- data/lib/ui_bibz/ui/core/modal/modal.rb +13 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +6 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +7 -18
- data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +45 -0
- data/lib/ui_bibz/ui/core/nav/components/nav_link_list.rb +35 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_brand.rb +40 -0
- data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +2 -2
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +6 -2
- data/lib/ui_bibz/ui/core/nav/nav.rb +22 -4
- data/lib/ui_bibz/ui/core/nav/navbar.rb +26 -17
- data/lib/ui_bibz/ui/core/progress.rb +98 -0
- data/lib/ui_bibz/ui/core/stars.rb +13 -5
- data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
- data/lib/ui_bibz/ui/ux/table/components/store.rb +4 -4
- data/lib/ui_bibz/ui/ux/table/extensions/actionable.rb +15 -13
- data/lib/ui_bibz/ui/ux/table/extensions/paginable.rb +7 -6
- data/lib/ui_bibz/ui/ux/table/extensions/searchable.rb +6 -5
- data/lib/ui_bibz/ui/ux/table/table.rb +14 -7
- data/lib/ui_bibz/ui/ux/table/{table_panel.rb → table_card.rb} +34 -36
- data/lib/ui_bibz/ui/ux/table/table_search_field.rb +19 -11
- data/lib/ui_bibz/version.rb +1 -1
- data/test/ui/breadcrumb_test.rb +25 -0
- data/test/ui/button_test.rb +44 -4
- data/test/ui/card_test.rb +106 -0
- data/test/ui/col_test.rb +22 -0
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/inputs_test.rb +81 -0
- data/test/ui/list_group_test.rb +1 -1
- data/test/ui/nav_test.rb +4 -5
- data/test/ui/table_test.rb +11 -11
- data/test/ui_helper_test.rb +29 -18
- data/ui_bibz.gemspec +3 -3
- data/vendor/assets/images/switch.png +0 -0
- data/vendor/assets/javascripts/bootstrap-4.0.0-alpha.min.js +7 -0
- data/vendor/assets/javascripts/bootstrap-multiselect.min.js +1180 -0
- data/vendor/assets/javascripts/jquery.multi-select.min.js +1 -0
- data/vendor/assets/javascripts/jquery.quicksearch.min.js +1 -0
- data/vendor/assets/stylesheets/bootstrap-4.0.0-alpha.min.css +6 -0
- data/vendor/assets/stylesheets/bootstrap-datepicker3.min.css +1 -1
- data/vendor/assets/stylesheets/bootstrap-multiselect.min.css +1 -0
- data/vendor/assets/stylesheets/multi-select.min.css +1 -0
- metadata +70 -24
- data/.yardoc/checksums +0 -59
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/ui_bibz/helpers/meta_helper.rb +0 -32
- data/lib/ui_bibz/ui/core/panel.rb +0 -138
- data/lib/ui_bibz/ui/core/progress_bar/components/bar.rb +0 -105
- data/lib/ui_bibz/ui/core/progress_bar/progress_bar.rb +0 -94
- data/lib/ui_bibz/ui/ux/grid.rb +0 -121
- data/test/ui/grid_test.rb +0 -46
- data/test/ui/panel_test.rb +0 -52
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Mon Oct 19 15:25:14 2015 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.2.3).
|
109
109
|
</div>
|
data/lib/ui_bibz.rb
CHANGED
@@ -15,32 +15,40 @@ module UiBibz
|
|
15
15
|
autoload :Alert, "ui_bibz/ui/core/alert"
|
16
16
|
autoload :Breadcrumb, "ui_bibz/ui/core/breadcrumb/breadcrumb"
|
17
17
|
autoload :Button, "ui_bibz/ui/core/button/button"
|
18
|
+
autoload :ButtonChoice, "ui_bibz/ui/core/button/button_choice"
|
18
19
|
autoload :ButtonDropdown, "ui_bibz/ui/core/button/button_dropdown"
|
19
20
|
autoload :ButtonGroup, "ui_bibz/ui/core/button/button_group"
|
20
21
|
autoload :ButtonLink, "ui_bibz/ui/core/button/button_link"
|
21
22
|
autoload :ButtonSplitDropdown, "ui_bibz/ui/core/button/button_split_dropdown"
|
22
|
-
autoload :
|
23
|
+
autoload :Card, "ui_bibz/ui/core/card/card"
|
24
|
+
autoload :CardColumn, "ui_bibz/ui/core/card/card_column"
|
25
|
+
autoload :CardDeck, "ui_bibz/ui/core/card/card_deck"
|
26
|
+
autoload :CardGroup, "ui_bibz/ui/core/card/card_group"
|
27
|
+
autoload :Col, "ui_bibz/ui/core/layout/col"
|
23
28
|
autoload :Component, "ui_bibz/ui/core/component"
|
29
|
+
autoload :Container, "ui_bibz/ui/core/layout/container"
|
30
|
+
autoload :DatePickerField, "ui_bibz/ui/core/input/date_picker_field"
|
24
31
|
autoload :Dropdown, "ui_bibz/ui/core/dropdown/dropdown"
|
25
32
|
autoload :Glyph, "ui_bibz/ui/core/glyph"
|
26
33
|
autoload :Jumbotron, "ui_bibz/ui/core/jumbotron"
|
27
34
|
autoload :Label, "ui_bibz/ui/core/label"
|
28
35
|
autoload :ListGroup, "ui_bibz/ui/core/list/list_group"
|
29
36
|
autoload :Modal, "ui_bibz/ui/core/modal/modal"
|
37
|
+
autoload :MultiSelectField, "ui_bibz/ui/core/input/multi_select_field"
|
38
|
+
autoload :MultiColumnField, "ui_bibz/ui/core/input/multi_column_field"
|
30
39
|
autoload :Nav, "ui_bibz/ui/core/nav/nav"
|
31
40
|
autoload :Navbar, "ui_bibz/ui/core/nav/navbar"
|
32
|
-
autoload :
|
33
|
-
autoload :
|
34
|
-
autoload :Row, "ui_bibz/ui/core/row"
|
41
|
+
autoload :Progress, "ui_bibz/ui/core/progress"
|
42
|
+
autoload :Row, "ui_bibz/ui/core/layout/row"
|
35
43
|
autoload :Stars, "ui_bibz/ui/core/stars"
|
44
|
+
autoload :SurroundField, "ui_bibz/ui/core/input/surround_field"
|
36
45
|
autoload :Tab, "ui_bibz/ui/core/nav/tab"
|
37
46
|
end
|
38
47
|
|
39
48
|
# Ux
|
40
49
|
module Ux
|
41
|
-
autoload :Grid, "ui_bibz/ui/ux/grid"
|
42
50
|
autoload :Table, "ui_bibz/ui/ux/table/table"
|
43
|
-
autoload :
|
51
|
+
autoload :TableCard, "ui_bibz/ui/ux/table/table_card"
|
44
52
|
autoload :TableSearchField, "ui_bibz/ui/ux/table/table_search_field"
|
45
53
|
autoload :TablePagination, "ui_bibz/ui/ux/table/table_pagination"
|
46
54
|
autoload :TablePaginationPerPage, "ui_bibz/ui/ux/table/table_pagination_per_page"
|
@@ -48,7 +56,6 @@ module UiBibz
|
|
48
56
|
end
|
49
57
|
|
50
58
|
module Helpers
|
51
|
-
autoload :MetaHelper, "ui_bibz/helpers/meta_helper"
|
52
59
|
autoload :UiCoreHelper, "ui_bibz/helpers/ui_core_helper"
|
53
60
|
autoload :UiUxHelper, "ui_bibz/helpers/ui_ux_helper"
|
54
61
|
autoload :UtilsHelper, "ui_bibz/helpers/utils_helper"
|
@@ -1,13 +1,29 @@
|
|
1
1
|
module UiBibz::Helpers::UiCoreHelper
|
2
2
|
|
3
|
-
def
|
3
|
+
def card content = nil, options = nil, html_options = nil, &block
|
4
4
|
if is_tap(content, options)
|
5
|
-
UiBibz::Ui::Core::
|
5
|
+
UiBibz::Ui::Core::Card.new(content, options, html_options).tap(&block).render
|
6
6
|
else
|
7
|
-
UiBibz::Ui::Core::
|
7
|
+
UiBibz::Ui::Core::Card.new(content, options, html_options, &block).render
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
def card_group content = nil, options = nil, html_options = nil, &block
|
12
|
+
UiBibz::Ui::Core::CardGroup.new(content, options, html_options).tap(&block).render
|
13
|
+
end
|
14
|
+
|
15
|
+
def card_deck content = nil, options = nil, html_options = nil, &block
|
16
|
+
UiBibz::Ui::Core::CardDeck.new(content, options, html_options).tap(&block).render
|
17
|
+
end
|
18
|
+
|
19
|
+
def card_column content = nil, options = nil, html_options = nil, &block
|
20
|
+
UiBibz::Ui::Core::CardColumn.new(content, options, html_options).tap(&block).render
|
21
|
+
end
|
22
|
+
|
23
|
+
def date_picker_field content = nil, options = nil, html_options = nil, &block
|
24
|
+
UiBibz::Ui::Core::DatePickerField.new(content, options, html_options, &block).render
|
25
|
+
end
|
26
|
+
|
11
27
|
def modal content = nil, options = nil, html_options = nil, &block
|
12
28
|
UiBibz::Ui::Core::Modal.new(content, options, html_options).tap(&block).render
|
13
29
|
end
|
@@ -34,6 +50,18 @@ module UiBibz::Helpers::UiCoreHelper
|
|
34
50
|
UiBibz::Ui::Core::Nav.new(content, options, html_options).tap(&block).render
|
35
51
|
end
|
36
52
|
|
53
|
+
def surround_field content = nil, options = nil, html_options = nil, &block
|
54
|
+
UiBibz::Ui::Core::SurroundField.new(content, options, html_options, &block).render
|
55
|
+
end
|
56
|
+
|
57
|
+
def multi_column_field content = nil, options = nil, html_options = nil, &block
|
58
|
+
UiBibz::Ui::Core::MultiColumnField.new(content, options, html_options, &block).render
|
59
|
+
end
|
60
|
+
|
61
|
+
def multi_select_field content = nil, options = nil, html_options = nil, &block
|
62
|
+
UiBibz::Ui::Core::MultiSelectField.new(content, options, html_options, &block).render
|
63
|
+
end
|
64
|
+
|
37
65
|
def navbar content = nil, options = nil, html_options = nil, &block
|
38
66
|
UiBibz::Ui::Core::Navbar.new(content, options, html_options).tap(&block).render
|
39
67
|
end
|
@@ -42,12 +70,15 @@ module UiBibz::Helpers::UiCoreHelper
|
|
42
70
|
UiBibz::Ui::Core::ListGroup.new(content, options, html_options).tap(&block).render
|
43
71
|
end
|
44
72
|
|
45
|
-
|
46
73
|
# Button section begin ----------------------------------------------------
|
47
74
|
def button_link content = nil, options = nil, html_options = nil, &block
|
48
75
|
UiBibz::Ui::Core::ButtonLink.new(content, options, html_options, &block).render
|
49
76
|
end
|
50
77
|
|
78
|
+
def button_choice content = nil, options = nil, html_options = nil, &block
|
79
|
+
UiBibz::Ui::Core::ButtonChoice.new(content, options, html_options, &block).render
|
80
|
+
end
|
81
|
+
|
51
82
|
def button_group content = nil, options = nil, html_options = nil, &block
|
52
83
|
UiBibz::Ui::Core::ButtonGroup.new(content, options, html_options, &block).render
|
53
84
|
end
|
@@ -66,7 +97,11 @@ module UiBibz::Helpers::UiCoreHelper
|
|
66
97
|
# Button section end ----------------------------------------------------
|
67
98
|
|
68
99
|
def breadcrumb content = nil, options = nil, html_options = nil, &block
|
69
|
-
|
100
|
+
if is_tap(content, options)
|
101
|
+
UiBibz::Ui::Core::Breadcrumb.new(content, options, html_options).tap(&block).render
|
102
|
+
else
|
103
|
+
UiBibz::Ui::Core::Breadcrumb.new(content, options, html_options, &block).render
|
104
|
+
end
|
70
105
|
end
|
71
106
|
|
72
107
|
def dropdown name, options = nil, html_options = nil, &block
|
@@ -77,12 +112,8 @@ module UiBibz::Helpers::UiCoreHelper
|
|
77
112
|
UiBibz::Ui::Core::Glyph.new(content, options, html_options, &block).render
|
78
113
|
end
|
79
114
|
|
80
|
-
def
|
81
|
-
|
82
|
-
UiBibz::Ui::Core::ProgressBar.new(percentage, options, html_options).tap(&block).render
|
83
|
-
else
|
84
|
-
UiBibz::Ui::Core::ProgressBar.new(percentage, options, html_options, &block).render
|
85
|
-
end
|
115
|
+
def progress percentage = nil, options = nil, html_options = nil, &block
|
116
|
+
UiBibz::Ui::Core::Progress.new(percentage, options, html_options, &block).render
|
86
117
|
end
|
87
118
|
|
88
119
|
def row content = nil, options = nil, html_options = nil, &block
|
@@ -93,6 +124,10 @@ module UiBibz::Helpers::UiCoreHelper
|
|
93
124
|
UiBibz::Ui::Core::Col.new(content, options, html_options, &block).render
|
94
125
|
end
|
95
126
|
|
127
|
+
def container content = nil, options = nil, html_options = nil, &block
|
128
|
+
UiBibz::Ui::Core::Container.new(content, options, html_options, &block).render
|
129
|
+
end
|
130
|
+
|
96
131
|
private
|
97
132
|
|
98
133
|
def is_tap content, options
|
@@ -25,11 +25,15 @@ module UiBibz::Helpers::UiUxHelper
|
|
25
25
|
UiBibz::Ui::Ux::TablePagination.new(options, html_options).render
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
28
|
+
def glyph_and_text glyph_args, text
|
29
|
+
"#{ glyph glyph_args } #{ text }".html_safe
|
30
|
+
end
|
31
|
+
|
32
|
+
def table_card content = nil, options = nil, html_options = nil, &block
|
29
33
|
if is_tap(content, options)
|
30
|
-
UiBibz::Ui::Ux::
|
34
|
+
UiBibz::Ui::Ux::TableCard.new(content, options, html_options).tap(&block).render
|
31
35
|
else
|
32
|
-
UiBibz::Ui::Ux::
|
36
|
+
UiBibz::Ui::Ux::TableCard.new(content, options, html_options, &block).render
|
33
37
|
end
|
34
38
|
end
|
35
39
|
# Table section end -------------------------------------------------------
|
data/lib/ui_bibz/rails/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# to load pagination in rails app
|
2
2
|
require 'will_paginate'
|
3
|
-
require 'bootstrap
|
3
|
+
require 'bootstrap'
|
4
|
+
require 'rails-assets-tether'
|
4
5
|
require "font-awesome-sass"
|
5
6
|
|
6
7
|
module UiBibz
|
@@ -11,7 +12,6 @@ module UiBibz
|
|
11
12
|
ActionView::Base.send :include, UiBibz::Helpers::UiCoreHelper
|
12
13
|
ActionView::Base.send :include, UiBibz::Helpers::UiUxHelper
|
13
14
|
ActionView::Base.send :include, UiBibz::Helpers::UtilsHelper
|
14
|
-
ActionView::Base.send :include, UiBibz::Helpers::MetaHelper
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
data/lib/ui_bibz/ui/base.rb
CHANGED
@@ -31,7 +31,7 @@ module UiBibz::Ui::Core
|
|
31
31
|
#
|
32
32
|
# ==== Examples
|
33
33
|
#
|
34
|
-
# UiBibz::Ui::Core::Alert.new(content, {
|
34
|
+
# UiBibz::Ui::Core::Alert.new(content, { state: :success, glyph: 'eye' },{ class: 'test' }).render
|
35
35
|
#
|
36
36
|
# UiBibz::Ui::Core::Alert.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
37
37
|
# content
|
@@ -54,23 +54,32 @@ module UiBibz::Ui::Core
|
|
54
54
|
|
55
55
|
# Render html tag
|
56
56
|
def render
|
57
|
-
content_tag :div,
|
57
|
+
content_tag :div, html_options do
|
58
58
|
concat glyph_and_content_html
|
59
|
-
concat close_html if
|
59
|
+
concat close_html if options[:closable]
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
private
|
64
64
|
|
65
|
+
def component_html_classes
|
66
|
+
['alert', 'alert-dismissible']
|
67
|
+
end
|
68
|
+
|
69
|
+
def component_html_options
|
70
|
+
{ role: 'alert'}
|
71
|
+
end
|
72
|
+
|
65
73
|
def close_html
|
66
74
|
content_tag :button, type: 'button', class: 'close', "data-dismiss" => "alert", "aria-label" => "Close" do
|
67
|
-
content_tag :span, "
|
75
|
+
concat content_tag :span, "×", "aria-hidden" => true
|
76
|
+
concat content_tag :span, "Close", class: "sr-only"
|
68
77
|
end
|
69
78
|
end
|
70
79
|
|
71
80
|
def state
|
72
|
-
sym =
|
73
|
-
"alert-#{
|
81
|
+
sym = options[:state] || :info
|
82
|
+
"alert-#{ sym }"
|
74
83
|
end
|
75
84
|
|
76
85
|
end
|
@@ -44,13 +44,15 @@ module UiBibz::Ui::Core
|
|
44
44
|
#
|
45
45
|
# ==== Helper
|
46
46
|
#
|
47
|
-
# breadcrumb do |b|
|
47
|
+
# breadcrumb({tap: true}) do |b|
|
48
48
|
# b.link(content, options = {}, html_options = {})
|
49
49
|
# b.link(options = {}, html_options = {}) do
|
50
50
|
# content
|
51
51
|
# end
|
52
52
|
# end
|
53
53
|
#
|
54
|
+
# breadcrumb({store: @users, link_label: name, link_url: user_path(:id)})
|
55
|
+
#
|
54
56
|
class Breadcrumb < Component
|
55
57
|
|
56
58
|
# See UiBibz::Ui::Core::Component.initialize
|
@@ -61,7 +63,8 @@ module UiBibz::Ui::Core
|
|
61
63
|
|
62
64
|
# Render html tag
|
63
65
|
def render
|
64
|
-
|
66
|
+
generate_links unless store.nil?
|
67
|
+
content_tag :ol, @links.join.html_safe, html_options
|
65
68
|
end
|
66
69
|
|
67
70
|
# Add breadcrumb link items
|
@@ -70,5 +73,37 @@ module UiBibz::Ui::Core
|
|
70
73
|
@links << BreadcrumbLink.new(content, options, html_options, &block).render
|
71
74
|
end
|
72
75
|
|
76
|
+
private
|
77
|
+
|
78
|
+
def component_html_classes
|
79
|
+
'breadcrumb'
|
80
|
+
end
|
81
|
+
|
82
|
+
def store
|
83
|
+
@options[:store]
|
84
|
+
end
|
85
|
+
|
86
|
+
def model_name
|
87
|
+
store.class.to_s
|
88
|
+
end
|
89
|
+
|
90
|
+
def link_label
|
91
|
+
@options[:link_label] || :name
|
92
|
+
end
|
93
|
+
|
94
|
+
def link_url
|
95
|
+
@options[:link_url] || '#'
|
96
|
+
end
|
97
|
+
|
98
|
+
def generate_links
|
99
|
+
@options[:store].each do |item|
|
100
|
+
if item == @options[:store].last
|
101
|
+
@links << BreadcrumbLink.new(item.send(link_label), state: :disabled).render
|
102
|
+
else
|
103
|
+
@links << BreadcrumbLink.new(item.send(link_label), url: inject_url(link_url, item)).render
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
73
108
|
end
|
74
109
|
end
|
@@ -47,14 +47,14 @@ module UiBibz::Ui::Core
|
|
47
47
|
|
48
48
|
# Render html tag
|
49
49
|
def render
|
50
|
-
content_tag :li, link_html,
|
50
|
+
content_tag :li, link_html, html_options
|
51
51
|
end
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def link_html
|
56
|
-
if
|
57
|
-
link_to glyph_and_content_html,
|
56
|
+
if options[:url]
|
57
|
+
link_to glyph_and_content_html, options[:url], options[:link_html_options]
|
58
58
|
else
|
59
59
|
glyph_and_content_html
|
60
60
|
end
|
@@ -15,9 +15,12 @@ module UiBibz::Ui::Core
|
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
17
|
# * +state+ - State of élement with symbol value:
|
18
|
-
# (+:
|
18
|
+
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
|
19
19
|
# * +size+
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
21
|
+
# * +outline+ - Boolean
|
22
|
+
# * +status+ - Symbol (+:active+, +:disabled)
|
23
|
+
# * +type+ - Symbol (+:outline)
|
21
24
|
# * +glyph+ - Add glyph with name or hash options
|
22
25
|
# * +name+ - String
|
23
26
|
# * +size+ - Integer
|
@@ -55,20 +58,50 @@ module UiBibz::Ui::Core
|
|
55
58
|
|
56
59
|
# Render html tag
|
57
60
|
def render
|
58
|
-
content_tag :button, glyph_and_content_html,
|
61
|
+
content_tag :button, glyph_and_content_html, html_options
|
59
62
|
end
|
60
63
|
|
61
|
-
|
64
|
+
protected
|
65
|
+
|
66
|
+
def component_html_classes
|
67
|
+
['btn', size, type]
|
68
|
+
end
|
69
|
+
|
70
|
+
def component_html_options
|
71
|
+
options[:toggle].nil? ? {} : { "data-toggle" => 'button', "aria-pressed" => false, "autocomplete" => "off" }
|
72
|
+
end
|
62
73
|
|
63
74
|
def state
|
64
|
-
|
65
|
-
"btn-#{
|
75
|
+
s = options[:state] || :primary
|
76
|
+
"btn-#{ s }#{ outline }"
|
77
|
+
end
|
78
|
+
|
79
|
+
def outline
|
80
|
+
"-outline" unless options[:outline].nil?
|
81
|
+
end
|
82
|
+
|
83
|
+
def toggle
|
84
|
+
end
|
85
|
+
|
86
|
+
def type
|
87
|
+
"btn-block" if options[:type] == :block
|
66
88
|
end
|
67
89
|
|
68
90
|
# :lg, :sm or :xs
|
69
91
|
def size
|
70
|
-
"btn-#{
|
92
|
+
"btn-#{ options[:size] }" if options[:size]
|
71
93
|
end
|
72
94
|
|
95
|
+
#def states
|
96
|
+
#if @states.nil?
|
97
|
+
#states = {}
|
98
|
+
#%w(success primary secondary info warning danger link).each do |s|
|
99
|
+
#states = states.merge(Hash[s.to_sym, s])
|
100
|
+
#end
|
101
|
+
#@states = states
|
102
|
+
#end
|
103
|
+
#@states
|
104
|
+
#end
|
105
|
+
|
73
106
|
end
|
74
107
|
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module UiBibz::Ui::Core
|
2
|
+
|
3
|
+
# Create a button choice
|
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
|
+
# * +type+ - Symbol (+:checkbox+, +:radio+)
|
18
|
+
# * +state+ - State of élement with symbol value:
|
19
|
+
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
20
|
+
# * +size+
|
21
|
+
# (+:xs+, +:sm+, +:lg+)
|
22
|
+
# * +url+ - String url
|
23
|
+
# * +outline+ - Boolean
|
24
|
+
# * +status+ - Symbol (+:active+, +:disabled)
|
25
|
+
# * +type+ - Symbol (+:block)
|
26
|
+
# * +name+ - String name of input checkbox
|
27
|
+
# * +id+ - String id of input checkbox
|
28
|
+
# * +input_html_options+ - Hash of input html options
|
29
|
+
# * +glyph+ - Add glyph with name or hash options
|
30
|
+
# * +name+ - String
|
31
|
+
# * +size+ - Integer
|
32
|
+
# * +type+ - Symbol
|
33
|
+
#
|
34
|
+
# ==== Signatures
|
35
|
+
#
|
36
|
+
# UiBibz::Ui::Core::ButtonChoice.new(content, options = nil, html_options = nil)
|
37
|
+
#
|
38
|
+
# UiBibz::Ui::Core::ButtonChoice.new(options = nil, html_options = nil) do
|
39
|
+
# content
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# ==== Examples
|
43
|
+
#
|
44
|
+
# UiBibz::Ui::Core::ButtonChoice.new('test', status: :active)
|
45
|
+
#
|
46
|
+
# UiBibz::Ui::Core::ButtonChoice.new({id: 'toto', input_html_options: { class: 'toto'}}, { class: 'lable-class'}) do
|
47
|
+
# test
|
48
|
+
# end.render
|
49
|
+
#
|
50
|
+
# ==== Helper
|
51
|
+
#
|
52
|
+
# button_choice(content, options = {}, html_options = {})
|
53
|
+
#
|
54
|
+
# button_choice(options = {}, html_options = {}) do
|
55
|
+
# content
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
class ButtonChoice < UiBibz::Ui::Core::Button
|
59
|
+
|
60
|
+
# See UiBibz::Ui::Core::Component.initialize
|
61
|
+
def initialize content = nil, options = nil, html_options = nil, &block
|
62
|
+
super
|
63
|
+
end
|
64
|
+
|
65
|
+
# Render html tag
|
66
|
+
def render
|
67
|
+
content_tag :label, html_options do
|
68
|
+
concat tag(:input,input_options)
|
69
|
+
concat @content
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def component_html_classes
|
76
|
+
['btn', size]
|
77
|
+
end
|
78
|
+
|
79
|
+
def input_options
|
80
|
+
{ type: type, autocomplete: :off }.merge(checked).merge(name).merge(id).merge(input_html_options)
|
81
|
+
end
|
82
|
+
|
83
|
+
def checked
|
84
|
+
@options[:status] == :active ? { checked: :checked } : {}
|
85
|
+
end
|
86
|
+
|
87
|
+
def name
|
88
|
+
@options[:name].nil? ? {} : { name: @options[:name] }
|
89
|
+
end
|
90
|
+
|
91
|
+
def id
|
92
|
+
@options[:id].nil? ? {} : { id: @options[:id] }
|
93
|
+
end
|
94
|
+
|
95
|
+
def input_html_options
|
96
|
+
@options[:input_html_options].nil? ? {} : @options[:input_html_options]
|
97
|
+
end
|
98
|
+
|
99
|
+
def type
|
100
|
+
@options[:type] || :checkbox
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
end
|