ui_bibz 3.0.0.beta17 → 3.0.0.beta18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 293f9667c9bfae713e8968aedb6fb67bb8f391b0ef8f57663e048be71589e4e5
4
- data.tar.gz: 4b15c120616b00753011fd7f58e278dbe249cacd98e1642bac153b80b0e6b5de
3
+ metadata.gz: 710b0c4a072a6505597eb6f7b2c92685eb6e545e470ba72bec6838b0f6acc4f6
4
+ data.tar.gz: 1c3e4c48723812182a347d8cbe2ef85053fbc72c1f36c07853025212e16f0353
5
5
  SHA512:
6
- metadata.gz: a9d3053d5303bd6c9ff0c6de3dde049a08a75f25f94e70f3812031050328dd66dc14e3b6909a35f083993ee09b1782c615d3b00c0c8fd41e224bc50f223b4077
7
- data.tar.gz: a167b60e21e64c303227f580ca599b95351ae1b5554a5c611fef8abc199abe9180c5aa44af7654a5b61ef777b21d81cb7e289389d3098bfd10f78a26a5597638
6
+ metadata.gz: da63293c5b8bd94bd2a4797aef3d3b94ae360c2f796730f23bee60fc55c645dad59dd5ec09f22c9251a1ff2cce6c7ccc345e6e9ed82c5b63e7832cfb485fa446
7
+ data.tar.gz: 0e7d6f80d5d85506c04c8123fd5b94143a6c96f58ba39a90feacb1ed3ec765330c846a7f810af7ea6a8917ec4c92cbb1a448e552ef29a1b638889b2bb126981a
data/.rubocop.yml CHANGED
@@ -8,7 +8,6 @@ Layout/LineLength:
8
8
  Enabled: false
9
9
 
10
10
  AllCops:
11
- TargetRubyVersion: 2.7
12
11
  NewCops: enable
13
12
 
14
13
  Lint/UselessAssignment:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-3.0.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.beta17)
4
+ ui_bibz (3.0.0.beta18)
5
5
  will-paginate-i18n
6
6
  will_paginate (~> 3.3.0)
7
7
  will_paginate-bootstrap4
@@ -95,32 +95,32 @@ GEM
95
95
  haml (>= 4.0, < 6)
96
96
  nokogiri (>= 1.6.0)
97
97
  ruby_parser (~> 3.5)
98
- i18n (1.8.9)
98
+ i18n (1.8.10)
99
99
  concurrent-ruby (~> 1.0)
100
100
  iniparse (1.5.0)
101
101
  jquery-rails (4.4.0)
102
102
  rails-dom-testing (>= 1, < 3)
103
103
  railties (>= 4.2.0)
104
104
  thor (>= 0.14, < 2.0)
105
- loofah (2.9.0)
105
+ loofah (2.9.1)
106
106
  crass (~> 1.0.2)
107
107
  nokogiri (>= 1.5.9)
108
108
  mail (2.7.1)
109
109
  mini_mime (>= 0.1.1)
110
- marcel (1.0.0)
110
+ marcel (1.0.1)
111
111
  method_source (1.0.0)
112
- mini_mime (1.0.3)
113
- mini_portile2 (2.5.0)
112
+ mini_mime (1.1.0)
113
+ mini_portile2 (2.5.1)
114
114
  minitest (5.14.4)
115
115
  nio4r (2.5.7)
116
- nokogiri (1.11.2)
116
+ nokogiri (1.11.3)
117
117
  mini_portile2 (~> 2.5.0)
118
118
  racc (~> 1.4)
119
119
  overcommit (0.57.0)
120
120
  childprocess (>= 0.6.3, < 5)
121
121
  iniparse (~> 1.4)
122
122
  parallel (1.20.1)
123
- parser (3.0.0.0)
123
+ parser (3.0.1.1)
124
124
  ast (~> 2.4.1)
125
125
  racc (1.5.2)
126
126
  rack (2.2.3)
@@ -155,8 +155,8 @@ GEM
155
155
  rainbow (3.0.0)
156
156
  rake (13.0.3)
157
157
  regexp_parser (2.1.1)
158
- rexml (3.2.4)
159
- rubocop (1.12.0)
158
+ rexml (3.2.5)
159
+ rubocop (1.13.0)
160
160
  parallel (~> 1.10)
161
161
  parser (>= 3.0.0.0)
162
162
  rainbow (>= 2.2.2, < 4.0)
@@ -165,12 +165,12 @@ GEM
165
165
  rubocop-ast (>= 1.2.0, < 2.0)
166
166
  ruby-progressbar (~> 1.7)
167
167
  unicode-display_width (>= 1.4.0, < 3.0)
168
- rubocop-ast (1.4.1)
169
- parser (>= 2.7.1.5)
170
- rubocop-minitest (0.11.1)
168
+ rubocop-ast (1.5.0)
169
+ parser (>= 3.0.1.1)
170
+ rubocop-minitest (0.12.1)
171
171
  rubocop (>= 0.90, < 2.0)
172
- rubocop-performance (1.10.2)
173
- rubocop (>= 0.90.0, < 2.0)
172
+ rubocop-performance (1.11.1)
173
+ rubocop (>= 1.7.0, < 2.0)
174
174
  rubocop-ast (>= 0.4.0)
175
175
  rubocop-rails (2.9.1)
176
176
  activesupport (>= 4.2.0)
@@ -188,7 +188,7 @@ GEM
188
188
  simplecov-html (~> 0.11)
189
189
  simplecov_json_formatter (~> 0.1)
190
190
  simplecov-html (0.12.3)
191
- simplecov_json_formatter (0.1.2)
191
+ simplecov_json_formatter (0.1.3)
192
192
  sprockets (4.0.2)
193
193
  concurrent-ruby (~> 1.0)
194
194
  rack (> 1, < 3)
@@ -211,6 +211,7 @@ GEM
211
211
  will_paginate (3.3.0)
212
212
  will_paginate-bootstrap4 (0.2.2)
213
213
  will_paginate (~> 3.0, >= 3.0.0)
214
+ yard (0.9.26)
214
215
  zeitwerk (2.4.2)
215
216
 
216
217
  PLATFORMS
@@ -234,6 +235,7 @@ DEPENDENCIES
234
235
  simplecov
235
236
  sqlite3
236
237
  ui_bibz!
238
+ yard
237
239
 
238
240
  BUNDLED WITH
239
- 2.1.4
241
+ 2.2.15
@@ -37,11 +37,13 @@ module UiBibz::Concerns::Models::Searchable
37
37
 
38
38
  # If there is more one table in html page
39
39
  def self.initialize_params
40
+ @tmp_params = { per_page: @arguments[:per_page] }
41
+
40
42
  return unless good_store_id?
41
43
 
42
44
  @tmp_params = {
43
45
  search: @params[:search],
44
- per_page: @params[:per_page],
46
+ per_page: @params[:per_page] || @arguments[:per_page],
45
47
  page: new_search? ? nil : @params[:page],
46
48
  sort: @params[:sort],
47
49
  direction: @params[:direction]
data/lib/ui_bibz/infos.rb CHANGED
@@ -7,11 +7,11 @@ module UiBibz
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'
10
- FONTAWESOME_VERSION = '5.15.2'
10
+ FONTAWESOME_VERSION = '5.15.3'
11
11
  HOMEPAGE = 'https://hummel.link/ui-bibz/'
12
12
  REPO = 'git+https://github.com/thooams/ui_bibz.git'
13
13
  EMAIL = 'thomas@hummel.link'
14
14
  AUTHOR = 'Thooams [Thomas HUMMEL]'
15
- VERSION = '3.0.0.beta17'
15
+ VERSION = '3.0.0.beta18'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -5,9 +5,9 @@ module UiBibz::Ui::Concerns::NotificationConcern #:nodoc:
5
5
 
6
6
  included do
7
7
  def data_attributes
8
- self.class.const_get('DATA_ATTRIBUTES').map do |data_attribute|
8
+ self.class.const_get('DATA_ATTRIBUTES').filter_map do |data_attribute|
9
9
  options[data_attribute].to_s.blank? ? nil : { "data-bs-#{data_attribute}" => data_attribute_value(data_attribute) }
10
- end.compact.reduce(&:merge) || {}
10
+ end.reduce(&:merge) || {}
11
11
  end
12
12
  end
13
13
  end
@@ -90,7 +90,7 @@ module UiBibz::Ui::Core::Boxes
90
90
  class Card < UiBibz::Ui::Core::Component
91
91
  include UiBibz::Ui::Concerns::CardItemableConcern
92
92
 
93
- # See UiBibz::Ui::Core::Component.initialize
93
+ # (see UiBibz::Ui::Core::Component#initialize)
94
94
  def initialize(content = nil, options = nil, html_options = nil, &block)
95
95
  super
96
96
  @items = @content.nil? ? [] : [UiBibz::Ui::Core::Boxes::Components::CardBody.new(@content).render]
@@ -94,7 +94,7 @@ module UiBibz::Ui::Core::Forms::Choices
94
94
 
95
95
  def component_html_data
96
96
  super
97
- add_html_data 'toggle', value: 'buttons'
97
+ add_html_data 'toggle', value: 'buttons' if @options[:form].nil?
98
98
  end
99
99
  end
100
100
  end
@@ -25,6 +25,7 @@ module UiBibz::Ui::Core::Forms::Selects
25
25
  # * +searchable+ - Boolean
26
26
  # * +select_all_option+ - Boolean
27
27
  # * +append+ - String, Html
28
+ # * +non_selected_text+ - String
28
29
  # * +open+ - Boolean
29
30
  # * +theme+ - Symbol, defaut: +:dark+
30
31
  # * +prepend+ - String, Html
@@ -83,10 +84,12 @@ module UiBibz::Ui::Core::Forms::Selects
83
84
  clickable_opt_group
84
85
  collapsible_opt_group
85
86
  searchable
87
+ non_selected_text
86
88
  select_all_options
87
89
  number_displayed
88
90
  dropdown_menu_classes
89
91
  dropdown_classes
92
+ n_selected_text
90
93
  end
91
94
 
92
95
  def clickable_opt_group
@@ -101,6 +104,10 @@ module UiBibz::Ui::Core::Forms::Selects
101
104
  add_html_data('enable_filtering') if options[:searchable]
102
105
  end
103
106
 
107
+ def n_selected_text
108
+ add_html_data('n_selected_text', value: options[:n_selected_text]) if options[:n_selected_text]
109
+ end
110
+
104
111
  def number_displayed
105
112
  add_html_data('number_displayed') if options[:number_displayed]
106
113
  end
@@ -109,6 +116,10 @@ module UiBibz::Ui::Core::Forms::Selects
109
116
  add_html_data('include_select_all_option') if options[:select_all_options]
110
117
  end
111
118
 
119
+ def non_selected_text
120
+ add_html_data('non_selected_text', value: options[:non_selected_text]) if options[:non_selected_text]
121
+ end
122
+
112
123
  def dropdown_menu_classes
113
124
  classes = join_classes(theme, alignment, open)
114
125
  add_html_data('dropdown_menu_classes', value: classes.nil? ? nil : classes.join(' '))
@@ -42,6 +42,7 @@ module UiBibz::Ui::Ux::Tables
42
42
  content_tag :div, html_options do
43
43
  concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('search').render, class: 'input-group-text')
44
44
  concat tag(:input, type: 'search', value: search_content, name: 'search', class: 'form-control', placeholder: search_placeholder_field)
45
+ concat tag(:input, type: 'hidden', name: 'store_id', value: store.id) unless store.id.nil? # if there is more one table in html page
45
46
  concat tag(:input, type: 'hidden', name: 'link_type', value: 'search')
46
47
  concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('times-circle').render, class: 'clear-search-btn input-group-text')
47
48
  end
@@ -37,9 +37,9 @@ module UiBibz::Utils
37
37
  if opts.is_a?(Hash)
38
38
  @position = opts[:position]
39
39
 
40
- opts.map do |k, v|
40
+ opts.filter_map do |k, v|
41
41
  send(k, size, v) if POSITIONING.include?(k.to_sym)
42
- end.compact.join(' ')
42
+ end.join(' ')
43
43
  else
44
44
  send('num', size, opts)
45
45
  end
@@ -7,7 +7,7 @@ module UiBibz::Utils
7
7
 
8
8
  class << self
9
9
  def join_classes(*classes)
10
- klasses = Array(classes).flatten.map(&:to_s).compact.uniq.reject(&:blank?)
10
+ klasses = Array(classes).flatten.filter_map(&:to_s).uniq.reject(&:blank?)
11
11
  klasses.empty? ? nil : klasses
12
12
  end
13
13
 
@@ -256,7 +256,7 @@ test1</textarea></div></form>"
256
256
  end
257
257
  end
258
258
 
259
- expected = "<form class=\"simple_form\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"button_group\"><div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><div class=\"form-check\"><input type=\"checkbox\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_checkbox_field optional form-check-input\" checked=\"checked\" /><label class=\"form-check-label\" for=\"user_name_fr\">Name Fr</label></div></div></div></form>"
259
+ expected = "<form class=\"simple_form\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"button_group\"><div class=\"btn-group button-choice btn-group-toggle\"><div class=\"form-check\"><input type=\"checkbox\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_checkbox_field optional form-check-input\" checked=\"checked\" /><label class=\"form-check-label\" for=\"user_name_fr\">Name Fr</label></div></div></div></form>"
260
260
 
261
261
  assert_equal expected, actual
262
262
  end
@@ -23,4 +23,11 @@ class CheckboxFieldTest < ActionView::TestCase
23
23
 
24
24
  assert_equal expected, actual
25
25
  end
26
+
27
+ test 'checkbox_field with html_options' do
28
+ actual = UiBibz::Ui::Core::Forms::Choices::CheckboxField.new('John', { checked: true }, { data: { name: 'check' } }).render
29
+ expected = "<div class=\"form-check\"><input type=\"checkbox\" name=\"John\" id=\"John\" value=\"1\" data-name=\"check\" class=\"form-check-input\" checked=\"checked\" /><label class=\"form-check-label\" for=\"John\">John</label></div>"
30
+
31
+ assert_equal expected, actual
32
+ end
26
33
  end
@@ -3,7 +3,7 @@
3
3
  require 'test_helper'
4
4
 
5
5
  class DropdownSelectFieldTest < ActionView::TestCase
6
- test 'Multi Select Field' do
6
+ test 'Dropdown Select Field' do
7
7
  options = options_for_select(Array.new(2) { |i| "option #{i}" })
8
8
  actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', multiple: true, option_tags: options).render
9
9
  expected = "<select name=\"example[]\" id=\"example\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"option 0\">option 0</option>
@@ -12,10 +12,10 @@ class DropdownSelectFieldTest < ActionView::TestCase
12
12
  assert_equal expected, actual
13
13
  end
14
14
 
15
- test 'Multi Select Field data html options' do
15
+ test 'Dropdown Select Field data html options' do
16
16
  grouped_options = { 'North America' => [['United statuss', 'US'], 'Canada'], 'Europe' => %w[Denmark Germany France] }
17
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', { multiple: true, option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, select_all_options: true, number_displayed: 2, status: :danger }).render
18
- expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-include-select-all-option=\"true\" data-number-displayed=\"true\" data-dropdown-classes=\"dropdown\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
17
+ actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', { multiple: true, option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, non_selected_text: 'test', select_all_options: true, number_displayed: 2, status: :danger, n_selected_text: "items selected" }).render
18
+ expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-non-selected-text=\"test\" data-include-select-all-option=\"true\" data-number-displayed=\"true\" data-dropdown-classes=\"dropdown\" data-n-selected-text=\"items selected\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
19
19
  <option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>
20
20
  <option value=\"Germany\">Germany</option>
21
21
  <option value=\"France\">France</option></optgroup></select>"
@@ -23,7 +23,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
23
23
  assert_equal expected, actual
24
24
  end
25
25
 
26
- test 'Multi select Field refresh option' do
26
+ test 'Dropdown Select Field refresh option' do
27
27
  actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { multiple: true, refresh: { target: { url: '/' } } }).render
28
28
  expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"test[]\" id=\"test\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span data-connect=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;#test&quot;,&quot;url&quot;:&quot;/&quot;,&quot;data&quot;:[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i></span></div>"
29
29
 
data/ui_bibz.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.description = UiBibz::DESCRIPTION
20
20
  s.license = UiBibz::LICENSE
21
21
 
22
- s.required_ruby_version = '>= 2.7'
22
+ s.required_ruby_version = '>= 3.0.0'
23
23
 
24
24
  s.files = `git ls-files`.split
25
25
  s.test_files = `git ls-files -- {test,spec,features}/*`.split
@@ -47,4 +47,5 @@ Gem::Specification.new do |s|
47
47
  s.add_development_dependency 'simplecov'
48
48
  s.add_development_dependency 'simple_form'
49
49
  s.add_development_dependency 'sqlite3'
50
+ s.add_development_dependency 'yard'
50
51
  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.beta17
4
+ version: 3.0.0.beta18
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: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -240,6 +240,20 @@ dependencies:
240
240
  - - ">="
241
241
  - !ruby/object:Gem::Version
242
242
  version: '0'
243
+ - !ruby/object:Gem::Dependency
244
+ name: yard
245
+ requirement: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ version: '0'
250
+ type: :development
251
+ prerelease: false
252
+ version_requirements: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
243
257
  description: A Rails Interface Framework using Bootstrap 5.0.0.beta3.
244
258
  email: thomas@hummel.link
245
259
  executables:
@@ -546,8 +560,8 @@ files:
546
560
  - test/ui/core/forms/numbers/number_field_test.rb
547
561
  - test/ui/core/forms/numbers/range_field_test.rb
548
562
  - test/ui/core/forms/numbers/slider_field_test.rb
563
+ - test/ui/core/forms/selects/dropdown_select_field_test.rb
549
564
  - test/ui/core/forms/selects/multi_column_field_test.rb
550
- - test/ui/core/forms/selects/multi_select_field_test.rb
551
565
  - test/ui/core/forms/selects/select_field_test.rb
552
566
  - test/ui/core/forms/surrounds/surround_field_test.rb
553
567
  - test/ui/core/forms/textareas/markdown_editor_field_test.rb
@@ -657,14 +671,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
657
671
  requirements:
658
672
  - - ">="
659
673
  - !ruby/object:Gem::Version
660
- version: '2.7'
674
+ version: 3.0.0
661
675
  required_rubygems_version: !ruby/object:Gem::Requirement
662
676
  requirements:
663
677
  - - ">"
664
678
  - !ruby/object:Gem::Version
665
679
  version: 1.3.1
666
680
  requirements: []
667
- rubygems_version: 3.1.2
681
+ rubygems_version: 3.2.15
668
682
  signing_key:
669
683
  specification_version: 4
670
684
  summary: Ui Bibz is an Ui Framework that allows you to build an interface very quickly
@@ -759,8 +773,8 @@ test_files:
759
773
  - test/ui/core/forms/numbers/number_field_test.rb
760
774
  - test/ui/core/forms/numbers/range_field_test.rb
761
775
  - test/ui/core/forms/numbers/slider_field_test.rb
776
+ - test/ui/core/forms/selects/dropdown_select_field_test.rb
762
777
  - test/ui/core/forms/selects/multi_column_field_test.rb
763
- - test/ui/core/forms/selects/multi_select_field_test.rb
764
778
  - test/ui/core/forms/selects/select_field_test.rb
765
779
  - test/ui/core/forms/surrounds/surround_field_test.rb
766
780
  - test/ui/core/forms/textareas/markdown_editor_field_test.rb