ui_bibz 3.0.0.alpha8 → 3.0.0.alpha9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/ui_bibz/infos.rb +2 -2
- data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +5 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +2 -11
- data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +0 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -1
- data/lib/ui_bibz/ui/core/icons/glyph.rb +9 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/tab_group.rb +4 -0
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +10 -24
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/test/simple_form_test.rb +1 -1
- data/test/ui/core/boxes/card_test.rb +2 -2
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -8
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -9
- data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +1 -1
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +2 -2
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +2 -2
- data/test/ui/core/navigations/tab_group_test.rb +5 -5
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +2 -2
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e609add47b874d22474ad98a691fb0511ac6b1704309355079a369ae7141a2ac
|
|
4
|
+
data.tar.gz: c202dad217807b43e0857d17de0fe98d6df0ee9e26b20d74c9d33244fae1ab01
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c57825fadad8a281d4891732ee10a91fc2d7eef81ca51060c9cecba484658b7132cebf1969b796e1ce49698bd50039c037f78782741fe8226083799a908c1720
|
|
7
|
+
data.tar.gz: d2ff37b288db8a88b8797f22af6f87b43c2f76fe2bcfe0c39bc14d01e582b7a9aacd908a32bf98cd8ee35e6e5df13c32689d1ecd2b669949c6f66338ea3dc5c8
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ui_bibz (3.0.0.
|
|
4
|
+
ui_bibz (3.0.0.alpha9)
|
|
5
5
|
rails (~> 6.0.3, >= 6.0.3.2)
|
|
6
6
|
will-paginate-i18n
|
|
7
7
|
will_paginate (~> 3.1.0)
|
|
@@ -75,7 +75,7 @@ GEM
|
|
|
75
75
|
concurrent-ruby (1.1.7)
|
|
76
76
|
crass (1.0.6)
|
|
77
77
|
docile (1.3.2)
|
|
78
|
-
erubi (1.
|
|
78
|
+
erubi (1.10.0)
|
|
79
79
|
erubis (2.7.0)
|
|
80
80
|
factory_bot (4.11.1)
|
|
81
81
|
activesupport (>= 3.0.0)
|
|
@@ -159,7 +159,7 @@ GEM
|
|
|
159
159
|
rake (13.0.1)
|
|
160
160
|
regexp_parser (1.8.2)
|
|
161
161
|
rexml (3.2.4)
|
|
162
|
-
rubocop (1.3.
|
|
162
|
+
rubocop (1.3.1)
|
|
163
163
|
parallel (~> 1.10)
|
|
164
164
|
parser (>= 2.7.1.5)
|
|
165
165
|
rainbow (>= 2.2.2, < 4.0)
|
data/lib/ui_bibz/infos.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module UiBibz
|
|
4
4
|
NAME = 'Ui Bibz'
|
|
5
5
|
SLUG = 'ui_bibz'
|
|
6
|
-
BOOTSTRAP_VERSION = '5.0.0.
|
|
6
|
+
BOOTSTRAP_VERSION = '5.0.0.alpha3'
|
|
7
7
|
DESCRIPTION = "A Rails Interface Framework using Bootstrap #{BOOTSTRAP_VERSION}."
|
|
8
8
|
SUMMARY = "Ui Bibz is an Ui Framework that allows you to build an interface very quickly and simply using Bootstrap #{BOOTSTRAP_VERSION}."
|
|
9
9
|
LICENSE = 'MIT'
|
|
@@ -12,6 +12,6 @@ module UiBibz
|
|
|
12
12
|
REPO = 'git+https://github.com/thooams/Ui-Bibz.git'
|
|
13
13
|
EMAIL = 'thomas@hummel.link'
|
|
14
14
|
AUTHOR = 'Thooams'
|
|
15
|
-
VERSION = '3.0.0.
|
|
15
|
+
VERSION = '3.0.0.alpha9'
|
|
16
16
|
AUTHORS = ['Thooams'].freeze
|
|
17
17
|
end
|
|
@@ -38,7 +38,11 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
|
38
38
|
# Render html tag
|
|
39
39
|
def pre_render
|
|
40
40
|
# image_tag content, html_options
|
|
41
|
-
|
|
41
|
+
if options[:pack]
|
|
42
|
+
image_pack_tag content, html_options
|
|
43
|
+
else
|
|
44
|
+
image_tag content, html_options
|
|
45
|
+
end
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
private
|
|
@@ -21,7 +21,6 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
|
21
21
|
# (+:xs+, +:sm+, +:lg+)
|
|
22
22
|
# * +outline+ - Boolean
|
|
23
23
|
# * +state+ - Symbol (+:active+, +:disabled)
|
|
24
|
-
# * +type+ - Symbol (+:outline)
|
|
25
24
|
# * +collapse+ - String
|
|
26
25
|
# * +expand_collaspe+ - Boolean
|
|
27
26
|
# * +glyph+ - Add glyph with name or hash options
|
|
@@ -63,13 +62,13 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
|
63
62
|
def button_html_tag
|
|
64
63
|
content_tag :button, html_options do
|
|
65
64
|
concat spinner_html unless options[:spinner].nil?
|
|
66
|
-
concat glyph_and_content_html(
|
|
65
|
+
concat glyph_and_content_html(@content)
|
|
67
66
|
concat badge_html unless options[:badge].nil?
|
|
68
67
|
end
|
|
69
68
|
end
|
|
70
69
|
|
|
71
70
|
def component_html_classes
|
|
72
|
-
super << ['btn', size
|
|
71
|
+
super << ['btn', size]
|
|
73
72
|
end
|
|
74
73
|
|
|
75
74
|
def component_html_options
|
|
@@ -107,14 +106,6 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
|
107
106
|
{ 'aria-pressed' => true }
|
|
108
107
|
end
|
|
109
108
|
|
|
110
|
-
def type
|
|
111
|
-
'btn-block' if options[:type] == :block
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def without_text
|
|
115
|
-
'without-text' unless options[:text].nil?
|
|
116
|
-
end
|
|
117
|
-
|
|
118
109
|
def action
|
|
119
110
|
add_html_data('action', value: options[:action]) unless options[:action].nil?
|
|
120
111
|
end
|
|
@@ -22,7 +22,6 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
|
22
22
|
# * +url+ - String url
|
|
23
23
|
# * +outline+ - Boolean
|
|
24
24
|
# * +state+ - Symbol (+:active+, +:disabled)
|
|
25
|
-
# * +type+ - Symbol (+:block)
|
|
26
25
|
# * +glyph+ - Add glyph with name or hash options
|
|
27
26
|
# * +name+ - String
|
|
28
27
|
# * +size+ - Integer
|
|
@@ -20,7 +20,6 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
|
21
21
|
# * +outline+ - Boolean
|
|
22
22
|
# * +state+ - Symbol (+:active+, +:disabled)
|
|
23
|
-
# * +type+ - Symbol (+:outline)
|
|
24
23
|
# * +glyph+ - Add glyph with name or hash options
|
|
25
24
|
# * +name+ - String
|
|
26
25
|
# * +size+ - Integer
|
|
@@ -61,7 +61,7 @@ module UiBibz::Ui::Core::Icons
|
|
|
61
61
|
|
|
62
62
|
# Render html tag
|
|
63
63
|
def pre_render
|
|
64
|
-
[content_tag(:i, '', html_options),
|
|
64
|
+
[content_tag(:i, '', html_options), label].compact.join(' ').html_safe
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
private
|
|
@@ -138,5 +138,13 @@ module UiBibz::Ui::Core::Icons
|
|
|
138
138
|
def match_style
|
|
139
139
|
{ solid: 'fas', regular: 'far', light: 'fal', brands: 'fab' }
|
|
140
140
|
end
|
|
141
|
+
|
|
142
|
+
def label
|
|
143
|
+
if options[:text] == false
|
|
144
|
+
content_tag :span, options[:label], class: 'visually-hidden'
|
|
145
|
+
else
|
|
146
|
+
options[:label]
|
|
147
|
+
end
|
|
148
|
+
end
|
|
141
149
|
end
|
|
142
150
|
end
|
|
@@ -60,7 +60,7 @@ module UiBibz::Ui::Core::Navigations
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def link_html
|
|
63
|
-
content_tag :a, button_content, class: join_classes(size, state, 'dropdown-toggle', 'nav-link'), 'data-toggle' => 'dropdown', 'aria-expanded' => false
|
|
63
|
+
content_tag :a, button_content, class: join_classes(size, state, 'dropdown-toggle', 'nav-link'), href: '#', 'data-toggle' => 'dropdown', 'aria-expanded' => false
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
end
|
|
@@ -45,7 +45,7 @@ module UiBibz::Ui::Core::Navigations
|
|
|
45
45
|
when 'nav-tabs'
|
|
46
46
|
html_tag_base
|
|
47
47
|
when 'list-group'
|
|
48
|
-
html_tag_base.merge("aria-controls": sanitize_text(content))
|
|
48
|
+
html_tag_base.merge("aria-controls": sanitize_text(content).parameterize)
|
|
49
49
|
else
|
|
50
50
|
{}
|
|
51
51
|
end.merge(options[:a_html] || {})
|
|
@@ -3,28 +3,11 @@
|
|
|
3
3
|
module GlyphExtension
|
|
4
4
|
# Render glyph and content html
|
|
5
5
|
def glyph_and_content_html(content_html = nil)
|
|
6
|
-
[
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def ct_html(content_html)
|
|
10
|
-
content_html || content if options[:text].nil? || options[:text] == true
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
# Render glyph with space html
|
|
14
|
-
def glyph_with_space
|
|
15
|
-
out = [glyph]
|
|
16
|
-
out << if options[:text] == false
|
|
17
|
-
content_tag(:span, ' ', class: 'empty-space')
|
|
18
|
-
else
|
|
19
|
-
' '
|
|
20
|
-
end
|
|
21
|
-
out.join unless glyph.nil?
|
|
6
|
+
options[:glyph] ? generate_glyph(content_html) : content_html || content
|
|
22
7
|
end
|
|
23
8
|
|
|
24
9
|
# Render glyph html
|
|
25
|
-
def
|
|
26
|
-
options[:content] = content if options[:text] == false
|
|
27
|
-
|
|
10
|
+
def generate_glyph(content_html)
|
|
28
11
|
glyph_options = if options[:glyph].is_a?(Hash)
|
|
29
12
|
options[:glyph]
|
|
30
13
|
elsif options[:glyph]
|
|
@@ -33,11 +16,14 @@ module GlyphExtension
|
|
|
33
16
|
{}
|
|
34
17
|
end
|
|
35
18
|
|
|
36
|
-
glyph_options
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
glyph_options = glyph_options.tap do |h|
|
|
20
|
+
h[:text] = options[:text]
|
|
21
|
+
h[:label] = options[:label] || content_html || content
|
|
22
|
+
h[:shortcut] = options[:shortcut] unless options[:shortcut].nil?
|
|
23
|
+
h[:html_options] = options[:html_options] unless options[:html_options].nil?
|
|
24
|
+
end
|
|
40
25
|
|
|
41
|
-
UiBibz::Utils::GlyphChanger.new(glyph_options[:name], glyph_options).render unless glyph_options[:name].nil?
|
|
26
|
+
# UiBibz::Utils::GlyphChanger.new(glyph_options[:name], glyph_options).render unless glyph_options[:name].nil?
|
|
27
|
+
UiBibz::Ui::Core::Icons::Glyph.new(glyph_options[:name], glyph_options).render if glyph_options[:name].present?
|
|
42
28
|
end
|
|
43
29
|
end
|
|
@@ -69,7 +69,7 @@ module UiBibz::Ui::Ux::Tables
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def clear_button
|
|
72
|
-
content_tag :button, UiBibz::Ui::Core::Icons::Glyph.new('times-circle').render, type: :button, class: 'btn btn-secondary input-group-btn clear-search-btn'
|
|
72
|
+
content_tag :button, UiBibz::Ui::Core::Icons::Glyph.new('times-circle', text: false, label: 'Clear Search').render, type: :button, class: 'btn btn-secondary input-group-btn clear-search-btn'
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def component_html_classes
|
data/test/simple_form_test.rb
CHANGED
|
@@ -147,7 +147,7 @@ test1</textarea></div></form>"
|
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"field-refresh input-group ui_surround_field\"><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option value=\"1\">test1</option>
|
|
150
|
-
<option value=\"2\">test2</option></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#user_name_fr","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
|
150
|
+
<option value=\"2\">test2</option></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#user_name_fr","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div></div></form>"
|
|
151
151
|
|
|
152
152
|
assert_equal expected, actual
|
|
153
153
|
end
|
|
@@ -59,7 +59,7 @@ class CardTest < ActionView::TestCase
|
|
|
59
59
|
p.body 'state'
|
|
60
60
|
p.footer 'state'
|
|
61
61
|
end
|
|
62
|
-
expected =
|
|
62
|
+
expected = "<div class=\"state card\"><div class=\"card-header\"><i class=\"glyph fas fa-eye\"></i> state</div><div class=\"card-body\">state</div><div class=\"card-footer\">state</div></div>"
|
|
63
63
|
|
|
64
64
|
assert_equal expected, actual
|
|
65
65
|
end
|
|
@@ -145,7 +145,7 @@ class CardTest < ActionView::TestCase
|
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
end
|
|
148
|
-
expected = "<div class=\"card\"><div class=\"card-header\"><ul class=\"nav nav-tabs card-header-tabs\"><li class=\"nav-item\"><a href=\"#link1\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">link1</a></li><li class=\"nav-item\"><a href=\"#link2\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">link2</a></li></ul></div></div>"
|
|
148
|
+
expected = "<div class=\"card\"><div class=\"card-header\"><ul class=\"nav nav-tabs card-header-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#link1\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">link1</a></li><li class=\"nav-item\"><a href=\"#link2\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">link2</a></li></ul></div></div>"
|
|
149
149
|
|
|
150
150
|
assert_equal expected, actual
|
|
151
151
|
end
|
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
|
5
5
|
class ComponentTest < ActionView::TestCase
|
|
6
6
|
test 'create complex component' do
|
|
7
7
|
actual = UiBibz::Ui::Core::Component.new('New component', { state: :active, glyph: 'add' }, { class: 'new-class' }).render
|
|
8
|
-
expected =
|
|
8
|
+
expected = "<i class=\"glyph fas fa-add\"></i> New component"
|
|
9
9
|
|
|
10
10
|
assert_equal expected, actual
|
|
11
11
|
end
|
|
@@ -21,7 +21,7 @@ class ComponentTest < ActionView::TestCase
|
|
|
21
21
|
|
|
22
22
|
test 'create component without text and glyph' do
|
|
23
23
|
actual = UiBibz::Ui::Core::Component.new('My text', { glyph: 'diamond', text: false }).render
|
|
24
|
-
expected =
|
|
24
|
+
expected = "<i class=\"glyph fas fa-diamond\"></i> <span class=\"visually-hidden\">My text</span>"
|
|
25
25
|
|
|
26
26
|
assert_equal expected, actual
|
|
27
27
|
end
|
|
@@ -47,7 +47,7 @@ class ButtonGroupTest < ActionView::TestCase
|
|
|
47
47
|
d.link 'Link 1', url: '#link1', glyph: 'eye'
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
-
expected =
|
|
50
|
+
expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a></div></div></div>"
|
|
51
51
|
|
|
52
52
|
assert_equal expected, actual
|
|
53
53
|
end
|
|
@@ -54,13 +54,6 @@ class ButtonLinkTest < ActionView::TestCase
|
|
|
54
54
|
assert_equal expected, actual
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
test 'button_link block' do
|
|
58
|
-
actual = ui_button_link('state', type: :block)
|
|
59
|
-
expected = '<a class="btn-secondary btn btn-block" role="button" href="#">state</a>'
|
|
60
|
-
|
|
61
|
-
assert_equal expected, actual
|
|
62
|
-
end
|
|
63
|
-
|
|
64
57
|
test 'button_link size' do
|
|
65
58
|
actual = ui_button_link('state', size: :sm)
|
|
66
59
|
expected = '<a class="btn-secondary btn btn-sm" role="button" href="#">state</a>'
|
|
@@ -77,7 +70,7 @@ class ButtonLinkTest < ActionView::TestCase
|
|
|
77
70
|
|
|
78
71
|
test 'button_link glyph' do
|
|
79
72
|
actual = ui_button_link('state', glyph: 'diamond')
|
|
80
|
-
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph fas fa-diamond"></i>
|
|
73
|
+
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph fas fa-diamond"></i> state</a>'
|
|
81
74
|
|
|
82
75
|
assert_equal expected, actual
|
|
83
76
|
end
|
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
|
5
5
|
class ButtonRefreshTest < ActionView::TestCase
|
|
6
6
|
test 'button' do
|
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('state', status: :success, connect: { target: { url: '/' } }).render
|
|
8
|
-
expected =
|
|
8
|
+
expected = "<span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"/","data":[]}}\" class=\"btn-success ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i> state</span>"
|
|
9
9
|
|
|
10
10
|
assert_equal expected, actual
|
|
11
11
|
end
|
|
@@ -47,13 +47,6 @@ class ButtonTest < ActionView::TestCase
|
|
|
47
47
|
assert_equal expected, actual
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
test 'button block' do
|
|
51
|
-
actual = ui_button('state', type: :block)
|
|
52
|
-
expected = '<button class="btn-secondary btn btn-block">state</button>'
|
|
53
|
-
|
|
54
|
-
assert_equal expected, actual
|
|
55
|
-
end
|
|
56
|
-
|
|
57
50
|
test 'button size' do
|
|
58
51
|
actual = ui_button('state', size: :sm)
|
|
59
52
|
expected = '<button class="btn-secondary btn btn-sm">state</button>'
|
|
@@ -70,14 +63,14 @@ class ButtonTest < ActionView::TestCase
|
|
|
70
63
|
|
|
71
64
|
test 'button glyph' do
|
|
72
65
|
actual = ui_button('state', glyph: 'diamond')
|
|
73
|
-
expected =
|
|
66
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fas fa-diamond\"></i> state</button>"
|
|
74
67
|
|
|
75
68
|
assert_equal expected, actual
|
|
76
69
|
end
|
|
77
70
|
|
|
78
71
|
test 'button glyph without text' do
|
|
79
72
|
actual = ui_button('state', glyph: 'diamond', text: false)
|
|
80
|
-
expected =
|
|
73
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fas fa-diamond\"></i> <span class=\"visually-hidden\">state</span></button>"
|
|
81
74
|
|
|
82
75
|
assert_equal expected, actual
|
|
83
76
|
end
|
|
@@ -11,7 +11,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
|
11
11
|
bc.choice 'Checkbox 2', state: :active
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn
|
|
14
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn\" for=\"#{actual.items.first.input_options[:id]}\">Checkbox 1</label><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-secondary btn\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Checkbox 2</label></div>"
|
|
15
15
|
|
|
16
16
|
assert_equal expected, actual.render
|
|
17
17
|
end
|
|
@@ -22,7 +22,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
|
22
22
|
bc.choice 'Radio 2', state: :active
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn
|
|
25
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-secondary btn\" for=\"#{actual.items.first.input_options[:id]}\">Radio 1</label><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" name=\"#{actual.items.last.input_options[:name]}\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-secondary btn\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Radio 2</label></div>"
|
|
26
26
|
|
|
27
27
|
assert_equal expected, actual.render
|
|
28
28
|
end
|
|
@@ -32,7 +32,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
|
32
32
|
bc.choice 'Radio 1', glyph: 'diamond', status: :primary
|
|
33
33
|
bc.choice 'Radio 2', state: :active
|
|
34
34
|
end
|
|
35
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg
|
|
35
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg\" for=\"#{actual.items.first.input_options[:id]}\"><i class=\"glyph fas fa-diamond\"></i> Radio 1</label><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" name=\"#{actual.items.last.input_options[:name]}\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"active btn-outline-secondary btn btn-lg\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Radio 2</label></div>"
|
|
36
36
|
|
|
37
37
|
assert_equal expected, actual.render
|
|
38
38
|
end
|
|
@@ -39,7 +39,7 @@ class DropdownTest < ActionView::TestCase
|
|
|
39
39
|
d.divider
|
|
40
40
|
d.link 'Link3', url: '#link3'
|
|
41
41
|
end
|
|
42
|
-
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fas fa-diamond\"></i>
|
|
42
|
+
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fas fa-diamond\"></i> Dropdown</button><div class=\"dropdown-menu dropdown-menu-right\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
|
43
43
|
|
|
44
44
|
assert_equal expected, actual.render
|
|
45
45
|
end
|
|
@@ -25,7 +25,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
|
25
25
|
|
|
26
26
|
test 'Multi select Field refresh option' do
|
|
27
27
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { multiple: true, refresh: { target: { url: '/' } } }).render
|
|
28
|
-
expected = '<div class="field-refresh input-group ui_surround_field"><select name="test[]" id="test" class="btn-secondary multi-select-field" multiple="multiple"></select><span data-connect="{"events":"click","mode":"remote","target":{"selector":"#test","url":"/","data":[]}}" class="btn-secondary ui-bibz-connect btn input-refresh-button"><i class="glyph fas fa-sync-alt"></i
|
|
28
|
+
expected = '<div class="field-refresh input-group ui_surround_field"><select name="test[]" id="test" class="btn-secondary multi-select-field" multiple="multiple"></select><span data-connect="{"events":"click","mode":"remote","target":{"selector":"#test","url":"/","data":[]}}" class="btn-secondary ui-bibz-connect btn input-refresh-button"><i class="glyph fas fa-sync-alt"></i></span></div>'
|
|
29
29
|
|
|
30
30
|
assert_equal expected, actual
|
|
31
31
|
end
|
|
@@ -14,7 +14,7 @@ class SelectFieldTest < ActionView::TestCase
|
|
|
14
14
|
|
|
15
15
|
test 'Select Field refresh' do
|
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', refresh: { target: { url: '/' } }).render
|
|
17
|
-
expected =
|
|
17
|
+
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"example\" id=\"example\" class=\"select-field form-control form-select\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
|
18
18
|
|
|
19
19
|
assert_equal expected, actual
|
|
20
20
|
end
|
|
@@ -31,7 +31,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
|
31
31
|
d.link 'Link3', url: '#link3'
|
|
32
32
|
end
|
|
33
33
|
end.render
|
|
34
|
-
expected =
|
|
34
|
+
expected = "<div class=\"input-group ui_surround_field\"><div id=\"dropdown-test\" class=\"dropdown input-group-btn\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fas fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div></div>"
|
|
35
35
|
|
|
36
36
|
assert_equal expected, actual
|
|
37
37
|
end
|
|
@@ -87,7 +87,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
|
87
87
|
sf.button_refresh
|
|
88
88
|
end.render
|
|
89
89
|
|
|
90
|
-
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-gem\"></i></span><span class=\"input-group-text\">test</span><button class=\"btn-secondary btn\">button</button><div class=\"input-group-btn\" role=\"group\"><button class=\"btn-secondary btn\">test</button></div><a class=\"btn-secondary btn\" role=\"button\" href=\"#\">link</a><div class=\"input-group-text\" label=\"false\"><input type=\"checkbox\" name=\"check\" id=\"check\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"check\">check</label></div><div class=\"input-group-text\" label=\"false\"><input type=\"radio\" name=\"radio\" id=\"radio_\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"radio_\">radio</label></div><input type=\"text\" name=\"text\" id=\"text\" class=\"form-control\" /><input type=\"text\" name=\"date\" id=\"date\" data-date-locale=\"en\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" data-date-today-btn=\"linked\" data-date-toggle-active=\"true\" class=\"date_picker form-control\" /><select name=\"dropdown_select\" id=\"dropdown_select\" data-wrapper-classes=\"input-group-btn\" class=\"btn-secondary multi-select-field\"></select><select name=\"select\" id=\"select\" class=\"select-field form-control form-select\"></select><input type=\"text\" name=\"auto\" id=\"auto\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"auto-datalist\" /><datalist id=\"auto-datalist\"></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
|
90
|
+
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-gem\"></i></span><span class=\"input-group-text\">test</span><button class=\"btn-secondary btn\">button</button><div class=\"input-group-btn\" role=\"group\"><button class=\"btn-secondary btn\">test</button></div><a class=\"btn-secondary btn\" role=\"button\" href=\"#\">link</a><div class=\"input-group-text\" label=\"false\"><input type=\"checkbox\" name=\"check\" id=\"check\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"check\">check</label></div><div class=\"input-group-text\" label=\"false\"><input type=\"radio\" name=\"radio\" id=\"radio_\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"radio_\">radio</label></div><input type=\"text\" name=\"text\" id=\"text\" class=\"form-control\" /><input type=\"text\" name=\"date\" id=\"date\" data-date-locale=\"en\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" data-date-today-btn=\"linked\" data-date-toggle-active=\"true\" class=\"date_picker form-control\" /><select name=\"dropdown_select\" id=\"dropdown_select\" data-wrapper-classes=\"input-group-btn\" class=\"btn-secondary multi-select-field\"></select><select name=\"select\" id=\"select\" class=\"select-field form-control form-select\"></select><input type=\"text\" name=\"auto\" id=\"auto\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"auto-datalist\" /><datalist id=\"auto-datalist\"></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
|
91
91
|
|
|
92
92
|
assert_equal expected, actual
|
|
93
93
|
end
|
|
@@ -16,7 +16,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
|
16
16
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
|
18
18
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
|
19
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
|
19
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
|
20
20
|
|
|
21
21
|
assert_equal expected, actual
|
|
22
22
|
end
|
|
@@ -25,7 +25,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
|
25
25
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, append: 'Append content', refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
|
27
27
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><span class=\"input-group-text\">Append content</span><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
|
28
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i
|
|
28
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
|
|
29
29
|
|
|
30
30
|
assert_equal expected, actual
|
|
31
31
|
end
|
|
@@ -10,7 +10,7 @@ class BreadcrumbTest < ActionView::TestCase
|
|
|
10
10
|
b.link 'Home', url: '#home', glyph: 'home'
|
|
11
11
|
b.link 'state', { url: '#state', state: :active }
|
|
12
12
|
end
|
|
13
|
-
expected =
|
|
13
|
+
expected = "<nav arial-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"#home\"><i class=\"glyph fas fa-home\"></i> Home</a></li><li class=\"active breadcrumb-item\"><a href=\"#state\">state</a></li></ol></nav>"
|
|
14
14
|
|
|
15
15
|
assert_equal expected, actual
|
|
16
16
|
end
|
|
@@ -13,7 +13,7 @@ class LinkTest < ActionView::TestCase
|
|
|
13
13
|
|
|
14
14
|
test 'Link without text' do
|
|
15
15
|
actual = ui_link 'My link', glyph: 'gem', text: false, url: '#link'
|
|
16
|
-
expected =
|
|
16
|
+
expected = "<a href=\"#link\"><i class=\"glyph fas fa-gem\"></i> <span class=\"visually-hidden\">My link</span></a>"
|
|
17
17
|
|
|
18
18
|
assert_equal expected, actual
|
|
19
19
|
end
|
|
@@ -10,7 +10,7 @@ class NavTest < ActionView::TestCase
|
|
|
10
10
|
n.link 'Profile', url: '#profile', selector: 'profile'
|
|
11
11
|
n.link 'Messages', url: '#messages', selector: 'messages'
|
|
12
12
|
end
|
|
13
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
13
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
14
14
|
|
|
15
15
|
assert_equal expected, actual
|
|
16
16
|
end
|
|
@@ -65,7 +65,7 @@ class NavTest < ActionView::TestCase
|
|
|
65
65
|
n.link 'Profile', url: '#profile', selector: 'profile', label: 16
|
|
66
66
|
n.link 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
|
67
67
|
end
|
|
68
|
-
expected = "<div class=\"list-group\" role=\"tablist\"><a href=\"#Home\" class=\"active list-group-item list-group-item-action\" data-toggle=\"tab\" role=\"tab\" aria-controls=\"
|
|
68
|
+
expected = "<div class=\"list-group\" role=\"tablist\"><a href=\"#Home\" class=\"active list-group-item list-group-item-action\" data-toggle=\"tab\" role=\"tab\" aria-controls=\"home\">Home</a><a href=\"#profile\" class=\"list-group-item list-group-item-action\" data-toggle=\"tab\" role=\"tab\" aria-controls=\"profile\">Profile</a><a href=\"#messages\" class=\"disabled list-group-item list-group-item-action\" data-toggle=\"tab\" role=\"tab\" aria-controls=\"messages\">Messages</a></div>"
|
|
69
69
|
|
|
70
70
|
assert_equal expected, actual
|
|
71
71
|
end
|
|
@@ -10,7 +10,7 @@ class TabGroupTest < ActionView::TestCase
|
|
|
10
10
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
|
11
11
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
|
12
12
|
end
|
|
13
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
13
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
14
14
|
|
|
15
15
|
assert_equal expected, actual
|
|
16
16
|
end
|
|
@@ -21,7 +21,7 @@ class TabGroupTest < ActionView::TestCase
|
|
|
21
21
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
|
22
22
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
|
23
23
|
end
|
|
24
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
24
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
25
25
|
|
|
26
26
|
assert_equal expected, actual
|
|
27
27
|
end
|
|
@@ -32,7 +32,7 @@ class TabGroupTest < ActionView::TestCase
|
|
|
32
32
|
n.tab 'Profile', url: '#profile', selector: 'profile'
|
|
33
33
|
n.tab 'Messages', url: '#messages', selector: 'messages'
|
|
34
34
|
end
|
|
35
|
-
expected =
|
|
35
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><span class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</span></li><li class=\"nav-item\"><span class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</span></li><li class=\"nav-item\"><span class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</span></li></ul>"
|
|
36
36
|
|
|
37
37
|
assert_equal expected, actual
|
|
38
38
|
end
|
|
@@ -43,7 +43,7 @@ class TabGroupTest < ActionView::TestCase
|
|
|
43
43
|
n.tab 'Profile', url: '#profile', selector: 'profile', label: 16
|
|
44
44
|
n.tab 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
|
45
45
|
end
|
|
46
|
-
expected = "<ul class=\"nav nav-tabs justify-content-end\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
46
|
+
expected = "<ul class=\"nav nav-tabs justify-content-end\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
47
47
|
|
|
48
48
|
assert_equal expected, actual
|
|
49
49
|
end
|
|
@@ -54,7 +54,7 @@ class TabGroupTest < ActionView::TestCase
|
|
|
54
54
|
n.tab 'Profile', url: '#profile', selector: 'profile', label: 16
|
|
55
55
|
n.tab 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
|
56
56
|
end
|
|
57
|
-
expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
57
|
+
expected = "<ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\" data-toggle=\"tab\" role=\"tab\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\">Messages</a></li></ul>"
|
|
58
58
|
|
|
59
59
|
assert_equal expected, actual
|
|
60
60
|
end
|
|
@@ -16,7 +16,7 @@ class AlertTest < ActionView::TestCase
|
|
|
16
16
|
a.header 'Information'
|
|
17
17
|
a.body 'Body text'
|
|
18
18
|
end
|
|
19
|
-
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fas fa-thumbs-o-up\"></i>
|
|
19
|
+
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fas fa-thumbs-o-up\"></i> Information<button type=\"button\" class=\"btn-close\" data-dismiss=\"alert\" aria-label=\"Close\"></button></h4><hr /><p class=\"alert-body mb-0\">Body text</p></div>"
|
|
20
20
|
|
|
21
21
|
assert_equal expected, actual
|
|
22
22
|
end
|
|
@@ -6,7 +6,7 @@ class BadgeTest < ActionView::TestCase
|
|
|
6
6
|
|
|
7
7
|
test 'badge' do
|
|
8
8
|
actual = ui_badge 'state', status: :success, glyph: 'pencil'
|
|
9
|
-
expected =
|
|
9
|
+
expected = "<span class=\"bg-success badge\"><i class=\"glyph fas fa-pencil\"></i> state</span>"
|
|
10
10
|
|
|
11
11
|
assert_equal expected, actual
|
|
12
12
|
end
|
|
@@ -20,7 +20,7 @@ class BadgeTest < ActionView::TestCase
|
|
|
20
20
|
|
|
21
21
|
test 'badge pill' do
|
|
22
22
|
actual = ui_badge 'state', status: :success, type: :pill, glyph: 'pencil'
|
|
23
|
-
expected =
|
|
23
|
+
expected = "<span class=\"bg-success badge rounded-pill\"><i class=\"glyph fas fa-pencil\"></i> state</span>"
|
|
24
24
|
|
|
25
25
|
assert_equal expected, actual
|
|
26
26
|
end
|
|
@@ -35,7 +35,7 @@ class CardTest < ActionView::TestCase
|
|
|
35
35
|
end
|
|
36
36
|
p.footer 'Footer'
|
|
37
37
|
end
|
|
38
|
-
expected = "<div class=\"panel\"><div class=\"panel-header justify-content-between\"><div class=\"panel-title\">My header</div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-outline-secondary btn btn-sm
|
|
38
|
+
expected = "<div class=\"panel\"><div class=\"panel-header justify-content-between\"><div class=\"panel-title\">My header</div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-caret-up\"></i> <span class=\"visually-hidden\">Minimize</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-cog\"></i> <span class=\"visually-hidden\">Options</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-Close\"></i> <span class=\"visually-hidden\">Close</span></button></div></div><div class=\"btn-toolbar justify-content-between panel-toolbar\" role=\"toolbar\"><div role=\"group\" class=\"btn-group btn-group-sm mr-2\"><button class=\"btn-secondary btn btn-sm\">Copy</button><button class=\"btn-secondary btn btn-sm\">Cut</button><button class=\"btn-secondary btn btn-sm\">Paste</button></div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-secondary btn btn-sm\">Delete</button></div></div><div class=\"panel-body\">Body</div><div class=\"btn-toolbar panel-toolbar\" role=\"toolbar\"><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-success btn btn-sm\"><i class=\"glyph fas fa-plus-circle\"></i> <span class=\"visually-hidden\">Add</span></button><button class=\"btn-danger btn btn-sm\"><i class=\"glyph fas fa-minus-circle\"></i> <span class=\"visually-hidden\">Remove</span></button></div></div><div class=\"panel-footer\">Footer</div></div>"
|
|
39
39
|
|
|
40
40
|
assert_equal expected, actual
|
|
41
41
|
end
|
|
@@ -26,7 +26,7 @@ class TableTest < ActionView::TestCase
|
|
|
26
26
|
|
|
27
27
|
test 'table search field' do
|
|
28
28
|
actual = UiBibz::Ui::Ux::Tables::TableSearchField.new({ store: @users }).render
|
|
29
|
-
expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&page=1&per_page=2&search=Name+fr&sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i></button></div></form>"
|
|
29
|
+
expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&page=1&per_page=2&search=Name+fr&sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form>"
|
|
30
30
|
|
|
31
31
|
assert_equal expected, actual
|
|
32
32
|
end
|
|
@@ -97,7 +97,7 @@ class TableTest < ActionView::TestCase
|
|
|
97
97
|
test 'table searchable' do
|
|
98
98
|
options = { searchable: true }
|
|
99
99
|
actual = UiBibz::Ui::Ux::Tables::Searchable.new(@store, options).render
|
|
100
|
-
expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&page=1&per_page=2&search=Name+fr&sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i></button></div></form><br class=\"ui-bibz-clear\" /></div>"
|
|
100
|
+
expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&page=1&per_page=2&search=Name+fr&sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form><br class=\"ui-bibz-clear\" /></div>"
|
|
101
101
|
|
|
102
102
|
assert_equal expected, actual
|
|
103
103
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ui_bibz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.0.
|
|
4
|
+
version: 3.0.0.alpha9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thooams
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-11-
|
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -240,7 +240,7 @@ dependencies:
|
|
|
240
240
|
- - ">="
|
|
241
241
|
- !ruby/object:Gem::Version
|
|
242
242
|
version: '0'
|
|
243
|
-
description: A Rails Interface Framework using Bootstrap 5.0.0.
|
|
243
|
+
description: A Rails Interface Framework using Bootstrap 5.0.0.alpha3.
|
|
244
244
|
email: thomas@hummel.link
|
|
245
245
|
executables:
|
|
246
246
|
- test
|
|
@@ -659,7 +659,7 @@ rubygems_version: 3.1.2
|
|
|
659
659
|
signing_key:
|
|
660
660
|
specification_version: 4
|
|
661
661
|
summary: Ui Bibz is an Ui Framework that allows you to build an interface very quickly
|
|
662
|
-
and simply using Bootstrap 5.0.0.
|
|
662
|
+
and simply using Bootstrap 5.0.0.alpha3.
|
|
663
663
|
test_files:
|
|
664
664
|
- test/dummy/README.rdoc
|
|
665
665
|
- test/dummy/Rakefile
|