ui_bibz 2.0.0.beta2.5 → 2.0.0.beta2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/app/assets/javascripts/interface.coffee +1 -1
  4. data/app/inputs/ui_bibz_inputs/{ui_button_choices_input.rb → ui_choice_group_input.rb} +3 -3
  5. data/lib/ui_bibz.rb +28 -29
  6. data/lib/ui_bibz/helpers/ui/core/{cards_helper.rb → boxes_helper.rb} +14 -6
  7. data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +20 -11
  8. data/lib/ui_bibz/helpers/ui/core/icons_helper.rb +24 -0
  9. data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +11 -0
  10. data/lib/ui_bibz/helpers/ui/core/navigations_helper.rb +64 -0
  11. data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +43 -0
  12. data/lib/ui_bibz/helpers/ui/core_helper.rb +8 -79
  13. data/lib/ui_bibz/ui/core/{cards → boxes}/card.rb +19 -19
  14. data/lib/ui_bibz/ui/core/{cards → boxes}/card_column.rb +6 -6
  15. data/lib/ui_bibz/ui/core/{cards → boxes}/card_deck.rb +6 -6
  16. data/lib/ui_bibz/ui/core/{cards → boxes}/card_group.rb +6 -6
  17. data/lib/ui_bibz/ui/core/{cards → boxes}/components/body/card_body_link.rb +5 -5
  18. data/lib/ui_bibz/ui/core/{cards → boxes}/components/body/card_body_text.rb +5 -5
  19. data/lib/ui_bibz/ui/core/{cards → boxes}/components/body/card_body_title.rb +5 -5
  20. data/lib/ui_bibz/ui/core/{cards → boxes}/components/card_body.rb +11 -11
  21. data/lib/ui_bibz/ui/core/{cards → boxes}/components/card_footer.rb +5 -5
  22. data/lib/ui_bibz/ui/core/{cards → boxes}/components/card_header.rb +5 -5
  23. data/lib/ui_bibz/ui/core/{cards → boxes}/components/card_image.rb +5 -5
  24. data/lib/ui_bibz/ui/core/{cards → boxes}/components/card_list_group.rb +5 -5
  25. data/lib/ui_bibz/ui/core/{jumbotron.rb → boxes/jumbotron.rb} +6 -6
  26. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +8 -3
  27. data/lib/ui_bibz/ui/core/forms/buttons/button_choice.rb +3 -3
  28. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +1 -6
  29. data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_dropdown.rb +1 -1
  30. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +81 -0
  31. data/lib/ui_bibz/ui/core/forms/{buttons → choices}/components/choice.rb +11 -18
  32. data/lib/ui_bibz/ui/core/{dropdowns → forms/dropdowns}/components/dropdown_divider.rb +1 -1
  33. data/lib/ui_bibz/ui/core/{dropdowns → forms/dropdowns}/components/dropdown_header.rb +5 -5
  34. data/lib/ui_bibz/ui/core/{dropdowns → forms/dropdowns}/components/dropdown_link.rb +5 -5
  35. data/lib/ui_bibz/ui/core/{dropdowns → forms/dropdowns}/dropdown.rb +12 -12
  36. data/lib/ui_bibz/ui/core/{dropdowns → forms/dropdowns}/split_dropdown.rb +6 -6
  37. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +1 -1
  38. data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +8 -3
  39. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +1 -1
  40. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +1 -1
  41. data/lib/ui_bibz/ui/core/{glyph.rb → icons/glyph.rb} +10 -10
  42. data/lib/ui_bibz/ui/core/{star.rb → icons/star.rb} +6 -6
  43. data/lib/ui_bibz/ui/core/lists/components/list.rb +2 -2
  44. data/lib/ui_bibz/ui/core/{breadcrumb.rb → navigations/breadcrumb.rb} +8 -12
  45. data/lib/ui_bibz/ui/core/{paths → navigations}/components/breadcrumb_link.rb +5 -5
  46. data/lib/ui_bibz/ui/core/{navs → navigations}/components/nav_dropdown.rb +5 -5
  47. data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +68 -0
  48. data/lib/ui_bibz/ui/core/{navs → navigations}/components/nav_link_link.rb +1 -1
  49. data/lib/ui_bibz/ui/core/{navs → navigations}/components/nav_link_list.rb +1 -1
  50. data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +50 -0
  51. data/lib/ui_bibz/ui/core/{navs → navigations}/components/navbar_brand.rb +1 -1
  52. data/lib/ui_bibz/ui/core/{navs → navigations}/components/navbar_form.rb +4 -4
  53. data/lib/ui_bibz/ui/core/{navs → navigations}/components/navbar_nav.rb +7 -7
  54. data/lib/ui_bibz/ui/core/{navs → navigations}/components/navbar_text.rb +5 -5
  55. data/lib/ui_bibz/ui/core/{navs → navigations}/components/pagination_link.rb +6 -6
  56. data/lib/ui_bibz/ui/core/navigations/link.rb +54 -0
  57. data/lib/ui_bibz/ui/core/{navs → navigations}/nav.rb +24 -13
  58. data/lib/ui_bibz/ui/core/{navs → navigations}/navbar.rb +9 -9
  59. data/lib/ui_bibz/ui/core/{navs → navigations}/pagination.rb +6 -6
  60. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +82 -0
  61. data/lib/ui_bibz/ui/core/{forms/buttons/button_toolbar.rb → navigations/toolbar.rb} +12 -8
  62. data/lib/ui_bibz/ui/core/{badge.rb → notifications/badge.rb} +8 -9
  63. data/lib/ui_bibz/ui/core/{progresses → notifications}/components/bar.rb +6 -6
  64. data/lib/ui_bibz/ui/core/{progresses → notifications}/progress_bar.rb +11 -11
  65. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +1 -1
  66. data/lib/ui_bibz/ui/extensions/core/component/klass_extension.rb +18 -2
  67. data/lib/ui_bibz/ui/ux/tables/components/actions.rb +9 -9
  68. data/lib/ui_bibz/ui/ux/tables/components/as.rb +2 -2
  69. data/lib/ui_bibz/ui/ux/tables/extensions/actionable.rb +1 -1
  70. data/lib/ui_bibz/ui/ux/tables/extensions/searchable.rb +1 -1
  71. data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +1 -1
  72. data/lib/ui_bibz/ui/ux/tables/table_card.rb +3 -3
  73. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +4 -4
  74. data/lib/ui_bibz/utils/screwdriver.rb +10 -1
  75. data/lib/ui_bibz/version.rb +1 -1
  76. data/structure.md +64 -0
  77. data/test/ui/core/{cards → boxes}/card_test.rb +0 -0
  78. data/test/ui/core/{jumbotron_test.rb → boxes/jumbotron_test.rb} +0 -0
  79. data/test/ui/core/forms/buttons/button_test.rb +1 -1
  80. data/test/ui/core/forms/choices/choice_group_test.rb +36 -0
  81. data/test/ui/core/{dropdowns → forms/dropdowns}/dropdown_test.rb +5 -5
  82. data/test/ui/core/forms/selects/multi_select_field_test.rb +2 -2
  83. data/test/ui/core/{glyph_test.rb → icons/glyph_test.rb} +0 -0
  84. data/test/ui/core/{star_test.rb → icons/star_test.rb} +0 -0
  85. data/test/ui/core/{paths → navigations}/breadcrumb_test.rb +0 -0
  86. data/test/ui/core/{navs → navigations}/nav_test.rb +0 -0
  87. data/test/ui/core/{navs → navigations}/navbar_test.rb +4 -4
  88. data/test/ui/core/navigations/pagination_test.rb +38 -0
  89. data/test/ui/core/navigations/tab_group_test.rb +49 -0
  90. data/test/ui/core/navigations/toolbar_test.rb +31 -0
  91. data/test/ui/core/{badge_test.rb → notifications/badge_test.rb} +0 -0
  92. data/test/ui/core/{progress_test.rb → notifications/progress_bar_test.rb} +1 -1
  93. metadata +79 -69
  94. data/lib/ui_bibz/helpers/ui/core/dropdowns_helper.rb +0 -21
  95. data/lib/ui_bibz/helpers/ui/core/navs_helper.rb +0 -27
  96. data/lib/ui_bibz/helpers/ui/core/paths_helper.rb +0 -16
  97. data/lib/ui_bibz/ui/core/navs/components/nav_link.rb +0 -60
  98. data/lib/ui_bibz/ui/core/paths/breadcrumb.rb +0 -109
  99. data/test/ui/core/forms/buttons/button_choice_test.rb +0 -36
@@ -77,7 +77,8 @@ module UiBibz::Ui::Core::Forms::Selects
77
77
  clickable_opt_group
78
78
  collapsible_opt_group
79
79
  searchable
80
- select_all_option
80
+ select_all_options
81
+ number_displayed
81
82
  end
82
83
 
83
84
  def clickable_opt_group
@@ -92,8 +93,12 @@ module UiBibz::Ui::Core::Forms::Selects
92
93
  add_html_data('enable_filtering') if options[:searchable]
93
94
  end
94
95
 
95
- def select_all_option
96
- add_html_data('include_select_all_option') if options[:select_all_option]
96
+ def number_displayed
97
+ add_html_data('number_displayed') if options[:number_displayed]
98
+ end
99
+
100
+ def select_all_options
101
+ add_html_data('include_select_all_option') if options[:select_all_options]
97
102
  end
98
103
 
99
104
  def status
@@ -1,5 +1,5 @@
1
1
  module UiBibz::Ui::Core::Forms::Surrounds
2
- class SurroundDropdown < UiBibz::Ui::Core::Dropdowns::Dropdown
2
+ class SurroundDropdown < UiBibz::Ui::Core::Forms::Dropdowns::Dropdown
3
3
 
4
4
  # See UiBibz::Ui::Core::Dropdown.initialize
5
5
  def initialize content, options = nil, html_options = nil, &block
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core::Forms::Surrounds
70
70
  end
71
71
 
72
72
  def glyph content = nil, options = {}, html_options = nil, &block
73
- @items << SurroundAddon.new(UiBibz::Ui::Core::Glyph.new(content, options, html_options, &block).render).render
73
+ @items << SurroundAddon.new(UiBibz::Ui::Core::Icons::Glyph.new(content, options, html_options, &block).render).render
74
74
  end
75
75
 
76
76
  def addon content = nil, options = {}, html_options = nil, &block
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core
1
+ module UiBibz::Ui::Core::Icons
2
2
 
3
3
  # Create a glyph
4
4
  #
@@ -23,28 +23,28 @@ module UiBibz::Ui::Core
23
23
  #
24
24
  # ==== Signatures
25
25
  #
26
- # UiBibz::Ui::Core::Glyph.new content = nil, options = nil, html_options = nil,
26
+ # UiBibz::Ui::Core::Icons::Glyph.new content = nil, options = nil, html_options = nil,
27
27
  # &block
28
28
  #
29
- # UiBibz::Ui::Core::Glyph.new(options = nil, html_options = nil) do
29
+ # UiBibz::Ui::Core::Icons::Glyph.new(options = nil, html_options = nil) do
30
30
  # content
31
31
  # end
32
32
  #
33
- # UiBibz::Ui::Core::Glyph.new content = {}
33
+ # UiBibz::Ui::Core::Icons::Glyph.new content = {}
34
34
  #
35
- # UiBibz::Ui::Core::Glyph.new content, options = {}, html_options = {}
35
+ # UiBibz::Ui::Core::Icons::Glyph.new content, options = {}, html_options = {}
36
36
  #
37
37
  # ==== Exemples
38
38
  #
39
- # UiBibz::Ui::Core::Glyph.new('eye').render
39
+ # UiBibz::Ui::Core::Icons::Glyph.new('eye').render
40
40
  #
41
- # UiBibz::Ui::Core::Glyph.new() do
41
+ # UiBibz::Ui::Core::Icons::Glyph.new() do
42
42
  # name
43
43
  # end.render
44
44
  #
45
- # UiBibz::Ui::Core::Glyph.new('eye', { size: 3, type: 'fw' }).render
45
+ # UiBibz::Ui::Core::Icons::Glyph.new('eye', { size: 3, type: 'fw' }).render
46
46
  #
47
- # UiBibz::Ui::Core::Glyph.new({ name: 'eye', size: 3, type: 'fw' }).render
47
+ # UiBibz::Ui::Core::Icons::Glyph.new({ name: 'eye', size: 3, type: 'fw' }).render
48
48
  #
49
49
  # ==== Helper
50
50
  #
@@ -55,7 +55,7 @@ module UiBibz::Ui::Core
55
55
  # glyph(options = {}, html_options = {}) do
56
56
  # name
57
57
  # end
58
- class Glyph < Component
58
+ class Glyph < UiBibz::Ui::Core::Component
59
59
 
60
60
  # See UiBibz::Ui::Core::Component.initialize
61
61
  def initialize content, options = nil, html_options = nil, &block
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core
1
+ module UiBibz::Ui::Core::Icons
2
2
 
3
3
  # Create star notation
4
4
  #
@@ -20,17 +20,17 @@ module UiBibz::Ui::Core
20
20
  #
21
21
  # ==== Signatures
22
22
  #
23
- # UiBibz::Ui::Core::Star.new(content, options = nil, html_options = nil)
23
+ # UiBibz::Ui::Core::Icons::Star.new(content, options = nil, html_options = nil)
24
24
  #
25
- # UiBibz::Ui::Core::Star.new(options = nil, html_options = nil) do
25
+ # UiBibz::Ui::Core::Icons::Star.new(options = nil, html_options = nil) do
26
26
  # content
27
27
  # end
28
28
  #
29
29
  # ==== Examples
30
30
  #
31
- # UiBibz::Ui::Core::Star.new(content, status: :success).render
31
+ # UiBibz::Ui::Core::Icons::Star.new(content, status: :success).render
32
32
  #
33
- # UiBibz::Ui::Core::Star.new({ num: 10 }) do
33
+ # UiBibz::Ui::Core::Icons::Star.new({ num: 10 }) do
34
34
  # #content
35
35
  # end.render
36
36
  #
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core
70
70
  number.times do |star|
71
71
  star += 1
72
72
  name = star_name(star)
73
- stars << UiBibz::Ui::Core::Glyph.new(name, glyph_opts).render
73
+ stars << UiBibz::Ui::Core::Icons::Glyph.new(name, glyph_opts).render
74
74
  end
75
75
  stars
76
76
  end
@@ -134,10 +134,10 @@ module UiBibz::Ui::Core::Lists::Components
134
134
  def badge_html
135
135
  if options[:badge].kind_of? Hash
136
136
  options[:badge][:status] = options[:status] || :secondary
137
- UiBibz::Ui::Core::Badge.new(options[:badge].delete(:content), options[:badge]).render
137
+ UiBibz::Ui::Core::Notifications::Badge.new(options[:badge].delete(:content), options[:badge]).render
138
138
 
139
139
  else
140
- UiBibz::Ui::Core::Badge.new(options[:badge], type: :pill, status: (options[:status] || :secondary)).render
140
+ UiBibz::Ui::Core::Notifications::Badge.new(options[:badge], type: :pill, status: (options[:status] || :secondary)).render
141
141
  end
142
142
  end
143
143
 
@@ -1,5 +1,5 @@
1
- require 'ui_bibz/ui/core/breadcrumb/components/breadcrumb_link'
2
- module UiBibz::Ui::Core
1
+ require 'ui_bibz/ui/core/navigations/components/breadcrumb_link'
2
+ module UiBibz::Ui::Core::Navigations
3
3
 
4
4
  # Breadcrumb
5
5
  #
@@ -17,24 +17,20 @@ module UiBibz::Ui::Core
17
17
  #
18
18
  # ==== Components
19
19
  #
20
- # +link+ is UiBibz::Ui::Core::BreadCrumb::Components::BreadcrumbLink component
20
+ # +link+ is UiBibz::Ui::Core::Navigations::BreadCrumb::Components::BreadcrumbLink component
21
21
  #
22
22
  # ==== Signatures
23
23
  #
24
- # UiBibz::Ui::Core::Breadcrumb.new().tap do |b|
24
+ # UiBibz::Ui::Core::Navigations::Breadcrumb.new().tap do |b|
25
25
  # b.link content = nil, options = nil, html_options = nil, &block
26
26
  # b.link content = nil, options = nil, html_options = nil, &block
27
27
  # b.link content = nil, options = nil, html_options = nil, &block
28
28
  # ...
29
29
  # end
30
30
  #
31
- # UiBibz::Ui::Core::Alert.new(options = nil, html_options = nil) do
32
- # content
33
- # end
34
- #
35
31
  # ==== Examples
36
32
  #
37
- # UiBibz::Ui::Core::Breadcrumb.new().tap do |b|
33
+ # UiBibz::Ui::Core::Navigations::Breadcrumb.new().tap do |b|
38
34
  # b.link 'Home', url: '#home'
39
35
  # b.link url: '#level-1' do
40
36
  # 'Level 1'
@@ -70,7 +66,7 @@ module UiBibz::Ui::Core
70
66
  # Add breadcrumb link items
71
67
  # See UiBibz::Ui::Core::BreadcrumbLink
72
68
  def link content = nil, options = nil, html_options = nil, &block
73
- @links << UiBibz::Ui::Core::Breadcrumbs::Components::BreadcrumbLink.new(content, options, html_options, &block).render
69
+ @links << UiBibz::Ui::Core::Navigations::Components::BreadcrumbLink.new(content, options, html_options, &block).render
74
70
  end
75
71
 
76
72
  private
@@ -98,9 +94,9 @@ module UiBibz::Ui::Core
98
94
  def generate_links
99
95
  @options[:store].each do |item|
100
96
  if item == @options[:store].last
101
- @links << UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new(item.send(link_label), status: :disabled).render
97
+ @links << UiBibz::Ui::Core::Navigations::Components::BreadcrumbLink.new(item.send(link_label), status: :disabled).render
102
98
  else
103
- @links << UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new(item.send(link_label), url: inject_url(link_url, item)).render
99
+ @links << UiBibz::Ui::Core::Navigations::Components::BreadcrumbLink.new(item.send(link_label), url: inject_url(link_url, item)).render
104
100
  end
105
101
  end
106
102
  end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core::Paths::Components
1
+ module UiBibz::Ui::Core::Navigations::Components
2
2
 
3
3
  # Create a BreadcrumbLink
4
4
  #
@@ -24,17 +24,17 @@ module UiBibz::Ui::Core::Paths::Components
24
24
  #
25
25
  # ==== Signatures
26
26
  #
27
- # UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new(content, options = nil, html_options = nil)
27
+ # UiBibz::Ui::Core::Navigations::Breadcrumb::Components::BreadcrumbLink.new(content, options = nil, html_options = nil)
28
28
  #
29
- # UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new(options = nil, html_options = nil) do
29
+ # UiBibz::Ui::Core::Navigations::Breadcrumb::Components::BreadcrumbLink.new(options = nil, html_options = nil) do
30
30
  # content
31
31
  # end
32
32
  #
33
33
  # ==== Examples
34
34
  #
35
- # UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new('Home', { glyph: 'home', state: :active },{ class: 'test' }).render
35
+ # UiBibz::Ui::Core::Navigations::Breadcrumb::Components::BreadcrumbLink.new('Home', { glyph: 'home', state: :active },{ class: 'test' }).render
36
36
  #
37
- # UiBibz::Ui::Core::Breadcrumb::Components::BreadcrumbLink.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
37
+ # UiBibz::Ui::Core::Navigations::Breadcrumb::Components::BreadcrumbLink.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
38
38
  # 'Home'
39
39
  # end.render
40
40
  #
@@ -1,8 +1,8 @@
1
- module UiBibz::Ui::Core::Navs
1
+ module UiBibz::Ui::Core::Navigations
2
2
 
3
3
  # Create a dropdown
4
4
  #
5
- # This element is an extend of UiBibz::Ui::Core::Navs::Component.
5
+ # This element is an extend of UiBibz::Ui::Core::Navigations::Component.
6
6
  # You can use tap method to add list items.
7
7
  #
8
8
  # ==== Attributes
@@ -26,7 +26,7 @@ module UiBibz::Ui::Core::Navs
26
26
  #
27
27
  # ==== Signatures
28
28
  #
29
- # UiBibz::Ui::Core::Navs::NavDropdown.new(options = nil, html_options = nil).tap do |d|
29
+ # UiBibz::Ui::Core::Navigations::NavDropdown.new(options = nil, html_options = nil).tap do |d|
30
30
  # ...
31
31
  # d.list content = nil, options = nil, html_options = nil, &block
32
32
  # d.list content = nil, options = nil, html_options = nil, &block
@@ -36,12 +36,12 @@ module UiBibz::Ui::Core::Navs
36
36
  #
37
37
  # ==== Examples
38
38
  #
39
- # UiBibz::Ui::Core::Navs::NavDropdown.new(name, status: :success).tap do |d|
39
+ # UiBibz::Ui::Core::Navigations::NavDropdown.new(name, status: :success).tap do |d|
40
40
  # d.list link_to('test', '#')
41
41
  # d.list link_to('test2', '#')
42
42
  # end.render
43
43
  #
44
- class NavDropdown < UiBibz::Ui::Core::Dropdowns::Dropdown
44
+ class NavDropdown < UiBibz::Ui::Core::Forms::Dropdowns::Dropdown
45
45
 
46
46
  # See UiBibz::Ui::Core::Dropdown.initialize
47
47
  def initialize content, options = nil, html_options = nil, &block
@@ -0,0 +1,68 @@
1
+ require 'ui_bibz/ui/core/navigations/components/nav_link_link'
2
+ require 'ui_bibz/ui/core/navigations/components/nav_link_list'
3
+ module UiBibz::Ui::Core::Navigations
4
+
5
+ # Create a NavLink
6
+ #
7
+ # This element is an extend of UiBibz::Ui::Core::Navigations::Component.
8
+ #
9
+ # ==== Attributes
10
+ #
11
+ # * +content+ - Content of element
12
+ # * +options+ - Options of element
13
+ # * +html_options+ - Html Options of element
14
+ #
15
+ # ==== Options
16
+ #
17
+ # You can add HTML attributes using the +html_options+.
18
+ # You can pass arguments in options attribute:
19
+ # * +state+ - status of élement with symbol value:
20
+ # (+:active+)
21
+ # * +url+ - String
22
+ # * +badge+ - String
23
+ # * +link_html_options+ - Hash
24
+ #
25
+ # ==== Signatures
26
+ #
27
+ # UiBibz::Ui::Core::Navigations::NavLink.new(content, options = nil, html_options = nil)
28
+ #
29
+ # UiBibz::Ui::Core::Navigations::NavLink.new(options = nil, html_options = nil) do
30
+ # content
31
+ # end
32
+ #
33
+ # ==== Examples
34
+ #
35
+ # UiBibz::Ui::Core::Navigations::NavLink.new(content, { badge: 15, url: '/', state: :active, link_html_options: { class: 'link1' }},{ class: 'test' }).render
36
+ #
37
+ # UiBibz::Ui::Core::Navigations::NavLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
38
+ # 'Home'
39
+ # end.render
40
+ #
41
+ class NavLink < UiBibz::Ui::Core::Component
42
+
43
+ # See UiBibz::Ui::Core::Component.initialize
44
+ def initialize content = nil, options = nil, html_options = nil, &block
45
+ super
46
+ end
47
+
48
+ # Render html tag
49
+ def render
50
+ if options[:nav_type] == "nav-links"
51
+ UiBibz::Ui::Core::Navigations::NavLinkLink.new(content, options, html_options).render
52
+ else
53
+ cont = UiBibz::Ui::Core::Navigations::NavLinkLink.new(content, options).render
54
+ #html_options[:class] = remove_class(html_options[:class])
55
+ remove_classes
56
+ UiBibz::Ui::Core::Navigations::NavLinkList.new(cont, options, html_options).render
57
+ end
58
+ end
59
+
60
+ private
61
+
62
+ def remove_classes
63
+ exclude_classes_in_html_options %w(active disabled)
64
+ options.delete(:state)
65
+ end
66
+
67
+ end
68
+ end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core::Navs
1
+ module UiBibz::Ui::Core::Navigations
2
2
 
3
3
  # Create a NavLinkLink
4
4
  #
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core::Navs
1
+ module UiBibz::Ui::Core::Navigations
2
2
 
3
3
  # Create a NavLinkList
4
4
  #
@@ -0,0 +1,50 @@
1
+ module UiBibz::Ui::Core::Navigations
2
+
3
+ # Create a NavLinkLink
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
+ # * +state+ - status of élement with symbol value:
18
+ # (+:active+)
19
+ #
20
+ class NavText < UiBibz::Ui::Core::Component
21
+
22
+ # UiBibz::Ui::Core::Component.initialize
23
+ def initialize content = nil, options = nil, html_options = nil, &block
24
+ super
25
+ end
26
+
27
+ # Render html tag
28
+ def render
29
+ options[:nav_type] == "nav-links" ? content_html : content_tag(:li, content_html, class: 'nav-item nav-text')
30
+ end
31
+
32
+ private
33
+
34
+ def content_html
35
+ content_tag :span, html_options do
36
+ concat glyph_and_content_html
37
+ concat tag_html if options[:tag]
38
+ end
39
+ end
40
+
41
+ def component_html_classes
42
+ "nav-link"
43
+ end
44
+
45
+ def component_html_options
46
+ options[:nav_type] == "nav-tabs" ? { "data-toggle" => "tab", role: 'tab' } : {}
47
+ end
48
+
49
+ end
50
+ end
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core::Navs
1
+ module UiBibz::Ui::Core::Navigations
2
2
 
3
3
  # Create a Navbar
4
4
  #
@@ -1,5 +1,5 @@
1
1
  require 'haml'
2
- module UiBibz::Ui::Core::Navs
2
+ module UiBibz::Ui::Core::Navigations
3
3
 
4
4
  # Create a NavbarForm
5
5
  #
@@ -22,19 +22,19 @@ module UiBibz::Ui::Core::Navs
22
22
  #
23
23
  # ==== Signatures
24
24
  #
25
- # UiBibz::Ui::Core::Navs::NavbarForm.new(options = nil, html_options = nil) do |f|
25
+ # UiBibz::Ui::Core::Navigations::NavbarForm.new(options = nil, html_options = nil) do |f|
26
26
  # f.text_field :field
27
27
  # f.submit 'Submit'
28
28
  # end
29
29
  #
30
30
  # ==== Examples
31
31
  #
32
- # UiBibz::Ui::Core::Navs::NavbarForm.new(position: :right) do |f|
32
+ # UiBibz::Ui::Core::Navigations::NavbarForm.new(position: :right) do |f|
33
33
  # f.text_field :field
34
34
  # f.submit 'Submit'
35
35
  # end.render
36
36
  #
37
- # UiBibz::Ui::Core::Navs::NavbarForm.new('/search', type: :form_tag) do
37
+ # UiBibz::Ui::Core::Navigations::NavbarForm.new('/search', type: :form_tag) do
38
38
  # text_field_tag :field
39
39
  # submit_tag 'Submit'
40
40
  # end.render
@@ -1,8 +1,8 @@
1
- module UiBibz::Ui::Core::Navs
1
+ module UiBibz::Ui::Core::Navigations
2
2
 
3
3
  # Create a NavbarNav
4
4
  #
5
- # This element is an extend of UiBibz::Ui::Core::Navs::Nav.
5
+ # This element is an extend of UiBibz::Ui::Core::Navigations::Nav.
6
6
  #
7
7
  # ==== Attributes
8
8
  #
@@ -21,9 +21,9 @@ module UiBibz::Ui::Core::Navs
21
21
  #
22
22
  # ==== Signatures
23
23
  #
24
- # UiBibz::Ui::Core::Navs::NavbarNav.new(content, options = nil, html_options = nil)
24
+ # UiBibz::Ui::Core::Navigations::NavbarNav.new(content, options = nil, html_options = nil)
25
25
  #
26
- # UiBibz::Ui::Core::Navs::NavbarNav.new(options = nil, html_options = nil).tap do |n|
26
+ # UiBibz::Ui::Core::Navigations::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::Navs
31
31
  #
32
32
  # ==== Examples
33
33
  #
34
- # UiBibz::Ui::Core::Navs::NavbarNav.new().tap do |n|
34
+ # UiBibz::Ui::Core::Navigations::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 < UiBibz::Ui::Core::Navs::Nav
39
+ class NavbarNav < UiBibz::Ui::Core::Navigations::Nav
40
40
 
41
- # See UiBibz::Ui::Core::Navs::Nav.initialize
41
+ # See UiBibz::Ui::Core::Navigations::Nav.initialize
42
42
  def initialize content = nil, options = nil, html_options = nil, &block
43
43
  super
44
44
  end