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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +10 -7
  5. data/README.md +8 -1042
  6. data/app/assets/javascripts/multi_column.coffee +45 -0
  7. data/app/assets/javascripts/{ui_bibz.js.coffee → ui_bibz.coffee} +16 -3
  8. data/app/assets/stylesheets/fix-bootstrap-4.sass +2 -0
  9. data/app/assets/stylesheets/ui_bibz.sass +22 -9
  10. data/app/inputs/custom_inputs/date_picker_input.rb +10 -0
  11. data/app/inputs/custom_inputs/date_picker_input_old.rb +61 -0
  12. data/app/inputs/custom_inputs/multi_column_input.rb +18 -0
  13. data/app/inputs/custom_inputs/multi_select_input.rb +15 -0
  14. data/app/inputs/custom_inputs/surround_input.rb +10 -0
  15. data/doc/UiBibz.html +2 -2
  16. data/doc/UiBibz/Concerns.html +1 -1
  17. data/doc/UiBibz/Concerns/Models.html +1 -1
  18. data/doc/UiBibz/Concerns/Models/Searchable.html +1 -1
  19. data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +5 -5
  20. data/doc/UiBibz/Helpers.html +1 -1
  21. data/doc/UiBibz/Helpers/MetaHelper.html +1 -1
  22. data/doc/UiBibz/Helpers/UiCoreHelper.html +1 -1
  23. data/doc/UiBibz/Helpers/UiUxHelper.html +1 -1
  24. data/doc/UiBibz/Helpers/UtilsHelper.html +1 -1
  25. data/doc/UiBibz/Rails.html +1 -1
  26. data/doc/UiBibz/Rails/Engine.html +1 -1
  27. data/doc/UiBibz/Ui.html +1 -1
  28. data/doc/UiBibz/Ui/Base.html +1 -1
  29. data/doc/UiBibz/Ui/Core.html +1 -1
  30. data/doc/UiBibz/Ui/Core/Alert.html +1 -1
  31. data/doc/UiBibz/Ui/Core/Bar.html +1 -1
  32. data/doc/UiBibz/Ui/Core/Breadcrumb.html +1 -1
  33. data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +1 -1
  34. data/doc/UiBibz/Ui/Core/Button.html +1 -1
  35. data/doc/UiBibz/Ui/Core/ButtonDropdown.html +1 -1
  36. data/doc/UiBibz/Ui/Core/ButtonGroup.html +1 -1
  37. data/doc/UiBibz/Ui/Core/ButtonLink.html +1 -1
  38. data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +1 -1
  39. data/doc/UiBibz/Ui/Core/Col.html +1 -1
  40. data/doc/UiBibz/Ui/Core/Component.html +1 -1
  41. data/doc/UiBibz/Ui/Core/Dropdown.html +1 -1
  42. data/doc/UiBibz/Ui/Core/DropdownDivider.html +1 -1
  43. data/doc/UiBibz/Ui/Core/DropdownHeader.html +1 -1
  44. data/doc/UiBibz/Ui/Core/DropdownLink.html +1 -1
  45. data/doc/UiBibz/Ui/Core/Glyph.html +1 -1
  46. data/doc/UiBibz/Ui/Core/Jumbotron.html +1 -1
  47. data/doc/UiBibz/Ui/Core/Label.html +1 -1
  48. data/doc/UiBibz/Ui/Core/List.html +1 -1
  49. data/doc/UiBibz/Ui/Core/ListGroup.html +1 -1
  50. data/doc/UiBibz/Ui/Core/Modal.html +1 -1
  51. data/doc/UiBibz/Ui/Core/ModalBody.html +1 -1
  52. data/doc/UiBibz/Ui/Core/ModalFooter.html +1 -1
  53. data/doc/UiBibz/Ui/Core/ModalHeader.html +1 -1
  54. data/doc/UiBibz/Ui/Core/Nav.html +1 -1
  55. data/doc/UiBibz/Ui/Core/NavDropdown.html +1 -1
  56. data/doc/UiBibz/Ui/Core/NavLink.html +1 -1
  57. data/doc/UiBibz/Ui/Core/Navbar.html +1 -1
  58. data/doc/UiBibz/Ui/Core/NavbarForm.html +1 -1
  59. data/doc/UiBibz/Ui/Core/NavbarNav.html +1 -1
  60. data/doc/UiBibz/Ui/Core/NavbarText.html +1 -1
  61. data/doc/UiBibz/Ui/Core/Panel.html +1 -1
  62. data/doc/UiBibz/Ui/Core/ProgressBar.html +1 -1
  63. data/doc/UiBibz/Ui/Core/Row.html +1 -1
  64. data/doc/UiBibz/Ui/Core/Stars.html +1 -1
  65. data/doc/UiBibz/Ui/Ux.html +1 -1
  66. data/doc/UiBibz/Ui/Ux/Actionable.html +1 -1
  67. data/doc/UiBibz/Ui/Ux/Actions.html +1 -1
  68. data/doc/UiBibz/Ui/Ux/Column.html +1 -1
  69. data/doc/UiBibz/Ui/Ux/Columns.html +1 -1
  70. data/doc/UiBibz/Ui/Ux/Grid.html +1 -1
  71. data/doc/UiBibz/Ui/Ux/Paginable.html +1 -1
  72. data/doc/UiBibz/Ui/Ux/Searchable.html +1 -1
  73. data/doc/UiBibz/Ui/Ux/Sortable.html +1 -1
  74. data/doc/UiBibz/Ui/Ux/Store.html +18 -70
  75. data/doc/UiBibz/Ui/Ux/Table.html +1 -1
  76. data/doc/UiBibz/Ui/Ux/TablePagination.html +1 -1
  77. data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +1 -1
  78. data/doc/UiBibz/Ui/Ux/TablePanel.html +1 -1
  79. data/doc/UiBibz/Ui/Ux/TableSearchField.html +1 -1
  80. data/doc/UiBibz/Utils.html +1 -1
  81. data/doc/UiBibz/Utils/Internationalization.html +1 -1
  82. data/doc/_index.html +1 -1
  83. data/doc/file.README.html +47 -51
  84. data/doc/index.html +47 -51
  85. data/doc/method_list.html +69 -75
  86. data/doc/top-level-namespace.html +1 -1
  87. data/lib/ui_bibz.rb +14 -7
  88. data/lib/ui_bibz/helpers/ui_core_helper.rb +46 -11
  89. data/lib/ui_bibz/helpers/ui_ux_helper.rb +7 -3
  90. data/lib/ui_bibz/rails/engine.rb +2 -2
  91. data/lib/ui_bibz/ui/base.rb +5 -0
  92. data/lib/ui_bibz/ui/core/alert.rb +15 -6
  93. data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +37 -2
  94. data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +3 -3
  95. data/lib/ui_bibz/ui/core/button/button.rb +39 -6
  96. data/lib/ui_bibz/ui/core/button/button_choice.rb +104 -0
  97. data/lib/ui_bibz/ui/core/button/button_dropdown.rb +15 -2
  98. data/lib/ui_bibz/ui/core/button/button_group.rb +17 -5
  99. data/lib/ui_bibz/ui/core/button/button_link.rb +8 -11
  100. data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +15 -5
  101. data/lib/ui_bibz/ui/core/card/card.rb +158 -0
  102. data/lib/ui_bibz/ui/core/card/card_column.rb +60 -0
  103. data/lib/ui_bibz/ui/core/card/card_deck.rb +62 -0
  104. data/lib/ui_bibz/ui/core/card/card_group.rb +60 -0
  105. data/lib/ui_bibz/ui/core/card/components/block/card_block_link.rb +51 -0
  106. data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +51 -0
  107. data/lib/ui_bibz/ui/core/card/components/block/card_block_title.rb +51 -0
  108. data/lib/ui_bibz/ui/core/card/components/card_block.rb +67 -0
  109. data/lib/ui_bibz/ui/core/card/components/card_footer.rb +55 -0
  110. data/lib/ui_bibz/ui/core/card/components/card_header.rb +51 -0
  111. data/lib/ui_bibz/ui/core/card/components/card_image.rb +57 -0
  112. data/lib/ui_bibz/ui/core/card/components/card_list_group.rb +47 -0
  113. data/lib/ui_bibz/ui/core/component.rb +78 -32
  114. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_divider.rb +1 -1
  115. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb +11 -1
  116. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +11 -4
  117. data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +14 -6
  118. data/lib/ui_bibz/ui/core/glyph.rb +22 -4
  119. data/lib/ui_bibz/ui/core/input/date_picker_field.rb +125 -0
  120. data/lib/ui_bibz/ui/core/input/multi_column_field.rb +77 -0
  121. data/lib/ui_bibz/ui/core/input/multi_select_field.rb +89 -0
  122. data/lib/ui_bibz/ui/core/input/surround_field.rb +74 -0
  123. data/lib/ui_bibz/ui/core/jumbotron.rb +10 -6
  124. data/lib/ui_bibz/ui/core/label.rb +13 -3
  125. data/lib/ui_bibz/ui/core/{col.rb → layout/col.rb} +38 -18
  126. data/lib/ui_bibz/ui/core/layout/container.rb +65 -0
  127. data/lib/ui_bibz/ui/core/{row.rb → layout/row.rb} +7 -1
  128. data/lib/ui_bibz/ui/core/list/components/list.rb +26 -11
  129. data/lib/ui_bibz/ui/core/list/components/list_body.rb +36 -0
  130. data/lib/ui_bibz/ui/core/list/components/list_header.rb +36 -0
  131. data/lib/ui_bibz/ui/core/list/list_group.rb +7 -3
  132. data/lib/ui_bibz/ui/core/modal/components/modal_body.rb +7 -1
  133. data/lib/ui_bibz/ui/core/modal/components/modal_footer.rb +7 -1
  134. data/lib/ui_bibz/ui/core/modal/components/modal_header.rb +5 -2
  135. data/lib/ui_bibz/ui/core/modal/modal.rb +13 -2
  136. data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +6 -2
  137. data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +7 -18
  138. data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +45 -0
  139. data/lib/ui_bibz/ui/core/nav/components/nav_link_list.rb +35 -0
  140. data/lib/ui_bibz/ui/core/nav/components/navbar_brand.rb +40 -0
  141. data/lib/ui_bibz/ui/core/nav/components/navbar_form.rb +2 -2
  142. data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
  143. data/lib/ui_bibz/ui/core/nav/components/navbar_text.rb +6 -2
  144. data/lib/ui_bibz/ui/core/nav/nav.rb +22 -4
  145. data/lib/ui_bibz/ui/core/nav/navbar.rb +26 -17
  146. data/lib/ui_bibz/ui/core/progress.rb +98 -0
  147. data/lib/ui_bibz/ui/core/stars.rb +13 -5
  148. data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
  149. data/lib/ui_bibz/ui/ux/table/components/store.rb +4 -4
  150. data/lib/ui_bibz/ui/ux/table/extensions/actionable.rb +15 -13
  151. data/lib/ui_bibz/ui/ux/table/extensions/paginable.rb +7 -6
  152. data/lib/ui_bibz/ui/ux/table/extensions/searchable.rb +6 -5
  153. data/lib/ui_bibz/ui/ux/table/table.rb +14 -7
  154. data/lib/ui_bibz/ui/ux/table/{table_panel.rb → table_card.rb} +34 -36
  155. data/lib/ui_bibz/ui/ux/table/table_search_field.rb +19 -11
  156. data/lib/ui_bibz/version.rb +1 -1
  157. data/test/ui/breadcrumb_test.rb +25 -0
  158. data/test/ui/button_test.rb +44 -4
  159. data/test/ui/card_test.rb +106 -0
  160. data/test/ui/col_test.rb +22 -0
  161. data/test/ui/dropdown_test.rb +1 -1
  162. data/test/ui/inputs_test.rb +81 -0
  163. data/test/ui/list_group_test.rb +1 -1
  164. data/test/ui/nav_test.rb +4 -5
  165. data/test/ui/table_test.rb +11 -11
  166. data/test/ui_helper_test.rb +29 -18
  167. data/ui_bibz.gemspec +3 -3
  168. data/vendor/assets/images/switch.png +0 -0
  169. data/vendor/assets/javascripts/bootstrap-4.0.0-alpha.min.js +7 -0
  170. data/vendor/assets/javascripts/bootstrap-multiselect.min.js +1180 -0
  171. data/vendor/assets/javascripts/jquery.multi-select.min.js +1 -0
  172. data/vendor/assets/javascripts/jquery.quicksearch.min.js +1 -0
  173. data/vendor/assets/stylesheets/bootstrap-4.0.0-alpha.min.css +6 -0
  174. data/vendor/assets/stylesheets/bootstrap-datepicker3.min.css +1 -1
  175. data/vendor/assets/stylesheets/bootstrap-multiselect.min.css +1 -0
  176. data/vendor/assets/stylesheets/multi-select.min.css +1 -0
  177. metadata +70 -24
  178. data/.yardoc/checksums +0 -59
  179. data/.yardoc/object_types +0 -0
  180. data/.yardoc/objects/root.dat +0 -0
  181. data/.yardoc/proxy_types +0 -0
  182. data/lib/ui_bibz/helpers/meta_helper.rb +0 -32
  183. data/lib/ui_bibz/ui/core/panel.rb +0 -138
  184. data/lib/ui_bibz/ui/core/progress_bar/components/bar.rb +0 -105
  185. data/lib/ui_bibz/ui/core/progress_bar/progress_bar.rb +0 -94
  186. data/lib/ui_bibz/ui/ux/grid.rb +0 -121
  187. data/test/ui/grid_test.rb +0 -46
  188. 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 Wed Jan 13 16:47:02 2016 by
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 :Col, "ui_bibz/ui/core/col"
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 :Panel, "ui_bibz/ui/core/panel"
33
- autoload :ProgressBar, "ui_bibz/ui/core/progress_bar/progress_bar"
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 :TablePanel, "ui_bibz/ui/ux/table/table_panel"
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 panel content = nil, options = nil, html_options = nil, &block
3
+ def card content = nil, options = nil, html_options = nil, &block
4
4
  if is_tap(content, options)
5
- UiBibz::Ui::Core::Panel.new(content, options, html_options).tap(&block).render
5
+ UiBibz::Ui::Core::Card.new(content, options, html_options).tap(&block).render
6
6
  else
7
- UiBibz::Ui::Core::Panel.new(content, options, html_options, &block).render
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
- UiBibz::Ui::Core::Breadcrumb.new(content, options, html_options).tap(&block).render
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 progress_bar percentage = nil, options = nil, html_options = nil, &block
81
- if is_tap(percentage, options)
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 table_panel content = nil, options = nil, html_options = nil, &block
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::TablePanel.new(content, options, html_options).tap(&block).render
34
+ UiBibz::Ui::Ux::TableCard.new(content, options, html_options).tap(&block).render
31
35
  else
32
- UiBibz::Ui::Ux::TablePanel.new(content, options, html_options, &block).render
36
+ UiBibz::Ui::Ux::TableCard.new(content, options, html_options, &block).render
33
37
  end
34
38
  end
35
39
  # Table section end -------------------------------------------------------
@@ -1,6 +1,7 @@
1
1
  # to load pagination in rails app
2
2
  require 'will_paginate'
3
- require 'bootstrap-sass'
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
@@ -10,5 +10,10 @@ module UiBibz::Ui
10
10
  def i18n_set? key
11
11
  I18n.t key, :raise => true rescue false
12
12
  end
13
+
14
+ # Add "id" in url to match with current record
15
+ def inject_url url, record
16
+ url.gsub(/(\/id\/?)/, "/#{ record.id }/")
17
+ end
13
18
  end
14
19
  end
@@ -31,7 +31,7 @@ module UiBibz::Ui::Core
31
31
  #
32
32
  # ==== Examples
33
33
  #
34
- # UiBibz::Ui::Core::Alert.new(content, { type: :success, glyph: 'eye' },{ class: 'test' }).render
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, class_and_html_options('alert').merge({ role: 'alert'}) do
57
+ content_tag :div, html_options do
58
58
  concat glyph_and_content_html
59
- concat close_html if @options[:close]
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, "x", "aria-hidden" => true
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 = @options[:state] || :info
73
- "alert-#{ states[sym] }"
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
- content_tag :ol, @links.join.html_safe, class_and_html_options("breadcrumb")
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, class_and_html_options
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 @options[:url]
57
- link_to glyph_and_content_html, @options[:url], @options[:link_html_options]
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
- # (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
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, class_and_html_options(['btn', size])
61
+ content_tag :button, glyph_and_content_html, html_options
59
62
  end
60
63
 
61
- private
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
- sym = @options[:state] || :default
65
- "btn-#{ states[sym] }"
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-#{ @options[:size] }" if @options[:size]
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