activeadmin-tom_select 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.claude/commands/fix-tests.md +1 -1
- data/.github/workflows/ci.yml +3 -4
- data/.github/workflows/npm-publish.yml +3 -3
- data/.rubocop.yml +1 -1
- data/AGENTS.md +2 -2
- data/CHANGELOG.md +19 -1
- data/Gemfile.lock +85 -79
- data/README.md +20 -18
- data/activeadmin-tom_select.gemspec +3 -3
- data/docs/guide-update-your-app.md +198 -25
- data/docs/update-tom-select.md +322 -158
- data/gemfiles/rails_7.x_active_admin_4.x.gemfile.lock +11 -11
- data/gemfiles/rails_8.x_active_admin_4.x.gemfile.lock +66 -64
- data/lib/activeadmin/inputs/filters/searchable_select_input.rb +5 -12
- data/lib/activeadmin/inputs/filters/tom_select_input.rb +19 -0
- data/lib/activeadmin/inputs/searchable_select_input.rb +5 -11
- data/lib/activeadmin/inputs/tom_select_input.rb +16 -0
- data/lib/activeadmin/tom_select/engine.rb +3 -1
- data/lib/activeadmin/tom_select/option_collection.rb +1 -1
- data/lib/activeadmin/tom_select/resource_dsl_extension.rb +1 -1
- data/lib/activeadmin/tom_select/resource_extension.rb +1 -1
- data/lib/activeadmin/tom_select/select_input_extension.rb +14 -5
- data/lib/activeadmin/tom_select/version.rb +2 -2
- data/lib/activeadmin/tom_select.rb +3 -3
- data/lib/generators/active_admin/tom_select/install/install_generator.rb +5 -5
- data/npm-package/package-lock.json +2 -2
- data/npm-package/package.json +2 -2
- data/npm-package/src/index.js +1 -3
- data/npm-package/src/tom-select-tailwind.css +26 -20
- data/sonar-project.properties +5 -4
- data/spec/features/form_input_spec.rb +2 -2
- data/spec/features/inline_ajax_setting_spec.rb +1 -1
- data/spec/internal/Gemfile.lock +1 -1
- data/spec/internal/app/admin/articles.rb +28 -0
- data/spec/internal/app/assets/config/manifest.js +2 -1
- data/spec/internal/app/assets/stylesheets/active_admin.tailwind.css +1 -1
- data/spec/internal/app/assets/stylesheets/application.tailwind.css +0 -15
- data/spec/internal/app/javascript/active_admin.js +2 -4
- data/spec/internal/db/schema.rb +3 -1
- data/spec/internal/db/seeds.rb +4 -7
- data/spec/internal/package-lock.json +3 -3
- data/spec/internal/package.json +1 -1
- data/spec/internal/yarn.lock +1 -1
- data/spec/support/reset_settings.rb +1 -1
- metadata +5 -2
@@ -1,36 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
activeadmin-tom_select (4.1.
|
4
|
+
activeadmin-tom_select (4.1.1)
|
5
5
|
activeadmin (>= 3.0, < 5)
|
6
6
|
ransack (>= 1.8, < 5)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (8.0.
|
12
|
-
actionpack (= 8.0.
|
13
|
-
activesupport (= 8.0.
|
11
|
+
actioncable (8.0.3)
|
12
|
+
actionpack (= 8.0.3)
|
13
|
+
activesupport (= 8.0.3)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
16
|
zeitwerk (~> 2.6)
|
17
|
-
actionmailbox (8.0.
|
18
|
-
actionpack (= 8.0.
|
19
|
-
activejob (= 8.0.
|
20
|
-
activerecord (= 8.0.
|
21
|
-
activestorage (= 8.0.
|
22
|
-
activesupport (= 8.0.
|
17
|
+
actionmailbox (8.0.3)
|
18
|
+
actionpack (= 8.0.3)
|
19
|
+
activejob (= 8.0.3)
|
20
|
+
activerecord (= 8.0.3)
|
21
|
+
activestorage (= 8.0.3)
|
22
|
+
activesupport (= 8.0.3)
|
23
23
|
mail (>= 2.8.0)
|
24
|
-
actionmailer (8.0.
|
25
|
-
actionpack (= 8.0.
|
26
|
-
actionview (= 8.0.
|
27
|
-
activejob (= 8.0.
|
28
|
-
activesupport (= 8.0.
|
24
|
+
actionmailer (8.0.3)
|
25
|
+
actionpack (= 8.0.3)
|
26
|
+
actionview (= 8.0.3)
|
27
|
+
activejob (= 8.0.3)
|
28
|
+
activesupport (= 8.0.3)
|
29
29
|
mail (>= 2.8.0)
|
30
30
|
rails-dom-testing (~> 2.2)
|
31
|
-
actionpack (8.0.
|
32
|
-
actionview (= 8.0.
|
33
|
-
activesupport (= 8.0.
|
31
|
+
actionpack (8.0.3)
|
32
|
+
actionview (= 8.0.3)
|
33
|
+
activesupport (= 8.0.3)
|
34
34
|
nokogiri (>= 1.8.5)
|
35
35
|
rack (>= 2.2.4)
|
36
36
|
rack-session (>= 1.0.1)
|
@@ -38,15 +38,15 @@ GEM
|
|
38
38
|
rails-dom-testing (~> 2.2)
|
39
39
|
rails-html-sanitizer (~> 1.6)
|
40
40
|
useragent (~> 0.16)
|
41
|
-
actiontext (8.0.
|
42
|
-
actionpack (= 8.0.
|
43
|
-
activerecord (= 8.0.
|
44
|
-
activestorage (= 8.0.
|
45
|
-
activesupport (= 8.0.
|
41
|
+
actiontext (8.0.3)
|
42
|
+
actionpack (= 8.0.3)
|
43
|
+
activerecord (= 8.0.3)
|
44
|
+
activestorage (= 8.0.3)
|
45
|
+
activesupport (= 8.0.3)
|
46
46
|
globalid (>= 0.6.0)
|
47
47
|
nokogiri (>= 1.8.5)
|
48
|
-
actionview (8.0.
|
49
|
-
activesupport (= 8.0.
|
48
|
+
actionview (8.0.3)
|
49
|
+
activesupport (= 8.0.3)
|
50
50
|
builder (~> 3.1)
|
51
51
|
erubi (~> 1.11)
|
52
52
|
rails-dom-testing (~> 2.2)
|
@@ -60,22 +60,22 @@ GEM
|
|
60
60
|
kaminari (>= 1.2.1)
|
61
61
|
railties (>= 7.0)
|
62
62
|
ransack (>= 4.0)
|
63
|
-
activejob (8.0.
|
64
|
-
activesupport (= 8.0.
|
63
|
+
activejob (8.0.3)
|
64
|
+
activesupport (= 8.0.3)
|
65
65
|
globalid (>= 0.3.6)
|
66
|
-
activemodel (8.0.
|
67
|
-
activesupport (= 8.0.
|
68
|
-
activerecord (8.0.
|
69
|
-
activemodel (= 8.0.
|
70
|
-
activesupport (= 8.0.
|
66
|
+
activemodel (8.0.3)
|
67
|
+
activesupport (= 8.0.3)
|
68
|
+
activerecord (8.0.3)
|
69
|
+
activemodel (= 8.0.3)
|
70
|
+
activesupport (= 8.0.3)
|
71
71
|
timeout (>= 0.4.0)
|
72
|
-
activestorage (8.0.
|
73
|
-
actionpack (= 8.0.
|
74
|
-
activejob (= 8.0.
|
75
|
-
activerecord (= 8.0.
|
76
|
-
activesupport (= 8.0.
|
72
|
+
activestorage (8.0.3)
|
73
|
+
actionpack (= 8.0.3)
|
74
|
+
activejob (= 8.0.3)
|
75
|
+
activerecord (= 8.0.3)
|
76
|
+
activesupport (= 8.0.3)
|
77
77
|
marcel (~> 1.0)
|
78
|
-
activesupport (8.0.
|
78
|
+
activesupport (8.0.3)
|
79
79
|
base64
|
80
80
|
benchmark (>= 0.3)
|
81
81
|
bigdecimal
|
@@ -142,7 +142,7 @@ GEM
|
|
142
142
|
formtastic (5.0.0)
|
143
143
|
actionpack (>= 6.0.0)
|
144
144
|
formtastic_i18n (0.7.0)
|
145
|
-
globalid (1.
|
145
|
+
globalid (1.3.0)
|
146
146
|
activesupport (>= 6.1)
|
147
147
|
has_scope (0.8.2)
|
148
148
|
actionpack (>= 5.2)
|
@@ -159,7 +159,7 @@ GEM
|
|
159
159
|
pp (>= 0.6.0)
|
160
160
|
rdoc (>= 4.0.0)
|
161
161
|
reline (>= 0.4.2)
|
162
|
-
json (2.
|
162
|
+
json (2.15.0)
|
163
163
|
kaminari (1.2.2)
|
164
164
|
activesupport (>= 4.1.0)
|
165
165
|
kaminari-actionview (= 1.2.2)
|
@@ -183,12 +183,12 @@ GEM
|
|
183
183
|
net-imap
|
184
184
|
net-pop
|
185
185
|
net-smtp
|
186
|
-
marcel (1.0
|
186
|
+
marcel (1.1.0)
|
187
187
|
matrix (0.4.3)
|
188
188
|
mime-types (3.7.0)
|
189
189
|
logger
|
190
190
|
mime-types-data (~> 3.2025, >= 3.2025.0507)
|
191
|
-
mime-types-data (3.2025.
|
191
|
+
mime-types-data (3.2025.0924)
|
192
192
|
mini_mime (1.1.5)
|
193
193
|
minitest (5.25.5)
|
194
194
|
net-imap (0.5.10)
|
@@ -215,7 +215,7 @@ GEM
|
|
215
215
|
prettyprint
|
216
216
|
prettyprint (0.2.0)
|
217
217
|
prism (1.5.1)
|
218
|
-
propshaft (1.
|
218
|
+
propshaft (1.3.1)
|
219
219
|
actionpack (>= 7.0.0)
|
220
220
|
activesupport (>= 7.0.0)
|
221
221
|
rack
|
@@ -234,20 +234,20 @@ GEM
|
|
234
234
|
rack (>= 1.3)
|
235
235
|
rackup (2.2.1)
|
236
236
|
rack (>= 3)
|
237
|
-
rails (8.0.
|
238
|
-
actioncable (= 8.0.
|
239
|
-
actionmailbox (= 8.0.
|
240
|
-
actionmailer (= 8.0.
|
241
|
-
actionpack (= 8.0.
|
242
|
-
actiontext (= 8.0.
|
243
|
-
actionview (= 8.0.
|
244
|
-
activejob (= 8.0.
|
245
|
-
activemodel (= 8.0.
|
246
|
-
activerecord (= 8.0.
|
247
|
-
activestorage (= 8.0.
|
248
|
-
activesupport (= 8.0.
|
237
|
+
rails (8.0.3)
|
238
|
+
actioncable (= 8.0.3)
|
239
|
+
actionmailbox (= 8.0.3)
|
240
|
+
actionmailer (= 8.0.3)
|
241
|
+
actionpack (= 8.0.3)
|
242
|
+
actiontext (= 8.0.3)
|
243
|
+
actionview (= 8.0.3)
|
244
|
+
activejob (= 8.0.3)
|
245
|
+
activemodel (= 8.0.3)
|
246
|
+
activerecord (= 8.0.3)
|
247
|
+
activestorage (= 8.0.3)
|
248
|
+
activesupport (= 8.0.3)
|
249
249
|
bundler (>= 1.15.0)
|
250
|
-
railties (= 8.0.
|
250
|
+
railties (= 8.0.3)
|
251
251
|
rails-dom-testing (2.3.0)
|
252
252
|
activesupport (>= 5.0.0)
|
253
253
|
minitest
|
@@ -255,19 +255,20 @@ GEM
|
|
255
255
|
rails-html-sanitizer (1.6.2)
|
256
256
|
loofah (~> 2.21)
|
257
257
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
258
|
-
railties (8.0.
|
259
|
-
actionpack (= 8.0.
|
260
|
-
activesupport (= 8.0.
|
258
|
+
railties (8.0.3)
|
259
|
+
actionpack (= 8.0.3)
|
260
|
+
activesupport (= 8.0.3)
|
261
261
|
irb (~> 1.13)
|
262
262
|
rackup (>= 1.0.0)
|
263
263
|
rake (>= 12.2)
|
264
264
|
thor (~> 1.0, >= 1.2.2)
|
265
|
+
tsort (>= 0.2)
|
265
266
|
zeitwerk (~> 2.6)
|
266
267
|
rainbow (3.1.1)
|
267
268
|
rake (13.3.0)
|
268
|
-
ransack (4.
|
269
|
-
activerecord (>=
|
270
|
-
activesupport (>=
|
269
|
+
ransack (4.4.0)
|
270
|
+
activerecord (>= 7.1)
|
271
|
+
activesupport (>= 7.1)
|
271
272
|
i18n
|
272
273
|
rdoc (6.14.2)
|
273
274
|
erb
|
@@ -294,7 +295,7 @@ GEM
|
|
294
295
|
rspec-expectations (~> 3.13)
|
295
296
|
rspec-mocks (~> 3.13)
|
296
297
|
rspec-support (~> 3.13)
|
297
|
-
rspec-support (3.13.
|
298
|
+
rspec-support (3.13.6)
|
298
299
|
rspec_junit_formatter (0.6.0)
|
299
300
|
rspec-core (>= 2, < 4, != 2.12.0)
|
300
301
|
rubocop (1.80.2)
|
@@ -322,10 +323,11 @@ GEM
|
|
322
323
|
simplecov_json_formatter (~> 0.1)
|
323
324
|
simplecov-html (0.13.2)
|
324
325
|
simplecov_json_formatter (0.1.4)
|
325
|
-
sqlite3 (2.7.
|
326
|
+
sqlite3 (2.7.4-x86_64-linux-gnu)
|
326
327
|
stringio (3.1.7)
|
327
328
|
thor (1.4.0)
|
328
329
|
timeout (0.4.3)
|
330
|
+
tsort (0.2.0)
|
329
331
|
tzinfo (2.0.6)
|
330
332
|
concurrent-ruby (~> 1.0)
|
331
333
|
unicode-display_width (3.2.0)
|
@@ -1,18 +1,11 @@
|
|
1
|
+
require 'activeadmin/inputs/filters/tom_select_input'
|
2
|
+
|
1
3
|
module ActiveAdmin
|
2
4
|
module Inputs
|
3
5
|
module Filters
|
4
|
-
#
|
5
|
-
#
|
6
|
-
|
7
|
-
# SelectInputExtension for list of available options.
|
8
|
-
class SearchableSelectInput < SelectInput
|
9
|
-
include ActiveAdmin::SearchableSelect::SelectInputExtension
|
10
|
-
|
11
|
-
# Override to remove the empty "Any" option since we're using
|
12
|
-
# Tom Select's clear button plugin instead
|
13
|
-
def input_options
|
14
|
-
super.merge(include_blank: false)
|
15
|
-
end
|
6
|
+
# Legacy alias for TomSelectInput - maintained for backward compatibility
|
7
|
+
# @deprecated Use TomSelectInput instead
|
8
|
+
class SearchableSelectInput < TomSelectInput
|
16
9
|
end
|
17
10
|
end
|
18
11
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module Inputs
|
3
|
+
module Filters
|
4
|
+
# Tom Select input type for ActiveAdmin filters.
|
5
|
+
#
|
6
|
+
# @see ActiveAdmin::TomSelect::SelectInputExtension
|
7
|
+
# SelectInputExtension for list of available options.
|
8
|
+
class TomSelectInput < SelectInput
|
9
|
+
include ActiveAdmin::TomSelect::SelectInputExtension
|
10
|
+
|
11
|
+
# Override to remove the empty "Any" option since we're using
|
12
|
+
# Tom Select's clear button plugin instead
|
13
|
+
def input_options
|
14
|
+
super.merge(include_blank: false)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,16 +1,10 @@
|
|
1
|
+
require 'activeadmin/inputs/tom_select_input'
|
2
|
+
|
1
3
|
module ActiveAdmin
|
2
4
|
module Inputs
|
3
|
-
#
|
4
|
-
#
|
5
|
-
|
6
|
-
# SelectInputExtension for list of available options.
|
7
|
-
class SearchableSelectInput < Formtastic::Inputs::SelectInput
|
8
|
-
include ActiveAdmin::SearchableSelect::SelectInputExtension
|
9
|
-
|
10
|
-
# Override to prevent adding empty options
|
11
|
-
def input_options
|
12
|
-
super.merge(include_blank: false)
|
13
|
-
end
|
5
|
+
# Legacy alias for TomSelectInput - maintained for backward compatibility
|
6
|
+
# @deprecated Use TomSelectInput instead
|
7
|
+
class SearchableSelectInput < TomSelectInput
|
14
8
|
end
|
15
9
|
end
|
16
10
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module Inputs
|
3
|
+
# Tom Select input type for ActiveAdmin forms.
|
4
|
+
#
|
5
|
+
# @see ActiveAdmin::TomSelect::SelectInputExtension
|
6
|
+
# SelectInputExtension for list of available options.
|
7
|
+
class TomSelectInput < Formtastic::Inputs::SelectInput
|
8
|
+
include ActiveAdmin::TomSelect::SelectInputExtension
|
9
|
+
|
10
|
+
# Override to prevent adding empty options
|
11
|
+
def input_options
|
12
|
+
super.merge(include_blank: false)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'active_admin'
|
2
2
|
|
3
3
|
module ActiveAdmin
|
4
|
-
module
|
4
|
+
module TomSelect
|
5
5
|
# @api private
|
6
6
|
class Engine < ::Rails::Engine
|
7
7
|
engine_name 'activeadmin_tom_select'
|
8
8
|
|
9
9
|
initializer 'activeadmin_tom_select.setup' do
|
10
10
|
ActiveSupport.on_load(:active_admin) do
|
11
|
+
require 'activeadmin/inputs/tom_select_input'
|
12
|
+
require 'activeadmin/inputs/filters/tom_select_input'
|
11
13
|
require 'activeadmin/inputs/searchable_select_input'
|
12
14
|
require 'activeadmin/inputs/filters/searchable_select_input'
|
13
15
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module ActiveAdmin
|
2
|
-
module
|
2
|
+
module TomSelect
|
3
3
|
# Mixin for searchable select inputs.
|
4
4
|
#
|
5
5
|
# Supports the same options as inputs of type `:select`.
|
@@ -40,9 +40,8 @@ module ActiveAdmin
|
|
40
40
|
# @api private
|
41
41
|
def input_html_options
|
42
42
|
super.tap do |options|
|
43
|
-
options
|
44
|
-
options
|
45
|
-
options['data-clearable'] = true if clearable?
|
43
|
+
add_css_class(options)
|
44
|
+
add_data_attributes(options)
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
@@ -50,7 +49,7 @@ module ActiveAdmin
|
|
50
49
|
def collection_from_options
|
51
50
|
return super unless options[:ajax]
|
52
51
|
|
53
|
-
collection = if
|
52
|
+
collection = if TomSelect.inline_ajax_options
|
54
53
|
all_options_collection
|
55
54
|
else
|
56
55
|
selected_value_collection
|
@@ -62,6 +61,16 @@ module ActiveAdmin
|
|
62
61
|
|
63
62
|
private
|
64
63
|
|
64
|
+
def add_css_class(options)
|
65
|
+
css_class = self.class.name.demodulize.underscore.dasherize
|
66
|
+
options[:class] = [options[:class], css_class].compact.join(' ')
|
67
|
+
end
|
68
|
+
|
69
|
+
def add_data_attributes(options)
|
70
|
+
options['data-ajax-url'] = ajax_url if ajax? && !TomSelect.inline_ajax_options
|
71
|
+
options['data-clearable'] = true if clearable?
|
72
|
+
end
|
73
|
+
|
65
74
|
def ajax?
|
66
75
|
options[:ajax].present?
|
67
76
|
end
|
@@ -5,12 +5,12 @@ require 'activeadmin/tom_select/resource_dsl_extension'
|
|
5
5
|
require 'activeadmin/tom_select/select_input_extension'
|
6
6
|
require 'activeadmin/tom_select/version'
|
7
7
|
|
8
|
-
ActiveAdmin::Resource.include ActiveAdmin::
|
9
|
-
ActiveAdmin::ResourceDSL.include ActiveAdmin::
|
8
|
+
ActiveAdmin::Resource.include ActiveAdmin::TomSelect::ResourceExtension
|
9
|
+
ActiveAdmin::ResourceDSL.include ActiveAdmin::TomSelect::ResourceDSLExtension
|
10
10
|
|
11
11
|
module ActiveAdmin
|
12
12
|
# Global settings for searchable selects
|
13
|
-
module
|
13
|
+
module TomSelect
|
14
14
|
# Statically render all options into searchable selects with
|
15
15
|
# `ajax` option set to true. This can be used to ease ui driven
|
16
16
|
# integration testing.
|
@@ -17,8 +17,8 @@ module ActiveAdmin
|
|
17
17
|
def install_npm_package
|
18
18
|
return unless options[:bundler] != 'importmap'
|
19
19
|
|
20
|
-
say 'Installing
|
21
|
-
run 'npm install
|
20
|
+
say 'Installing activeadmin-tom_select npm package...', :green
|
21
|
+
run 'npm install activeadmin-tom_select'
|
22
22
|
end
|
23
23
|
|
24
24
|
def setup_javascript
|
@@ -90,7 +90,7 @@ module ActiveAdmin
|
|
90
90
|
<<~JS
|
91
91
|
|
92
92
|
// ActiveAdmin Tom Select
|
93
|
-
import '
|
93
|
+
import 'activeadmin-tom_select';
|
94
94
|
JS
|
95
95
|
end
|
96
96
|
else
|
@@ -100,7 +100,7 @@ module ActiveAdmin
|
|
100
100
|
import "@activeadmin/activeadmin";
|
101
101
|
|
102
102
|
// ActiveAdmin Tom Select
|
103
|
-
import '
|
103
|
+
import 'activeadmin-tom_select';
|
104
104
|
JS
|
105
105
|
end
|
106
106
|
end
|
@@ -166,7 +166,7 @@ module ActiveAdmin
|
|
166
166
|
<<~JS
|
167
167
|
|
168
168
|
// ActiveAdmin Tom Select
|
169
|
-
import '
|
169
|
+
import 'activeadmin-tom_select';
|
170
170
|
JS
|
171
171
|
end
|
172
172
|
else
|
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
|
-
"name": "
|
2
|
+
"name": "activeadmin-tom_select",
|
3
3
|
"version": "4.1.0",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
|
-
"name": "
|
8
|
+
"name": "activeadmin-tom_select",
|
9
9
|
"version": "4.1.0",
|
10
10
|
"license": "MIT",
|
11
11
|
"peerDependencies": {
|
data/npm-package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"name": "
|
3
|
-
"version": "4.1.
|
2
|
+
"name": "activeadmin-tom_select",
|
3
|
+
"version": "4.1.1",
|
4
4
|
"description": "Use Tom Select for searchable selects in Active Admin forms and filters.",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"module": "src/index.js",
|
data/npm-package/src/index.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
import TomSelect from 'tom-select';
|
4
4
|
|
5
5
|
const MODULE_NAME = 'ActiveAdmin Searchable Select';
|
6
|
-
const SELECTOR = '.searchable-select-input';
|
6
|
+
const SELECTOR = '.searchable-select-input, .tom-select-input';
|
7
7
|
const INITIALIZED_CLASS = 'tom-select-initialized';
|
8
8
|
|
9
9
|
// Core initialization function
|
@@ -148,6 +148,4 @@ export function setupAutoInit() {
|
|
148
148
|
initSearchableSelects(selects);
|
149
149
|
}
|
150
150
|
});
|
151
|
-
|
152
|
-
console.log(`${MODULE_NAME} (Tom Select) initialized`);
|
153
151
|
}
|
@@ -28,7 +28,7 @@
|
|
28
28
|
}
|
29
29
|
|
30
30
|
.plugin-clear_button.single .clear-button {
|
31
|
-
|
31
|
+
right: 1.8rem;
|
32
32
|
}
|
33
33
|
|
34
34
|
.plugin-clear_button.focus.has-items .clear-button,
|
@@ -103,7 +103,7 @@
|
|
103
103
|
}
|
104
104
|
|
105
105
|
.ts-wrapper.plugin-remove_button .item .remove {
|
106
|
-
@apply text-inherit no-underline align-middle inline-block p-0 px-1.5 border-l border-gray-300 rounded-r-
|
106
|
+
@apply text-inherit no-underline align-middle inline-block p-0 px-1.5 border-l border-gray-300 rounded-r-md box-border ml-1.5;
|
107
107
|
}
|
108
108
|
|
109
109
|
.ts-wrapper.plugin-remove_button .item .remove:hover {
|
@@ -137,7 +137,7 @@
|
|
137
137
|
.ts-dropdown,
|
138
138
|
.ts-control,
|
139
139
|
.ts-control input {
|
140
|
-
|
140
|
+
@apply text-gray-900 dark:text-gray-100;
|
141
141
|
font-family: inherit;
|
142
142
|
font-size: 13px;
|
143
143
|
line-height: 18px;
|
@@ -146,12 +146,12 @@
|
|
146
146
|
/* Control (Input) Styles */
|
147
147
|
.ts-control,
|
148
148
|
.ts-wrapper.single.input-active .ts-control {
|
149
|
-
@apply bg-white dark:bg-gray-
|
149
|
+
@apply bg-white dark:bg-gray-700;
|
150
150
|
cursor: text;
|
151
151
|
}
|
152
152
|
|
153
153
|
.ts-control {
|
154
|
-
@apply border border-gray-300 dark:border-gray-600 p-2 w-full overflow-hidden relative z-10 box-border shadow-none rounded-
|
154
|
+
@apply border border-gray-300 dark:border-gray-600 p-2 w-full overflow-hidden relative z-10 box-border shadow-none rounded-md flex flex-wrap;
|
155
155
|
}
|
156
156
|
|
157
157
|
.ts-wrapper.multi.has-items .ts-control {
|
@@ -159,7 +159,7 @@
|
|
159
159
|
}
|
160
160
|
|
161
161
|
.full .ts-control {
|
162
|
-
@apply bg-gray-50 dark:bg-gray-
|
162
|
+
@apply bg-gray-50 dark:bg-gray-700 dark:text-gray-100;
|
163
163
|
}
|
164
164
|
|
165
165
|
.disabled .ts-control,
|
@@ -177,7 +177,7 @@
|
|
177
177
|
|
178
178
|
/* Multi-select Items */
|
179
179
|
.ts-wrapper.multi .ts-control > div {
|
180
|
-
@apply cursor-pointer m-0 mr-1 my-1 px-2 py-1 bg-gray-100 text-gray-800 border-0 rounded-
|
180
|
+
@apply cursor-pointer m-0 mr-1 my-1 px-2 py-1 bg-gray-100 text-gray-800 border-0 rounded-md;
|
181
181
|
}
|
182
182
|
|
183
183
|
.ts-wrapper.multi .ts-control > div.active {
|
@@ -242,7 +242,7 @@
|
|
242
242
|
|
243
243
|
/* Dropdown Styles */
|
244
244
|
.ts-dropdown {
|
245
|
-
@apply absolute top-full left-0 w-full z-50 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-
|
245
|
+
@apply absolute top-full left-0 w-full z-50 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 mt-1 box-border rounded-md shadow-sm overflow-hidden;
|
246
246
|
}
|
247
247
|
|
248
248
|
.ts-dropdown [data-selectable] {
|
@@ -284,7 +284,7 @@
|
|
284
284
|
.ts-dropdown .create:hover,
|
285
285
|
.ts-dropdown .option:hover,
|
286
286
|
.ts-dropdown .active {
|
287
|
-
@apply bg-indigo-50 dark:bg-gray-
|
287
|
+
@apply bg-indigo-50 dark:bg-gray-600 text-indigo-900 dark:text-gray-100;
|
288
288
|
}
|
289
289
|
|
290
290
|
.ts-dropdown .create:hover.create,
|
@@ -343,20 +343,20 @@
|
|
343
343
|
padding-right: 2.5rem;
|
344
344
|
}
|
345
345
|
|
346
|
-
/*
|
347
|
-
.ts-wrapper.single .ts-control,
|
346
|
+
/* Ensure single select inputs don't break layout */
|
348
347
|
.ts-wrapper.single .ts-control input {
|
349
348
|
width: auto !important;
|
350
349
|
}
|
351
350
|
|
352
351
|
/* ActiveAdmin Specific Overrides */
|
353
352
|
.searchable_select.input .ts-wrapper {
|
354
|
-
|
355
|
-
display:
|
353
|
+
width: 100%;
|
354
|
+
display: block;
|
356
355
|
}
|
357
356
|
|
358
357
|
.searchable_select.input .ts-control {
|
359
358
|
margin-top: 0;
|
359
|
+
width: 100% !important;
|
360
360
|
}
|
361
361
|
|
362
362
|
/* Filter Form Specific Styles */
|
@@ -364,18 +364,24 @@
|
|
364
364
|
width: 100%;
|
365
365
|
}
|
366
366
|
|
367
|
+
.filter_form .searchable_select.input .ts-control {
|
368
|
+
width: 100% !important;
|
369
|
+
}
|
370
|
+
|
371
|
+
/* Ensure full width for all searchable selects */
|
372
|
+
.ts-wrapper {
|
373
|
+
width: 100%;
|
374
|
+
}
|
375
|
+
|
367
376
|
/* Hide Duplicate Elements */
|
368
377
|
.ts-wrapper + .ts-control {
|
369
378
|
display: none;
|
370
379
|
}
|
371
380
|
|
372
|
-
/* Dark Mode Support */
|
373
|
-
.dark .ts-control {
|
374
|
-
@apply bg-gray-800 border-gray-600 text-gray-100;
|
375
|
-
}
|
381
|
+
/* Dark Mode Support - Already handled above, removing duplicate */
|
376
382
|
|
377
383
|
.dark .ts-dropdown {
|
378
|
-
@apply bg-gray-
|
384
|
+
@apply bg-gray-700 border-gray-600;
|
379
385
|
}
|
380
386
|
|
381
387
|
.dark .ts-dropdown .option {
|
@@ -384,9 +390,9 @@
|
|
384
390
|
|
385
391
|
.dark .ts-dropdown .option:hover,
|
386
392
|
.dark .ts-dropdown [data-selectable].active {
|
387
|
-
@apply bg-gray-
|
393
|
+
@apply bg-gray-600 text-white;
|
388
394
|
}
|
389
395
|
|
390
396
|
.dark .ts-wrapper.multi .ts-control > div {
|
391
|
-
@apply bg-gray-
|
397
|
+
@apply bg-gray-600 text-gray-100;
|
392
398
|
}
|
data/sonar-project.properties
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# SonarQube project configuration
|
2
|
-
sonar.projectKey=
|
3
|
-
sonar.
|
4
|
-
sonar.
|
2
|
+
sonar.projectKey=rs-pro_activeadmin-tom_select
|
3
|
+
sonar.organization=rs-pro
|
4
|
+
sonar.projectName=activeadmin-tom_select
|
5
|
+
sonar.projectVersion=4.1.0
|
5
6
|
|
6
7
|
# Source code directories
|
7
8
|
sonar.sources=lib,app
|
@@ -22,4 +23,4 @@ sonar.exclusions=spec/**/*,vendor/**/*,coverage/**/*,tmp/**/*,*.gemspec,gemfiles
|
|
22
23
|
sonar.test.exclusions=spec/internal/app/assets/builds/**/*,spec/internal/public/**/*,spec/internal/node_modules/**/*
|
23
24
|
|
24
25
|
# Coverage exclusions (files that don't need coverage)
|
25
|
-
sonar.coverage.exclusions=spec/**/*,vendor/**/*,spec/internal/**/*,**/*_spec.rb
|
26
|
+
sonar.coverage.exclusions=spec/**/*,vendor/**/*,spec/internal/**/*,**/*_spec.rb
|