ui_bibz 2.0.0.alpha14 → 2.0.0.alpha15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/inputs/custom_inputs/autocomplete_input.rb +2 -2
  4. data/app/inputs/custom_inputs/date_picker_input.rb +2 -2
  5. data/app/inputs/custom_inputs/dropdown_select_input.rb +2 -2
  6. data/app/inputs/custom_inputs/formula_input.rb +2 -2
  7. data/app/inputs/custom_inputs/markdown_editor_input.rb +2 -2
  8. data/app/inputs/custom_inputs/multi_column_input.rb +2 -2
  9. data/app/inputs/custom_inputs/multi_select_input.rb +2 -2
  10. data/app/inputs/custom_inputs/surround_input.rb +2 -2
  11. data/app/inputs/custom_inputs/switch_input.rb +2 -2
  12. data/lib/ui_bibz/helpers/ui_core_helper.rb +189 -25
  13. data/lib/ui_bibz/helpers/ui_ux_helper.rb +38 -11
  14. data/lib/ui_bibz/ui/core/{button → buttons}/button.rb +6 -17
  15. data/lib/ui_bibz/ui/core/{button → buttons}/button_choice.rb +8 -8
  16. data/lib/ui_bibz/ui/core/{button → buttons}/button_dropdown.rb +6 -6
  17. data/lib/ui_bibz/ui/core/{button → buttons}/button_group.rb +6 -6
  18. data/lib/ui_bibz/ui/core/{button → buttons}/button_link.rb +8 -8
  19. data/lib/ui_bibz/ui/core/{button → buttons}/button_split_dropdown.rb +5 -5
  20. data/lib/ui_bibz/ui/core/{card → cards}/card.rb +13 -13
  21. data/lib/ui_bibz/ui/core/{card → cards}/card_column.rb +7 -7
  22. data/lib/ui_bibz/ui/core/{card → cards}/card_deck.rb +7 -7
  23. data/lib/ui_bibz/ui/core/{card → cards}/card_group.rb +7 -7
  24. data/lib/ui_bibz/ui/core/{card → cards}/components/block/card_block_link.rb +6 -6
  25. data/lib/ui_bibz/ui/core/{card → cards}/components/block/card_block_text.rb +6 -6
  26. data/lib/ui_bibz/ui/core/{card → cards}/components/block/card_block_title.rb +6 -6
  27. data/lib/ui_bibz/ui/core/{card → cards}/components/card_block.rb +9 -9
  28. data/lib/ui_bibz/ui/core/{card → cards}/components/card_footer.rb +6 -6
  29. data/lib/ui_bibz/ui/core/{card → cards}/components/card_header.rb +6 -6
  30. data/lib/ui_bibz/ui/core/{card → cards}/components/card_image.rb +6 -6
  31. data/lib/ui_bibz/ui/core/{card → cards}/components/card_list_group.rb +5 -5
  32. data/lib/ui_bibz/ui/core/{input → inputs}/autocomplete_field.rb +6 -6
  33. data/lib/ui_bibz/ui/core/{input → inputs}/date_picker_field.rb +20 -19
  34. data/lib/ui_bibz/ui/core/{input → inputs}/dropdown_select_field.rb +5 -5
  35. data/lib/ui_bibz/ui/core/{input → inputs}/formula_field.rb +6 -6
  36. data/lib/ui_bibz/ui/core/{input → inputs}/markdown_editor_field.rb +6 -6
  37. data/lib/ui_bibz/ui/core/{input → inputs}/multi_column_field.rb +6 -6
  38. data/lib/ui_bibz/ui/core/{input → inputs}/multi_select_field.rb +8 -8
  39. data/lib/ui_bibz/ui/core/{input → inputs}/surround_field.rb +6 -6
  40. data/lib/ui_bibz/ui/core/{input → inputs}/switch_field.rb +4 -4
  41. data/lib/ui_bibz/ui/core/jumbotron.rb +2 -2
  42. data/lib/ui_bibz/ui/core/{layout → layouts}/col.rb +6 -6
  43. data/lib/ui_bibz/ui/core/{layout → layouts}/container.rb +6 -6
  44. data/lib/ui_bibz/ui/core/{layout → layouts}/row.rb +4 -4
  45. data/lib/ui_bibz/ui/core/list/list_group.rb +1 -1
  46. data/lib/ui_bibz/ui/core/{nav → navs}/components/nav_dropdown.rb +6 -6
  47. data/lib/ui_bibz/ui/core/{nav → navs}/components/nav_link.rb +11 -11
  48. data/lib/ui_bibz/ui/core/{nav → navs}/components/nav_link_link.rb +3 -2
  49. data/lib/ui_bibz/ui/core/{nav → navs}/components/nav_link_list.rb +2 -2
  50. data/lib/ui_bibz/ui/core/{nav → navs}/components/navbar_brand.rb +2 -2
  51. data/lib/ui_bibz/ui/core/{nav → navs}/components/navbar_form.rb +4 -5
  52. data/lib/ui_bibz/ui/core/{nav → navs}/components/navbar_nav.rb +7 -7
  53. data/lib/ui_bibz/ui/core/{nav → navs}/components/navbar_text.rb +6 -6
  54. data/lib/ui_bibz/ui/core/{nav → navs}/nav.rb +9 -9
  55. data/lib/ui_bibz/ui/core/{nav → navs}/navbar.rb +9 -9
  56. data/lib/ui_bibz/ui/ux/{table → tables}/components/actions.rb +1 -1
  57. data/lib/ui_bibz/ui/ux/{table → tables}/components/as.rb +1 -1
  58. data/lib/ui_bibz/ui/ux/{table → tables}/components/column.rb +1 -1
  59. data/lib/ui_bibz/ui/ux/{table → tables}/components/columns.rb +1 -1
  60. data/lib/ui_bibz/ui/ux/{table → tables}/components/store.rb +3 -3
  61. data/lib/ui_bibz/ui/ux/{table → tables}/components/thead.rb +1 -1
  62. data/lib/ui_bibz/ui/ux/{table → tables}/extensions/actionable.rb +2 -2
  63. data/lib/ui_bibz/ui/ux/{table → tables}/extensions/paginable.rb +3 -3
  64. data/lib/ui_bibz/ui/ux/{table → tables}/extensions/searchable.rb +1 -1
  65. data/lib/ui_bibz/ui/ux/{table → tables}/extensions/sortable.rb +1 -1
  66. data/lib/ui_bibz/ui/ux/{table → tables}/table.rb +17 -17
  67. data/lib/ui_bibz/ui/ux/{table → tables}/table_card.rb +10 -10
  68. data/lib/ui_bibz/ui/ux/{table → tables}/table_pagination.rb +3 -3
  69. data/lib/ui_bibz/ui/ux/{table → tables}/table_pagination_per_page.rb +3 -3
  70. data/lib/ui_bibz/ui/ux/{table → tables}/table_search_field.rb +3 -2
  71. data/lib/ui_bibz/version.rb +1 -1
  72. data/lib/ui_bibz.rb +45 -29
  73. data/test/store_test.rb +2 -2
  74. data/test/ui/button_test.rb +15 -15
  75. data/test/ui/grid_test.rb +3 -3
  76. data/test/ui/input_dropdown_select_field_test.rb +9 -9
  77. data/test/ui/input_switch_field_test.rb +10 -10
  78. data/test/ui/inputs_test.rb +13 -13
  79. data/test/ui/nav_test.rb +2 -2
  80. data/test/ui/table_test.rb +26 -26
  81. metadata +57 -57
@@ -1,8 +1,8 @@
1
- module UiBibz::Ui::Core
1
+ module UiBibz::Ui::Core::Navs
2
2
 
3
3
  # Create a NavbarNav
4
4
  #
5
- # This element is an extend of UiBibz::Ui::Core::Nav.
5
+ # This element is an extend of UiBibz::Ui::Core::Navs::Nav.
6
6
  #
7
7
  # ==== Attributes
8
8
  #
@@ -21,9 +21,9 @@ module UiBibz::Ui::Core
21
21
  #
22
22
  # ==== Signatures
23
23
  #
24
- # UiBibz::Ui::Core::NavbarNav.new(content, options = nil, html_options = nil)
24
+ # UiBibz::Ui::Core::Navs::NavbarNav.new(content, options = nil, html_options = nil)
25
25
  #
26
- # UiBibz::Ui::Core::NavbarNav.new(options = nil, html_options = nil).tap do |n|
26
+ # UiBibz::Ui::Core::Navs::NavbarNav.new(options = nil, html_options = nil).tap do |n|
27
27
  # ...
28
28
  # n.link content = nil, options = nil, html_options = nil, block
29
29
  # ...
@@ -31,14 +31,14 @@ module UiBibz::Ui::Core
31
31
  #
32
32
  # ==== Examples
33
33
  #
34
- # UiBibz::Ui::Core::NavbarNav.new().tap do |n|
34
+ # UiBibz::Ui::Core::Navs::NavbarNav.new().tap do |n|
35
35
  # n.link 'Test', url: '#test'
36
36
  # n.link 'Test2', url: '#test2', state: :active
37
37
  # end.render
38
38
  #
39
- class NavbarNav < Nav
39
+ class NavbarNav < UiBibz::Ui::Core::Navs::Nav
40
40
 
41
- # See UiBibz::Ui::Core::Component.initialize
41
+ # See UiBibz::Ui::Core::Navs::Nav.initialize
42
42
  def initialize content = nil, options = nil, html_options = nil, &block
43
43
  super
44
44
  end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core
1
+ module UiBibz::Ui::Core::Navs
2
2
 
3
3
  # Create a NavbarText
4
4
  #
@@ -17,21 +17,21 @@ module UiBibz::Ui::Core
17
17
  #
18
18
  # ==== Signatures
19
19
  #
20
- # UiBibz::Ui::Core::NavbarText.new(content, options = nil, html_options = nil)
20
+ # UiBibz::Ui::Core::Navs::NavbarText.new(content, options = nil, html_options = nil)
21
21
  #
22
- # UiBibz::Ui::Core::NavbarText.new(options = nil, html_options = nil) do
22
+ # UiBibz::Ui::Core::Navs::NavbarText.new(options = nil, html_options = nil) do
23
23
  # content
24
24
  # end
25
25
  #
26
26
  # ==== Examples
27
27
  #
28
- # UiBibz::Ui::Core::NavbarText.new('Exemple).render
28
+ # UiBibz::Ui::Core::Navs::NavbarText.new('Exemple).render
29
29
  #
30
- # UiBibz::Ui::Core::NavbarText.new(position: :right) do
30
+ # UiBibz::Ui::Core::Navs::NavbarText.new(position: :right) do
31
31
  # 'Exemple'
32
32
  # end.render
33
33
  #
34
- class NavbarText < Component
34
+ class NavbarText < UiBibz::Ui::Core::Component
35
35
 
36
36
  # See UiBibz::Ui::Core::Component.initialize
37
37
  def initialize content = nil, options = nil, html_options = nil, &block
@@ -1,6 +1,6 @@
1
- require 'ui_bibz/ui/core/nav/components/nav_link'
2
- require 'ui_bibz/ui/core/nav/components/nav_dropdown'
3
- module UiBibz::Ui::Core
1
+ require 'ui_bibz/ui/core/navs/components/nav_link'
2
+ require 'ui_bibz/ui/core/navs/components/nav_dropdown'
3
+ module UiBibz::Ui::Core::Navs
4
4
 
5
5
  # Create a nav
6
6
  #
@@ -21,9 +21,9 @@ module UiBibz::Ui::Core
21
21
  #
22
22
  # ==== Signatures
23
23
  #
24
- # UiBibz::Ui::Core::Nav.new(content, options = nil, html_options = nil)
24
+ # UiBibz::Ui::Core::Navs::Nav.new(content, options = nil, html_options = nil)
25
25
  #
26
- # UiBibz::Ui::Core::Nav.new(options = nil, html_options = nil).tap do |n|
26
+ # UiBibz::Ui::Core::Navs::Nav.new(options = nil, html_options = nil).tap do |n|
27
27
  # ...
28
28
  # n.link content = nil, options = nil, html_options = nil, block
29
29
  # n.link content = nil, options = nil, html_options = nil, block
@@ -33,7 +33,7 @@ module UiBibz::Ui::Core
33
33
  #
34
34
  # ==== Examples
35
35
  #
36
- # UiBibz::Ui::Core::Nav.new(type: :pills).tap do |n|
36
+ # UiBibz::Ui::Core::Navs::Nav.new(type: :pills).tap do |n|
37
37
  # n.link 'Test', url: '#test'
38
38
  # n.link 'Test2', url: '#test2', state: :active
39
39
  # n.dropdown('Action') do |d|
@@ -56,7 +56,7 @@ module UiBibz::Ui::Core
56
56
  # end
57
57
  # end
58
58
  #
59
- class Nav < Component
59
+ class Nav < UiBibz::Ui::Core::Component
60
60
 
61
61
  # See UiBibz::Ui::Core::Component.initialize
62
62
  def initialize content = nil, options = nil, html_options = nil, &block
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core
70
70
  end
71
71
 
72
72
  # Add nav link items
73
- # See UiBibz::Ui::Core::NavLink
73
+ # See UiBibz::Ui::Core::Navs::NavLink
74
74
  def link content = nil, options = {}, html_options = nil, &block
75
75
  block_given? ? content.merge!({ nav_type: type }) : options.merge!({ nav_type: type })
76
76
  @items << NavLink.new(content, options, html_options, &block).render
@@ -82,7 +82,7 @@ module UiBibz::Ui::Core
82
82
  end
83
83
 
84
84
  # Add nav dropdown items
85
- # See UiBibz::Ui::Core::NavDropdown
85
+ # See UiBibz::Ui::Core::Navs::NavDropdown
86
86
  def dropdown content = nil, options = {}, html_options = nil, &block
87
87
  @items << NavDropdown.new(content, options, html_options).tap(&block).render
88
88
  end
@@ -1,8 +1,8 @@
1
- require 'ui_bibz/ui/core/nav/components/navbar_nav'
2
- require 'ui_bibz/ui/core/nav/components/navbar_text'
3
- require 'ui_bibz/ui/core/nav/components/navbar_form'
4
- require 'ui_bibz/ui/core/nav/components/navbar_brand'
5
- module UiBibz::Ui::Core
1
+ require 'ui_bibz/ui/core/navs/components/navbar_nav'
2
+ require 'ui_bibz/ui/core/navs/components/navbar_text'
3
+ require 'ui_bibz/ui/core/navs/components/navbar_form'
4
+ require 'ui_bibz/ui/core/navs/components/navbar_brand'
5
+ module UiBibz::Ui::Core::Navs
6
6
 
7
7
  # Create a Navbar
8
8
  #
@@ -64,7 +64,7 @@ module UiBibz::Ui::Core
64
64
  # end
65
65
  # end
66
66
  #
67
- class Navbar < Component
67
+ class Navbar < UiBibz::Ui::Core::Component
68
68
 
69
69
  # See UiBibz::Ui::Core::Component.initialize
70
70
  def initialize content = nil, options = nil, html_options = nil, &block
@@ -86,13 +86,13 @@ module UiBibz::Ui::Core
86
86
  # See UiBibz::Ui::Core::NavbarNav
87
87
  def nav content = nil, options = nil, html_options = nil, &block
88
88
  options = options || {}
89
- @items << UiBibz::Ui::Core::NavbarNav.new(content, options, html_options).tap(&block).render
89
+ @items << UiBibz::Ui::Core::Navs::NavbarNav.new(content, options, html_options).tap(&block).render
90
90
  end
91
91
 
92
92
  # Add navbar form items
93
93
  # See UiBibz::Ui::Core::NavbarForm
94
94
  def form model_or_url, options = {}, &block
95
- @items << UiBibz::Ui::Core::NavbarForm.new(model_or_url, options, &block).render
95
+ @items << UiBibz::Ui::Core::Navs::NavbarForm.new(model_or_url, options, &block).render
96
96
  end
97
97
 
98
98
  # Not use !!!!!
@@ -103,7 +103,7 @@ module UiBibz::Ui::Core
103
103
  #end
104
104
 
105
105
  def brand content = nil, options = nil, html_options = nil, &block
106
- @brand = UiBibz::Ui::Core::NavbarBrand.new(content, options, html_options, &block).render
106
+ @brand = UiBibz::Ui::Core::Navs::NavbarBrand.new(content, options, html_options, &block).render
107
107
  end
108
108
 
109
109
  private
@@ -1,7 +1,7 @@
1
1
  require 'ui_bibz/ui/core/dropdown/components/dropdown_header'
2
2
  require 'ui_bibz/ui/core/dropdown/components/dropdown_divider'
3
3
  require 'ui_bibz/ui/core/dropdown/components/dropdown_link'
4
- module UiBibz::Ui::Ux
4
+ module UiBibz::Ui::Ux::Tables
5
5
  class Actions
6
6
 
7
7
  def initialize store
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
 
3
3
  # As
4
4
  #
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Column < UiBibz::Ui::Core::Component
3
3
 
4
4
  attr_accessor :hidden, :link, :status, :name, :input_options, :class, :as, :data_index, :date_format, :sort, :format, :date_format, :count, :custom_sort, :parent, :id
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Columns
3
3
 
4
4
  def initialize columns = nil
@@ -1,6 +1,6 @@
1
- require 'ui_bibz/ui/ux/table/components/columns'
2
- require 'ui_bibz/ui/ux/table/components/column'
3
- module UiBibz::Ui::Ux
1
+ require 'ui_bibz/ui/ux/tables/components/columns'
2
+ require 'ui_bibz/ui/ux/tables/components/column'
3
+ module UiBibz::Ui::Ux::Tables
4
4
  class Store
5
5
 
6
6
  attr_accessor :records
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
 
3
3
  # Create a Thead
4
4
  #
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Actionable < UiBibz::Ui::Base
3
3
 
4
4
  def initialize store, options, actions = nil
@@ -31,7 +31,7 @@ module UiBibz::Ui::Ux
31
31
  unless @actions.nil?
32
32
  @actions.format_action.call(record) unless @actions.format_action.nil?
33
33
  unless (default_actions? != true && @actions.raw_list.empty?)
34
- UiBibz::Ui::Core::ButtonDropdown.new(dropdown_action_name, { position: :right, size: :xs, glyph: actions_glyph }, { class: 'dropdown-action' }).tap do |d|
34
+ UiBibz::Ui::Core::Buttons::ButtonDropdown.new(dropdown_action_name, { position: :right, size: :xs, glyph: actions_glyph }, { class: 'dropdown-action' }).tap do |d|
35
35
  actions_links(record).each do |l|
36
36
  d.html l.to_s.html_safe
37
37
  end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Paginable < UiBibz::Ui::Base
3
3
  include WillPaginate::ActionView
4
4
 
@@ -11,8 +11,8 @@ module UiBibz::Ui::Ux
11
11
  # Render html tag
12
12
  def render
13
13
  content_tag :div, @html_options do
14
- concat UiBibz::Ui::Ux::TablePagination.new(store: @store).render
15
- concat UiBibz::Ui::Ux::TablePaginationPerPage.new(store: @store).render
14
+ concat UiBibz::Ui::Ux::Tables::TablePagination.new(store: @store).render
15
+ concat UiBibz::Ui::Ux::Tables::TablePaginationPerPage.new(store: @store).render
16
16
  concat tag(:br, class: 'ui-bibz-clear')
17
17
  end
18
18
  end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Searchable < UiBibz::Ui::Base
3
3
 
4
4
  def initialize store, options, html_options = nil
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Ux
1
+ module UiBibz::Ui::Ux::Tables
2
2
  class Sortable < UiBibz::Ui::Base
3
3
 
4
4
  def initialize store, options
@@ -1,19 +1,19 @@
1
- require "ui_bibz/ui/ux/table/components/store"
2
- require "ui_bibz/ui/ux/table/components/columns"
3
- require "ui_bibz/ui/ux/table/components/column"
4
- require "ui_bibz/ui/ux/table/components/actions"
5
- require "ui_bibz/ui/ux/table/components/thead"
6
- require "ui_bibz/ui/ux/table/components/as"
7
- require "ui_bibz/ui/ux/table/extensions/paginable"
8
- require "ui_bibz/ui/ux/table/extensions/paginable"
9
- require "ui_bibz/ui/ux/table/extensions/searchable"
10
- require "ui_bibz/ui/ux/table/extensions/sortable"
11
- require "ui_bibz/ui/ux/table/extensions/actionable"
12
- module UiBibz::Ui::Ux
1
+ require "ui_bibz/ui/ux/tables/components/store"
2
+ require "ui_bibz/ui/ux/tables/components/columns"
3
+ require "ui_bibz/ui/ux/tables/components/column"
4
+ require "ui_bibz/ui/ux/tables/components/actions"
5
+ require "ui_bibz/ui/ux/tables/components/thead"
6
+ require "ui_bibz/ui/ux/tables/components/as"
7
+ require "ui_bibz/ui/ux/tables/extensions/paginable"
8
+ require "ui_bibz/ui/ux/tables/extensions/paginable"
9
+ require "ui_bibz/ui/ux/tables/extensions/searchable"
10
+ require "ui_bibz/ui/ux/tables/extensions/sortable"
11
+ require "ui_bibz/ui/ux/tables/extensions/actionable"
12
+ module UiBibz::Ui::Ux::Tables
13
13
 
14
14
  # Create a Table
15
15
  #
16
- # This element is an extend of UiBibz::Ui::Ux::Component.
16
+ # This element is an extend of UiBibz::Ui::Core::Component.
17
17
  #
18
18
  # ==== Attributes
19
19
  #
@@ -47,9 +47,9 @@ module UiBibz::Ui::Ux
47
47
  #
48
48
  # ==== Signatures
49
49
  #
50
- # UiBibz::Ui::Ux::Table.new(store: @store)
50
+ # UiBibz::Ui::Ux::Tables::Table.new(store: @store)
51
51
  #
52
- # UiBibz::Ui::Ux::Table.new(store: @store, tap: true) do |t|
52
+ # UiBibz::Ui::Ux::Tables::Table.new(store: @store, tap: true) do |t|
53
53
  # t.columns do |c|
54
54
  # c.column :id, name: '#'
55
55
  # end
@@ -60,9 +60,9 @@ module UiBibz::Ui::Ux
60
60
  #
61
61
  # ==== Examples
62
62
  #
63
- # UiBibz::Ui::Ux::Table.new(store: @users).render
63
+ # UiBibz::Ui::Ux::Tables::Table.new(store: @users).render
64
64
  #
65
- # UiBibz::Ui::Ux::Table.new(store: @users).tap do |t|
65
+ # UiBibz::Ui::Ux::Tables::Table.new(store: @users).tap do |t|
66
66
  # t.columns do |c|
67
67
  # c.column :id, { name: '#' }
68
68
  # c.column :name_fr', { link: edit_user_path(:id), order: 2 }
@@ -1,9 +1,9 @@
1
- require "ui_bibz/ui/ux/table/components/store"
2
- module UiBibz::Ui::Ux
1
+ require "ui_bibz/ui/ux/tables/components/store"
2
+ module UiBibz::Ui::Ux::Tables
3
3
 
4
4
  # Create a TableCard
5
5
  #
6
- # This element is an extend of UiBibz::Ui::Ux::card.
6
+ # This element is an extend of UiBibz::Ui::Core::Cards::card.
7
7
  #
8
8
  # ==== Attributes
9
9
  #
@@ -37,9 +37,9 @@ module UiBibz::Ui::Ux
37
37
  #
38
38
  # ==== Signatures
39
39
  #
40
- # UiBibz::Ui::Ux::TableCard.new(store: @store)
40
+ # UiBibz::Ui::Ux::Tables::TableCard.new(store: @store)
41
41
  #
42
- # UiBibz::Ui::Ux::TableCard.new(store: @store, tap: true) do |t|
42
+ # UiBibz::Ui::Ux::Tables::TableCard.new(store: @store, tap: true) do |t|
43
43
  # t.columns do |c|
44
44
  # c.column '#', { data_index: '#' }
45
45
  # end
@@ -50,9 +50,9 @@ module UiBibz::Ui::Ux
50
50
  #
51
51
  # ==== Examples
52
52
  #
53
- # UiBibz::Ui::Ux::TableCard.new(store: @users, table_options: { actionable: false }).render
53
+ # UiBibz::Ui::Ux::Tables::TableCard.new(store: @users, table_options: { actionable: false }).render
54
54
  #
55
- # UiBibz::Ui::Ux::TableCard.new(store: @users).tap do |t|
55
+ # UiBibz::Ui::Ux::Tables::TableCard.new(store: @users).tap do |t|
56
56
  # t.header 'My Table card'
57
57
  # t.columns do |c|
58
58
  # c.column :id, { name: '# }, { class: 'column-id' }
@@ -103,15 +103,15 @@ module UiBibz::Ui::Ux
103
103
  # content
104
104
  # end
105
105
  # end
106
- class TableCard < UiBibz::Ui::Core::Card
106
+ class TableCard < UiBibz::Ui::Core::Cards::Card
107
107
 
108
108
  attr_accessor :columns
109
109
 
110
- # See UiBibz::Ui::Core::Component.initialize
110
+ # See UiBibz::Ui::Core::Cards::Card.initialize
111
111
  def initialize content = nil, options = nil, html_options = nil, &block
112
112
  super
113
113
  table_options = (@options[:table_options] || {}).merge({ store: store })
114
- @table = UiBibz::Ui::Ux::Table.new(table_options, @options[:table_html_options])
114
+ @table = UiBibz::Ui::Ux::Tables::Table.new(table_options, @options[:table_html_options])
115
115
  end
116
116
 
117
117
  # Render html tag
@@ -1,7 +1,7 @@
1
1
  require 'will_paginate'
2
2
  require "will_paginate-bootstrap"
3
- require "ui_bibz/ui/ux/table/components/store"
4
- module UiBibz::Ui::Ux
3
+ require "ui_bibz/ui/ux/tables/components/store"
4
+ module UiBibz::Ui::Ux::Tables
5
5
 
6
6
  # Create a pagination for table
7
7
  #
@@ -18,7 +18,7 @@ module UiBibz::Ui::Ux
18
18
  #
19
19
  # ==== Signatures
20
20
  #
21
- # UiBibz::Ui::Ux::TablePagination.new(store: @store)
21
+ # UiBibz::Ui::Ux::Tables::TablePagination.new(store: @store)
22
22
  #
23
23
  # ==== Helper
24
24
  #
@@ -1,5 +1,5 @@
1
- require "ui_bibz/ui/ux/table/components/store"
2
- module UiBibz::Ui::Ux
1
+ require "ui_bibz/ui/ux/tables/components/store"
2
+ module UiBibz::Ui::Ux::Tables
3
3
 
4
4
  # Create a select pagination per page
5
5
  #
@@ -16,7 +16,7 @@ module UiBibz::Ui::Ux
16
16
  #
17
17
  # ==== Signatures
18
18
  #
19
- # UiBibz::Ui::Ux::TablePaginationPerPage.new(store: @store)
19
+ # UiBibz::Ui::Ux::Tables::TablePaginationPerPage.new(store: @store)
20
20
  #
21
21
  # ==== Helper
22
22
  #
@@ -1,5 +1,6 @@
1
- require "ui_bibz/ui/ux/table/components/store"
2
- module UiBibz::Ui::Ux
1
+ require "ui_bibz/ui/ux/tables/components/store"
2
+ module UiBibz::Ui::Ux::Tables
3
+
3
4
  class TableSearchField < UiBibz::Ui::Core::Component
4
5
 
5
6
  # Initialize search_field with component item
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "2.0.0.alpha14"
2
+ VERSION = "2.0.0.alpha15"
3
3
  end
data/lib/ui_bibz.rb CHANGED
@@ -12,39 +12,50 @@ module UiBibz
12
12
 
13
13
  # Core
14
14
  module Core
15
+
15
16
  # Button section
16
- autoload :Button, "ui_bibz/ui/core/button/button"
17
- autoload :ButtonChoice, "ui_bibz/ui/core/button/button_choice"
18
- autoload :ButtonDropdown, "ui_bibz/ui/core/button/button_dropdown"
19
- autoload :ButtonGroup, "ui_bibz/ui/core/button/button_group"
20
- autoload :ButtonLink, "ui_bibz/ui/core/button/button_link"
21
- autoload :ButtonSplitDropdown, "ui_bibz/ui/core/button/button_split_dropdown"
17
+ module Buttons
18
+ autoload :Button, "ui_bibz/ui/core/buttons/button"
19
+ autoload :ButtonChoice, "ui_bibz/ui/core/buttons/button_choice"
20
+ autoload :ButtonDropdown, "ui_bibz/ui/core/buttons/button_dropdown"
21
+ autoload :ButtonGroup, "ui_bibz/ui/core/buttons/button_group"
22
+ autoload :ButtonLink, "ui_bibz/ui/core/buttons/button_link"
23
+ autoload :ButtonSplitDropdown, "ui_bibz/ui/core/buttons/button_split_dropdown"
24
+ end
22
25
 
23
26
  # Card section
24
- autoload :Card, "ui_bibz/ui/core/card/card"
25
- autoload :CardColumn, "ui_bibz/ui/core/card/card_column"
26
- autoload :CardDeck, "ui_bibz/ui/core/card/card_deck"
27
- autoload :CardGroup, "ui_bibz/ui/core/card/card_group"
27
+ module Cards
28
+ autoload :Card, "ui_bibz/ui/core/cards/card"
29
+ autoload :CardColumn, "ui_bibz/ui/core/cards/card_column"
30
+ autoload :CardDeck, "ui_bibz/ui/core/cards/card_deck"
31
+ autoload :CardGroup, "ui_bibz/ui/core/cards/card_group"
32
+ end
28
33
 
29
34
  # Input section
30
- autoload :AutocompleteField, "ui_bibz/ui/core/input/autocomplete_field"
31
- autoload :DatePickerField, "ui_bibz/ui/core/input/date_picker_field"
32
- autoload :DropdownSelectField, "ui_bibz/ui/core/input/dropdown_select_field"
33
- autoload :FormulaField, "ui_bibz/ui/core/input/formula_field"
34
- autoload :MarkdownEditorField, "ui_bibz/ui/core/input/markdown_editor_field"
35
- autoload :MultiColumnField, "ui_bibz/ui/core/input/multi_column_field"
36
- autoload :MultiSelectField, "ui_bibz/ui/core/input/multi_select_field"
37
- autoload :SurroundField, "ui_bibz/ui/core/input/surround_field"
38
- autoload :SwitchField, "ui_bibz/ui/core/input/switch_field"
35
+ module Inputs
36
+ autoload :AutocompleteField, "ui_bibz/ui/core/inputs/autocomplete_field"
37
+ autoload :DatePickerField, "ui_bibz/ui/core/inputs/date_picker_field"
38
+ autoload :DropdownSelectField, "ui_bibz/ui/core/inputs/dropdown_select_field"
39
+ autoload :FormulaField, "ui_bibz/ui/core/inputs/formula_field"
40
+ autoload :MarkdownEditorField, "ui_bibz/ui/core/inputs/markdown_editor_field"
41
+ autoload :MultiColumnField, "ui_bibz/ui/core/inputs/multi_column_field"
42
+ autoload :MultiSelectField, "ui_bibz/ui/core/inputs/multi_select_field"
43
+ autoload :SurroundField, "ui_bibz/ui/core/inputs/surround_field"
44
+ autoload :SwitchField, "ui_bibz/ui/core/inputs/switch_field"
45
+ end
39
46
 
40
47
  # Layout section
41
- autoload :Row, "ui_bibz/ui/core/layout/row"
42
- autoload :Col, "ui_bibz/ui/core/layout/col"
43
- autoload :Container, "ui_bibz/ui/core/layout/container"
48
+ module Layouts
49
+ autoload :Row, "ui_bibz/ui/core/layouts/row"
50
+ autoload :Col, "ui_bibz/ui/core/layouts/col"
51
+ autoload :Container, "ui_bibz/ui/core/layouts/container"
52
+ end
44
53
 
45
54
  # Nav section
46
- autoload :Nav, "ui_bibz/ui/core/nav/nav"
47
- autoload :Navbar, "ui_bibz/ui/core/nav/navbar"
55
+ module Navs
56
+ autoload :Nav, "ui_bibz/ui/core/navs/nav"
57
+ autoload :Navbar, "ui_bibz/ui/core/navs/navbar"
58
+ end
48
59
 
49
60
  # Other section
50
61
  autoload :Alert, "ui_bibz/ui/core/alert"
@@ -63,11 +74,16 @@ module UiBibz
63
74
 
64
75
  # Ux
65
76
  module Ux
66
- autoload :Table, "ui_bibz/ui/ux/table/table"
67
- autoload :TableCard, "ui_bibz/ui/ux/table/table_card"
68
- autoload :TableSearchField, "ui_bibz/ui/ux/table/table_search_field"
69
- autoload :TablePagination, "ui_bibz/ui/ux/table/table_pagination"
70
- autoload :TablePaginationPerPage, "ui_bibz/ui/ux/table/table_pagination_per_page"
77
+
78
+ # Table section
79
+ module Tables
80
+ autoload :Table, "ui_bibz/ui/ux/tables/table"
81
+ autoload :TableCard, "ui_bibz/ui/ux/tables/table_card"
82
+ autoload :TableSearchField, "ui_bibz/ui/ux/tables/table_search_field"
83
+ autoload :TablePagination, "ui_bibz/ui/ux/tables/table_pagination"
84
+ autoload :TablePaginationPerPage, "ui_bibz/ui/ux/tables/table_pagination_per_page"
85
+ end
86
+
71
87
  end
72
88
  end
73
89
 
data/test/store_test.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'test_helper'
2
- require "ui_bibz/ui/ux/table/components/store"
2
+ require "ui_bibz/ui/ux/tables/components/store"
3
3
  require 'will_paginate'
4
4
 
5
5
  class StoreTest < ActionView::TestCase
@@ -16,7 +16,7 @@ class StoreTest < ActionView::TestCase
16
16
  page: 1
17
17
  }
18
18
  users = User.table_search_pagination(params, session)
19
- @store = UiBibz::Ui::Ux::Store.new users
19
+ @store = UiBibz::Ui::Ux::Tables::Store.new users
20
20
  end
21
21
 
22
22
  test 'total pages' do