ui_bibz 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) 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/assets/stylesheets/fix_addon.sass +5 -0
  5. data/app/assets/stylesheets/forms.sass +1 -1
  6. data/lib/ui_bibz/ui/core/boxes/card.rb +5 -1
  7. data/lib/ui_bibz/ui/core/boxes/components/card_header.rb +16 -0
  8. data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +1 -1
  9. data/lib/ui_bibz/ui/core/boxes/components/card_tab_group.rb +26 -0
  10. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +3 -3
  11. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +1 -1
  12. data/lib/ui_bibz/ui/core/lists/components/list.rb +2 -2
  13. data/lib/ui_bibz/ui/core/lists/list_group.rb +12 -8
  14. data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +33 -17
  15. data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +11 -3
  16. data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +1 -1
  17. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +7 -3
  18. data/lib/ui_bibz/ui/core/notifications/alert.rb +3 -5
  19. data/lib/ui_bibz/ui/core/notifications/badge.rb +9 -6
  20. data/lib/ui_bibz/version.rb +1 -1
  21. data/test/ui/core/boxes/card_test.rb +14 -1
  22. data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
  23. data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
  24. data/test/ui/core/lists/list_group_test.rb +33 -3
  25. data/test/ui/core/navigations/breadcrumb_test.rb +3 -3
  26. data/test/ui/core/navigations/tab_group_test.rb +15 -4
  27. data/test/ui/core/notifications/badge_test.rb +7 -0
  28. data/ui_bibz.gemspec +1 -1
  29. data/vendor/assets/stylesheets/awesome-bootstrap-checkbox.css +205 -277
  30. metadata +7 -7
  31. data/lib/ui_bibz/ui/core/forms/buttons/button_choice.rb +0 -92
@@ -16,11 +16,10 @@ module UiBibz::Ui::Core::Notifications
16
16
  # You can pass arguments in options attribute:
17
17
  # * +status+ - status of élement with symbol value:
18
18
  # (+:primary+, +:secondary+, +:success+, +:danger+, +:warning+, +:info+, +:light+, +:dark+)
19
- # * +glyph+ - Add glyph with name or hash options
20
- # * +name+ - String
21
- # * +size+ - Integer
22
- # * +type+ - Symbol
23
- # * +type+ - Symbol
19
+ # * +glyph+ - [String | Hash] Add glyph with name or hash options
20
+ # * +name+ - [String]
21
+ # * +url+ - [String] Transform span to link
22
+ # * +type+ - [Symbol]
24
23
  # (+:pill+, +:square+)
25
24
  #
26
25
  # ==== Signatures
@@ -56,11 +55,15 @@ module UiBibz::Ui::Core::Notifications
56
55
 
57
56
  # Render html tag
58
57
  def pre_render
59
- content_tag :span, glyph_and_content_html, html_options
58
+ content_tag options[:url].nil? ? :span : :a, glyph_and_content_html, html_options
60
59
  end
61
60
 
62
61
  private
63
62
 
63
+ def component_html_options
64
+ super.merge(options[:url].nil? ? {} : { href: options[:url] })
65
+ end
66
+
64
67
  def component_html_classes
65
68
  ['badge', type]
66
69
  end
@@ -1,3 +1,3 @@
1
1
  module UiBibz
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
@@ -46,7 +46,7 @@ class CardTest < ActionView::TestCase
46
46
  link_to "Card link", '#', class: "card-link"
47
47
  end
48
48
  end
49
- expected = "<div class=\"card\"><img class=\"card-img-top\" src=\"/assets/image.svg\" /><div class=\"card-body\">test</div><ul class=\"list-group-flush list-group\"><li class=\"list-group-item\">Cras justo odio</li><li class=\"list-group-item\">Dapibas ac facilisis in</li><li class=\"list-group-item\">vestibulum at eros</li></ul><div class=\"card-body\"><a class=\"card-link\" href=\"#\">Card link</a></div></div>"
49
+ expected = "<div class=\"card\"><img class=\"card-img-top\" src=\"/images/image.svg\" /><div class=\"card-body\">test</div><ul class=\"list-group-flush list-group\"><li class=\"list-group-item\">Cras justo odio</li><li class=\"list-group-item\">Dapibas ac facilisis in</li><li class=\"list-group-item\">vestibulum at eros</li></ul><div class=\"card-body\"><a class=\"card-link\" href=\"#\">Card link</a></div></div>"
50
50
 
51
51
  assert_equal expected, actual
52
52
  end
@@ -133,4 +133,17 @@ class CardTest < ActionView::TestCase
133
133
  assert_equal expected, actual
134
134
  end
135
135
 
136
+ test 'card header tab group' do
137
+ actual = ui_card tap: true do |c|
138
+ c.header tap: true do |h|
139
+ h.tab_group tap: true do |cg|
140
+ cg.tab 'link1', url: '#link1'
141
+ cg.tab 'link2', url: '#link2'
142
+ end
143
+ end
144
+ end
145
+ expected = "<div class=\"card\"><div class=\"card-header\"><ul class=\"nav nav-tabs card-header-tabs\"><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#link1\">link1</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#link2\">link2</a></li></ul></div></div>"
146
+
147
+ assert_equal expected, actual
148
+ end
136
149
  end
@@ -4,7 +4,7 @@ class CheckboxFieldTest < ActionView::TestCase
4
4
 
5
5
  test 'checkbox_field' do
6
6
  actual = UiBibz::Ui::Core::Forms::Choices::CheckboxField.new('John', { value: 1, status: :primary, type: :circle }).render
7
- expected = "<div class=\"abc-checkbox-primary checkbox abc-checkbox abc-checkbox-circle\"><input type=\"checkbox\" name=\"John\" id=\"John\" value=\"1\" class=\"styled\" /><label for=\"John\">John</label></div>"
7
+ expected = "<div class=\"abc-checkbox-primary form-check abc-checkbox abc-checkbox-circle\"><input type=\"checkbox\" name=\"John\" id=\"John\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"John\">John</label></div>"
8
8
 
9
9
  assert_equal expected, actual
10
10
  end
@@ -8,7 +8,7 @@ class ChoiceGroupTest < ActionView::TestCase
8
8
  bc.choice 'Checkbox 1'
9
9
  bc.choice 'Checkbox 2', state: :active
10
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>"
11
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><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
12
 
13
13
  assert_equal expected, actual
14
14
  end
@@ -18,7 +18,7 @@ class ChoiceGroupTest < ActionView::TestCase
18
18
  bc.choice 'Radio 1'
19
19
  bc.choice 'Radio 2', state: :active
20
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>"
21
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><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
22
 
23
23
  assert_equal expected, actual
24
24
  end
@@ -28,7 +28,7 @@ class ChoiceGroupTest < ActionView::TestCase
28
28
  bc.choice 'Radio 1', glyph: 'diamond', status: :primary
29
29
  bc.choice 'Radio 2', state: :active
30
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 fas 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>"
31
+ expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><label class=\"btn-outline-primary btn btn-lg radio\"><input type=\"radio\" autocomplete=\"off\" /><i class=\"glyph fas 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
32
 
33
33
  assert_equal expected, actual
34
34
  end
@@ -4,20 +4,20 @@ class ListGroupTest < ActionView::TestCase
4
4
  include UiBibz::Helpers::Ui::CoreHelper
5
5
 
6
6
  test 'list_group with link' do
7
- actual = ui_list_group(type: :link) do |lg|
7
+ actual = ui_list_group(tag_type: :a) do |lg|
8
8
  lg.list 'Momo', { status: :success, url: '#momo' }
9
9
  lg.list({ tap: true, active: true, url: '#state' }) do |l|
10
10
  l.header 'My title'
11
11
  l.body 'My body'
12
12
  end
13
13
  end
14
- expected = "<ul class=\"list-group\"><li href=\"#momo\" class=\"list-group-item-success list-group-item\">Momo</li><li href=\"#state\" class=\"list-group-item flex-column align-items-start\"><div class=\"d-flex w-100 justify-content-between\"><h5 class=\"mb-1\">My title</h5><small></small></div><p class=\"mb-1\">My body</p><small></small></li></ul>"
14
+ expected = "<div class=\"list-group\"><a href=\"#momo\" class=\"list-group-item-success list-group-item list-group-item-action\">Momo</a><li href=\"#state\" class=\"list-group-item flex-column align-items-start\"><div class=\"d-flex w-100 justify-content-between\"><h5 class=\"mb-1\">My title</h5><small></small></div><p class=\"mb-1\">My body</p><small></small></li></div>"
15
15
 
16
16
  assert_equal expected, actual
17
17
  end
18
18
 
19
19
  test 'list_group' do
20
- actual = ui_list_group(type: :link) do |lg|
20
+ actual = ui_list_group do |lg|
21
21
  lg.list 'Lulu'
22
22
  lg.list 'state'
23
23
  end
@@ -26,4 +26,34 @@ class ListGroupTest < ActionView::TestCase
26
26
  assert_equal expected, actual
27
27
  end
28
28
 
29
+ test 'list with a tag' do
30
+ actual = ui_list_group(tag_type: :a) do |lg|
31
+ lg.list 'Lulu'
32
+ lg.list 'state'
33
+ end
34
+ expected = "<div class=\"list-group\"><a class=\"list-group-item list-group-item-action\">Lulu</a><a class=\"list-group-item list-group-item-action\">state</a></div>"
35
+
36
+ assert_equal expected, actual
37
+ end
38
+
39
+ test 'list with a li' do
40
+ actual = ui_list_group(tag_type: :li) do |lg|
41
+ lg.list 'Lulu'
42
+ lg.list 'state'
43
+ end
44
+ expected = "<ul class=\"list-group\"><li class=\"list-group-item\">Lulu</li><li class=\"list-group-item\">state</li></ul>"
45
+
46
+ assert_equal expected, actual
47
+ end
48
+
49
+ test 'list with a button' do
50
+ actual = ui_list_group(tag_type: :button) do |lg|
51
+ lg.list 'Lulu'
52
+ lg.list 'state'
53
+ end
54
+ expected = "<div class=\"list-group\"><button class=\"list-group-item list-group-item-action\">Lulu</button><button class=\"list-group-item list-group-item-action\">state</button></div>"
55
+
56
+ assert_equal expected, actual
57
+ end
58
+
29
59
  end
@@ -8,7 +8,7 @@ class BreadcrumbTest < ActionView::TestCase
8
8
  b.link 'Home', url: '#home', glyph: 'home'
9
9
  b.link 'state', { url: '#state', state: :active }
10
10
  end
11
- expected = "<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>"
11
+ 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>"
12
12
 
13
13
  assert_equal expected, actual
14
14
  end
@@ -25,8 +25,8 @@ class BreadcrumbTest < ActionView::TestCase
25
25
 
26
26
  test 'breadcrumb with store' do
27
27
  users = create_list(:user, 3)
28
- actual = ui_breadcrumb(store: users, link_label: :name_fr, link_url: user_path(:id))
29
- expected = "<ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"/users/1/\">Name fr</a></li><li class=\"breadcrumb-item\"><a href=\"/users/2/\">Name fr</a></li><li class=\"breadcrumb-item\">Name fr</li></ol>"
28
+ actual = ui_breadcrumb(users, link_label: :name_fr, link_url: user_path(:id))
29
+ expected = "<nav arial-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"/users/1/\">Name fr</a></li><li class=\"breadcrumb-item\"><a href=\"/users/2/\">Name fr</a></li><li class=\"breadcrumb-item\" aria-current=\"page\">Name fr</li></ol></nav>"
30
30
 
31
31
  assert_equal expected, actual
32
32
  end
@@ -8,7 +8,7 @@ class TabGroupTest < ActionView::TestCase
8
8
  n.tab 'Profile', url: "#profile", selector: 'profile'
9
9
  n.tab 'Messages', url: "#messages", selector: 'messages'
10
10
  end
11
- expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#messages\">Messages</a></li></ul>"
11
+ expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#messages\">Messages</a></li></ul>"
12
12
 
13
13
  assert_equal expected, actual
14
14
  end
@@ -19,7 +19,18 @@ class TabGroupTest < ActionView::TestCase
19
19
  n.tab 'Profile', url: "#profile", selector: 'profile'
20
20
  n.tab 'Messages', url: "#messages", selector: 'messages'
21
21
  end
22
- expected = "<nav class=\"nav nav-tabs\"><a class=\"active nav-link\" href=\"#Home\">Home</a><a class=\"nav-link\" href=\"#profile\">Profile</a><a class=\"nav-link\" href=\"#messages\">Messages</a></nav>"
22
+ expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#messages\">Messages</a></li></ul>"
23
+
24
+ assert_equal expected, actual
25
+ end
26
+
27
+ test 'tag_type' do
28
+ actual = ui_tab_group tag_type: :span do |n|
29
+ n.tab 'Home', state: :active, url: "#Home", selector: 'home'
30
+ n.tab 'Profile', url: "#profile", selector: 'profile'
31
+ n.tab 'Messages', url: "#messages", selector: 'messages'
32
+ end
33
+ expected = "<ul class=\"nav nav-tabs\"><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>"
23
34
 
24
35
  assert_equal expected, actual
25
36
  end
@@ -30,7 +41,7 @@ class TabGroupTest < ActionView::TestCase
30
41
  n.tab 'Profile', url: "#profile", selector: 'profile', label: 16
31
42
  n.tab 'Messages', url: "#messages", selector: 'messages', state: :disabled
32
43
  end
33
- expected = "<ul class=\"nav nav-tabs justify-content-end\"><li class=\"nav-item\"><a class=\"active nav-link\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" href=\"#messages\">Messages</a></li></ul>"
44
+ expected = "<ul class=\"nav nav-tabs justify-content-end\"><li class=\"nav-item\"><a class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#messages\">Messages</a></li></ul>"
34
45
 
35
46
  assert_equal expected, actual
36
47
  end
@@ -41,7 +52,7 @@ class TabGroupTest < ActionView::TestCase
41
52
  n.tab 'Profile', url: "#profile", selector: 'profile', label: 16
42
53
  n.tab 'Messages', url: "#messages", selector: 'messages', state: :disabled
43
54
  end
44
- expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" href=\"#messages\">Messages</a></li></ul>"
55
+ expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#messages\">Messages</a></li></ul>"
45
56
 
46
57
  assert_equal expected, actual
47
58
  end
@@ -9,6 +9,13 @@ class BadgeTest < ActionView::TestCase
9
9
  assert_equal expected, actual
10
10
  end
11
11
 
12
+ test 'badge with url' do
13
+ actual = ui_badge 'state', url: 'http://example.com'
14
+ expected = "<a class=\"badge-default badge\" href=\"http://example.com\">state</a>"
15
+
16
+ assert_equal expected, actual
17
+ end
18
+
12
19
  test 'badge pill' do
13
20
  actual = ui_badge 'state', status: :success, type: :pill, glyph: 'pencil'
14
21
  expected = "<span class=\"badge-success badge badge-pill\"><i class=\"glyph fas fa-pencil\"></i> state</span>"
data/ui_bibz.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_dependency 'haml-rails'
35
35
  s.add_dependency 'sass-rails', '>= 5.0.0'
36
36
  s.add_dependency 'font-awesome-sass'
37
- s.add_dependency 'bootstrap', '4.0.0'
37
+ s.add_dependency 'bootstrap', '~> 4.1.0'
38
38
 
39
39
  # Development gems
40
40
  s.add_development_dependency "simple_form"
@@ -1,60 +1,58 @@
1
- .checkbox {
2
- padding-left: 20px;
3
- }
4
- .checkbox label {
5
- display: inline-block;
6
- vertical-align: middle;
1
+ @charset "UTF-8";
2
+ .abc-checkbox {
3
+ cursor: default;
4
+ padding-left: 4px; }
5
+ .abc-checkbox label {
6
+ cursor: pointer;
7
+ display: inline;
8
+ vertical-align: top;
7
9
  position: relative;
8
- padding-left: 5px;
9
- }
10
- .checkbox label::before {
10
+ padding-left: 5px; }
11
+ .abc-checkbox label::before {
12
+ cursor: pointer;
11
13
  content: "";
12
14
  display: inline-block;
13
15
  position: absolute;
14
16
  width: 17px;
15
17
  height: 17px;
18
+ top: 2px;
16
19
  left: 0;
17
- margin-left: -20px;
18
- border: 1px solid #cccccc;
20
+ margin-left: -1.25rem;
21
+ border: 1px solid #ced4da;
19
22
  border-radius: 3px;
20
23
  background-color: #fff;
21
- -webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
22
- -o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
23
- transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
24
- }
25
- .checkbox label::after {
24
+ transition: border 0.15s ease-in-out, color 0.15s ease-in-out; }
25
+ .abc-checkbox label::after {
26
+ cursor: pointer;
26
27
  display: inline-block;
27
28
  position: absolute;
28
29
  width: 16px;
29
30
  height: 16px;
30
31
  left: 0;
31
- top: 0;
32
- margin-left: -20px;
32
+ top: 2px;
33
+ margin-left: -1.25rem;
33
34
  padding-left: 3px;
34
35
  padding-top: 1px;
35
36
  font-size: 11px;
36
- color: #555555;
37
- line-height: 1.4;
38
- }
39
- .checkbox input[type="checkbox"],
40
- .checkbox input[type="radio"] {
41
- opacity: 0;
42
- z-index: 1;
37
+ color: #495057; }
38
+ .abc-checkbox input[type="checkbox"],
39
+ .abc-checkbox input[type="radio"] {
40
+ position: static;
41
+ margin-left: 0;
43
42
  cursor: pointer;
44
- }
45
- .checkbox input[type="checkbox"]:focus + label::before,
46
- .checkbox input[type="radio"]:focus + label::before {
43
+ opacity: 0;
44
+ z-index: 1; }
45
+ .abc-checkbox input[type="checkbox"]:focus + label::before,
46
+ .abc-checkbox input[type="radio"]:focus + label::before {
47
47
  outline: thin dotted;
48
48
  outline: 5px auto -webkit-focus-ring-color;
49
- outline-offset: -2px;
50
- }
51
- .checkbox input[type="checkbox"]:checked + label::after,
52
- .checkbox input[type="radio"]:checked + label::after {
49
+ outline-offset: -2px; }
50
+ .abc-checkbox input[type="checkbox"]:checked + label::after,
51
+ .abc-checkbox input[type="radio"]:checked + label::after {
53
52
  font-family: "FontAwesome";
54
- content: "\f00c";
55
- }
56
- .checkbox input[type="checkbox"]:indeterminate + label::after,
57
- .checkbox input[type="radio"]:indeterminate + label::after {
53
+ content: ""; }
54
+ .abc-checkbox input[type="checkbox"]:indeterminate + label::after,
55
+ .abc-checkbox input[type="radio"]:indeterminate + label::after {
58
56
  display: block;
59
57
  content: "";
60
58
  width: 10px;
@@ -62,266 +60,196 @@
62
60
  background-color: #555555;
63
61
  border-radius: 2px;
64
62
  margin-left: -16.5px;
65
- margin-top: 7px;
66
- }
67
- .checkbox input[type="checkbox"]:disabled,
68
- .checkbox input[type="radio"]:disabled {
69
- cursor: not-allowed;
70
- }
71
- .checkbox input[type="checkbox"]:disabled + label,
72
- .checkbox input[type="radio"]:disabled + label {
73
- opacity: 0.65;
74
- }
75
- .checkbox input[type="checkbox"]:disabled + label::before,
76
- .checkbox input[type="radio"]:disabled + label::before {
77
- background-color: #eeeeee;
78
- cursor: not-allowed;
79
- }
80
- .checkbox.checkbox-circle label::before {
81
- border-radius: 50%;
82
- }
83
- .checkbox.checkbox-inline {
84
- margin-top: 0;
85
- }
86
-
87
- .checkbox-primary input[type="checkbox"]:checked + label::before,
88
- .checkbox-primary input[type="radio"]:checked + label::before {
89
- background-color: #337ab7;
90
- border-color: #337ab7;
91
- }
92
- .checkbox-primary input[type="checkbox"]:checked + label::after,
93
- .checkbox-primary input[type="radio"]:checked + label::after {
94
- color: #fff;
95
- }
96
-
97
- .checkbox-danger input[type="checkbox"]:checked + label::before,
98
- .checkbox-danger input[type="radio"]:checked + label::before {
99
- background-color: #d9534f;
100
- border-color: #d9534f;
101
- }
102
- .checkbox-danger input[type="checkbox"]:checked + label::after,
103
- .checkbox-danger input[type="radio"]:checked + label::after {
104
- color: #fff;
105
- }
106
-
107
- .checkbox-info input[type="checkbox"]:checked + label::before,
108
- .checkbox-info input[type="radio"]:checked + label::before {
109
- background-color: #5bc0de;
110
- border-color: #5bc0de;
111
- }
112
- .checkbox-info input[type="checkbox"]:checked + label::after,
113
- .checkbox-info input[type="radio"]:checked + label::after {
114
- color: #fff;
115
- }
116
-
117
- .checkbox-warning input[type="checkbox"]:checked + label::before,
118
- .checkbox-warning input[type="radio"]:checked + label::before {
119
- background-color: #f0ad4e;
120
- border-color: #f0ad4e;
121
- }
122
- .checkbox-warning input[type="checkbox"]:checked + label::after,
123
- .checkbox-warning input[type="radio"]:checked + label::after {
124
- color: #fff;
125
- }
126
-
127
- .checkbox-success input[type="checkbox"]:checked + label::before,
128
- .checkbox-success input[type="radio"]:checked + label::before {
129
- background-color: #5cb85c;
130
- border-color: #5cb85c;
131
- }
132
- .checkbox-success input[type="checkbox"]:checked + label::after,
133
- .checkbox-success input[type="radio"]:checked + label::after {
134
- color: #fff;
135
- }
136
-
137
- .checkbox-primary input[type="checkbox"]:indeterminate + label::before,
138
- .checkbox-primary input[type="radio"]:indeterminate + label::before {
139
- background-color: #337ab7;
140
- border-color: #337ab7;
141
- }
142
-
143
- .checkbox-primary input[type="checkbox"]:indeterminate + label::after,
144
- .checkbox-primary input[type="radio"]:indeterminate + label::after {
145
- background-color: #fff;
146
- }
147
-
148
- .checkbox-danger input[type="checkbox"]:indeterminate + label::before,
149
- .checkbox-danger input[type="radio"]:indeterminate + label::before {
150
- background-color: #d9534f;
151
- border-color: #d9534f;
152
- }
153
-
154
- .checkbox-danger input[type="checkbox"]:indeterminate + label::after,
155
- .checkbox-danger input[type="radio"]:indeterminate + label::after {
156
- background-color: #fff;
157
- }
158
-
159
- .checkbox-info input[type="checkbox"]:indeterminate + label::before,
160
- .checkbox-info input[type="radio"]:indeterminate + label::before {
161
- background-color: #5bc0de;
162
- border-color: #5bc0de;
163
- }
164
-
165
- .checkbox-info input[type="checkbox"]:indeterminate + label::after,
166
- .checkbox-info input[type="radio"]:indeterminate + label::after {
167
- background-color: #fff;
168
- }
169
-
170
- .checkbox-warning input[type="checkbox"]:indeterminate + label::before,
171
- .checkbox-warning input[type="radio"]:indeterminate + label::before {
172
- background-color: #f0ad4e;
173
- border-color: #f0ad4e;
174
- }
175
-
176
- .checkbox-warning input[type="checkbox"]:indeterminate + label::after,
177
- .checkbox-warning input[type="radio"]:indeterminate + label::after {
178
- background-color: #fff;
179
- }
180
-
181
- .checkbox-success input[type="checkbox"]:indeterminate + label::before,
182
- .checkbox-success input[type="radio"]:indeterminate + label::before {
183
- background-color: #5cb85c;
184
- border-color: #5cb85c;
185
- }
186
-
187
- .checkbox-success input[type="checkbox"]:indeterminate + label::after,
188
- .checkbox-success input[type="radio"]:indeterminate + label::after {
189
- background-color: #fff;
190
- }
191
-
192
- .radio {
193
- padding-left: 20px;
194
- }
195
- .radio label {
196
- display: inline-block;
197
- vertical-align: middle;
63
+ margin-top: 7px; }
64
+ .abc-checkbox input[type="checkbox"]:disabled + label,
65
+ .abc-checkbox input[type="radio"]:disabled + label {
66
+ opacity: 0.65; }
67
+ .abc-checkbox input[type="checkbox"]:disabled + label::before,
68
+ .abc-checkbox input[type="radio"]:disabled + label::before {
69
+ background-color: #e9ecef;
70
+ cursor: not-allowed; }
71
+ .abc-checkbox input[type="checkbox"]:disabled + label::after,
72
+ .abc-checkbox input[type="radio"]:disabled + label::after {
73
+ cursor: not-allowed; }
74
+ .abc-checkbox.abc-checkbox-circle label::before {
75
+ border-radius: 50%; }
76
+ .abc-checkbox.checkbox-inline {
77
+ margin-top: 0; }
78
+
79
+ .abc-checkbox-primary input[type="checkbox"]:checked + label::before,
80
+ .abc-checkbox-primary input[type="radio"]:checked + label::before {
81
+ background-color: #007bff;
82
+ border-color: #007bff; }
83
+ .abc-checkbox-primary input[type="checkbox"]:checked + label::after,
84
+ .abc-checkbox-primary input[type="radio"]:checked + label::after {
85
+ color: #fff; }
86
+
87
+ .abc-checkbox-danger input[type="checkbox"]:checked + label::before,
88
+ .abc-checkbox-danger input[type="radio"]:checked + label::before {
89
+ background-color: #dc3545;
90
+ border-color: #dc3545; }
91
+ .abc-checkbox-danger input[type="checkbox"]:checked + label::after,
92
+ .abc-checkbox-danger input[type="radio"]:checked + label::after {
93
+ color: #fff; }
94
+
95
+ .abc-checkbox-info input[type="checkbox"]:checked + label::before,
96
+ .abc-checkbox-info input[type="radio"]:checked + label::before {
97
+ background-color: #17a2b8;
98
+ border-color: #17a2b8; }
99
+ .abc-checkbox-info input[type="checkbox"]:checked + label::after,
100
+ .abc-checkbox-info input[type="radio"]:checked + label::after {
101
+ color: #fff; }
102
+
103
+ .abc-checkbox-warning input[type="checkbox"]:checked + label::before,
104
+ .abc-checkbox-warning input[type="radio"]:checked + label::before {
105
+ background-color: #ffc107;
106
+ border-color: #ffc107; }
107
+ .abc-checkbox-warning input[type="checkbox"]:checked + label::after,
108
+ .abc-checkbox-warning input[type="radio"]:checked + label::after {
109
+ color: #fff; }
110
+
111
+ .abc-checkbox-success input[type="checkbox"]:checked + label::before,
112
+ .abc-checkbox-success input[type="radio"]:checked + label::before {
113
+ background-color: #28a745;
114
+ border-color: #28a745; }
115
+ .abc-checkbox-success input[type="checkbox"]:checked + label::after,
116
+ .abc-checkbox-success input[type="radio"]:checked + label::after {
117
+ color: #fff; }
118
+
119
+ .abc-checkbox-primary input[type="checkbox"]:indeterminate + label::before,
120
+ .abc-checkbox-primary input[type="radio"]:indeterminate + label::before {
121
+ background-color: #007bff;
122
+ border-color: #007bff; }
123
+ .abc-checkbox-primary input[type="checkbox"]:indeterminate + label::after,
124
+ .abc-checkbox-primary input[type="radio"]:indeterminate + label::after {
125
+ background-color: #fff; }
126
+
127
+ .abc-checkbox-danger input[type="checkbox"]:indeterminate + label::before,
128
+ .abc-checkbox-danger input[type="radio"]:indeterminate + label::before {
129
+ background-color: #dc3545;
130
+ border-color: #dc3545; }
131
+ .abc-checkbox-danger input[type="checkbox"]:indeterminate + label::after,
132
+ .abc-checkbox-danger input[type="radio"]:indeterminate + label::after {
133
+ background-color: #fff; }
134
+
135
+ .abc-checkbox-info input[type="checkbox"]:indeterminate + label::before,
136
+ .abc-checkbox-info input[type="radio"]:indeterminate + label::before {
137
+ background-color: #17a2b8;
138
+ border-color: #17a2b8; }
139
+ .abc-checkbox-info input[type="checkbox"]:indeterminate + label::after,
140
+ .abc-checkbox-info input[type="radio"]:indeterminate + label::after {
141
+ background-color: #fff; }
142
+
143
+ .abc-checkbox-warning input[type="checkbox"]:indeterminate + label::before,
144
+ .abc-checkbox-warning input[type="radio"]:indeterminate + label::before {
145
+ background-color: #ffc107;
146
+ border-color: #ffc107; }
147
+ .abc-checkbox-warning input[type="checkbox"]:indeterminate + label::after,
148
+ .abc-checkbox-warning input[type="radio"]:indeterminate + label::after {
149
+ background-color: #fff; }
150
+
151
+ .abc-checkbox-success input[type="checkbox"]:indeterminate + label::before,
152
+ .abc-checkbox-success input[type="radio"]:indeterminate + label::before {
153
+ background-color: #28a745;
154
+ border-color: #28a745; }
155
+ .abc-checkbox-success input[type="checkbox"]:indeterminate + label::after,
156
+ .abc-checkbox-success input[type="radio"]:indeterminate + label::after {
157
+ background-color: #fff; }
158
+
159
+ .abc-radio {
160
+ cursor: default;
161
+ padding-left: 4px; }
162
+ .abc-radio label {
163
+ cursor: pointer;
164
+ display: inline;
165
+ vertical-align: top;
198
166
  position: relative;
199
- padding-left: 5px;
200
- }
201
- .radio label::before {
167
+ padding-left: 5px; }
168
+ .abc-radio label::before {
169
+ cursor: pointer;
202
170
  content: "";
203
171
  display: inline-block;
204
172
  position: absolute;
205
173
  width: 17px;
206
174
  height: 17px;
175
+ top: 2px;
207
176
  left: 0;
208
177
  margin-left: -20px;
209
- border: 1px solid #cccccc;
178
+ border: 1px solid #ced4da;
210
179
  border-radius: 50%;
211
180
  background-color: #fff;
212
- -webkit-transition: border 0.15s ease-in-out;
213
- -o-transition: border 0.15s ease-in-out;
214
- transition: border 0.15s ease-in-out;
215
- }
216
- .radio label::after {
181
+ transition: border 0.15s ease-in-out; }
182
+ .abc-radio label::after {
183
+ cursor: pointer;
217
184
  display: inline-block;
218
185
  position: absolute;
219
186
  content: " ";
220
187
  width: 11px;
221
188
  height: 11px;
222
189
  left: 3px;
223
- top: 3px;
190
+ top: 5px;
224
191
  margin-left: -20px;
225
192
  border-radius: 50%;
226
- background-color: #555555;
227
- -webkit-transform: scale(0, 0);
228
- -ms-transform: scale(0, 0);
229
- -o-transform: scale(0, 0);
193
+ background-color: #495057;
230
194
  transform: scale(0, 0);
231
- -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
232
- -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
233
- -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
234
- transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
235
- }
236
- .radio input[type="radio"] {
237
- opacity: 0;
238
- z-index: 1;
195
+ transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); }
196
+ .abc-radio input[type="radio"] {
197
+ position: static;
198
+ margin-left: 0;
239
199
  cursor: pointer;
240
- }
241
- .radio input[type="radio"]:focus + label::before {
200
+ opacity: 0;
201
+ z-index: 1; }
202
+ .abc-radio input[type="radio"]:focus + label::before {
242
203
  outline: thin dotted;
243
204
  outline: 5px auto -webkit-focus-ring-color;
244
- outline-offset: -2px;
245
- }
246
- .radio input[type="radio"]:checked + label::after {
247
- -webkit-transform: scale(1, 1);
248
- -ms-transform: scale(1, 1);
249
- -o-transform: scale(1, 1);
250
- transform: scale(1, 1);
251
- }
252
- .radio input[type="radio"]:disabled {
253
- cursor: not-allowed;
254
- }
255
- .radio input[type="radio"]:disabled + label {
256
- opacity: 0.65;
257
- }
258
- .radio input[type="radio"]:disabled + label::before {
259
- cursor: not-allowed;
260
- }
261
- .radio.radio-inline {
262
- margin-top: 0;
263
- }
264
-
265
- .radio-primary input[type="radio"] + label::after {
266
- background-color: #337ab7;
267
- }
268
- .radio-primary input[type="radio"]:checked + label::before {
269
- border-color: #337ab7;
270
- }
271
- .radio-primary input[type="radio"]:checked + label::after {
272
- background-color: #337ab7;
273
- }
274
-
275
- .radio-danger input[type="radio"] + label::after {
276
- background-color: #d9534f;
277
- }
278
- .radio-danger input[type="radio"]:checked + label::before {
279
- border-color: #d9534f;
280
- }
281
- .radio-danger input[type="radio"]:checked + label::after {
282
- background-color: #d9534f;
283
- }
284
-
285
- .radio-info input[type="radio"] + label::after {
286
- background-color: #5bc0de;
287
- }
288
- .radio-info input[type="radio"]:checked + label::before {
289
- border-color: #5bc0de;
290
- }
291
- .radio-info input[type="radio"]:checked + label::after {
292
- background-color: #5bc0de;
293
- }
294
-
295
- .radio-warning input[type="radio"] + label::after {
296
- background-color: #f0ad4e;
297
- }
298
- .radio-warning input[type="radio"]:checked + label::before {
299
- border-color: #f0ad4e;
300
- }
301
- .radio-warning input[type="radio"]:checked + label::after {
302
- background-color: #f0ad4e;
303
- }
304
-
305
- .radio-success input[type="radio"] + label::after {
306
- background-color: #5cb85c;
307
- }
308
- .radio-success input[type="radio"]:checked + label::before {
309
- border-color: #5cb85c;
310
- }
311
- .radio-success input[type="radio"]:checked + label::after {
312
- background-color: #5cb85c;
313
- }
314
-
315
- input[type="checkbox"].styled:checked + label:after,
316
- input[type="radio"].styled:checked + label:after {
317
- font-family: 'FontAwesome';
318
- content: "\f00c";
319
- }
320
- input[type="checkbox"] .styled:checked + label::before,
321
- input[type="radio"] .styled:checked + label::before {
322
- color: #fff;
323
- }
324
- input[type="checkbox"] .styled:checked + label::after,
325
- input[type="radio"] .styled:checked + label::after {
326
- color: #fff;
327
- }
205
+ outline-offset: -2px; }
206
+ .abc-radio input[type="radio"]:checked + label::after {
207
+ transform: scale(1, 1); }
208
+ .abc-radio input[type="radio"]:disabled + label {
209
+ opacity: 0.65; }
210
+ .abc-radio input[type="radio"]:disabled + label::before {
211
+ cursor: not-allowed; }
212
+ .abc-radio input[type="radio"]:disabled + label::after {
213
+ cursor: not-allowed; }
214
+ .abc-radio.radio-inline {
215
+ margin-top: 0; }
216
+
217
+ .abc-radio-primary input[type="radio"] + label::after {
218
+ background-color: #007bff; }
219
+ .abc-radio-primary input[type="radio"]:checked + label::before {
220
+ border-color: #007bff; }
221
+ .abc-radio-primary input[type="radio"]:checked + label::after {
222
+ background-color: #007bff; }
223
+
224
+ .abc-radio-danger input[type="radio"] + label::after {
225
+ background-color: #dc3545; }
226
+ .abc-radio-danger input[type="radio"]:checked + label::before {
227
+ border-color: #dc3545; }
228
+ .abc-radio-danger input[type="radio"]:checked + label::after {
229
+ background-color: #dc3545; }
230
+
231
+ .abc-radio-info input[type="radio"] + label::after {
232
+ background-color: #17a2b8; }
233
+ .abc-radio-info input[type="radio"]:checked + label::before {
234
+ border-color: #17a2b8; }
235
+ .abc-radio-info input[type="radio"]:checked + label::after {
236
+ background-color: #17a2b8; }
237
+
238
+ .abc-radio-warning input[type="radio"] + label::after {
239
+ background-color: #ffc107; }
240
+ .abc-radio-warning input[type="radio"]:checked + label::before {
241
+ border-color: #ffc107; }
242
+ .abc-radio-warning input[type="radio"]:checked + label::after {
243
+ background-color: #ffc107; }
244
+
245
+ .abc-radio-success input[type="radio"] + label::after {
246
+ background-color: #28a745; }
247
+ .abc-radio-success input[type="radio"]:checked + label::before {
248
+ border-color: #28a745; }
249
+ .abc-radio-success input[type="radio"]:checked + label::after {
250
+ background-color: #28a745; }
251
+
252
+ label .was-validated .form-check-input:invalid .abc-checkbox:before, label
253
+ .was-validated .form-check-input:invalid .abc-radio:before, label .form-check-input.is-invalid .abc-checkbox:before, label
254
+ .form-check-input.is-invalid .abc-radio:before {
255
+ border-color: #dc3545; }