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
@@ -1,4 +1,4 @@
1
- module UiBibz::Ui::Core::Progresses::Components
1
+ module UiBibz::Ui::Core::Notifications::Components
2
2
 
3
3
  # Create a bar
4
4
  #
@@ -24,19 +24,19 @@ module UiBibz::Ui::Core::Progresses::Components
24
24
  #
25
25
  # ==== Signatures
26
26
  #
27
- # UiBibz::Ui::Core::Bar.new(percentage, options = nil, html_options = nil)
27
+ # UiBibz::Ui::Core::Notifications::Components::Bar.new(percentage, options = nil, html_options = nil)
28
28
  #
29
- # UiBibz::Ui::Core::Bar.new(options = nil, html_options = nil) do
29
+ # UiBibz::Ui::Core::Notifications::Components::Bar.new(options = nil, html_options = nil) do
30
30
  # percentage
31
31
  # end
32
32
  #
33
33
  # ==== Examples
34
34
  #
35
- # UiBibz::Ui::Core::Bar.new(50%, { value: 50})
35
+ # UiBibz::Ui::Core::Notifications::Components::Bar.new(50%, { value: 50})
36
36
  # # or
37
- # UiBibz::Ui::Core::Bar.new(10%, { value: 10, status: :success },{ class: 'test' }).render
37
+ # UiBibz::Ui::Core::Notifications::Components::Bar.new(10%, { value: 10, status: :success },{ class: 'test' }).render
38
38
  # # or
39
- # UiBibz::Ui::Core::Bar.new({ value: 10, status: :success},{ class: 'test' }) do
39
+ # UiBibz::Ui::Core::Notifications::Components::Bar.new({ value: 10, status: :success},{ class: 'test' }) do
40
40
  # 10%
41
41
  # end.render
42
42
  #
@@ -1,5 +1,5 @@
1
- require 'ui_bibz/ui/core/progresses/components/bar'
2
- module UiBibz::Ui::Core::Progresses
1
+ require 'ui_bibz/ui/core/notifications/components/bar'
2
+ module UiBibz::Ui::Core::Notifications
3
3
 
4
4
  # Create a progress bar
5
5
  #
@@ -26,19 +26,19 @@ module UiBibz::Ui::Core::Progresses
26
26
  #
27
27
  # ==== Signatures
28
28
  #
29
- # UiBibz::Ui::Core::ProgressBar.new(percentage, options = nil, html_options = nil)
29
+ # UiBibz::Ui::Core::Notifications::ProgressBar.new(percentage, options = nil, html_options = nil)
30
30
  #
31
- # UiBibz::Ui::Core::ProgressBar.new(options = nil, html_options = nil) do
31
+ # UiBibz::Ui::Core::Notifications::ProgressBar.new(options = nil, html_options = nil) do
32
32
  # percentage
33
33
  # end
34
34
  #
35
35
  # ==== Examples
36
36
  #
37
- # UiBibz::Ui::Core::ProgressBar.new(50%, { value: 50})
37
+ # UiBibz::Ui::Core::Notifications::ProgressBar.new(50%, { value: 50})
38
38
  # # or
39
- # UiBibz::Ui::Core::ProgressBar.new(10%, { value: 10, status: :success },{ class: 'test' }).render
39
+ # UiBibz::Ui::Core::Notifications::ProgressBar.new(10%, { value: 10, status: :success },{ class: 'test' }).render
40
40
  # # or
41
- # UiBibz::Ui::Core::ProgressBar.new({ value: 10, status: :success},{ class: 'test' }) do
41
+ # UiBibz::Ui::Core::Notifications::ProgressBar.new({ value: 10, status: :success},{ class: 'test' }) do
42
42
  # 10%
43
43
  # end.render
44
44
  #
@@ -67,7 +67,7 @@ module UiBibz::Ui::Core::Progresses
67
67
  end
68
68
 
69
69
  def bar content = nil, options = nil, html_options = nil, &block
70
- @bars << UiBibz::Ui::Core::Progresses::Components::Bar.new(content, options, html_options, &block).render
70
+ @bars << UiBibz::Ui::Core::Notifications::Components::Bar.new(content, options, html_options, &block).render
71
71
  end
72
72
 
73
73
  private
@@ -82,7 +82,7 @@ module UiBibz::Ui::Core::Progresses
82
82
  elsif options[:stacked]
83
83
  stacked_bars
84
84
  else
85
- [UiBibz::Ui::Core::Progresses::Components::Bar.new(content, options).render]
85
+ [UiBibz::Ui::Core::Notifications::Components::Bar.new(content, options).render]
86
86
  end
87
87
  end
88
88
 
@@ -95,9 +95,9 @@ module UiBibz::Ui::Core::Progresses
95
95
  stacked_colors.map.with_index do |color, i|
96
96
  if percentages[0, i].sum <= content.to_f
97
97
  if content.to_f.between?(percentages[0, i].sum , percentages[0, i+1].sum)
98
- UiBibz::Ui::Core::Progresses::Components::Bar.new((content.to_f*percentages[i]/100), min: 0, striped: options[:striped], animated: options[:animated], max: 100, status: color).render
98
+ UiBibz::Ui::Core::Notifications::Components::Bar.new((content.to_f*percentages[i]/100), min: 0, striped: options[:striped], animated: options[:animated], max: 100, status: color).render
99
99
  else
100
- UiBibz::Ui::Core::Progresses::Components::Bar.new(percentages[i], min: 0, striped: options[:striped], animated: options[:animated], max: 100, status: color).render
100
+ UiBibz::Ui::Core::Notifications::Components::Bar.new(percentages[i], min: 0, striped: options[:striped], animated: options[:animated], max: 100, status: color).render
101
101
  end
102
102
  end
103
103
  end
@@ -13,7 +13,7 @@ module GlyphExtension
13
13
  # Render glyph html
14
14
  def glyph
15
15
  glyph_info = options[:glyph] if options.kind_of?(Hash)
16
- UiBibz::Ui::Core::Glyph.new(glyph_info).render unless glyph_info.nil?
16
+ UiBibz::Ui::Core::Icons::Glyph.new(glyph_info).render unless glyph_info.nil?
17
17
  end
18
18
 
19
19
  end
@@ -4,15 +4,23 @@ module KlassExtension
4
4
  UiBibz::Utils::Screwdriver.join_classes classes
5
5
  end
6
6
 
7
+ def exclude_classes arr, *classes
8
+ UiBibz::Utils::Screwdriver.exclude_classes arr, classes
9
+ end
10
+
7
11
  # Override this method to add a status class
8
12
  def status
9
13
  end
10
14
 
15
+ def exclude_classes_in_html_options *classes
16
+ html_options[:class] = exclude_classes html_options[:class], classes
17
+ end
18
+
11
19
  private
12
20
 
13
21
  def initialize_component_html_classes
14
22
  cls = [
15
- html_options[:class],
23
+ original_html_options,
16
24
  state,
17
25
  status,
18
26
  effect,
@@ -23,12 +31,16 @@ module KlassExtension
23
31
  html_options[:class] = join_classes(cls)
24
32
  end
25
33
 
34
+ def original_html_options
35
+ transform_classes_to_array(html_options[:class])
36
+ end
37
+
26
38
  def effect
27
39
  options[:effect]
28
40
  end
29
41
 
30
42
  def options_classes
31
- options[:class] if options.kind_of?(Hash)
43
+ transform_classes_to_array(options[:class])
32
44
  end
33
45
 
34
46
  def state
@@ -39,4 +51,8 @@ module KlassExtension
39
51
  "ui-bibz-connect" unless options[:connect].nil?
40
52
  end
41
53
 
54
+ def transform_classes_to_array classes
55
+ UiBibz::Utils::Screwdriver.uniq_word_in_string(classes.kind_of?(String) ? classes : classes.join(' ')) unless classes.nil?
56
+ end
57
+
42
58
  end
@@ -1,6 +1,6 @@
1
- require 'ui_bibz/ui/core/dropdowns/components/dropdown_header'
2
- require 'ui_bibz/ui/core/dropdowns/components/dropdown_divider'
3
- require 'ui_bibz/ui/core/dropdowns/components/dropdown_link'
1
+ require 'ui_bibz/ui/core/forms/dropdowns/components/dropdown_header'
2
+ require 'ui_bibz/ui/core/forms/dropdowns/components/dropdown_divider'
3
+ require 'ui_bibz/ui/core/forms/dropdowns/components/dropdown_link'
4
4
  module UiBibz::Ui::Ux::Tables
5
5
  class Actions
6
6
 
@@ -12,15 +12,15 @@ module UiBibz::Ui::Ux::Tables
12
12
 
13
13
  # Add link action in table
14
14
  def link content = nil, options = nil, html_options = nil, &block
15
- @actions << UiBibz::Ui::Core::Dropdowns::Components::DropdownLink.new(content, options, html_options, &block).render
15
+ @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &block).render
16
16
  end
17
17
 
18
18
  def divider
19
- @actions << UiBibz::Ui::Core::Dropdowns::Components::DropdownDivider.new.render
19
+ @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownDivider.new.render
20
20
  end
21
21
 
22
22
  def header content = nil, options = nil, html_options = nil, &block
23
- @actions << UiBibz::Ui::Core::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &block).render
23
+ @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &block).render
24
24
  end
25
25
 
26
26
  def html content
@@ -52,9 +52,9 @@ module UiBibz::Ui::Ux::Tables
52
52
 
53
53
  def defaults_actions
54
54
  [
55
- UiBibz::Ui::Core::Dropdowns::Components::DropdownLink.new(show_name, url: { controller: @store.controller, action: 'show', id: :id }, glyph: 'eye').render,
56
- UiBibz::Ui::Core::Dropdowns::Components::DropdownLink.new(edit_name, url:{ controller: @store.controller, action: 'edit', id: :id }, glyph: 'pencil').render,
57
- UiBibz::Ui::Core::Dropdowns::Components::DropdownLink.new(delete_name, { glyph: 'trash', url: { controller: @store.controller, action: 'destroy', id: :id }, link_html_options: { data: { confirm: 'Are you sure?', method: :delete }}}).render
55
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(show_name, url: { controller: @store.controller, action: 'show', id: :id }, glyph: 'eye').render,
56
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(edit_name, url:{ controller: @store.controller, action: 'edit', id: :id }, glyph: 'pencil').render,
57
+ UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(delete_name, { glyph: 'trash', url: { controller: @store.controller, action: 'destroy', id: :id }, link_html_options: { data: { confirm: 'Are you sure?', method: :delete }}}).render
58
58
  ]
59
59
  end
60
60
 
@@ -27,9 +27,9 @@ module UiBibz::Ui::Ux::Tables
27
27
 
28
28
  def boolean_render
29
29
  if @content == true
30
- glyph = UiBibz::Ui::Core::Glyph.new('check-circle', status: :success)
30
+ glyph = UiBibz::Ui::Core::Icons::Glyph.new('check-circle', status: :success)
31
31
  else
32
- glyph = UiBibz::Ui::Core::Glyph.new('minus-circle', status: :danger)
32
+ glyph = UiBibz::Ui::Core::Icons::Glyph.new('minus-circle', status: :danger)
33
33
  end
34
34
  glyph.render
35
35
  end
@@ -31,7 +31,7 @@ module UiBibz::Ui::Ux::Tables
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::Dropdowns::Dropdown.new(dropdown_action_name, { position: :right, size: :sm, glyph: actions_glyph }, { class: 'dropdown-action' }).tap do |d|
34
+ UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new(dropdown_action_name, { position: :right, size: :sm, 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
@@ -42,7 +42,7 @@ module UiBibz::Ui::Ux::Tables
42
42
  end
43
43
 
44
44
  def table_glyph
45
- UiBibz::Ui::Core::Glyph.new(@options[:glyph]).render unless @options[:glyph].nil?
45
+ UiBibz::Ui::Core::Icons::Glyph.new(@options[:glyph]).render unless @options[:glyph].nil?
46
46
  end
47
47
 
48
48
  end
@@ -77,7 +77,7 @@ module UiBibz::Ui::Ux::Tables
77
77
  end
78
78
 
79
79
  def caret
80
- UiBibz::Ui::Core::Glyph.new("caret-#{ direction == 'desc' ? 'up' : 'down' }").render
80
+ UiBibz::Ui::Core::Icons::Glyph.new("caret-#{ direction == 'desc' ? 'up' : 'down' }").render
81
81
  end
82
82
 
83
83
  def cls
@@ -3,7 +3,7 @@ module UiBibz::Ui::Ux::Tables
3
3
 
4
4
  # Create a TableCard
5
5
  #
6
- # This element is an extend of UiBibz::Ui::Core::Cards::card.
6
+ # This element is an extend of UiBibz::Ui::Core::Boxes::card.
7
7
  #
8
8
  # ==== Attributes
9
9
  #
@@ -103,11 +103,11 @@ module UiBibz::Ui::Ux::Tables
103
103
  # content
104
104
  # end
105
105
  # end
106
- class TableCard < UiBibz::Ui::Core::Cards::Card
106
+ class TableCard < UiBibz::Ui::Core::Boxes::Card
107
107
 
108
108
  attr_accessor :columns
109
109
 
110
- # See UiBibz::Ui::Core::Cards::Card.initialize
110
+ # See UiBibz::Ui::Core::Boxes::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 })
@@ -43,16 +43,16 @@ module UiBibz::Ui::Ux::Tables
43
43
  def search_field_html
44
44
  # add surround_field maybe ?
45
45
  content_tag :div, html_options do
46
- concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('search').render, class: 'input-group-addon')
46
+ concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('search').render, class: 'input-group-addon')
47
47
  concat tag(:input, type: 'search', value: search_content, name: 'search', class: 'form-control', placeholder: search_placeholder_field)
48
48
  concat tag(:input, type: 'hidden', name: 'link_type', value: 'search')
49
- concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('times-circle').render, class: 'clear-search-btn input-group-addon')
49
+ concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('times-circle').render, class: 'clear-search-btn input-group-addon')
50
50
  end
51
51
  end
52
52
 
53
53
  def search_field_html_in_wrap
54
54
  content_tag :div, html_options do
55
- concat content_tag(:span, UiBibz::Ui::Core::Glyph.new('search').render, class: 'input-group-addon')
55
+ concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('search').render, class: 'input-group-addon')
56
56
  store.parameters.with_indifferent_access.reject{ |k,_| default_parameters?(k) }.each do |k,v|
57
57
  concat tag(:input, type: 'hidden', name: k, value: v)
58
58
  end
@@ -72,7 +72,7 @@ module UiBibz::Ui::Ux::Tables
72
72
  end
73
73
 
74
74
  def clear_button
75
- content_tag :button, UiBibz::Ui::Core::Glyph.new('times-circle').render, type: :button, class: 'btn btn-secondary'
75
+ content_tag :button, UiBibz::Ui::Core::Icons::Glyph.new('times-circle').render, type: :button, class: 'btn btn-secondary'
76
76
  end
77
77
 
78
78
  def component_html_classes
@@ -3,9 +3,18 @@ module UiBibz::Utils
3
3
  include Singleton
4
4
 
5
5
  def self.join_classes *classes
6
- klasses = [*classes].flatten.compact.uniq.reject(&:blank?)
6
+ klasses = [*classes].flatten.map(&:to_s).compact.uniq.reject(&:blank?)
7
7
  klasses.empty? ? nil : klasses
8
8
  end
9
9
 
10
+ def self.exclude_classes html_classes, *classes
11
+ klasses = (html_classes || []).flatten.map(&:to_s).reject{ |klass_name| [*classes].flatten.include?(klass_name.to_s) || klass_name.blank? }
12
+ klasses.empty? ? nil : klasses
13
+ end
14
+
15
+ def self.uniq_word_in_string str
16
+ str.split(/\s/).uniq
17
+ end
18
+
10
19
  end
11
20
  end
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "2.0.0.beta2.5"
2
+ VERSION = "2.0.0.beta2.6"
3
3
  end
data/structure.md ADDED
@@ -0,0 +1,64 @@
1
+ * Ui
2
+ * Core
3
+ * Navigations
4
+ * navbar
5
+ * tabs
6
+ * nav
7
+ * breadcrumb
8
+ * pagination
9
+ * toolbar
10
+ * Notifications
11
+ * alert
12
+ * badge
13
+ * progress_bar
14
+ * Icons
15
+ * glyph
16
+ * star
17
+ * Boxes
18
+ * jumbotron
19
+ * card
20
+ * card_deck
21
+ * card_column
22
+ * card_group
23
+ * Lists
24
+ * list_group
25
+ * Layouts
26
+ * container
27
+ * row
28
+ * col
29
+ * Forms
30
+ * buttons
31
+ * button
32
+ * button_choice
33
+ * button_group
34
+ * button_link
35
+ * button_refresh
36
+ * choices
37
+ * checkbox_field
38
+ * radio_field
39
+ * switch_field
40
+ * dates
41
+ * date_picker_field
42
+ * dropdowns
43
+ * dropdown
44
+ * split_dropdown
45
+ * numbers
46
+ * formula_field
47
+ * selects
48
+ * dropdown_select_field
49
+ * multi_column_field
50
+ * multi_select_field
51
+ * select_field
52
+ * surrounds
53
+ * surround_field
54
+ * textareas
55
+ * markdown_editor_field
56
+ * texts
57
+ * auto_complete_field
58
+ * text_field
59
+ * Windows
60
+ * modal
61
+ * Ux
62
+ * tables
63
+ * table
64
+ * table_card
File without changes
@@ -75,7 +75,7 @@ class ButtonTest < ActionView::TestCase
75
75
 
76
76
  test 'button glyph without text' do
77
77
  actual = ui_button('state', glyph: 'diamond', text: false)
78
- expected = "<button class=\"btn without-text\"><i class=\"glyph fa fa-diamond\"></i>  </button>"
78
+ expected = "<button class=\"btn without-text\" title=\"state\"><i class=\"glyph fa fa-diamond\"></i>  </button>"
79
79
 
80
80
  assert_equal expected, actual
81
81
  end
@@ -0,0 +1,36 @@
1
+ require 'test_helper'
2
+
3
+ class ChoiceGroupTest < ActionView::TestCase
4
+ include UiBibz::Helpers::Ui::CoreHelper
5
+
6
+ test 'Choice group checkbox' do
7
+ actual = ui_choice_group do |bc|
8
+ bc.choice 'Checkbox 1'
9
+ bc.choice 'Checkbox 2', state: :active
10
+ end
11
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice\"><label class=\"btn-secondary btn checkbox\"><input type=\"checkbox\" autocomplete=\"off\" />Checkbox 1</label><label class=\"active btn-secondary btn checkbox\" aria-pressed=\"true\"><input type=\"checkbox\" autocomplete=\"off\" checked=\"checked\" />Checkbox 2</label></div>"
12
+
13
+ assert_equal expected, actual
14
+ end
15
+
16
+ test 'Choice group radio' do
17
+ actual = ui_choice_group type: :radio do |bc|
18
+ bc.choice 'Radio 1'
19
+ bc.choice 'Radio 2', state: :active
20
+ end
21
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice\"><label class=\"btn-secondary btn radio\"><input type=\"radio\" autocomplete=\"off\" />Radio 1</label><label class=\"active btn-secondary btn radio\" aria-pressed=\"true\"><input type=\"radio\" autocomplete=\"off\" checked=\"checked\" />Radio 2</label></div>"
22
+
23
+ assert_equal expected, actual
24
+ end
25
+
26
+ test 'Choice group options' do
27
+ actual = ui_choice_group size: :lg, outline: true, type: :radio do |bc|
28
+ bc.choice 'Radio 1', glyph: 'diamond', status: :primary
29
+ bc.choice 'Radio 2', state: :active
30
+ end
31
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice\"><label class=\"btn-outline-primary btn btn-lg radio\"><input type=\"radio\" autocomplete=\"off\" /><i class=\"glyph fa fa-diamond\"></i> Radio 1</label><label class=\"active btn-outline-secondary btn btn-lg radio\" aria-pressed=\"true\"><input type=\"radio\" autocomplete=\"off\" checked=\"checked\" />Radio 2</label></div>"
32
+
33
+ assert_equal expected, actual
34
+ end
35
+
36
+ end
@@ -3,7 +3,7 @@ class DropdownTest < ActionView::TestCase
3
3
  include UiBibz::Helpers::Ui::CoreHelper
4
4
 
5
5
  test 'Dropdown' do
6
- actual = UiBibz::Ui::Core::Dropdowns::Dropdown.new("Dropdown").tap do |d|
6
+ actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new("Dropdown").tap do |d|
7
7
  d.link 'link'
8
8
  end
9
9
  expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{ actual.id }\">Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu\" arial-labelledby=\"#{ actual.id }\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
@@ -12,7 +12,7 @@ class DropdownTest < ActionView::TestCase
12
12
  end
13
13
 
14
14
  test 'Dropdown status' do
15
- actual = UiBibz::Ui::Core::Dropdowns::Dropdown.new("Dropdown", status: :primary).tap do |d|
15
+ actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new("Dropdown", status: :primary).tap do |d|
16
16
  d.link 'link'
17
17
  end
18
18
  expected = "<div class=\"dropdown\"><button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{ actual.id }\">Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu\" arial-labelledby=\"#{ actual.id }\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
@@ -21,7 +21,7 @@ class DropdownTest < ActionView::TestCase
21
21
  end
22
22
 
23
23
  test 'Dropdown outline' do
24
- actual = UiBibz::Ui::Core::Dropdowns::Dropdown.new("Dropdown", status: :primary, outline: true).tap do |d|
24
+ actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new("Dropdown", status: :primary, outline: true).tap do |d|
25
25
  d.link 'link'
26
26
  end
27
27
  expected = "<div class=\"dropdown\"><button class=\"btn btn-outline-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{ actual.id }\">Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu\" arial-labelledby=\"#{ actual.id }\"><a class=\"dropdown-item\" href=\"#\">link</a></div></div>"
@@ -30,7 +30,7 @@ class DropdownTest < ActionView::TestCase
30
30
  end
31
31
 
32
32
  test 'Dropdown options' do
33
- actual = UiBibz::Ui::Core::Dropdowns::Dropdown.new("Dropdown", type: :dropup, status: :success, glyph: 'diamond').tap do |d|
33
+ actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new("Dropdown", type: :dropup, status: :success, glyph: 'diamond').tap do |d|
34
34
  d.link 'Link 1', url: '#link1', glyph: 'eye'
35
35
  d.header 'header'
36
36
  d.link 'Link 2', url: '#link2'
@@ -43,7 +43,7 @@ class DropdownTest < ActionView::TestCase
43
43
  end
44
44
 
45
45
  test 'Split Dropdown' do
46
- actual = UiBibz::Ui::Core::Dropdowns::Dropdown.new("Split Dropdown").tap do |d|
46
+ actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new("Split Dropdown").tap do |d|
47
47
  d.link 'state'
48
48
  end
49
49
  expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{ actual.id }\">Split Dropdown <span class=\"caret\"></span></button><div class=\"dropdown-menu\" arial-labelledby=\"#{ actual.id }\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"