ui_bibz 3.0.0.alpha10 → 3.0.0.alpha11

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: 63c95abb3d6e510f893aaa054080dc4e4b3012fd0a071cd0828a8d2333a0d20d
4
- data.tar.gz: 5c13dccaeea9254bd66d0c0a778b3ee18764973438a0668b74f9a56b9b093f10
3
+ metadata.gz: 14f3630b3e813fbac60b0a3e5a7651a09a507dd3dee4a0e252288a7baa3728e2
4
+ data.tar.gz: b9baafb65a65cc12b9e1d57c4fec819f01a6b36cd1e6865c9d26a4a8a5fac155
5
5
  SHA512:
6
- metadata.gz: a138d91759572dec4f047dd5fb7dacd4ea517fffefaca70e73c92aba4fc96a1e799c4e11c8c4ad9420f19e6d9ca0d32a714a9d4ced4ddacac0e8c3368ccafe8c
7
- data.tar.gz: 380361211a36fbf4cccfff82512233dcd05e84f20949bdf28e5808a53ea16626a1fafd5e8c020d8130307e3ecc3937e0c1e375ac5d91d58acf07cb0d66baaf4b
6
+ metadata.gz: 890d5d75f44d9e31753f5928ffac99386adbf43ed95ad0cc452edf6b492aa3e6cc5de07186c62923ac091de30b759c191872b62d76eebffbf50c5630f7317297
7
+ data.tar.gz: 41bf57292c76239790786809649dd5d8bb83220b20789976b1af1c4d5332f210335448de36dce170d3610c86c93529af3816c352b57ba9f9ec73d7de95afa561
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.alpha10)
4
+ ui_bibz (3.0.0.alpha11)
5
5
  rails (~> 6.0.3, >= 6.0.3.2)
6
6
  will-paginate-i18n
7
7
  will_paginate (~> 3.1.0)
@@ -123,7 +123,7 @@ GEM
123
123
  overcommit (0.57.0)
124
124
  childprocess (>= 0.6.3, < 5)
125
125
  iniparse (~> 1.4)
126
- parallel (1.20.0)
126
+ parallel (1.20.1)
127
127
  parser (2.7.2.0)
128
128
  ast (~> 2.4.1)
129
129
  rack (2.2.3)
@@ -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.1)
162
+ rubocop (1.4.2)
163
163
  parallel (~> 1.10)
164
164
  parser (>= 2.7.1.5)
165
165
  rainbow (>= 2.2.2, < 4.0)
@@ -168,7 +168,7 @@ GEM
168
168
  rubocop-ast (>= 1.1.1)
169
169
  ruby-progressbar (~> 1.7)
170
170
  unicode-display_width (>= 1.4.0, < 2.0)
171
- rubocop-ast (1.1.1)
171
+ rubocop-ast (1.2.0)
172
172
  parser (>= 2.7.1.5)
173
173
  rubocop-minitest (0.10.1)
174
174
  rubocop (>= 0.87)
@@ -110,7 +110,7 @@ module UiBibz::Concerns::Models::Searchable
110
110
  search_patterns = @tmp_params[:search].strip.gsub(/(?<=[\\s])\\s*|^\\s+|\\s+$/, '').downcase
111
111
 
112
112
  search_patterns_tmp = search_patterns.scan(/"(.*?)"/).flatten
113
- search_patterns = search_patterns.gsub(/"(.*?)"/, '').split(' ')
113
+ search_patterns = search_patterns.gsub(/"(.*?)"/, '').split
114
114
  search_patterns << search_patterns_tmp
115
115
 
116
116
  search_patterns.flatten.each_with_index do |pattern, i|
@@ -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 [Thomas HUMMEL]'
15
- VERSION = '3.0.0.alpha10'
15
+ VERSION = '3.0.0.alpha11'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -7,7 +7,7 @@ module UiBibzInputs
7
7
  def input(wrapper_options)
8
8
  unless string?
9
9
  input_html_classes.unshift('string')
10
- input_html_options[:type] ||= input_type if html5?
10
+ # input_html_options[:type] ||= input_type if html5?
11
11
  end
12
12
 
13
13
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
@@ -69,7 +69,7 @@ module UiBibz::Ui::Core::Forms::Selects
69
69
  end
70
70
 
71
71
  def component_html_classes
72
- [size, type, button_status, 'multi-select-field']
72
+ [open, size, type, button_status, 'multi-select-field']
73
73
  end
74
74
 
75
75
  def component_html_data
@@ -79,6 +79,8 @@ module UiBibz::Ui::Core::Forms::Selects
79
79
  searchable
80
80
  select_all_options
81
81
  number_displayed
82
+ dropdown_menu_classes
83
+ dropdown_classes
82
84
  end
83
85
 
84
86
  def clickable_opt_group
@@ -101,6 +103,32 @@ module UiBibz::Ui::Core::Forms::Selects
101
103
  add_html_data('include_select_all_option') if options[:select_all_options]
102
104
  end
103
105
 
106
+ def dropdown_menu_classes
107
+ classes = join_classes(theme, alignment, open)
108
+ add_html_data('dropdown_menu_classes', value: classes.nil? ? nil : classes.join(' '))
109
+ end
110
+
111
+ def dropdown_classes
112
+ classes = join_classes(position, open)
113
+ add_html_data('dropdown_classes', value: classes.nil? ? nil : classes.join(' '))
114
+ end
115
+
116
+ def position
117
+ "drop#{@options[:position] || 'down'}"
118
+ end
119
+
120
+ def theme
121
+ 'dropdown-menu-dark' if @options[:theme]
122
+ end
123
+
124
+ def open
125
+ 'show' if @options[:open]
126
+ end
127
+
128
+ def alignment
129
+ "dropdown-menu-#{@options[:alignment]}" unless @options[:alignment].nil?
130
+ end
131
+
104
132
  def type
105
133
  'btn-block' if options[:type] == :block
106
134
  end
@@ -117,9 +145,5 @@ module UiBibz::Ui::Core::Forms::Selects
117
145
  def outline
118
146
  'outline' if options[:outline]
119
147
  end
120
-
121
- def theme
122
- 'dropdown-menu-dark' if @options[:theme]
123
- end
124
148
  end
125
149
  end
@@ -82,7 +82,7 @@ test1</textarea></div></form>"
82
82
  f.input :name_fr, as: :ui_dropdown_select_field, multiple: true, collection: @users, label_method: :name_fr
83
83
  end
84
84
 
85
- 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_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
85
+ 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_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\" data-dropdown-classes=\"dropdown\"><option value=\"1\">test1</option>
86
86
  <option value=\"2\">test2</option></select></div></form>"
87
87
 
88
88
  assert_equal expected, actual
@@ -93,7 +93,7 @@ test1</textarea></div></form>"
93
93
  f.input :name_fr, as: :ui_dropdown_select_field, multiple: true, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
94
94
  end
95
95
 
96
- 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_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
96
+ 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_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\" data-dropdown-classes=\"dropdown\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
97
97
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
98
98
 
99
99
  assert_equal expected, actual
@@ -104,7 +104,7 @@ test1</textarea></div></form>"
104
104
  f.input :name_fr, as: :ui_text_field
105
105
  end
106
106
 
107
- 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_text_field optional user_name_fr\"><label class=\"control-label ui_text_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"ui_text_field\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control string ui_text_field optional\" /></div></form>"
107
+ 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_text_field optional user_name_fr\"><label class=\"control-label ui_text_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control string ui_text_field optional\" /></div></form>"
108
108
 
109
109
  assert_equal expected, actual
110
110
  end
@@ -6,7 +6,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
6
6
  test 'Multi 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
- expected = "<select name=\"example[]\" id=\"example\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"option 0\">option 0</option>
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>
10
10
  <option value=\"option 1\">option 1</option></select>"
11
11
 
12
12
  assert_equal expected, actual
@@ -15,7 +15,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
15
15
  test 'Multi Select Field data html options' do
16
16
  grouped_options = { 'North America' => [['United statuss', 'US'], 'Canada'], 'Europe' => %w[Denmark Germany France] }
17
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\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
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>
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>"
@@ -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="{&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>'
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
 
30
30
  assert_equal expected, actual
31
31
  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=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;&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>"
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\" data-dropdown-classes=\"dropdown\" 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=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;&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>"
91
91
 
92
92
  assert_equal expected, actual
93
93
  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.alpha10
4
+ version: 3.0.0.alpha11
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-11-22 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails