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,21 +0,0 @@
1
- module UiBibz::Helpers::Ui::Core::DropdownsHelper
2
-
3
- # Dropdown Component
4
- #
5
- # +name+ (String) [Required]
6
- # +options+ (Hash)
7
- # +html_options+ (Hash)
8
- def ui_dropdown name, options = nil, html_options = nil, &block
9
- UiBibz::Ui::Core::Dropdowns::Dropdown.new(name, options, html_options).tap(&block).render
10
- end
11
-
12
- # Split Dropdown Component
13
- #
14
- # +name+ (String) [Required]
15
- # +options+ (Hash)
16
- # +html_options+ (Hash)
17
- def ui_split_dropdown name, options = nil, html_options = nil, &block
18
- UiBibz::Ui::Core::Dropdowns::SplitDropdown.new(name, options, html_options).tap(&block).render
19
- end
20
-
21
- end
@@ -1,27 +0,0 @@
1
- module UiBibz::Helpers::Ui::Core::NavsHelper
2
-
3
- # Nav Component
4
- #
5
- # +options+ (Hash)
6
- # +html_options+ (Hash)
7
- def ui_nav content = nil, options = nil, html_options = nil, &block
8
- UiBibz::Ui::Core::Navs::Nav.new(content, options, html_options).tap(&block).render
9
- end
10
-
11
- # Navbar Component
12
- #
13
- # +options+ (Hash)
14
- # +html_options+ (Hash)
15
- def ui_navbar content = nil, options = nil, html_options = nil, &block
16
- UiBibz::Ui::Core::Navs::Navbar.new(content, options, html_options).tap(&block).render
17
- end
18
-
19
- # Pagination Component
20
- #
21
- # +options+ (Hash)
22
- # +html_options+ (Hash)
23
- def ui_pagination content = nil, options = nil, html_options = nil, &block
24
- UiBibz::Ui::Core::Navs::Pagination.new(content, options, html_options).tap(&block).render
25
- end
26
-
27
- end
@@ -1,16 +0,0 @@
1
- module UiBibz::Helpers::Ui::Core::PathsHelper
2
-
3
- # Breadcrumb Component
4
- #
5
- # +options+ (Hash)
6
- # +html_options+ (Hash)
7
- #
8
- def ui_breadcrumb content = nil, options = nil, html_options = nil, &block
9
- if is_tap(content, options)
10
- UiBibz::Ui::Core::Paths::Breadcrumb.new(content, options, html_options).tap(&block).render
11
- else
12
- UiBibz::Ui::Core::Paths::Breadcrumb.new(content, options, html_options, &block).render
13
- end
14
- end
15
-
16
- end
@@ -1,60 +0,0 @@
1
- require 'ui_bibz/ui/core/navs/components/nav_link_link'
2
- require 'ui_bibz/ui/core/navs/components/nav_link_list'
3
- module UiBibz::Ui::Core::Navs
4
-
5
- # Create a NavLink
6
- #
7
- # This element is an extend of UiBibz::Ui::Core::Navs::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::Navs::NavLink.new(content, options = nil, html_options = nil)
28
- #
29
- # UiBibz::Ui::Core::Navs::NavLink.new(options = nil, html_options = nil) do
30
- # content
31
- # end
32
- #
33
- # ==== Examples
34
- #
35
- # UiBibz::Ui::Core::Navs::NavLink.new(content, { badge: 15, url: '/', state: :active, link_html_options: { class: 'link1' }},{ class: 'test' }).render
36
- #
37
- # UiBibz::Ui::Core::Navs::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
- content_htm = UiBibz::Ui::Core::Navs::NavLinkLink.new(content, options, html_options).render
51
- if options[:nav_type] == "nav-links"
52
- content_htm
53
- else
54
- options.delete(:state)
55
- UiBibz::Ui::Core::Navs::NavLinkList.new(content_htm, options).render
56
- end
57
- end
58
-
59
- end
60
- end
@@ -1,109 +0,0 @@
1
- require 'ui_bibz/ui/core/paths/components/breadcrumb_link'
2
- module UiBibz::Ui::Core::Paths
3
-
4
- # Breadcrumb
5
- #
6
- # Indicate the current page's location within a navigational hierarchy.
7
- # Separators are automatically added in CSS through +:before+ and +content+.
8
- #
9
- # This element is an extend of UiBibz::Ui::Core::Component.
10
- # You can use tap method to add link items.
11
- #
12
- # ==== Attributes
13
- #
14
- # * +content+ - Content of element
15
- # * +options+ - Options of element
16
- # * +html_options+ - Html Options of element
17
- #
18
- # ==== Components
19
- #
20
- # +link+ is UiBibz::Ui::Core::BreadCrumb::Components::BreadcrumbLink component
21
- #
22
- # ==== Signatures
23
- #
24
- # UiBibz::Ui::Core::Breadcrumb.new().tap do |b|
25
- # b.link content = nil, options = nil, html_options = nil, &block
26
- # b.link content = nil, options = nil, html_options = nil, &block
27
- # b.link content = nil, options = nil, html_options = nil, &block
28
- # ...
29
- # end
30
- #
31
- # UiBibz::Ui::Core::Alert.new(options = nil, html_options = nil) do
32
- # content
33
- # end
34
- #
35
- # ==== Examples
36
- #
37
- # UiBibz::Ui::Core::Breadcrumb.new().tap do |b|
38
- # b.link 'Home', url: '#home'
39
- # b.link url: '#level-1' do
40
- # 'Level 1'
41
- # end
42
- # b.link 'Level 2', state: :active
43
- # end.render
44
- #
45
- # ==== Helper
46
- #
47
- # breadcrumb({tap: true}) do |b|
48
- # b.link(content, options = {}, html_options = {})
49
- # b.link(options = {}, html_options = {}) do
50
- # content
51
- # end
52
- # end
53
- #
54
- # breadcrumb({store: @users, link_label: name, link_url: user_path(:id)})
55
- #
56
- class Breadcrumb < UiBibz::Ui::Core::Component
57
-
58
- # See UiBibz::Ui::Core::Component.initialize
59
- def initialize content = nil, options = nil, html_options = nil, &block
60
- super
61
- @links = []
62
- end
63
-
64
- # Render html tag
65
- def render
66
- generate_links unless store.nil?
67
- content_tag :ol, @links.join.html_safe, html_options
68
- end
69
-
70
- # Add breadcrumb link items
71
- # See UiBibz::Ui::Core::BreadcrumbLink
72
- def link content = nil, options = nil, html_options = nil, &block
73
- @links << UiBibz::Ui::Core::Paths::Components::BreadcrumbLink.new(content, options, html_options, &block).render
74
- end
75
-
76
- private
77
-
78
- def component_html_classes
79
- 'breadcrumb'
80
- end
81
-
82
- def store
83
- @options[:store]
84
- end
85
-
86
- def model_name
87
- store.class.to_s
88
- end
89
-
90
- def link_label
91
- @options[:link_label] || :name
92
- end
93
-
94
- def link_url
95
- @options[:link_url] || '#'
96
- end
97
-
98
- def generate_links
99
- @options[:store].each do |item|
100
- if item == @options[:store].last
101
- @links << UiBibz::Ui::Core::Paths::Components::BreadcrumbLink.new(item.send(link_label), status: :disabled).render
102
- else
103
- @links << UiBibz::Ui::Core::Paths::Components::BreadcrumbLink.new(item.send(link_label), url: inject_url(link_url, item)).render
104
- end
105
- end
106
- end
107
-
108
- end
109
- end
@@ -1,36 +0,0 @@
1
- require 'test_helper'
2
-
3
- class ButtonChoiceTest < ActionView::TestCase
4
- include UiBibz::Helpers::Ui::CoreHelper
5
-
6
- test 'Button choice checkbox' do
7
- actual = ui_button_choice do |bc|
8
- bc.button 'Checkbox 1'
9
- bc.button 'Checkbox 2', state: :active
10
- end
11
- expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice\"><label class=\"btn-secondary btn\"><input type=\"checkbox\" autocomplete=\"off\" />Checkbox 1</label><label class=\"active btn-secondary btn\" 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 'Button choice radio' do
17
- actual = ui_button_choice type: :radio do |bc|
18
- bc.button 'Radio 1'
19
- bc.button 'Radio 2', state: :active
20
- end
21
- expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice\"><label class=\"btn-secondary btn\"><input type=\"radio\" autocomplete=\"off\" />Radio 1</label><label class=\"active btn-secondary btn\" 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 'Button choice options' do
27
- actual = ui_button_choice size: :lg, outline: true, type: :radio do |bc|
28
- bc.button 'Radio 1', glyph: 'diamond', status: :primary
29
- bc.button 'Radio 2', state: :active
30
- end
31
- expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice\"><label class=\"btn-primary btn btn-lg\"><input type=\"radio\" autocomplete=\"off\" /><i class=\"glyph fa fa-diamond\"></i> Radio 1</label><label class=\"active btn-secondary btn btn-lg\" 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