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.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -7
  3. data/app/assets/stylesheets/table.sass +2 -0
  4. data/app/assets/stylesheets/ui_bibz.sass +0 -2
  5. data/lib/ui_bibz/ui/core/alert.rb +4 -4
  6. data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +2 -2
  7. data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +2 -2
  8. data/lib/ui_bibz/ui/core/button/button.rb +10 -10
  9. data/lib/ui_bibz/ui/core/button/button_choice.rb +5 -5
  10. data/lib/ui_bibz/ui/core/button/button_dropdown.rb +3 -3
  11. data/lib/ui_bibz/ui/core/button/button_group.rb +5 -1
  12. data/lib/ui_bibz/ui/core/button/button_link.rb +2 -2
  13. data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +5 -5
  14. data/lib/ui_bibz/ui/core/card/card.rb +4 -4
  15. data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +1 -1
  16. data/lib/ui_bibz/ui/core/component.rb +7 -7
  17. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +2 -2
  18. data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +6 -6
  19. data/lib/ui_bibz/ui/core/glyph.rb +3 -3
  20. data/lib/ui_bibz/ui/core/input/autocomplete_field.rb +7 -1
  21. data/lib/ui_bibz/ui/core/input/dropdown_select_field.rb +2 -2
  22. data/lib/ui_bibz/ui/core/input/formula_field.rb +1 -1
  23. data/lib/ui_bibz/ui/core/input/multi_select_field.rb +2 -2
  24. data/lib/ui_bibz/ui/core/input/surround_field.rb +9 -1
  25. data/lib/ui_bibz/ui/core/input/switch_field.rb +4 -4
  26. data/lib/ui_bibz/ui/core/label.rb +4 -4
  27. data/lib/ui_bibz/ui/core/list/components/list.rb +7 -7
  28. data/lib/ui_bibz/ui/core/list/list_group.rb +5 -5
  29. data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +2 -2
  30. data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +3 -3
  31. data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +1 -1
  32. data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
  33. data/lib/ui_bibz/ui/core/nav/nav.rb +1 -1
  34. data/lib/ui_bibz/ui/core/nav/navbar.rb +3 -3
  35. data/lib/ui_bibz/ui/core/progress.rb +5 -5
  36. data/lib/ui_bibz/ui/core/stars.rb +3 -3
  37. data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
  38. data/lib/ui_bibz/ui/ux/table/components/as.rb +8 -4
  39. data/lib/ui_bibz/ui/ux/table/components/column.rb +17 -16
  40. data/lib/ui_bibz/ui/ux/table/components/thead.rb +4 -4
  41. data/lib/ui_bibz/ui/ux/table/table.rb +8 -8
  42. data/lib/ui_bibz/ui/ux/table/table_card.rb +4 -4
  43. data/lib/ui_bibz/version.rb +1 -1
  44. data/test/dummy/db/schema.rb +1 -1
  45. data/test/ui/breadcrumb_test.rb +2 -2
  46. data/test/ui/button_test.rb +24 -24
  47. data/test/ui/card_test.rb +5 -5
  48. data/test/ui/component_test.rb +2 -2
  49. data/test/ui/dropdown_test.rb +1 -1
  50. data/test/ui/input_switch_field_test.rb +3 -3
  51. data/test/ui/inputs_test.rb +5 -5
  52. data/test/ui/list_group_test.rb +5 -5
  53. data/test/ui/nav_test.rb +3 -3
  54. data/test/ui/stars_test.rb +2 -2
  55. data/test/ui/table_test.rb +7 -7
  56. data/test/ui_helper_test.rb +16 -16
  57. data/ui_bibz.gemspec +2 -2
  58. metadata +5 -109
  59. data/doc/UiBibz.html +0 -129
  60. data/doc/UiBibz/Concerns.html +0 -115
  61. data/doc/UiBibz/Concerns/Models.html +0 -115
  62. data/doc/UiBibz/Concerns/Models/Searchable.html +0 -120
  63. data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +0 -174
  64. data/doc/UiBibz/Helpers.html +0 -115
  65. data/doc/UiBibz/Helpers/MetaHelper.html +0 -273
  66. data/doc/UiBibz/Helpers/UiCoreHelper.html +0 -1234
  67. data/doc/UiBibz/Helpers/UiUxHelper.html +0 -463
  68. data/doc/UiBibz/Helpers/UtilsHelper.html +0 -187
  69. data/doc/UiBibz/Rails.html +0 -115
  70. data/doc/UiBibz/Rails/Engine.html +0 -123
  71. data/doc/UiBibz/Ui.html +0 -119
  72. data/doc/UiBibz/Ui/Base.html +0 -304
  73. data/doc/UiBibz/Ui/Core.html +0 -128
  74. data/doc/UiBibz/Ui/Core/Alert.html +0 -383
  75. data/doc/UiBibz/Ui/Core/Bar.html +0 -372
  76. data/doc/UiBibz/Ui/Core/Breadcrumb.html +0 -442
  77. data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +0 -369
  78. data/doc/UiBibz/Ui/Core/Button.html +0 -380
  79. data/doc/UiBibz/Ui/Core/ButtonDropdown.html +0 -401
  80. data/doc/UiBibz/Ui/Core/ButtonGroup.html +0 -372
  81. data/doc/UiBibz/Ui/Core/ButtonLink.html +0 -382
  82. data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +0 -403
  83. data/doc/UiBibz/Ui/Core/Col.html +0 -373
  84. data/doc/UiBibz/Ui/Core/Component.html +0 -1087
  85. data/doc/UiBibz/Ui/Core/Dropdown.html +0 -663
  86. data/doc/UiBibz/Ui/Core/DropdownDivider.html +0 -301
  87. data/doc/UiBibz/Ui/Core/DropdownHeader.html +0 -355
  88. data/doc/UiBibz/Ui/Core/DropdownLink.html +0 -376
  89. data/doc/UiBibz/Ui/Core/DropdownList.html +0 -382
  90. data/doc/UiBibz/Ui/Core/Glyph.html +0 -385
  91. data/doc/UiBibz/Ui/Core/Jumbotron.html +0 -379
  92. data/doc/UiBibz/Ui/Core/Label.html +0 -379
  93. data/doc/UiBibz/Ui/Core/List.html +0 -528
  94. data/doc/UiBibz/Ui/Core/ListGroup.html +0 -474
  95. data/doc/UiBibz/Ui/Core/Modal.html +0 -543
  96. data/doc/UiBibz/Ui/Core/ModalBody.html +0 -353
  97. data/doc/UiBibz/Ui/Core/ModalFooter.html +0 -353
  98. data/doc/UiBibz/Ui/Core/ModalHeader.html +0 -359
  99. data/doc/UiBibz/Ui/Core/Nav.html +0 -515
  100. data/doc/UiBibz/Ui/Core/NavDropdown.html +0 -391
  101. data/doc/UiBibz/Ui/Core/NavLink.html +0 -364
  102. data/doc/UiBibz/Ui/Core/Navbar.html +0 -646
  103. data/doc/UiBibz/Ui/Core/NavbarForm.html +0 -364
  104. data/doc/UiBibz/Ui/Core/NavbarNav.html +0 -302
  105. data/doc/UiBibz/Ui/Core/NavbarText.html +0 -355
  106. data/doc/UiBibz/Ui/Core/Panel.html +0 -617
  107. data/doc/UiBibz/Ui/Core/ProgressBar.html +0 -462
  108. data/doc/UiBibz/Ui/Core/Row.html +0 -350
  109. data/doc/UiBibz/Ui/Core/Stars.html +0 -371
  110. data/doc/UiBibz/Ui/Ux.html +0 -128
  111. data/doc/UiBibz/Ui/Ux/Actionable.html +0 -478
  112. data/doc/UiBibz/Ui/Ux/Actions.html +0 -602
  113. data/doc/UiBibz/Ui/Ux/Column.html +0 -1249
  114. data/doc/UiBibz/Ui/Ux/Columns.html +0 -338
  115. data/doc/UiBibz/Ui/Ux/Grid.html +0 -485
  116. data/doc/UiBibz/Ui/Ux/Paginable.html +0 -381
  117. data/doc/UiBibz/Ui/Ux/Searchable.html +0 -376
  118. data/doc/UiBibz/Ui/Ux/Sortable.html +0 -300
  119. data/doc/UiBibz/Ui/Ux/Store.html +0 -1176
  120. data/doc/UiBibz/Ui/Ux/Table.html +0 -694
  121. data/doc/UiBibz/Ui/Ux/TableAction.html +0 -309
  122. data/doc/UiBibz/Ui/Ux/TablePagination.html +0 -342
  123. data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +0 -348
  124. data/doc/UiBibz/Ui/Ux/TablePanel.html +0 -680
  125. data/doc/UiBibz/Ui/Ux/TableSearchField.html +0 -304
  126. data/doc/UiBibz/Utils.html +0 -115
  127. data/doc/UiBibz/Utils/Internationalization.html +0 -262
  128. data/doc/_index.html +0 -706
  129. data/doc/class_list.html +0 -58
  130. data/doc/css/common.css +0 -1
  131. data/doc/css/full_list.css +0 -57
  132. data/doc/css/style.css +0 -339
  133. data/doc/file.README.html +0 -1261
  134. data/doc/file_list.html +0 -60
  135. data/doc/frames.html +0 -26
  136. data/doc/images/alert.png +0 -0
  137. data/doc/images/breadcrumb.png +0 -0
  138. data/doc/images/button.png +0 -0
  139. data/doc/images/button_dropdown.png +0 -0
  140. data/doc/images/button_group.png +0 -0
  141. data/doc/images/button_link.png +0 -0
  142. data/doc/images/button_split_dropdown.png +0 -0
  143. data/doc/images/etiquette.png +0 -0
  144. data/doc/images/glyph.png +0 -0
  145. data/doc/images/list.png +0 -0
  146. data/doc/images/modal.png +0 -0
  147. data/doc/images/nav.png +0 -0
  148. data/doc/images/navbar.png +0 -0
  149. data/doc/images/panel.png +0 -0
  150. data/doc/images/progress_bar.png +0 -0
  151. data/doc/images/stars.png +0 -0
  152. data/doc/images/table.png +0 -0
  153. data/doc/images/table_pagination_per_page.png +0 -0
  154. data/doc/images/table_panel.png +0 -0
  155. data/doc/images/table_search_field.png +0 -0
  156. data/doc/images/ui-bibz-logo-without-border.gif +0 -0
  157. data/doc/images/ui-bibz-logo.gif +0 -0
  158. data/doc/index.html +0 -1261
  159. data/doc/js/app.js +0 -219
  160. data/doc/js/full_list.js +0 -181
  161. data/doc/js/jquery.js +0 -4
  162. data/doc/method_list.html +0 -1329
  163. data/doc/top-level-namespace.html +0 -112
@@ -14,7 +14,7 @@ module UiBibz::Ui::Ux
14
14
  #
15
15
  # You can add HTML attributes using the +html_options+.
16
16
  # You can pass arguments in options attribute:
17
- # * +state+ - State of élement with symbol value:
17
+ # * +status+ - status of élement with symbol value:
18
18
  # (+:inverse+, +:default+)
19
19
  #
20
20
  # ==== Signatures
@@ -27,7 +27,7 @@ module UiBibz::Ui::Ux
27
27
  #
28
28
  # ==== Examples
29
29
  #
30
- # UiBibz::Ui::Ux::Thead.new(content, { state: :inverse }).render
30
+ # UiBibz::Ui::Ux::Thead.new(content, { status: :inverse }).render
31
31
  #
32
32
  class Thead < UiBibz::Ui::Core::Component
33
33
 
@@ -43,8 +43,8 @@ module UiBibz::Ui::Ux
43
43
 
44
44
  private
45
45
 
46
- def state
47
- "thead-#{ @options[:state] }" unless @options[:state].nil?
46
+ def status
47
+ "thead-#{ @options[:status] }" unless @options[:status].nil?
48
48
  end
49
49
 
50
50
  end
@@ -32,11 +32,11 @@ module UiBibz::Ui::Ux
32
32
  # * +sortable+ - Boolean
33
33
  # * +searchable+ - Boolean
34
34
  # * +default_actions+ - Boolean
35
- # * +state+
35
+ # * +status+
36
36
  # (+:inverse+, +:default+, +:success+, +:primary+, +:secondary+, +:info+,
37
37
  # +:danger+, +:warning+)
38
38
  # * +thead+ - Hash
39
- # (+state+)
39
+ # (+status+)
40
40
  # (+:inverse+, +:default+)
41
41
  # * +bordered+ - Boolean
42
42
  # * +hoverable+ - Boolean
@@ -67,10 +67,10 @@ module UiBibz::Ui::Ux
67
67
  # c.column :id, { name: '#' }
68
68
  # c.column :name_fr', { link: edit_user_path(:id), order: 2 }
69
69
  # c.column :name_en'
70
- # c.column :status_id, { name: 'Status', format: lambda{ |records, record| "Test #{ record.id}"} }
70
+ # c.column :state_id, { name: 'state', format: lambda{ |records, record| "Test #{ record.id}"} }
71
71
  # end
72
72
  # t.actions do |a|
73
- # a.link 'toto', url: users_path(:id), glyph: 'eye'
73
+ # a.link 'state', url: users_path(:id), glyph: 'eye'
74
74
  # a.divider
75
75
  # a.link 'momo', url: users_path(:id), glyph: 'home'
76
76
  # end
@@ -184,9 +184,9 @@ module UiBibz::Ui::Ux
184
184
  content = content.strftime(col.date_format) unless col.date_format.nil?
185
185
  content = link_to content, action.inject_url(col.link, record) unless col.link.nil?
186
186
  content = col.format.call(@store.records, record) unless col.format.nil?
187
- content = As.new(col, record, content).render unless col.as.nil?
188
- content
189
187
  end
188
+ content = As.new(col, record, content, @options).render unless col.as.nil?
189
+ content
190
190
  end
191
191
 
192
192
  private
@@ -195,8 +195,8 @@ module UiBibz::Ui::Ux
195
195
  ["table", striped, bordered, hoverable, size, responsive, reflow]
196
196
  end
197
197
 
198
- def state
199
- "table-#{ @options[:state] }" unless @options[:state].nil?
198
+ def status
199
+ "table-#{ @options[:status] }" unless @options[:status].nil?
200
200
  end
201
201
 
202
202
  def striped
@@ -22,10 +22,10 @@ module UiBibz::Ui::Ux
22
22
  # * +actionable+ - Boolean
23
23
  # * +sortable+ - Boolean
24
24
  # * +searchable+ - Boolean
25
- # * +state+
25
+ # * +status+
26
26
  # (+:inverse+)
27
27
  # * +thead+ - Hash
28
- # (+state+)
28
+ # (+status+)
29
29
  # (+inverse+, +default+)
30
30
  # * +bordered+ - Boolean
31
31
  # * +hoverable+ - Boolean
@@ -58,10 +58,10 @@ module UiBibz::Ui::Ux
58
58
  # c.column :id, { name: '# }, { class: 'column-id' }
59
59
  # c.column :name_fr, { name: 'Name FR', link: edit_user_path(:id), order: 2 }
60
60
  # c.column :name_en
61
- # c.column :status_id, { name: 'Status', format: lambda{ |records, record| "Test #{ record.id}"} }
61
+ # c.column :state_id, { name: 'state', format: lambda{ |records, record| "Test #{ record.id}"} }
62
62
  # end
63
63
  # t.actions do |a|
64
- # a.link 'toto', url: users_path(:id), glyph: 'eye'
64
+ # a.link 'state', url: users_path(:id), glyph: 'eye'
65
65
  # a.divider
66
66
  # a.link 'momo', url: users_path(:id), glyph: 'home'
67
67
  # end
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "2.0.0.alpha10"
2
+ VERSION = "2.0.0.alpha11"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
2
+ # This file is auto-generated from the current status of the database. Instead
3
3
  # of editing this file, please use the migrations feature of Active Record to
4
4
  # incrementally modify your database, and then regenerate this schema definition.
5
5
  #
@@ -5,9 +5,9 @@ class NavTest < ActionView::TestCase
5
5
  test 'breadcrumb' do
6
6
  actual = UiBibz::Ui::Core::Breadcrumb.new.tap do |b|
7
7
  b.link 'Home', url: '#home', glyph: 'home'
8
- b.link 'Toto', { url: '#toto', status: :active }
8
+ b.link 'state', { url: '#state', state: :active }
9
9
  end.render
10
- expected = "<ol class=\"breadcrumb\"><li><a href=\"#home\"><i class=\"glyph fa fa-home\"></i> Home</a></li><li class=\"active\"><a href=\"#toto\">Toto</a></li></ol>"
10
+ expected = "<ol class=\"breadcrumb\"><li><a href=\"#home\"><i class=\"glyph fa fa-home\"></i> Home</a></li><li class=\"active\"><a href=\"#state\">state</a></li></ol>"
11
11
 
12
12
  assert_equal expected, actual
13
13
  end
@@ -4,91 +4,91 @@ include UiBibz::Helpers
4
4
  class ButtonTest < ActionView::TestCase
5
5
 
6
6
  test "button" do
7
- actual = UiBibz::Ui::Core::Button.new('toto', state: :success).render
8
- expected = "<button class=\"btn-success btn\">toto</button>"
7
+ actual = UiBibz::Ui::Core::Button.new('state', status: :success).render
8
+ expected = "<button class=\"btn-success btn\">state</button>"
9
9
 
10
10
  assert_equal expected, actual
11
11
  end
12
12
 
13
13
  test 'button group' do
14
14
  actual = UiBibz::Ui::Core::ButtonGroup.new position: :vertical do
15
- UiBibz::Ui::Core::Button.new('toto').render
15
+ UiBibz::Ui::Core::Button.new('state').render
16
16
  end.render
17
- expected = "<div class=\"btn-group btn-group-vertical\" role=\"group\"><button class=\"btn-primary btn\">toto</button></div>"
17
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-vertical\" role=\"group\"><button class=\"btn-primary btn\">state</button></div>"
18
18
 
19
19
  assert_equal expected, actual
20
20
  end
21
21
 
22
22
  test 'link button' do
23
- actual = UiBibz::Ui::Core::ButtonLink.new('Toto', { url: users_path, state: :danger, glyph: 'add'}).render
24
- expected = "<a class=\"btn-danger btn\" href=\"/users\"><i class=\"glyph fa fa-add\"></i> Toto</a>"
23
+ actual = UiBibz::Ui::Core::ButtonLink.new('state', { url: users_path, status: :danger, glyph: 'add'}).render
24
+ expected = "<a class=\"btn-danger btn\" href=\"/users\"><i class=\"glyph fa fa-add\"></i> state</a>"
25
25
 
26
26
  assert_equal expected, actual
27
27
  end
28
28
 
29
29
  test 'button outline' do
30
- actual = UiBibz::Ui::Core::Button.new('toto', state: :success, outline: true).render
31
- expected = "<button class=\"btn-success-outline btn\">toto</button>"
30
+ actual = UiBibz::Ui::Core::Button.new('state', status: :success, outline: true).render
31
+ expected = "<button class=\"btn-success-outline btn\">state</button>"
32
32
 
33
33
  assert_equal expected, actual
34
34
  end
35
35
 
36
36
  test 'checkbox button checked' do
37
- actual = UiBibz::Ui::Core::ButtonChoice.new('Toto', { status: :active }).render
38
- expected = "<label class=\"active btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" checked=\"checked\" />Toto</label>"
37
+ actual = UiBibz::Ui::Core::ButtonChoice.new('state', { state: :active }).render
38
+ expected = "<label class=\"active btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" checked=\"checked\" />state</label>"
39
39
 
40
40
  assert_equal expected, actual
41
41
  end
42
42
 
43
43
  test 'checkbox button non checked' do
44
- actual = UiBibz::Ui::Core::ButtonChoice.new('Toto', { name: 'toto', id: 'toto', input_html_options: { class: 'toto'}}).render
45
- expected = "<label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" name=\"toto\" id=\"toto\" class=\"toto\" />Toto</label>"
44
+ actual = UiBibz::Ui::Core::ButtonChoice.new('state', { name: 'state', id: 'state', input_html_options: { class: 'state'}}).render
45
+ expected = "<label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" name=\"state\" id=\"state\" class=\"state\" />state</label>"
46
46
 
47
47
  assert_equal expected, actual
48
48
  end
49
49
 
50
50
  test 'button group choice checkbox' do
51
51
  actual = UiBibz::Ui::Core::ButtonGroup.new do
52
- concat UiBibz::Ui::Core::ButtonChoice.new('Toto1').render
53
- concat UiBibz::Ui::Core::ButtonChoice.new('Toto2').render
52
+ concat UiBibz::Ui::Core::ButtonChoice.new('state1').render
53
+ concat UiBibz::Ui::Core::ButtonChoice.new('state2').render
54
54
  end.render
55
- expected = "<div class=\"btn-group\" role=\"group\"><label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" />Toto1</label><label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" />Toto2</label></div>"
55
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group\" role=\"group\"><label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" />state1</label><label class=\"btn-primary btn\"><input type=\"checkbox\" autocomplete=\"off\" />state2</label></div>"
56
56
 
57
57
  assert_equal expected, actual
58
58
  end
59
59
 
60
60
  test 'button group choice radio' do
61
61
  actual = UiBibz::Ui::Core::ButtonGroup.new do
62
- concat UiBibz::Ui::Core::ButtonChoice.new('Toto1', type: :radio).render
63
- concat UiBibz::Ui::Core::ButtonChoice.new('Toto2', type: :radio).render
62
+ concat UiBibz::Ui::Core::ButtonChoice.new('state1', type: :radio).render
63
+ concat UiBibz::Ui::Core::ButtonChoice.new('state2', type: :radio).render
64
64
  end.render
65
- expected = "<div class=\"btn-group\" role=\"group\"><label class=\"btn-primary btn\"><input type=\"radio\" autocomplete=\"off\" />Toto1</label><label class=\"btn-primary btn\"><input type=\"radio\" autocomplete=\"off\" />Toto2</label></div>"
65
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group\" role=\"group\"><label class=\"btn-primary btn\"><input type=\"radio\" autocomplete=\"off\" />state1</label><label class=\"btn-primary btn\"><input type=\"radio\" autocomplete=\"off\" />state2</label></div>"
66
66
 
67
67
  assert_equal expected, actual
68
68
  end
69
69
 
70
70
  test 'button dropdown' do
71
- actual = UiBibz::Ui::Core::ButtonDropdown.new("Dropdown", type: :dropup, state: :success).tap do |d|
72
- d.link 'toto'
71
+ actual = UiBibz::Ui::Core::ButtonDropdown.new("Dropdown", type: :dropup, status: :success).tap do |d|
72
+ d.link 'state'
73
73
  d.header 'header'
74
74
  d.link 'momo'
75
75
  d.divider
76
76
  d.link 'lolo'
77
77
  end.render
78
- expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu dropdown-menu-left\"><a class=\"dropdown-item\" href=\"#\">toto</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#\">momo</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#\">lolo</a></div></div>"
78
+ expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu dropdown-menu-left\"><a class=\"dropdown-item\" href=\"#\">state</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#\">momo</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#\">lolo</a></div></div>"
79
79
 
80
80
  assert_equal expected, actual
81
81
  end
82
82
 
83
83
  test 'button split dropdown' do
84
- actual = UiBibz::Ui::Core::ButtonSplitDropdown.new("Dropdown", type: :dropup, state: :primary).tap do |d|
85
- d.link 'toto'
84
+ actual = UiBibz::Ui::Core::ButtonSplitDropdown.new("Dropdown", type: :dropup, status: :primary).tap do |d|
85
+ d.link 'state'
86
86
  d.header 'header'
87
87
  d.link 'momo'
88
88
  d.divider
89
89
  d.link 'lolo'
90
90
  end.render
91
- expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-primary\">Dropdown</button><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><span class=\"caret\"></span><span class=\"sr-only\">Toggle Dropdown</span></button><div class=\"dropdown-menu dropdown-menu-left\"><a class=\"dropdown-item\" href=\"#\">toto</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#\">momo</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#\">lolo</a></div></div>"
91
+ expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-primary\">Dropdown</button><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><span class=\"caret\"></span><span class=\"sr-only\">Toggle Dropdown</span></button><div class=\"dropdown-menu dropdown-menu-left\"><a class=\"dropdown-item\" href=\"#\">state</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#\">momo</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#\">lolo</a></div></div>"
92
92
 
93
93
  assert_equal expected, actual
94
94
  end
data/test/ui/card_test.rb CHANGED
@@ -34,12 +34,12 @@ class CardTest < ActionView::TestCase
34
34
  end
35
35
 
36
36
  test 'create card with header, block and footer' do
37
- actual = card(state: :danger, tap: true, class: 'toto') do |p|
38
- p.header 'toto', glyph: 'eye'
39
- p.block 'toto'
40
- p.footer 'toto'
37
+ actual = card(status: :danger, tap: true, class: 'state') do |p|
38
+ p.header 'state', glyph: 'eye'
39
+ p.block 'state'
40
+ p.footer 'state'
41
41
  end
42
- expected = "<div class=\"card-danger toto card\"><div class=\"card-header\"><i class=\"glyph fa fa-eye\"></i> toto</div><div class=\"card-block\">toto</div><div class=\"card-footer\">toto</div></div>"
42
+ expected = "<div class=\"card-danger state card\"><div class=\"card-header\"><i class=\"glyph fa fa-eye\"></i> state</div><div class=\"card-block\">state</div><div class=\"card-footer\">state</div></div>"
43
43
 
44
44
  assert_equal expected, actual
45
45
  end
@@ -4,14 +4,14 @@ include UiBibz::Helpers
4
4
  class ComponentTest < ActionView::TestCase
5
5
 
6
6
  test 'create complex component' do
7
- actual = UiBibz::Ui::Core::Component.new('New component', { status: :active, glyph: 'add' }, { class: 'new-class' }).render
7
+ actual = UiBibz::Ui::Core::Component.new('New component', { state: :active, glyph: 'add' }, { class: 'new-class' }).render
8
8
  expected = '<i class="glyph fa fa-add"></i> New component'
9
9
 
10
10
  assert_equal expected, actual
11
11
  end
12
12
 
13
13
  test 'create complex component with block' do
14
- actual = UiBibz::Ui::Core::Component.new(status: :active) do
14
+ actual = UiBibz::Ui::Core::Component.new(state: :active) do
15
15
  "New content"
16
16
  end.render
17
17
  expected = 'New content'
@@ -3,7 +3,7 @@ include UiBibz::Helpers
3
3
  class DropdownTest < ActionView::TestCase
4
4
 
5
5
  test 'Dropdown' do
6
- actual = UiBibz::Ui::Core::Dropdown.new("Dropdown", type: :dropup, state: :success).tap do |d|
6
+ actual = UiBibz::Ui::Core::Dropdown.new("Dropdown", type: :dropup, status: :success).tap do |d|
7
7
  d.link 'Link 1', url: '#link1', glyph: 'eye'
8
8
  d.header 'header'
9
9
  d.link 'Link 2', url: '#link2'
@@ -28,9 +28,9 @@ class InputsSwitchFieldTest < ActionView::TestCase
28
28
  end
29
29
 
30
30
  # OK
31
- test 'switch_field status' do
32
- actual = UiBibz::Ui::Core::SwitchField.new('test', {}, status: "disabled").render
33
- expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" status=\"disabled\" class=\"switch\" />"
31
+ test 'switch_field state' do
32
+ actual = UiBibz::Ui::Core::SwitchField.new('test', {}, state: "disabled").render
33
+ expected = "<input type=\"checkbox\" name=\"test\" id=\"test\" state=\"disabled\" class=\"switch\" />"
34
34
 
35
35
  assert_equal expected, actual
36
36
  end
@@ -27,9 +27,9 @@ class InputsTest < ActionView::TestCase
27
27
  end
28
28
 
29
29
  test "Multi Column Field data html options" do
30
- grouped_options = { 'North America' => [['United States','US'], 'Canada'], 'Europe' => ['Denmark','Germany','France'] }
30
+ grouped_options = { 'North America' => [['United statuss','US'], 'Canada'], 'Europe' => ['Denmark','Germany','France'] }
31
31
  actual = UiBibz::Ui::Core::MultiColumnField.new('example', { option_tags: grouped_options_for_select(grouped_options), searchable: true, selectable_opt_group: true }).render
32
- expected = "<select name=\"example[]\" id=\"example\" data-searchable=\"true\" data-selectable-optgroup=\"true\" class=\"multi-column\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United States</option>
32
+ expected = "<select name=\"example[]\" id=\"example\" data-searchable=\"true\" data-selectable-optgroup=\"true\" class=\"multi-column\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
33
33
  <option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>
34
34
  <option value=\"Germany\">Germany</option>
35
35
  <option value=\"France\">France</option></optgroup></select>"
@@ -47,9 +47,9 @@ class InputsTest < ActionView::TestCase
47
47
  end
48
48
 
49
49
  test "Multi Select Field data html options" do
50
- grouped_options = { 'North America' => [['United States','US'], 'Canada'], 'Europe' => ['Denmark','Germany','France'] }
51
- actual = UiBibz::Ui::Core::MultiSelectField.new('example', { option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, select_all_option: true, state: :danger }).render
52
- expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-include-select-all-option=\"true\" class=\"danger btn multi-select\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United States</option>
50
+ grouped_options = { 'North America' => [['United statuss','US'], 'Canada'], 'Europe' => ['Denmark','Germany','France'] }
51
+ actual = UiBibz::Ui::Core::MultiSelectField.new('example', { option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, select_all_option: true, status: :danger }).render
52
+ expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-include-select-all-option=\"true\" class=\"danger btn multi-select\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
53
53
  <option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>
54
54
  <option value=\"Germany\">Germany</option>
55
55
  <option value=\"France\">France</option></optgroup></select>"
@@ -4,13 +4,13 @@ class ListGroupTest < ActionView::TestCase
4
4
 
5
5
  test 'list_group with link' do
6
6
  actual = UiBibz::Ui::Core::ListGroup.new(type: :link).tap do |lg|
7
- lg.list 'Momo', { state: :success, url: '#momo' }
8
- lg.list({ tap: true, active: true, url: '#toto' }) do |l|
7
+ lg.list 'Momo', { status: :success, url: '#momo' }
8
+ lg.list({ tap: true, active: true, url: '#state' }) do |l|
9
9
  l.header 'My title'
10
10
  l.body 'My body'
11
11
  end
12
12
  end.render
13
- expected = "<div class=\"list-group\"><a class=\"list-group-item-success list-group-item\" href=\"#momo\">Momo</a><a type=\"link\" class=\"list-group-item\" href=\"#toto\"><h4 class=\"list-group-item-heading\">My title</h4><p class=\"list-group-item-text\">My body</p></a></div>"
13
+ expected = "<div class=\"list-group\"><a class=\"list-group-item-success list-group-item\" href=\"#momo\">Momo</a><a type=\"link\" class=\"list-group-item\" href=\"#state\"><h4 class=\"list-group-item-heading\">My title</h4><p class=\"list-group-item-text\">My body</p></a></div>"
14
14
 
15
15
  assert_equal expected, actual
16
16
  end
@@ -18,9 +18,9 @@ class ListGroupTest < ActionView::TestCase
18
18
  test 'list_group' do
19
19
  actual = UiBibz::Ui::Core::ListGroup.new().tap do |lg|
20
20
  lg.list 'Lulu'
21
- lg.list 'Toto'
21
+ lg.list 'state'
22
22
  end.render
23
- expected = "<ul class=\"list-group\"><li class=\"list-group-item\">Lulu</li><li class=\"list-group-item\">Toto</li></ul>"
23
+ expected = "<ul class=\"list-group\"><li class=\"list-group-item\">Lulu</li><li class=\"list-group-item\">state</li></ul>"
24
24
 
25
25
  assert_equal expected, actual
26
26
  end
data/test/ui/nav_test.rb CHANGED
@@ -4,7 +4,7 @@ class NavTest < ActionView::TestCase
4
4
 
5
5
  test 'Nav with tab' do
6
6
  actual = UiBibz::Ui::Core::Nav.new(type: :tabs).tap do |n|
7
- n.link 'Home', status: :active, url: "#Home", selector: 'home'
7
+ n.link 'Home', state: :active, url: "#Home", selector: 'home'
8
8
  n.link 'Profile', url: "#profile", selector: 'profile'
9
9
  n.link 'Messages', url: "#messages", selector: 'messages'
10
10
  end.render
@@ -14,9 +14,9 @@ class NavTest < ActionView::TestCase
14
14
 
15
15
  test 'Nav with pills' do
16
16
  actual = UiBibz::Ui::Core::Nav.new(type: :pills, position: :justified).tap do |n|
17
- n.link 'Home', status: :active, url: "#Home", selector: 'home'
17
+ n.link 'Home', state: :active, url: "#Home", selector: 'home'
18
18
  n.link 'Profile', url: "#profile", selector: 'profile', label: 16
19
- n.link 'Messages', url: "#messages", selector: 'messages', status: :disabled
19
+ n.link 'Messages', url: "#messages", selector: 'messages', state: :disabled
20
20
  end.render
21
21
  expected = "<ul class=\"nav nav-pills pull-justified\"><li class=\"nav-item\"><a class=\"active nav-link\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#profile\">Profile<span class=\"label-default pull-right label label-pill\">16</span></a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" href=\"#messages\">Messages</a></li></ul>"
22
22
 
@@ -15,8 +15,8 @@ class StarsTest < ActionView::TestCase
15
15
  assert_equal expected, actual
16
16
  end
17
17
 
18
- test "stars with 3.6 with state danger" do
19
- actual = UiBibz::Ui::Core::Stars.new(3.6, { state: :danger }).render
18
+ test "stars with 3.6 with status danger" do
19
+ actual = UiBibz::Ui::Core::Stars.new(3.6, { status: :danger }).render
20
20
  expected = "<span class=\"stars-notation\"><i class=\"glyph-danger glyph fa fa-star\"></i> <i class=\"glyph-danger glyph fa fa-star\"></i> <i class=\"glyph-danger glyph fa fa-star\"></i> <i class=\"glyph-danger glyph fa fa-star-half-o\"></i> <i class=\"glyph-danger glyph fa fa-star-o\"></i></span>"
21
21
  assert_equal expected, actual
22
22
  end
@@ -87,9 +87,9 @@ class TableTest < ActionView::TestCase
87
87
  end
88
88
 
89
89
  test 'table non searchable with a title and glyph' do
90
- options = { searchable: false, glyph: 'toto', title: 'Title list' }
90
+ options = { searchable: false, glyph: 'state', title: 'Title list' }
91
91
  actual = UiBibz::Ui::Ux::Searchable.new(@store, options).render
92
- expected = "<div><div class=\"title\"><i class=\"glyph fa fa-toto\"></i>Title list</div><br class=\"ui-bibz-clear\" /></div>"
92
+ expected = "<div><div class=\"title\"><i class=\"glyph fa fa-state\"></i>Title list</div><br class=\"ui-bibz-clear\" /></div>"
93
93
 
94
94
  assert_equal expected, actual
95
95
  end
@@ -152,7 +152,7 @@ class TableTest < ActionView::TestCase
152
152
  end
153
153
 
154
154
  test 'complex table_card' do
155
- actual = UiBibz::Ui::Ux::TableCard.new({ store: @users, tap: true }, { class: 'toto' }).tap do |pane|
155
+ actual = UiBibz::Ui::Ux::TableCard.new({ store: @users, tap: true }, { class: 'state' }).tap do |pane|
156
156
  pane.header 'Test header'
157
157
  pane.block class: 'ui' do
158
158
  'Test body'
@@ -161,7 +161,7 @@ class TableTest < ActionView::TestCase
161
161
  end
162
162
 
163
163
  test 'complex table_card with custom actions' do
164
- actual = UiBibz::Ui::Ux::TableCard.new({ store: @users, tap: true }, { class: 'toto'}).tap do |pane|
164
+ actual = UiBibz::Ui::Ux::TableCard.new({ store: @users, tap: true }, { class: 'state'}).tap do |pane|
165
165
  pane.header 'Test header'
166
166
  pane.block cls: 'ui' do
167
167
  'Test body'
@@ -173,7 +173,7 @@ class TableTest < ActionView::TestCase
173
173
  c.column(:name_en, { name: 'Name en', format: lambda{ |records, record| "name #{ record.id}"}})
174
174
  end
175
175
  pane.actions do |a|
176
- a.link 'toto', url: users_path(:id), glyph: 'eye'
176
+ a.link 'state', url: users_path(:id), glyph: 'eye'
177
177
  a.divider
178
178
  a.link 'momo', url: users_path(:id), glyph: 'home'
179
179
  end
@@ -195,7 +195,7 @@ class TableTest < ActionView::TestCase
195
195
  end
196
196
 
197
197
  test 'table visual options' do
198
- table = UiBibz::Ui::Ux::Table.new(store: @users, striped: true, state: :inverse, responsive: true, bordered: true, size: :sm, hoverable: true, reflow: true).render
198
+ table = UiBibz::Ui::Ux::Table.new(store: @users, striped: true, status: :inverse, responsive: true, bordered: true, size: :sm, hoverable: true, reflow: true).render
199
199
  actual = Nokogiri::HTML(table).xpath("//table")[0].attributes["class"].value
200
200
  expected = "table-inverse table table-striped table-bordered table-hoverable table-sm table-responsive table-reflow"
201
201
 
@@ -203,7 +203,7 @@ class TableTest < ActionView::TestCase
203
203
  end
204
204
 
205
205
  test 'table thead visual options' do
206
- table = UiBibz::Ui::Ux::Table.new(store: @users, thead: { state: :default }).render
206
+ table = UiBibz::Ui::Ux::Table.new(store: @users, thead: { status: :default }).render
207
207
  actual = Nokogiri::HTML(table).xpath("//thead")[0].attributes["class"].value
208
208
  expected = "thead-default"
209
209