ui_bibz 3.0.0.beta1 → 3.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ui_bibz/infos.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +24 -6
- data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +4 -4
- data/lib/ui_bibz/ui/core/windows/modal.rb +2 -2
- data/test/ui/core/navigations/toolbar_test.rb +1 -1
- data/test/ui/core/notifications/spinner_test.rb +1 -1
- data/test/ui/core/notifications/toast_test.rb +1 -1
- data/test/ui/ux/containers/panel_test.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e265efc2e27c62c3bdefd67242d59b0bad016d3fab791b74880b1a9030092ce
|
4
|
+
data.tar.gz: 324e8e048bc431bf9426f7bb54572e95035e7079e1c87304349963592c1d13fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff64e1386ea6c156c0e82ad35950c50e7e603a154fbbc7104de530efbe6e15b3b2f5b9955899ecee33e7dce5883e0b15144fbc04d4e82f007d326bc017cc76d8
|
7
|
+
data.tar.gz: daf77edc8f5dbdeffa62a3822a232d80c39a2bc7f3cf5e6b8fdb1d06b261bd4c14b84de1f2a2422fa1bbc1535fa6a5e115bcd965b4fb269e4279e2c39055d590
|
data/Gemfile.lock
CHANGED
data/lib/ui_bibz/infos.rb
CHANGED
@@ -121,7 +121,7 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def spinner_html
|
124
|
-
opts = { size: :sm, tag: :span, class: options[:text] == false ? nil : '
|
124
|
+
opts = { size: :sm, tag: :span, class: options[:text] == false ? nil : 'me-2' }
|
125
125
|
opts = opts.merge(options[:spinner]) if options[:spinner].is_a? Hash
|
126
126
|
|
127
127
|
UiBibz::Ui::Core::Notifications::Spinner.new(nil, opts).render
|
@@ -31,8 +31,8 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
31
31
|
# * +theme+ - Symbol, defaut: +:dark+
|
32
32
|
# * +position+ - Symbol
|
33
33
|
# (+:up+, +:right+, +:down+, +:left+)
|
34
|
-
# * +alignment+ - Symbol
|
35
|
-
# (+:right)
|
34
|
+
# * +alignment+ - Symbol/Hash - eq. { direction: :start, size: :lg }
|
35
|
+
# (+:left+, +:right+, +:start+, +:end+)
|
36
36
|
#
|
37
37
|
# ==== Signatures
|
38
38
|
#
|
@@ -119,9 +119,9 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
119
119
|
def button_html
|
120
120
|
html_button = options[:html_button] || {}
|
121
121
|
if options[:tag] == :a
|
122
|
-
content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), role: 'button', 'data-bs-toggle' => 'dropdown', 'aria-
|
122
|
+
content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), role: 'button', 'data-bs-toggle' => 'dropdown', 'aria-expanded' => false, 'id' => id }.merge(html_button)
|
123
123
|
else
|
124
|
-
content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), type: 'button', 'data-bs-toggle' => 'dropdown', 'aria-
|
124
|
+
content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), type: 'button', 'data-bs-toggle' => 'dropdown', 'aria-expanded' => false, 'id' => id }.merge(html_button)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
@@ -134,11 +134,17 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def alignment
|
137
|
-
|
137
|
+
return nil if @options[:alignment].nil?
|
138
|
+
|
139
|
+
if @options[:alignment].is_a? Hash
|
140
|
+
['dropdown-menu', @options[:alignment][:size], match_direction[@options[:alignment][:direction]]].join('-')
|
141
|
+
else
|
142
|
+
"dropdown-menu-#{match_direction[@options[:alignment]]}"
|
143
|
+
end
|
138
144
|
end
|
139
145
|
|
140
146
|
def position
|
141
|
-
"drop#{@options[:position] ||
|
147
|
+
"drop#{match_direction[@options[:position] || :down]}"
|
142
148
|
end
|
143
149
|
|
144
150
|
def open
|
@@ -173,5 +179,17 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
173
179
|
def theme
|
174
180
|
'dropdown-menu-dark' if @options[:theme]
|
175
181
|
end
|
182
|
+
|
183
|
+
# Match end and start directions
|
184
|
+
def match_direction
|
185
|
+
{
|
186
|
+
up: 'up',
|
187
|
+
right: 'end',
|
188
|
+
down: 'down',
|
189
|
+
left: 'start',
|
190
|
+
start: 'start',
|
191
|
+
end: 'end'
|
192
|
+
}.with_indifferent_access
|
193
|
+
end
|
176
194
|
end
|
177
195
|
end
|
@@ -109,7 +109,7 @@ module UiBibz::Ui::Core::Navigations
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def spacer(num = 'auto')
|
112
|
-
kls = "
|
112
|
+
kls = " me-#{num}"
|
113
113
|
@items.last.html_options[:class].nil? ? @items.last.html_options[:class] = kls : @items.last.html_options[:class] << kls
|
114
114
|
end
|
115
115
|
|
@@ -125,7 +125,7 @@ module UiBibz::Ui::Core::Navigations
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def spacer(num = 'auto')
|
128
|
-
kls = "
|
128
|
+
kls = " me-#{num}"
|
129
129
|
@items.last.html_options[:class].nil? ? @items.last.html_options[:class] = kls : @items.last.html_options[:class] << kls
|
130
130
|
end
|
131
131
|
|
@@ -36,9 +36,9 @@ module UiBibz::Ui::Core::Notifications::Components
|
|
36
36
|
|
37
37
|
def pre_render
|
38
38
|
content_tag :div, html_options do
|
39
|
-
concat UiBibz::Ui::Core::Icons::Glyph.new(options[:glyph], class: '
|
39
|
+
concat UiBibz::Ui::Core::Icons::Glyph.new(options[:glyph], class: 'me-2').render unless options[:glyph].nil?
|
40
40
|
concat image unless options[:image].nil?
|
41
|
-
concat content_tag(:strong, content, class: '
|
41
|
+
concat content_tag(:strong, content, class: 'me-auto')
|
42
42
|
concat content_tag(:small, options[:time], class: 'text-muted') unless options[:time].nil?
|
43
43
|
concat close_button
|
44
44
|
end
|
@@ -48,9 +48,9 @@ module UiBibz::Ui::Core::Notifications::Components
|
|
48
48
|
|
49
49
|
def image
|
50
50
|
if options[:image].is_a?(String)
|
51
|
-
image_tag(options[:image], class: 'rounded
|
51
|
+
image_tag(options[:image], class: 'rounded me-2', alt: sanitize_text(options[:image])) unless options[:image].nil?
|
52
52
|
else
|
53
|
-
options[:image][:class] = UiBibz::Utils::Screwdriver.join_classes(options[:image][:class], 'rounded
|
53
|
+
options[:image][:class] = UiBibz::Utils::Screwdriver.join_classes(options[:image][:class], 'rounded me-2')
|
54
54
|
if options[:image].delete(:pack)
|
55
55
|
image_pack_tag(options[:image].delete(:href), **options[:image])
|
56
56
|
else
|
@@ -146,8 +146,8 @@ module UiBibz::Ui::Core::Windows
|
|
146
146
|
def backdrop
|
147
147
|
return unless @options[:backdrop]
|
148
148
|
|
149
|
-
add_html_data 'backdrop', value: @options[:backdrop]
|
150
|
-
add_html_data 'keyboard', value: 'false'
|
149
|
+
add_html_data 'bs-backdrop', value: @options[:backdrop]
|
150
|
+
add_html_data 'bs-keyboard', value: 'false'
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
@@ -25,7 +25,7 @@ class ToolbarTest < ActionView::TestCase
|
|
25
25
|
bg.button 'Home 2'
|
26
26
|
end
|
27
27
|
end
|
28
|
-
expected = '<div class="btn-toolbar justify-content-between" role="toolbar"><div role="group" class="btn-group
|
28
|
+
expected = '<div class="btn-toolbar justify-content-between" role="toolbar"><div role="group" class="btn-group me-2"><button class="btn-secondary btn">Home</button></div><div class="btn-group" role="group"><button class="btn-secondary btn">Home 2</button></div></div>'
|
29
29
|
|
30
30
|
assert_equal expected, actual
|
31
31
|
end
|
@@ -27,7 +27,7 @@ class SpinnerTest < ActionView::TestCase
|
|
27
27
|
|
28
28
|
test 'spinner in button' do
|
29
29
|
actual = ui_button 'Load', spinner: { status: :danger, type: :grow }
|
30
|
-
expected = '<button class="btn-secondary btn"><span class="text-danger
|
30
|
+
expected = '<button class="btn-secondary btn"><span class="text-danger me-2 spinner-grow spinner-grow-sm" role="status"><span class="sr-only">Loading...</span></span>Load</button>'
|
31
31
|
|
32
32
|
assert_equal expected, actual
|
33
33
|
end
|
@@ -9,7 +9,7 @@ class ToastTest < ActionView::TestCase
|
|
9
9
|
t.header 'My header toast', glyph: 'eye', time: 'Now', class: 'my-header-toast'
|
10
10
|
t.body 'My body toast', class: 'my-body-toast'
|
11
11
|
end
|
12
|
-
expected = "<div data-bs-autohide=\"true\" class=\"my-toast toast\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"
|
12
|
+
expected = "<div data-bs-autohide=\"true\" class=\"my-toast toast\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"me-2 glyph fas fa-eye\"></i><strong class=\"me-auto\">My header toast</strong><small class=\"text-muted\">Now</small><button class=\"ml-2 mb-1 btn-close\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button></div><div class=\"my-body-toast toast-body\">My body toast</div></div>"
|
13
13
|
|
14
14
|
assert_equal expected, actual
|
15
15
|
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\"><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
|
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 me-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
|
@@ -69,7 +69,7 @@ class CardTest < ActionView::TestCase
|
|
69
69
|
end
|
70
70
|
p.footer 'Main Panel Footer'
|
71
71
|
end
|
72
|
-
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm
|
72
|
+
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm me-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-group"><div class="panel"><div class="panel-header justify-content-between">Left Panel Header</div><div class="panel-body">Left Panel Body</div><div class="panel-footer">Left Panel Footer</div></div><div class="panel"><div class="panel-header justify-content-between">Right Panel Header</div><div class="panel-body">Right Panel Body</div></div></div><div class="panel-footer">Main Panel Footer</div></div>'
|
73
73
|
|
74
74
|
assert_equal expected, actual
|
75
75
|
end
|
@@ -103,7 +103,7 @@ class CardTest < ActionView::TestCase
|
|
103
103
|
end
|
104
104
|
p.footer 'Main Panel Footer'
|
105
105
|
end
|
106
|
-
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm
|
106
|
+
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm me-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-deck-wrapper"><div class="panel-deck"><div class="panel"><div class="panel-header justify-content-between">Left Panel Header</div><div class="panel-body">Left Panel Body</div><div class="panel-footer">Left Panel Footer</div></div><div class="panel"><div class="panel-header justify-content-between">Right Panel Header</div><div class="panel-body">Right Panel Body</div></div></div></div><div class="panel-footer">Main Panel Footer</div></div>'
|
107
107
|
|
108
108
|
assert_equal expected, actual
|
109
109
|
end
|
@@ -137,7 +137,7 @@ class CardTest < ActionView::TestCase
|
|
137
137
|
end
|
138
138
|
p.footer 'Main Panel Footer'
|
139
139
|
end
|
140
|
-
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm
|
140
|
+
expected = '<div class="panel"><div class="panel-header justify-content-between"><div class="panel-title">Main panel header</div></div><div class="btn-toolbar justify-content-between panel-toolbar" role="toolbar"><div role="group" class="btn-group btn-group-sm me-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-columns"><div class="panel"><div class="panel-header justify-content-between">Left Panel Header</div><div class="panel-body">Left Panel Body</div><div class="panel-footer">Left Panel Footer</div></div><div class="panel"><div class="panel-header justify-content-between">Right Panel Header</div><div class="panel-body">Right Panel Body</div></div></div><div class="panel-footer">Main Panel Footer</div></div>'
|
141
141
|
|
142
142
|
assert_equal expected, actual
|
143
143
|
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.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams [Thomas HUMMEL]
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|