ui_bibz 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +8 -8
  2. data/.yardoc/checksums +12 -12
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/Gemfile.lock +1 -1
  6. data/README.md +78 -70
  7. data/doc/UiBibz.html +1 -1
  8. data/doc/UiBibz/Concerns.html +1 -1
  9. data/doc/UiBibz/Concerns/Models.html +1 -1
  10. data/doc/UiBibz/Concerns/Models/Searchable.html +1 -1
  11. data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +1 -1
  12. data/doc/UiBibz/Helpers.html +1 -1
  13. data/doc/UiBibz/Helpers/MetaHelper.html +1 -1
  14. data/doc/UiBibz/Helpers/UiCoreHelper.html +1 -1
  15. data/doc/UiBibz/Helpers/UiUxHelper.html +1 -1
  16. data/doc/UiBibz/Helpers/UtilsHelper.html +1 -1
  17. data/doc/UiBibz/Rails.html +1 -1
  18. data/doc/UiBibz/Rails/Engine.html +1 -1
  19. data/doc/UiBibz/Ui.html +1 -1
  20. data/doc/UiBibz/Ui/Base.html +2 -2
  21. data/doc/UiBibz/Ui/Core.html +3 -3
  22. data/doc/UiBibz/Ui/Core/Alert.html +1 -1
  23. data/doc/UiBibz/Ui/Core/Bar.html +1 -1
  24. data/doc/UiBibz/Ui/Core/Breadcrumb.html +1 -1
  25. data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +1 -1
  26. data/doc/UiBibz/Ui/Core/Button.html +1 -1
  27. data/doc/UiBibz/Ui/Core/ButtonDropdown.html +2 -2
  28. data/doc/UiBibz/Ui/Core/ButtonGroup.html +1 -1
  29. data/doc/UiBibz/Ui/Core/ButtonLink.html +1 -1
  30. data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +2 -2
  31. data/doc/UiBibz/Ui/Core/Col.html +1 -1
  32. data/doc/UiBibz/Ui/Core/Component.html +2 -2
  33. data/doc/UiBibz/Ui/Core/Dropdown.html +175 -43
  34. data/doc/UiBibz/Ui/Core/DropdownDivider.html +301 -0
  35. data/doc/UiBibz/Ui/Core/DropdownHeader.html +353 -0
  36. data/doc/UiBibz/Ui/Core/DropdownLink.html +3 -3
  37. data/doc/UiBibz/Ui/Core/Glyph.html +1 -1
  38. data/doc/UiBibz/Ui/Core/Jumbotron.html +1 -1
  39. data/doc/UiBibz/Ui/Core/Label.html +1 -1
  40. data/doc/UiBibz/Ui/Core/List.html +1 -1
  41. data/doc/UiBibz/Ui/Core/ListGroup.html +1 -1
  42. data/doc/UiBibz/Ui/Core/Nav.html +1 -1
  43. data/doc/UiBibz/Ui/Core/NavDropdown.html +2 -2
  44. data/doc/UiBibz/Ui/Core/NavLink.html +1 -1
  45. data/doc/UiBibz/Ui/Core/Navbar.html +1 -1
  46. data/doc/UiBibz/Ui/Core/NavbarForm.html +1 -1
  47. data/doc/UiBibz/Ui/Core/NavbarNav.html +1 -1
  48. data/doc/UiBibz/Ui/Core/NavbarText.html +1 -1
  49. data/doc/UiBibz/Ui/Core/Panel.html +1 -1
  50. data/doc/UiBibz/Ui/Core/ProgressBar.html +1 -1
  51. data/doc/UiBibz/Ui/Core/Row.html +1 -1
  52. data/doc/UiBibz/Ui/Core/Stars.html +1 -1
  53. data/doc/UiBibz/Ui/Ux.html +3 -3
  54. data/doc/UiBibz/Ui/Ux/Actionable.html +1 -1
  55. data/doc/UiBibz/Ui/Ux/Actions.html +148 -44
  56. data/doc/UiBibz/Ui/Ux/Column.html +1 -1
  57. data/doc/UiBibz/Ui/Ux/Columns.html +1 -1
  58. data/doc/UiBibz/Ui/Ux/Grid.html +1 -1
  59. data/doc/UiBibz/Ui/Ux/Paginable.html +1 -1
  60. data/doc/UiBibz/Ui/Ux/Searchable.html +1 -1
  61. data/doc/UiBibz/Ui/Ux/Sortable.html +1 -1
  62. data/doc/UiBibz/Ui/Ux/Store.html +1 -1
  63. data/doc/UiBibz/Ui/Ux/Table.html +1 -1
  64. data/doc/UiBibz/Ui/Ux/TablePagination.html +1 -1
  65. data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +1 -1
  66. data/doc/UiBibz/Ui/Ux/TablePanel.html +1 -1
  67. data/doc/UiBibz/Ui/Ux/TableSearchField.html +1 -1
  68. data/doc/UiBibz/Utils.html +1 -1
  69. data/doc/UiBibz/Utils/Internationalization.html +1 -1
  70. data/doc/_index.html +14 -14
  71. data/doc/class_list.html +1 -1
  72. data/doc/file.README.html +35 -32
  73. data/doc/index.html +35 -32
  74. data/doc/method_list.html +261 -237
  75. data/doc/top-level-namespace.html +1 -1
  76. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_divider.rb +17 -0
  77. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb +47 -0
  78. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +8 -2
  79. data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +26 -12
  80. data/lib/ui_bibz/ui/ux/table/components/actions.rb +14 -7
  81. data/lib/ui_bibz/ui/ux/table/extensions/actionable.rb +1 -1
  82. data/lib/ui_bibz/version.rb +1 -1
  83. data/test/ui/button_test.rb +12 -12
  84. data/test/ui/dropdown_test.rb +3 -3
  85. data/test/ui/table_test.rb +3 -3
  86. metadata +6 -4
  87. data/lib/ui_bibz/ui/core/dropdown/components/dropdown_list.rb +0 -75
  88. data/lib/ui_bibz/ui/ux/table/components/table_action.rb +0 -21
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Mon Aug 31 14:08:52 2015 by
106
+ Generated on Wed Sep 2 11:20:03 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-1.9.3).
109
109
  </div>
@@ -0,0 +1,17 @@
1
+ module UiBibz::Ui::Core
2
+
3
+ # Create DropdownDivider
4
+ #
5
+ class DropdownDivider < UiBibz::Ui::Base
6
+
7
+ # See UiBibz::Ui::Core::Component.initialize
8
+ def initialize
9
+ end
10
+
11
+ # Render html tag
12
+ def render
13
+ content_tag :li, nil, class: 'divider', role: 'separator'
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,47 @@
1
+ module UiBibz::Ui::Core
2
+
3
+ # Create DropdownHeader
4
+ #
5
+ # This element is an extend of UiBibz::Ui::Core::Component.
6
+ # Use '---' in content to add a separator
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
+ #
18
+ # ==== Signatures
19
+ #
20
+ # UiBibz::Ui::Core::DropdownHeader.new(content, options = nil, html_options = nil)
21
+ #
22
+ # UiBibz::Ui::Core::DropdownHeader.new(options = nil, html_options = nil) do
23
+ # content
24
+ # end
25
+ #
26
+ # ==== Examples
27
+ #
28
+ # UiBibz::Ui::Core::DropdownHeader.new('Home',{ class: 'test' }).render
29
+ #
30
+ # UiBibz::Ui::Core::DropdownHeader.new({ class: 'test' }) do
31
+ # 'Home'
32
+ # end.render
33
+ #
34
+ class DropdownHeader < Component
35
+
36
+ # See UiBibz::Ui::Core::Component.initialize
37
+ def initialize content = nil, options = nil, html_options = nil, &block
38
+ super
39
+ end
40
+
41
+ # Render html tag
42
+ def render
43
+ content_tag :li, @content, class_and_html_options('dropdown-header').merge({ role: 'presentation' })
44
+ end
45
+
46
+ end
47
+ end
@@ -48,10 +48,16 @@ module UiBibz::Ui::Core
48
48
 
49
49
  # Render html tag
50
50
  def render
51
- content_tag :li, @html_options.merge({ role: 'presentation' }) do
52
- link_to glyph_and_content_html, @options[:url], @options[:link_html_options]
51
+ content_tag :li, class_and_html_options('').merge({ role: 'presentation' }) do
52
+ link_to glyph_and_content_html, link_url, @options[:link_html_options]
53
53
  end
54
54
  end
55
55
 
56
+ private
57
+
58
+ def link_url
59
+ @options[:url] || "#"
60
+ end
61
+
56
62
  end
57
63
  end
@@ -1,4 +1,5 @@
1
- require 'ui_bibz/ui/core/dropdown/components/dropdown_list'
1
+ require 'ui_bibz/ui/core/dropdown/components/dropdown_header'
2
+ require 'ui_bibz/ui/core/dropdown/components/dropdown_divider'
2
3
  require 'ui_bibz/ui/core/dropdown/components/dropdown_link'
3
4
  module UiBibz::Ui::Core
4
5
 
@@ -30,7 +31,8 @@ module UiBibz::Ui::Core
30
31
  #
31
32
  # UiBibz::Ui::Core::Dropdown.new(options = nil, html_options = nil).tap do |d|
32
33
  # ...
33
- # d.list content = nil, options = nil, html_options = nil, &block
34
+ # d.header content = nil, options = nil, html_options = nil, &block
35
+ # d.divider
34
36
  # d.link content = nil, options = nil, html_options = nil, &block
35
37
  # ...
36
38
  # end
@@ -39,22 +41,23 @@ module UiBibz::Ui::Core
39
41
  #
40
42
  # UiBibz::Ui::Core::Dropdown.new(name, state: :success).tap do |d|
41
43
  # d.link 'test', { url: '#' }
42
- # d.list '---'
43
- # d.list 'Header 1', { type: :header }
44
+ # d.divider
45
+ # d.header 'Header 1'
44
46
  # d.link 'test2', { url: '#' }
45
47
  # end.render
46
48
  #
47
49
  # ==== Helper
48
50
  #
49
51
  # dropdown(name, options = { tap: true }, html_options = {}) do |d|
50
- # d.list(content, options = {}, html_options = {})
51
- # d.list(options = {}, html_options = {}) do
52
- # content
53
- # end
54
52
  # d.link(content, options = {}, html_options = {})
55
53
  # d.link(options = {}, html_options = {}) do
56
54
  # content
57
55
  # end
56
+ # d.divider
57
+ # d.header(content, options = {}, html_options = {})
58
+ # d.header(options = {}, html_options = {}) do
59
+ # content
60
+ # end
58
61
  # end
59
62
  #
60
63
  class Dropdown < Component
@@ -73,10 +76,16 @@ module UiBibz::Ui::Core
73
76
  end
74
77
  end
75
78
 
76
- # Add dropdown list
77
- # See UiBibz::Ui::Core::DropdownList
78
- def list content = nil, options = nil, html_options = nil, &block
79
- @items << DropdownList.new(content, options, html_options, &block).render
79
+ # Add dropdown header
80
+ # See UiBibz::Ui::Core::DropdownHeader
81
+ def header content = nil, options = nil, html_options = nil, &block
82
+ @items << DropdownHeader.new(content, options, html_options, &block).render
83
+ end
84
+
85
+ # Add dropdown Separator
86
+ # See UiBibz::Ui::Core::DropdownDivider
87
+ def divider
88
+ @items << DropdownDivider.new.render
80
89
  end
81
90
 
82
91
  # Add dropdown link in list
@@ -85,6 +94,11 @@ module UiBibz::Ui::Core
85
94
  @items << DropdownLink.new(content, options, html_options, &block).render
86
95
  end
87
96
 
97
+ # Add html component
98
+ def html content
99
+ @items << content
100
+ end
101
+
88
102
  protected
89
103
 
90
104
  def button_content
@@ -1,4 +1,3 @@
1
- require "ui_bibz/ui/ux/table/components/table_action"
2
1
  module UiBibz::Ui::Ux
3
2
  class Actions
4
3
 
@@ -8,9 +7,17 @@ module UiBibz::Ui::Ux
8
7
  @action_order = -1
9
8
  end
10
9
 
11
- # Add action in table
12
- def action content = nil, options = nil, html_options = nil, &block
13
- @actions << TableAction.new(content, options, html_options, &block).render
10
+ # Add link action in table
11
+ def link content = nil, options = nil, html_options = nil, &block
12
+ @actions << UiBibz::Ui::Core::DropdownLink.new(content, options, html_options, &block).render
13
+ end
14
+
15
+ def divider
16
+ @actions << UiBibz::Ui::Core::DropdownDivider.new.render
17
+ end
18
+
19
+ def header content = nil, options = nil, html_options = nil, &block
20
+ @actions << UiBibz::Ui::Core::DropdownHeader.new(content, options, html_options, &block).render
14
21
  end
15
22
 
16
23
  def reset
@@ -34,9 +41,9 @@ module UiBibz::Ui::Ux
34
41
 
35
42
  def defaults_actions
36
43
  [
37
- UiBibz::Ui::Ux::TableAction.new(show_name, url: { controller: @store.controller, action: 'show', id: :id }, glyph: 'eye').render,
38
- UiBibz::Ui::Ux::TableAction.new(edit_name, url:{ controller: @store.controller, action: 'edit', id: :id }, glyph: 'pencil').render,
39
- UiBibz::Ui::Ux::TableAction.new(delete_name, { glyph: 'trash', url: { controller: @store.controller, action: 'destroy', id: :id }}, data: { confirm: 'Are you sure?', method: :delete }).render
44
+ UiBibz::Ui::Core::DropdownLink.new(show_name, url: { controller: @store.controller, action: 'show', id: :id }, glyph: 'eye').render,
45
+ UiBibz::Ui::Core::DropdownLink.new(edit_name, url:{ controller: @store.controller, action: 'edit', id: :id }, glyph: 'pencil').render,
46
+ UiBibz::Ui::Core::DropdownLink.new(delete_name, { glyph: 'trash', url: { controller: @store.controller, action: 'destroy', id: :id }}, data: { confirm: 'Are you sure?', method: :delete }).render
40
47
  ]
41
48
  end
42
49
 
@@ -33,7 +33,7 @@ module UiBibz::Ui::Ux
33
33
  unless @actions.nil?
34
34
  @actions.format_action.call(record) unless @actions.format_action.nil?
35
35
  actions_links(record).each do |l|
36
- d.list l.to_s.html_safe
36
+ d.html l.to_s.html_safe
37
37
  end
38
38
  @actions.reset
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -28,26 +28,26 @@ class ButtonTest < ActionView::TestCase
28
28
 
29
29
  test 'button dropdown' do
30
30
  actual = UiBibz::Ui::Core::ButtonDropdown.new("Dropdown", type: :dropup, state: :success).tap do |d|
31
- d.list 'toto'
32
- d.list 'header', type: :header
33
- d.list 'momo'
34
- d.list '---'
35
- d.list 'lolo'
31
+ d.link 'toto'
32
+ d.header 'header'
33
+ d.link 'momo'
34
+ d.divider
35
+ d.link 'lolo'
36
36
  end.render
37
- expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li role=\"presentation\">toto</li><li class=\"dropdown-header\" role=\"presentation\">header</li><li role=\"presentation\">momo</li><li class=\"divider\" role=\"presentation\"></li><li role=\"presentation\">lolo</li></ul></div>"
37
+ expected = "<div class=\"btn-group dropup\" role=\"group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li class=\"\" role=\"presentation\"><a href=\"#\">toto</a></li><li class=\"dropdown-header\" role=\"presentation\">header</li><li class=\"\" role=\"presentation\"><a href=\"#\">momo</a></li><li class=\"divider\" role=\"separator\"></li><li class=\"\" role=\"presentation\"><a href=\"#\">lolo</a></li></ul></div>"
38
38
 
39
39
  assert_equal expected, actual
40
40
  end
41
41
 
42
42
  test 'button split dropdown' do
43
43
  actual = UiBibz::Ui::Core::ButtonSplitDropdown.new("Dropdown", type: :dropup, state: :primary).tap do |d|
44
- d.list 'toto'
45
- d.list 'header', type: :header
46
- d.list 'momo'
47
- d.list '---'
48
- d.list 'lolo'
44
+ d.link 'toto'
45
+ d.header 'header'
46
+ d.link 'momo'
47
+ d.divider
48
+ d.link 'lolo'
49
49
  end.render
50
- 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-expanded=\"false\"><span class=\"caret\"></span><span class=\"sr-only\">Toggle Dropdown</span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li role=\"presentation\">toto</li><li class=\"dropdown-header\" role=\"presentation\">header</li><li role=\"presentation\">momo</li><li class=\"divider\" role=\"presentation\"></li><li role=\"presentation\">lolo</li></ul></div>"
50
+ 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-expanded=\"false\"><span class=\"caret\"></span><span class=\"sr-only\">Toggle Dropdown</span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li class=\"\" role=\"presentation\"><a href=\"#\">toto</a></li><li class=\"dropdown-header\" role=\"presentation\">header</li><li class=\"\" role=\"presentation\"><a href=\"#\">momo</a></li><li class=\"divider\" role=\"separator\"></li><li class=\"\" role=\"presentation\"><a href=\"#\">lolo</a></li></ul></div>"
51
51
 
52
52
  assert_equal expected, actual
53
53
  end
@@ -5,12 +5,12 @@ class DropdownTest < ActionView::TestCase
5
5
  test 'Dropdown' do
6
6
  actual = UiBibz::Ui::Core::Dropdown.new("Dropdown", type: :dropup, state: :success).tap do |d|
7
7
  d.link 'Link 1', url: '#link1', glyph: 'eye'
8
- d.list 'header', type: :header
8
+ d.header 'header'
9
9
  d.link 'Link 2', url: '#link2'
10
- d.list '---'
10
+ d.divider
11
11
  d.link 'Link3', url: '#link3'
12
12
  end.render
13
- expected = "<div class=\"dropup\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li role=\"presentation\"><a href=\"#link1\"><i class=\"glyph fa fa-eye\"></i> Link 1</a></li><li class=\"dropdown-header\" role=\"presentation\">header</li><li role=\"presentation\"><a href=\"#link2\">Link 2</a></li><li class=\"divider\" role=\"presentation\"></li><li role=\"presentation\"><a href=\"#link3\">Link3</a></li></ul></div>"
13
+ expected = "<div class=\"dropup\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></button><ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\"><li class=\"\" role=\"presentation\"><a href=\"#link1\"><i class=\"glyph fa fa-eye\"></i> Link 1</a></li><li class=\"dropdown-header\" role=\"presentation\">header</li><li class=\"\" role=\"presentation\"><a href=\"#link2\">Link 2</a></li><li class=\"divider\" role=\"separator\"></li><li class=\"\" role=\"presentation\"><a href=\"#link3\">Link3</a></li></ul></div>"
14
14
 
15
15
  assert_equal expected, actual
16
16
  end
@@ -172,9 +172,9 @@ class TableTest < ActionView::TestCase
172
172
  c.column(:name_en, { name: 'Name en', format: lambda{ |records, record| "name #{ record.id}"}})
173
173
  end
174
174
  pane.actions do |a|
175
- a.action 'toto', url: users_path(:id), glyph: 'eye'
176
- a.action '---'
177
- a.action 'momo', url: users_path(:id), glyph: 'home'
175
+ a.link 'toto', url: users_path(:id), glyph: 'eye'
176
+ a.divider
177
+ a.link 'momo', url: users_path(:id), glyph: 'home'
178
178
  end
179
179
  end.render
180
180
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -267,6 +267,8 @@ files:
267
267
  - doc/UiBibz/Ui/Core/Col.html
268
268
  - doc/UiBibz/Ui/Core/Component.html
269
269
  - doc/UiBibz/Ui/Core/Dropdown.html
270
+ - doc/UiBibz/Ui/Core/DropdownDivider.html
271
+ - doc/UiBibz/Ui/Core/DropdownHeader.html
270
272
  - doc/UiBibz/Ui/Core/DropdownLink.html
271
273
  - doc/UiBibz/Ui/Core/DropdownList.html
272
274
  - doc/UiBibz/Ui/Core/Glyph.html
@@ -357,8 +359,9 @@ files:
357
359
  - lib/ui_bibz/ui/core/button/button_split_dropdown.rb
358
360
  - lib/ui_bibz/ui/core/col.rb
359
361
  - lib/ui_bibz/ui/core/component.rb
362
+ - lib/ui_bibz/ui/core/dropdown/components/dropdown_divider.rb
363
+ - lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
360
364
  - lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb
361
- - lib/ui_bibz/ui/core/dropdown/components/dropdown_list.rb
362
365
  - lib/ui_bibz/ui/core/dropdown/dropdown.rb
363
366
  - lib/ui_bibz/ui/core/glyph.rb
364
367
  - lib/ui_bibz/ui/core/jumbotron.rb
@@ -382,7 +385,6 @@ files:
382
385
  - lib/ui_bibz/ui/ux/table/components/column.rb
383
386
  - lib/ui_bibz/ui/ux/table/components/columns.rb
384
387
  - lib/ui_bibz/ui/ux/table/components/store.rb
385
- - lib/ui_bibz/ui/ux/table/components/table_action.rb
386
388
  - lib/ui_bibz/ui/ux/table/extensions/actionable.rb
387
389
  - lib/ui_bibz/ui/ux/table/extensions/paginable.rb
388
390
  - lib/ui_bibz/ui/ux/table/extensions/searchable.rb
@@ -1,75 +0,0 @@
1
- module UiBibz::Ui::Core
2
-
3
- # Create DropdownList
4
- #
5
- # This element is an extend of UiBibz::Ui::Core::Component.
6
- # Use '---' in content to add a separator
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
- # * +status+ - State of élement with symbol value:
19
- # (+:active+)
20
- # * +url+ - String
21
- # * +glyph+ - Add glyph with name or hash options
22
- # * +name+ - String
23
- # * +size+ - Integer
24
- # * +type+ - Symbol
25
- #
26
- # ==== Signatures
27
- #
28
- # UiBibz::Ui::Core::DropdownList.new(content, options = nil, html_options = nil)
29
- #
30
- # UiBibz::Ui::Core::DropdownList.new(options = nil, html_options = nil) do
31
- # content
32
- # end
33
- #
34
- # ==== Examples
35
- #
36
- # UiBibz::Ui::Core::DropdownList.new('Home', { glyph: 'home', status: :active },{ class: 'test' }).render
37
- #
38
- # UiBibz::Ui::Core::DropdownList.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
39
- # 'Home'
40
- # end.render
41
- #
42
- # UiBibz::Ui::CoreBibz::DropdownList.new('---').render # To add a separator
43
- #
44
- class DropdownList < Component
45
-
46
- DIVIDER = '---'
47
-
48
- # See UiBibz::Ui::Core::Component.initialize
49
- def initialize content = nil, options = nil, html_options = nil, &block
50
- super
51
- end
52
-
53
- # Render html tag
54
- def render
55
- @content == DIVIDER ? divider_html : link_html
56
- end
57
-
58
- private
59
-
60
- def divider_html
61
- content_tag :li, '', class_and_html_options('divider').merge({ role: 'presentation' })
62
- end
63
-
64
- def link_html
65
- content_tag :li, class_and_html_options(type).merge({ role: 'presentation' }) do
66
- @content
67
- end
68
- end
69
-
70
- def type
71
- "dropdown-header" if @options[:type] == :header
72
- end
73
-
74
- end
75
- end
@@ -1,21 +0,0 @@
1
- module UiBibz::Ui::Ux
2
- class TableAction < UiBibz::Ui::Core::Component
3
-
4
- DIVIDER = '---'
5
-
6
- def initialize content = nil, options = nil, html_options = nil, &block
7
- super
8
- end
9
-
10
- def render
11
- @content == DIVIDER ? DIVIDER : link_html
12
- end
13
-
14
- private
15
-
16
- def link_html
17
- link_to glyph_and_content_html, @options[:url], class_and_html_options
18
- end
19
-
20
- end
21
- end