ui_bibz 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +16 -16
  3. data/app/assets/stylesheets/_panel.scss +2 -2
  4. data/app/assets/stylesheets/fix_addon.sass +7 -0
  5. data/app/assets/stylesheets/navigations.sass +3 -0
  6. data/app/assets/stylesheets/notifications.sass +3 -0
  7. data/lib/ui_bibz/infos.rb +3 -3
  8. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +4 -0
  9. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +3 -2
  10. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +1 -1
  11. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +1 -1
  12. data/lib/ui_bibz/ui/core/icons/star.rb +5 -5
  13. data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +93 -0
  14. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +8 -1
  15. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +9 -0
  16. data/lib/ui_bibz/ui/ux/containers/components/panel_tab_group.rb +45 -0
  17. data/test/factories/user.rb +5 -5
  18. data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
  19. data/test/ui/core/icons/star_test.rb +5 -5
  20. data/test/ui/core/navigations/toolbar_test.rb +1 -1
  21. data/test/ui/ux/containers/panel_test.rb +4 -4
  22. data/vendor/assets/fonts/fa-brands-400.eot +0 -0
  23. data/vendor/assets/fonts/fa-brands-400.svg +36 -6
  24. data/vendor/assets/fonts/fa-brands-400.ttf +0 -0
  25. data/vendor/assets/fonts/fa-brands-400.woff +0 -0
  26. data/vendor/assets/fonts/fa-brands-400.woff2 +0 -0
  27. data/vendor/assets/fonts/fa-regular-400.eot +0 -0
  28. data/vendor/assets/fonts/fa-regular-400.svg +2 -2
  29. data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
  30. data/vendor/assets/fonts/fa-regular-400.woff +0 -0
  31. data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
  32. data/vendor/assets/fonts/fa-solid-900.eot +0 -0
  33. data/vendor/assets/fonts/fa-solid-900.svg +183 -9
  34. data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
  35. data/vendor/assets/fonts/fa-solid-900.woff +0 -0
  36. data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
  37. data/vendor/assets/javascripts/all.js +93 -22
  38. data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +1 -1
  39. data/vendor/assets/stylesheets/fontawesome/_icons.scss +69 -1
  40. data/vendor/assets/stylesheets/fontawesome/_shims.scss +0 -4
  41. data/vendor/assets/stylesheets/fontawesome/_stacked.scss +1 -1
  42. data/vendor/assets/stylesheets/fontawesome/_variables.scss +72 -3
  43. data/vendor/assets/stylesheets/fontawesome/brands.scss +1 -1
  44. data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +1 -1
  45. data/vendor/assets/stylesheets/fontawesome/regular.scss +1 -1
  46. data/vendor/assets/stylesheets/fontawesome/solid.scss +1 -1
  47. data/vendor/assets/stylesheets/fontawesome/v4-shims.scss +1 -1
  48. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8e5cc80794cc21d792fa246f74909176423e213
4
- data.tar.gz: bc903615fd2bb0eb6e1fb921302dea8489353887
3
+ metadata.gz: d5c8ee009ca6a7751e3c7201b975e3943acb6065
4
+ data.tar.gz: c87cd2632f56a8e05db95992200aa3936229c904
5
5
  SHA512:
6
- metadata.gz: 01e1525f051b376f294449d02c49b1d35f26c37ab0de6e0262046dba3b95f960bf7f60b0a27d4140ce33249d6807dbb932359a092f51dabd3d3825d00ebb5a53
7
- data.tar.gz: f838abaffe37a46c3649328163c995b55305a3cc02807a00bc237ef2c996764323c467c56a803973568b47f3b077f6732d3607389ded84c104758c664da20186
6
+ metadata.gz: d2aa81787c42ae4e542c818dc55bb0aa2ecfc1abd42b1411d11e8bc38e33dbda3e2e9beebf12af73bd8704d987bb7d3400c0feb39e483f9e118c5cadf0762a2e
7
+ data.tar.gz: 64c48f832fc4ee7e25ee964ecf8b3fe0e8349b31b0bd3a4125a3ee7199d9034e67fd2d67859f75986092da436cc091d882e0b6fd1d005f60a7c3589552502d25
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (2.1.2)
5
- bootstrap (= 4.1.1)
4
+ ui_bibz (2.1.3)
5
+ bootstrap (= 4.1.3)
6
6
  haml
7
7
  haml-rails
8
8
  jquery-rails (>= 3.1.0)
@@ -57,20 +57,20 @@ GEM
57
57
  minitest (~> 5.1)
58
58
  tzinfo (~> 1.1)
59
59
  arel (9.0.0)
60
- autoprefixer-rails (9.1.4)
60
+ autoprefixer-rails (9.3.1)
61
61
  execjs
62
62
  awesome_print (1.8.0)
63
- bootstrap (4.1.1)
63
+ bootstrap (4.1.3)
64
64
  autoprefixer-rails (>= 6.0.3)
65
65
  popper_js (>= 1.12.9, < 2)
66
66
  sass (>= 3.5.2)
67
67
  builder (3.2.3)
68
68
  byebug (10.0.2)
69
- codeclimate-test-reporter (1.0.8)
70
- simplecov (<= 0.13)
71
- concurrent-ruby (1.0.5)
69
+ codeclimate-test-reporter (1.0.7)
70
+ simplecov
71
+ concurrent-ruby (1.1.3)
72
72
  crass (1.0.4)
73
- docile (1.1.5)
73
+ docile (1.3.1)
74
74
  erubi (1.7.1)
75
75
  erubis (2.7.0)
76
76
  execjs (2.7.0)
@@ -96,21 +96,21 @@ GEM
96
96
  haml (>= 4.0, < 6)
97
97
  nokogiri (>= 1.6.0)
98
98
  ruby_parser (~> 3.5)
99
- i18n (1.1.0)
99
+ i18n (1.1.1)
100
100
  concurrent-ruby (~> 1.0)
101
101
  jquery-rails (4.3.3)
102
102
  rails-dom-testing (>= 1, < 3)
103
103
  railties (>= 4.2.0)
104
104
  thor (>= 0.14, < 2.0)
105
105
  json (2.1.0)
106
- loofah (2.2.2)
106
+ loofah (2.2.3)
107
107
  crass (~> 1.0.2)
108
108
  nokogiri (>= 1.5.9)
109
- mail (2.7.0)
109
+ mail (2.7.1)
110
110
  mini_mime (>= 0.1.1)
111
111
  marcel (0.3.3)
112
112
  mimemagic (~> 0.3.2)
113
- method_source (0.9.0)
113
+ method_source (0.9.1)
114
114
  mimemagic (0.3.2)
115
115
  mini_mime (1.0.1)
116
116
  mini_portile2 (2.3.0)
@@ -119,7 +119,7 @@ GEM
119
119
  nokogiri (1.8.5)
120
120
  mini_portile2 (~> 2.3.0)
121
121
  popper_js (1.14.3)
122
- rack (2.0.5)
122
+ rack (2.0.6)
123
123
  rack-test (1.1.0)
124
124
  rack (>= 1.0, < 3)
125
125
  rails (5.2.1)
@@ -152,7 +152,7 @@ GEM
152
152
  ffi (>= 0.5.0, < 2)
153
153
  ruby_parser (3.11.0)
154
154
  sexp_processor (~> 4.9)
155
- sass (3.6.0)
155
+ sass (3.7.1)
156
156
  sass-listen (~> 4.0.0)
157
157
  sass-listen (4.0.0)
158
158
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -167,8 +167,8 @@ GEM
167
167
  simple_form (4.0.1)
168
168
  actionpack (>= 5.0)
169
169
  activemodel (>= 5.0)
170
- simplecov (0.13.0)
171
- docile (~> 1.1.0)
170
+ simplecov (0.16.1)
171
+ docile (~> 1.1)
172
172
  json (>= 1.8, < 3)
173
173
  simplecov-html (~> 0.10.0)
174
174
  simplecov-html (0.10.2)
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  // Select last panel-toolbar
50
- > .panel-toolbar:nth-last-child(2), .panel-toolbar:nth-last-child(1){
50
+ > .panel-toolbar:nth-last-child{
51
51
  border-bottom: none;
52
52
  }
53
53
  }
@@ -93,7 +93,7 @@
93
93
  border-bottom: $panel-border-width solid $panel-border-color;
94
94
  display: flex;
95
95
 
96
- div {
96
+ > div:not(.dropdown) {
97
97
  position: relative;
98
98
  display: inline-flex;
99
99
  vertical-align: middle;
@@ -94,12 +94,19 @@ $input-group-btn-border-color: $input-border-color
94
94
  font-size: $font-size-sm
95
95
  @include border-radius($input-border-radius-sm)
96
96
 
97
+ svg
98
+ font-size: 1rem
99
+ margin-top: 0.1rem
100
+
97
101
 
98
102
  &.form-control-lg
99
103
  padding: $input-btn-padding-y-lg $input-btn-padding-x-lg
100
104
  font-size: $font-size-lg
101
105
  @include border-radius($input-border-radius-lg)
102
106
 
107
+ svg
108
+ font-size: 1.3rem
109
+
103
110
 
104
111
  // scss-lint:disable QualifyingElement
105
112
  // Nuke default margins from checkboxes and radios to vertically center within.
@@ -12,3 +12,6 @@
12
12
 
13
13
  .nav-link
14
14
  cursor: pointer
15
+
16
+ .btn-toolbar form
17
+ display: inline-flex
@@ -22,3 +22,6 @@
22
22
  .fal,
23
23
  .fab
24
24
  line-height: 0.7 !important
25
+
26
+ span:not(.input-group-addon) .glyph
27
+ margin-top: -0.1rem
data/lib/ui_bibz/infos.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  module UiBibz
2
2
  NAME = "Ui Bibz"
3
- VERSION = "2.1.2"
3
+ VERSION = "2.1.3"
4
4
  DESCRIPTION = "A Rails Interface Framework using Bootstrap."
5
5
  SUMMARY = "Create your project with Ui Bibz. Over a thirty reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more."
6
6
  LICENSE = "MIT"
7
- FONTAWESOME_VERSION = "5.3.1"
8
- BOOTSTRAP_VERSION = "4.1.1"
7
+ FONTAWESOME_VERSION = "5.5.0"
8
+ BOOTSTRAP_VERSION = "4.1.3"
9
9
  end
@@ -92,6 +92,10 @@ module UiBibz::Ui::Core::Forms::Buttons
92
92
  @items << UiBibz::Ui::Core::Component.new(content, options, html_options, &block).render
93
93
  end
94
94
 
95
+ def choice_group content = nil, options = nil, html_options = nil, &block
96
+ @items << UiBibz::Ui::Core::Forms::Choices::ChoiceGroup.new(content, options, html_options).tap(&block).render
97
+ end
98
+
95
99
  private
96
100
 
97
101
  def component_html_classes
@@ -58,14 +58,15 @@ module UiBibz::Ui::Core::Forms::Choices
58
58
  private
59
59
 
60
60
  def checkbox_field_html_tag
61
- content_tag :div, html_options.except(:id) do
61
+ options[:action] = html_options[:data].delete(:action)
62
+ content_tag :div, html_options.except(:id, "data-action") do
62
63
  concat check_box_tag content, options[:value], options[:checked] || false, checkbox_html_options
63
64
  concat label_tag label_name, label_content, label_html_options
64
65
  end
65
66
  end
66
67
 
67
68
  def checkbox_html_options
68
- { class: 'form-check-input', disabled: options[:state] == :disabled }
69
+ { class: 'form-check-input', disabled: options[:state] == :disabled, "data-action": options[:action] }
69
70
  end
70
71
 
71
72
  def label_name
@@ -65,7 +65,7 @@ module UiBibz::Ui::Core::Forms::Choices
65
65
  private
66
66
 
67
67
  def component_html_classes
68
- super << ['button-choice', "btn-group-toggle"]
68
+ super << ['button-choice', "btn-group-toggle", options.delete(:class)]
69
69
  end
70
70
 
71
71
  def component_html_options
@@ -110,7 +110,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
110
110
  end
111
111
 
112
112
  def button_content
113
- [glyph_with_space, @content, ' ', caret].compact.join.html_safe
113
+ [glyph_and_content_html(options[:text].nil? ? @content : ''), ' ', caret].compact.join.html_safe
114
114
  end
115
115
 
116
116
  def button_html
@@ -69,8 +69,8 @@ module UiBibz::Ui::Core::Icons
69
69
  stars = []
70
70
  number.times do |star|
71
71
  star += 1
72
- name = star_name(star)
73
- stars << UiBibz::Ui::Core::Icons::Glyph.new(name, glyph_opts).render
72
+ star_options = star_name(star).merge(glyph_opts)
73
+ stars << UiBibz::Ui::Core::Icons::Glyph.new(star_options).render
74
74
  end
75
75
  stars
76
76
  end
@@ -84,11 +84,11 @@ module UiBibz::Ui::Core::Icons
84
84
 
85
85
  def star_name star
86
86
  if star <= content
87
- 'star'
87
+ { name: 'star', style: :solid }
88
88
  elsif star > content && !content.is_a?(Integer) && star < content + 1
89
- 'star-half-o'
89
+ { name: 'star-half-alt', style: :solid }
90
90
  else
91
- 'star-o'
91
+ { name: 'star', style: :regular }
92
92
  end
93
93
  end
94
94
 
@@ -0,0 +1,93 @@
1
+ require 'haml'
2
+ module UiBibz::Ui::Core::Navigations
3
+
4
+ # Create a ToolbarForm
5
+ #
6
+ # This element is an extend of ActionView::Helpers::FormHelper::FormFor to Rails
7
+ #
8
+ # ==== Attributes
9
+ #
10
+ # * +content+ - Content of element
11
+ # * +options+ - Options of element
12
+ # * +html_options+ - Html Options of element
13
+ #
14
+ # ==== Options
15
+ #
16
+ # You can add HTML attributes using the +html_options+.
17
+ # You can pass arguments in options attribute:
18
+ #
19
+ # http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for
20
+ # # and
21
+ # http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-form_tag
22
+ #
23
+ # ==== Signatures
24
+ #
25
+ # UiBibz::Ui::Core::Navigations::ToolbarForm.new(options = nil, html_options = nil) do |f|
26
+ # f.text_field :field
27
+ # f.submit 'Submit'
28
+ # end
29
+ #
30
+ # ==== Examples
31
+ #
32
+ # UiBibz::Ui::Core::Navigations::ToolbarForm.new(position: :right) do |f|
33
+ # f.text_field :field
34
+ # f.submit 'Submit'
35
+ # end.render
36
+ #
37
+ # UiBibz::Ui::Core::Navigations::ToolbarForm.new('/search', type: :form_tag) do
38
+ # text_field_tag :field
39
+ # submit_tag 'Submit'
40
+ # end.render
41
+ #
42
+ class ToolbarForm < UiBibz::Ui::Base
43
+ include Haml::Helpers
44
+ include SimpleForm::ActionViewExtensions::FormHelper if defined?(SimpleForm)
45
+ include UiBibz::Helpers::UtilsHelper
46
+ include ActionView::Helpers
47
+
48
+ attr_accessor :html_options
49
+
50
+ def initialize model_or_url, options = {}, &block
51
+ init_haml_helpers
52
+ @content = block
53
+ @model_or_url = model_or_url
54
+ @options = options
55
+ @html_options = !%i(form_for ui_form_for).include?(type) ? html_options_for_form(@model_or_url, new_option) : new_option
56
+ end
57
+
58
+ # Render html tag
59
+ def render
60
+ case type
61
+ when :form_for
62
+ @form = form_for(@model_or_url, html_options, &@content)
63
+ when :ui_form_for
64
+ begin
65
+ @form = ui_form_for(@model_or_url, html_options, &@content)
66
+ ## rescue
67
+ ## raise 'You must install simple form to use ui_form_for.'
68
+ end
69
+ else
70
+ @form = form_tag_with_body(html_options, capture(&@content))
71
+ end
72
+ end
73
+
74
+ private
75
+
76
+ def new_option
77
+ (@options || {}).merge({ class: UiBibz::Utils::Screwdriver.join_classes("btn-group", @options[:class]) })
78
+ end
79
+
80
+ def protect_against_forgery?
81
+ false
82
+ end
83
+
84
+ def url
85
+ @options[:url]
86
+ end
87
+
88
+ def type
89
+ @options[:type] || :form_for
90
+ end
91
+
92
+ end
93
+ end
@@ -1,3 +1,4 @@
1
+ require 'ui_bibz/ui/core/navigations/components/toolbar_form'
1
2
  module UiBibz::Ui::Core::Navigations
2
3
 
3
4
  # Create a toolbar
@@ -70,7 +71,13 @@ module UiBibz::Ui::Core::Navigations
70
71
 
71
72
  def spacer num = "auto"
72
73
  kls = "mr-#{ num }"
73
- @items.last.html_options[:class] = @items.last.html_options[:class].nil? ? kls : join_classes(@items.last.html_options[:class], kls)
74
+ @items.last.html_options["class"] = join_classes(@items.last.html_options.delete(:class), @items.last.html_options[:class], kls)
75
+ end
76
+
77
+ # Add navbar form items
78
+ # See UiBibz::Ui::Core::ToolbarForm
79
+ def form model_or_url, options = {}, &block
80
+ @items << UiBibz::Ui::Core::Navigations::ToolbarForm.new(model_or_url, options, &block)
74
81
  end
75
82
 
76
83
  private
@@ -1,3 +1,4 @@
1
+ require 'ui_bibz/ui/ux/containers/components/panel_tab_group'
1
2
  module UiBibz::Ui::Ux::Containers::Components
2
3
 
3
4
  # Create a panel header
@@ -52,6 +53,14 @@ module UiBibz::Ui::Ux::Containers::Components
52
53
  @actions = UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(content, options, html_options).tap(&block).render
53
54
  end
54
55
 
56
+ def tab_group content = nil, options = nil, html_options = nil, &block
57
+ if is_tap(content, options)
58
+ @content = PanelTabGroup.new(content, options, html_options).tap(&block).render
59
+ else
60
+ @content = PanelTabGroup.new(content, options, html_options, &block).render
61
+ end
62
+ end
63
+
55
64
  private
56
65
 
57
66
  def component_html_classes
@@ -0,0 +1,45 @@
1
+ module UiBibz::Ui::Ux::Containers::Components
2
+
3
+ # Create a card body
4
+ #
5
+ # ==== Attributes
6
+ #
7
+ # * +content+ - Content of element
8
+ # * +options+ - Options of element
9
+ # * +html_options+ - Html Options of element
10
+ #
11
+ # ==== Options
12
+ #
13
+ # You can add HTML attributes using the +html_options+.
14
+ # You can pass arguments in options attribute:
15
+ #
16
+ # ==== Signatures
17
+ #
18
+ # UiBibz::Ui::Core::Boxes::PanelBody.new(content, options = nil, html_options = nil)
19
+ #
20
+ # UiBibz::Ui::Core::Boxes::PanelBody.new(options = nil, html_options = nil) do
21
+ # content
22
+ # end
23
+ #
24
+ # ==== Examples
25
+ #
26
+ # UiBibz::Ui::Core::Boxes::PanelBody.new.render
27
+ #
28
+ # UiBibz::Ui::Core::Boxes::PanelBody.new do
29
+ # 'Exemple'
30
+ # end.render
31
+ #
32
+ class PanelTabGroup < UiBibz::Ui::Core::Navigations::TabGroup
33
+
34
+ def initialize content = nil, options = nil, html_options = nil, &block
35
+ super
36
+ end
37
+
38
+ private
39
+
40
+ def component_html_classes
41
+ super << "panel-header-tabs"
42
+ end
43
+
44
+ end
45
+ end
@@ -1,9 +1,9 @@
1
1
  FactoryBot.define do
2
2
  factory :user do
3
- name_fr "Name fr"
4
- name_en "Name en"
5
- body_fr "Body fr"
6
- body_en "Body en"
7
- active true
3
+ name_fr { "Name fr" }
4
+ name_en { "Name en" }
5
+ body_fr { "Body fr" }
6
+ body_en { "Body en" }
7
+ active { true }
8
8
  end
9
9
  end