activeadmin-tom_select 4.1.0 → 4.1.2

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/commands/fix-tests.md +1 -1
  3. data/.github/workflows/ci.yml +13 -11
  4. data/.github/workflows/npm-publish.yml +3 -3
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +1 -1
  7. data/AGENTS.md +2 -2
  8. data/CHANGELOG.md +19 -1
  9. data/Gemfile.lock +85 -79
  10. data/README.md +20 -18
  11. data/activeadmin-tom_select.gemspec +3 -3
  12. data/docs/guide-update-your-app.md +198 -25
  13. data/docs/update-tom-select.md +322 -158
  14. data/gemfiles/rails_7.x_active_admin_4.x.gemfile.lock +11 -11
  15. data/gemfiles/rails_8.x_active_admin_4.x.gemfile.lock +66 -64
  16. data/lib/activeadmin/inputs/filters/searchable_select_input.rb +5 -12
  17. data/lib/activeadmin/inputs/filters/tom_select_input.rb +19 -0
  18. data/lib/activeadmin/inputs/searchable_select_input.rb +5 -11
  19. data/lib/activeadmin/inputs/tom_select_input.rb +16 -0
  20. data/lib/activeadmin/tom_select/engine.rb +3 -1
  21. data/lib/activeadmin/tom_select/option_collection.rb +1 -1
  22. data/lib/activeadmin/tom_select/resource_dsl_extension.rb +1 -1
  23. data/lib/activeadmin/tom_select/resource_extension.rb +1 -1
  24. data/lib/activeadmin/tom_select/select_input_extension.rb +39 -16
  25. data/lib/activeadmin/tom_select/version.rb +2 -2
  26. data/lib/activeadmin/tom_select.rb +3 -3
  27. data/lib/generators/active_admin/tom_select/install/install_generator.rb +5 -5
  28. data/npm-package/package-lock.json +2 -2
  29. data/npm-package/package.json +2 -2
  30. data/npm-package/src/index.js +1 -3
  31. data/npm-package/src/tom-select-tailwind.css +26 -20
  32. data/sonar-project.properties +14 -13
  33. data/spec/features/ajax_false_input_spec.rb +74 -0
  34. data/spec/features/end_to_end_spec.rb +33 -20
  35. data/spec/features/form_input_spec.rb +2 -2
  36. data/spec/features/inline_ajax_setting_spec.rb +1 -1
  37. data/spec/internal/Gemfile.lock +1 -1
  38. data/spec/internal/app/admin/articles.rb +28 -0
  39. data/spec/internal/app/admin/option_values.rb +6 -6
  40. data/spec/internal/app/admin/posts.rb +4 -4
  41. data/spec/internal/app/admin/test_ajax_false.rb +18 -0
  42. data/spec/internal/app/admin/variants.rb +2 -2
  43. data/spec/internal/app/assets/config/manifest.js +2 -1
  44. data/spec/internal/app/assets/stylesheets/active_admin.tailwind.css +1 -1
  45. data/spec/internal/app/assets/stylesheets/application.tailwind.css +0 -15
  46. data/spec/internal/app/javascript/active_admin.js +2 -4
  47. data/spec/internal/app/models/option_value.rb +8 -0
  48. data/spec/internal/db/schema.rb +3 -1
  49. data/spec/internal/db/seeds.rb +4 -7
  50. data/spec/internal/package-lock.json +3 -3
  51. data/spec/internal/package.json +1 -1
  52. data/spec/internal/yarn.lock +1 -1
  53. data/spec/support/reset_settings.rb +1 -1
  54. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 101301522f68deaa4722807193d35b2e8e1e91b9f30e3ca555a1d08ca86681ba
4
- data.tar.gz: 8ab0654e5ea3c8fdd6f180126b84b7e7477252cee7be34f5d10b49e2ed8aad5a
3
+ metadata.gz: 153fdfdb190ef24f202368e25d4aec43867b04e7b95d6bbcb7f628220f86aa19
4
+ data.tar.gz: ce4baaecf0ec8e56b7f2e8e42af66e9f13089b8ca452c7d060cab78f9ccf4a3f
5
5
  SHA512:
6
- metadata.gz: 4abe389636853e25410b3dfbdc56c38c536f5c97d92a141d374ca1e1e0e2426bf93fdd4c3764929b6a306ae9f8f87e02a7ae79b7c0cde83b11a748bf9bc06ff2
7
- data.tar.gz: ef5c07fcfbb26a0921fd24070be3bec85d92f05d3752de56bfb64a2f3df7f7da76832bb4f16e9475350189b5b5ff9b4ea1a7c79e386c6f70b3b652300d22e2b7
6
+ metadata.gz: 14c597299f028c3502505975c5f2c92eea64415511ad0fc74fbd675a28c6af8b512b3b585fc29951f2c42309a70b1657e580c4b5a60bac383b8ce0dae7c482fe
7
+ data.tar.gz: 0a8e4068afd1fadaf7b32413ad6b8ba155979270a2768f2692e734cb6734955e4422234b32508db6e5be18325bf7b109bcd64ea50b09a2b8f799a9d08bbe3d1e
@@ -142,7 +142,7 @@ The gem's JavaScript is in `app/assets/javascripts/active_admin/searchable_selec
142
142
  ### 4. Inline AJAX Options Mode
143
143
  For testing without real AJAX calls, enable inline mode:
144
144
  ```ruby
145
- ActiveAdmin::SearchableSelect.inline_ajax_options = true
145
+ ActiveAdmin::TomSelect.inline_ajax_options = true
146
146
  ```
147
147
  This renders all options statically in the HTML.
148
148
 
@@ -81,7 +81,7 @@ jobs:
81
81
  cd ../spec/internal
82
82
  # Remove any existing symlink/folder
83
83
  rm -rf package
84
- rm -rf node_modules/@rocket-sensei/activeadmin-tom_select
84
+ rm -rf node_modules/activeadmin-tom_select
85
85
  npm install
86
86
 
87
87
  # Install from the extracted package
@@ -106,22 +106,24 @@ jobs:
106
106
 
107
107
  - name: Setup test database
108
108
  run: |
109
- # The database tasks may not be available, skip for now
110
- echo "Database setup will be handled by test suite"
109
+ cd spec/internal
110
+ ./bin/rails db:create db:schema:load RAILS_ENV=test
111
111
 
112
112
  - name: Run tests with coverage
113
113
  run: |
114
114
  bundle exec rspec --format progress --format RspecJunitFormatter --out rspec-results.xml
115
- continue-on-error: true
116
115
 
117
- - name: Upload coverage to Codecov
116
+ - name: Fix coverage paths for SonarQube
118
117
  if: matrix.ruby == '3.4' && matrix.gemfile == 'rails_7.x_active_admin_4.x'
119
- uses: codecov/codecov-action@v5
120
- with:
121
- file: ./coverage/coverage.json
122
- fail_ci_if_error: false
123
- token: ${{ secrets.CODECOV_TOKEN }}
124
-
118
+ run: |
119
+ # SonarQube runs in Docker container where workspace is /github/workspace
120
+ # Coverage has paths like /home/runner/work/activeadmin-tom_select/activeadmin-tom_select/
121
+ # Need to replace GitHub runner paths with Docker container paths
122
+ if [ -f coverage/coverage.json ]; then
123
+ sed -i "s|/home/runner/work/activeadmin-tom_select/activeadmin-tom_select/|/github/workspace/|g" coverage/coverage.json
124
+ echo "Coverage paths fixed for SonarQube Docker container"
125
+ fi
126
+
125
127
  - name: SonarQube Scan
126
128
  if: matrix.ruby == '3.4' && matrix.gemfile == 'rails_7.x_active_admin_4.x' && github.event_name != 'pull_request'
127
129
  uses: sonarsource/sonarqube-scan-action@v3
@@ -40,11 +40,11 @@ jobs:
40
40
  run: |
41
41
  echo "### NPM Package Published! 🎉" >> $GITHUB_STEP_SUMMARY
42
42
  echo "" >> $GITHUB_STEP_SUMMARY
43
- echo "Package: \`@rocket-sensei/activeadmin-tom_select@$(cd npm-package && npm pkg get version | tr -d '"')\`" >> $GITHUB_STEP_SUMMARY
43
+ echo "Package: \`activeadmin-tom_select@$(cd npm-package && npm pkg get version | tr -d '"')\`" >> $GITHUB_STEP_SUMMARY
44
44
  echo "" >> $GITHUB_STEP_SUMMARY
45
45
  echo "Install with:" >> $GITHUB_STEP_SUMMARY
46
46
  echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
47
- echo "npm install @rocket-sensei/activeadmin-tom_select" >> $GITHUB_STEP_SUMMARY
47
+ echo "npm install activeadmin-tom_select" >> $GITHUB_STEP_SUMMARY
48
48
  echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
49
49
  echo "" >> $GITHUB_STEP_SUMMARY
50
- echo "View on NPM: https://www.npmjs.com/package/@rocket-sensei/activeadmin-tom_select" >> $GITHUB_STEP_SUMMARY
50
+ echo "View on NPM: https://www.npmjs.com/package/activeadmin-tom_select" >> $GITHUB_STEP_SUMMARY
data/.gitignore CHANGED
@@ -33,3 +33,4 @@
33
33
  # Code coverage reports
34
34
  /coverage/
35
35
  *.lcov
36
+ rspec-results.xml
data/.rubocop.yml CHANGED
@@ -61,7 +61,7 @@ Metrics/MethodLength:
61
61
 
62
62
  # Allow slightly longer modules for input extensions
63
63
  Metrics/ModuleLength:
64
- Max: 110
64
+ Max: 115
65
65
 
66
66
  # Allow complex methods for generators
67
67
  Metrics/AbcSize:
data/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Repository Guidelines
2
2
 
3
3
  ## Project Structure & Module Organization
4
- - `lib/`: Ruby engine, extensions, and DSL under `ActiveAdmin::SearchableSelect`.
4
+ - `lib/`: Ruby engine, extensions, and DSL under `ActiveAdmin::TomSelect`.
5
5
  - `app/assets/`: Legacy Sprockets JS/CSS entry points for ActiveAdmin.
6
6
  - `src/`: ESM sources for the npm package (`searchable_select.js/.scss`).
7
7
  - `vendor/assets/javascripts/`: Importmap-friendly JS build.
@@ -19,7 +19,7 @@
19
19
 
20
20
  ## Coding Style & Naming Conventions
21
21
  - Ruby: 2-space indent, TargetRuby 3.0, max line length 100; follow RuboCop rules.
22
- - Names: Ruby files in `lib/activeadmin/searchable_select/` use snake_case; modules under `ActiveAdmin::SearchableSelect`.
22
+ - Names: Ruby files in `lib/activeadmin/tom_select/` use snake_case; modules under `ActiveAdmin::TomSelect`.
23
23
  - JS: ESM modules in `src/`; keep imports explicit. Avoid global jQuery except for ActiveAdmin integration.
24
24
 
25
25
  ## Testing Guidelines
data/CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 5.0.0 (Draft - Unreleased)
3
+ ### Version 4.1.1
4
+
5
+ #### ✨ Improvements
6
+ - **New Input Type**: Added `TomSelectInput` as the primary input class, with `SearchableSelectInput` now as a legacy alias for backward compatibility
7
+ - **Module Renaming**: Renamed internal module from `ActiveAdmin::SearchableSelect` to `ActiveAdmin::TomSelect` for consistency
8
+ - **NPM Package Name**: Changed npm package name from `@rocket-sensei/activeadmin-tom_select` to `activeadmin-tom_select` (without organization prefix)
9
+ - **Style Fixes**:
10
+ - Fixed dark mode background colors to match ActiveAdmin inputs (#374151)
11
+ - Fixed dark mode text color visibility
12
+ - Fixed border radius to match ActiveAdmin design (rounded-md)
13
+ - Fixed full width styling for select inputs
14
+ - **Documentation**: Updated README to show `as: :tom_select` usage (with backward compatibility note)
15
+
16
+ #### 🔄 Migration
17
+ - New code should use `f.input :field, as: :tom_select`
18
+ - Legacy `as: :searchable_select` continues to work for backward compatibility
19
+ - NPM install command: `npm install activeadmin-tom_select` (no organization prefix)
20
+
21
+ ### Version 4.1.0
4
22
 
5
23
  [Compare changes](https://github.com/glebtv/activeadmin-searchable_select/compare/1-8-stable...master)
6
24
 
data/Gemfile.lock CHANGED
@@ -1,36 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeadmin-tom_select (4.1.0)
4
+ activeadmin-tom_select (4.1.2)
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.2.1)
12
- actionpack (= 8.0.2.1)
13
- activesupport (= 8.0.2.1)
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.2.1)
18
- actionpack (= 8.0.2.1)
19
- activejob (= 8.0.2.1)
20
- activerecord (= 8.0.2.1)
21
- activestorage (= 8.0.2.1)
22
- activesupport (= 8.0.2.1)
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.2.1)
25
- actionpack (= 8.0.2.1)
26
- actionview (= 8.0.2.1)
27
- activejob (= 8.0.2.1)
28
- activesupport (= 8.0.2.1)
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.2.1)
32
- actionview (= 8.0.2.1)
33
- activesupport (= 8.0.2.1)
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.2.1)
42
- actionpack (= 8.0.2.1)
43
- activerecord (= 8.0.2.1)
44
- activestorage (= 8.0.2.1)
45
- activesupport (= 8.0.2.1)
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.2.1)
49
- activesupport (= 8.0.2.1)
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.2.1)
64
- activesupport (= 8.0.2.1)
63
+ activejob (8.0.3)
64
+ activesupport (= 8.0.3)
65
65
  globalid (>= 0.3.6)
66
- activemodel (8.0.2.1)
67
- activesupport (= 8.0.2.1)
68
- activerecord (8.0.2.1)
69
- activemodel (= 8.0.2.1)
70
- activesupport (= 8.0.2.1)
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.2.1)
73
- actionpack (= 8.0.2.1)
74
- activejob (= 8.0.2.1)
75
- activerecord (= 8.0.2.1)
76
- activesupport (= 8.0.2.1)
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.2.1)
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.2.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.13.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)
@@ -172,6 +172,8 @@ GEM
172
172
  activerecord
173
173
  kaminari-core (= 1.2.2)
174
174
  kaminari-core (1.2.2)
175
+ language_server-protocol (3.17.0.5)
176
+ lint_roller (1.1.0)
175
177
  logger (1.7.0)
176
178
  loofah (2.24.1)
177
179
  crass (~> 1.0.2)
@@ -181,12 +183,12 @@ GEM
181
183
  net-imap
182
184
  net-pop
183
185
  net-smtp
184
- marcel (1.0.4)
186
+ marcel (1.1.0)
185
187
  matrix (0.4.3)
186
188
  mime-types (3.7.0)
187
189
  logger
188
190
  mime-types-data (~> 3.2025, >= 3.2025.0507)
189
- mime-types-data (3.2025.0909)
191
+ mime-types-data (3.2025.0924)
190
192
  mini_mime (1.1.5)
191
193
  minitest (5.25.5)
192
194
  net-imap (0.5.10)
@@ -199,7 +201,7 @@ GEM
199
201
  net-smtp (0.5.1)
200
202
  net-protocol
201
203
  nio4r (2.7.4)
202
- nokogiri (1.18.9-x86_64-linux-gnu)
204
+ nokogiri (1.18.10-x86_64-linux-gnu)
203
205
  racc (~> 1.4)
204
206
  orm_adapter (0.5.0)
205
207
  parallel (1.27.0)
@@ -212,8 +214,8 @@ GEM
212
214
  pp (0.6.2)
213
215
  prettyprint
214
216
  prettyprint (0.2.0)
215
- prism (1.4.0)
216
- propshaft (1.2.1)
217
+ prism (1.5.1)
218
+ propshaft (1.3.1)
217
219
  actionpack (>= 7.0.0)
218
220
  activesupport (>= 7.0.0)
219
221
  rack
@@ -232,20 +234,20 @@ GEM
232
234
  rack (>= 1.3)
233
235
  rackup (2.2.1)
234
236
  rack (>= 3)
235
- rails (8.0.2.1)
236
- actioncable (= 8.0.2.1)
237
- actionmailbox (= 8.0.2.1)
238
- actionmailer (= 8.0.2.1)
239
- actionpack (= 8.0.2.1)
240
- actiontext (= 8.0.2.1)
241
- actionview (= 8.0.2.1)
242
- activejob (= 8.0.2.1)
243
- activemodel (= 8.0.2.1)
244
- activerecord (= 8.0.2.1)
245
- activestorage (= 8.0.2.1)
246
- activesupport (= 8.0.2.1)
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)
247
249
  bundler (>= 1.15.0)
248
- railties (= 8.0.2.1)
250
+ railties (= 8.0.3)
249
251
  rails-dom-testing (2.3.0)
250
252
  activesupport (>= 5.0.0)
251
253
  minitest
@@ -253,31 +255,30 @@ GEM
253
255
  rails-html-sanitizer (1.6.2)
254
256
  loofah (~> 2.21)
255
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)
256
- railties (8.0.2.1)
257
- actionpack (= 8.0.2.1)
258
- activesupport (= 8.0.2.1)
258
+ railties (8.0.3)
259
+ actionpack (= 8.0.3)
260
+ activesupport (= 8.0.3)
259
261
  irb (~> 1.13)
260
262
  rackup (>= 1.0.0)
261
263
  rake (>= 12.2)
262
264
  thor (~> 1.0, >= 1.2.2)
265
+ tsort (>= 0.2)
263
266
  zeitwerk (~> 2.6)
264
- rainbow (2.2.2)
265
- rake
267
+ rainbow (3.1.1)
266
268
  rake (13.3.0)
267
- ransack (4.3.0)
268
- activerecord (>= 6.1.5)
269
- activesupport (>= 6.1.5)
269
+ ransack (4.4.1)
270
+ activerecord (>= 7.2)
271
+ activesupport (>= 7.2)
270
272
  i18n
271
273
  rdoc (6.14.2)
272
274
  erb
273
275
  psych (>= 4.0.0)
274
- regexp_parser (2.11.2)
276
+ regexp_parser (2.11.3)
275
277
  reline (0.6.2)
276
278
  io-console (~> 0.5)
277
279
  responders (3.1.1)
278
280
  actionpack (>= 5.2)
279
281
  railties (>= 5.2)
280
- rexml (3.4.4)
281
282
  rspec-core (3.13.5)
282
283
  rspec-support (~> 3.13.0)
283
284
  rspec-expectations (3.13.5)
@@ -294,24 +295,26 @@ GEM
294
295
  rspec-expectations (~> 3.13)
295
296
  rspec-mocks (~> 3.13)
296
297
  rspec-support (~> 3.13)
297
- rspec-support (3.13.5)
298
+ rspec-support (3.13.6)
298
299
  rspec_junit_formatter (0.6.0)
299
300
  rspec-core (>= 2, < 4, != 2.12.0)
300
- rubocop (1.50.2)
301
+ rubocop (1.80.2)
301
302
  json (~> 2.3)
303
+ language_server-protocol (~> 3.17.0.2)
304
+ lint_roller (~> 1.1.0)
302
305
  parallel (~> 1.10)
303
- parser (>= 3.2.0.0)
306
+ parser (>= 3.3.0.2)
304
307
  rainbow (>= 2.2.2, < 4.0)
305
- regexp_parser (>= 1.8, < 3.0)
306
- rexml (>= 3.2.5, < 4.0)
307
- rubocop-ast (>= 1.28.0, < 2.0)
308
+ regexp_parser (>= 2.9.3, < 3.0)
309
+ rubocop-ast (>= 1.46.0, < 2.0)
308
310
  ruby-progressbar (~> 1.7)
309
- unicode-display_width (>= 2.4.0, < 3.0)
311
+ unicode-display_width (>= 2.4.0, < 4.0)
310
312
  rubocop-ast (1.46.0)
311
313
  parser (>= 3.3.7.2)
312
314
  prism (~> 1.4)
313
- rubocop-rspec (3.0.0)
314
- rubocop (~> 1.40)
315
+ rubocop-rspec (3.7.0)
316
+ lint_roller (~> 1.1)
317
+ rubocop (~> 1.72, >= 1.72.1)
315
318
  ruby-progressbar (1.13.0)
316
319
  securerandom (0.4.1)
317
320
  simplecov (0.22.0)
@@ -320,13 +323,16 @@ GEM
320
323
  simplecov_json_formatter (~> 0.1)
321
324
  simplecov-html (0.13.2)
322
325
  simplecov_json_formatter (0.1.4)
323
- sqlite3 (2.7.3-x86_64-linux-gnu)
326
+ sqlite3 (2.7.4-x86_64-linux-gnu)
324
327
  stringio (3.1.7)
325
328
  thor (1.4.0)
326
329
  timeout (0.4.3)
330
+ tsort (0.2.0)
327
331
  tzinfo (2.0.6)
328
332
  concurrent-ruby (~> 1.0)
329
- unicode-display_width (2.6.0)
333
+ unicode-display_width (3.2.0)
334
+ unicode-emoji (~> 4.1)
335
+ unicode-emoji (4.1.0)
330
336
  uri (1.0.3)
331
337
  useragent (0.16.11)
332
338
  warden (1.2.9)
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # ActiveAdmin Tom Select
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/activeadmin-tom_select.svg)](http://badge.fury.io/rb/activeadmin-tom_select)
4
- [![NPM Version](https://badge.fury.io/js/@rocket-sensei%2Factiveadmin-tom_select.svg)](https://badge.fury.io/js/@rocket-sensei%2Factiveadmin-tom_select)
5
- [![npm](https://img.shields.io/npm/dm/@rocket-sensei/activeadmin-tom_select)](https://www.npmjs.com/package/@rocket-sensei/activeadmin-tom_select)
4
+ [![NPM Version](https://badge.fury.io/js/activeadmin-tom_select.svg)](https://badge.fury.io/js/activeadmin-tom_select)
5
+ [![npm](https://img.shields.io/npm/dm/activeadmin-tom_select)](https://www.npmjs.com/package/activeadmin-tom_select)
6
6
  [![Build Status](https://github.com/rs-pro/activeadmin-tom_select/actions/workflows/ci.yml/badge.svg)](https://github.com/rs-pro/activeadmin-tom_select/actions)
7
7
 
8
8
  Searchable select boxes (via [Tom Select](https://tom-select.js.org/)) for
@@ -37,7 +37,7 @@ rails generate active_admin:searchable_select:install --bundler=importmap
37
37
 
38
38
  1. Install npm packages:
39
39
  ```bash
40
- npm install @rocket-sensei/activeadmin-tom_select tom-select
40
+ npm install activeadmin-tom_select tom-select
41
41
  ```
42
42
 
43
43
  2. In `app/javascript/active_admin.js`:
@@ -49,7 +49,7 @@ import TomSelect from 'tom-select';
49
49
  window.TomSelect = TomSelect;
50
50
 
51
51
  // Import and auto-initialize searchable selects
52
- import { setupAutoInit } from '@rocket-sensei/activeadmin-tom_select';
52
+ import { setupAutoInit } from 'activeadmin-tom_select';
53
53
  setupAutoInit();
54
54
  ```
55
55
 
@@ -80,19 +80,19 @@ Import stylesheets and require javascripts:
80
80
  Add to `package.json`:
81
81
  ```json
82
82
  "dependencies": {
83
- "@rocket-sensei/activeadmin-tom_select": "^5.0.0"
83
+ "activeadmin-tom_select": "^4.1.0"
84
84
  }
85
85
  ```
86
86
 
87
87
  In `app/javascript/packs/active_admin.js`:
88
88
  ```javascript
89
- import { setupAutoInit } from '@rocket-sensei/activeadmin-tom_select';
89
+ import { setupAutoInit } from 'activeadmin-tom_select';
90
90
  setupAutoInit();
91
91
  ```
92
92
 
93
93
  In `app/javascript/stylesheets/active_admin.scss`:
94
94
  ```css
95
- @import '@rocket-sensei/activeadmin-tom_select/css';
95
+ @import 'activeadmin-tom_select/css';
96
96
  ```
97
97
 
98
98
  ## Usage
@@ -100,12 +100,12 @@ In `app/javascript/stylesheets/active_admin.scss`:
100
100
  ### Making Select Boxes Searchable
101
101
 
102
102
  To add search functionality to a select box, use the
103
- `:searchable_select` input type:
103
+ `:tom_select` input type:
104
104
 
105
105
  ```ruby
106
106
  ActiveAdmin.register Product do
107
107
  form do |f|
108
- f.input(:category, as: :searchable_select)
108
+ f.input(:category, as: :tom_select)
109
109
  end
110
110
  end
111
111
  ```
@@ -114,16 +114,18 @@ This also works for filters:
114
114
 
115
115
  ```ruby
116
116
  ActiveAdmin.register Product do
117
- filter(:category, as: :searchable_select)
117
+ filter(:category, as: :tom_select)
118
118
  end
119
119
  ```
120
120
 
121
+ **Note:** The legacy `:searchable_select` input type is still supported for backward compatibility but `:tom_select` is recommended for new code.
122
+
121
123
  By default, you can only select one at a time for a filter. You can
122
124
  specify a multi-select with:
123
125
 
124
126
  ```ruby
125
127
  ActiveAdmin.register Product do
126
- filter(:category, as: :searchable_select, multiple: true)
128
+ filter(:category, as: :tom_select, multiple: true)
127
129
  end
128
130
  ```
129
131
 
@@ -137,7 +139,7 @@ once the user begins to type:
137
139
 
138
140
  ActiveAdmin.register Product do
139
141
  filter(:category,
140
- as: :searchable_select,
142
+ as: :tom_select,
141
143
  ajax: true)
142
144
  end
143
145
  ```
@@ -209,7 +211,7 @@ based on the input attribute name, you can pass an object with a
209
211
  ActiveAdmin.register Product do
210
212
  form do |f|
211
213
  f.input(:additional_category,
212
- as: :searchable_select,
214
+ as: :tom_select,
213
215
  ajax: { resource: Category })
214
216
  end
215
217
  end
@@ -238,7 +240,7 @@ To specify which collection to use, pass an object with a
238
240
  ActiveAdmin.register Product do
239
241
  form do |f|
240
242
  f.input(:category,
241
- as: :searchable_select,
243
+ as: :tom_select,
242
244
  ajax: { collection_name: :favorites })
243
245
  end
244
246
  end
@@ -288,7 +290,7 @@ You can pass additional parameters to the options endpoint:
288
290
  ActiveAdmin.register Product do
289
291
  form do |f|
290
292
  f.input(:category,
291
- as: :searchable_select,
293
+ as: :tom_select,
292
294
  ajax: {
293
295
  params: {
294
296
  some: 'value'
@@ -357,7 +359,7 @@ ActiveAdmin.register(Variant) do
357
359
  form do |f|
358
360
  ...
359
361
  f.input(:option_value,
360
- as: :searchable_select,
362
+ as: :tom_select,
361
363
  ajax: {
362
364
  resource: OptionValue,
363
365
  path_params: {
@@ -386,7 +388,7 @@ for feature specs:
386
388
  ```ruby
387
389
  RSpec.configure do |config|
388
390
  config.before(:each) do |example|
389
- ActiveAdmin::SearchableSelect.inline_ajax_options = (example.metadata[:type] == :feature)
391
+ ActiveAdmin::TomSelect.inline_ajax_options = (example.metadata[:type] == :feature)
390
392
  end
391
393
  end
392
394
 
@@ -404,7 +406,7 @@ has stopped typing before sending the request:
404
406
  ```ruby
405
407
  ...
406
408
  f.input(:category,
407
- as: :searchable_select,
409
+ as: :tom_select,
408
410
  ajax: true,
409
411
  input_html: {
410
412
  data: {
@@ -4,7 +4,7 @@ require 'activeadmin/tom_select/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'activeadmin-tom_select'
7
- spec.version = ActiveAdmin::SearchableSelect::VERSION
7
+ spec.version = ActiveAdmin::TomSelect::VERSION
8
8
  spec.summary = 'Use Tom Select for searchable selects in Active Admin forms and filters.'
9
9
  spec.license = 'MIT'
10
10
  spec.authors = ['Rocket Sensei']
@@ -35,8 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'rspec_junit_formatter'
36
36
  spec.add_development_dependency 'simplecov'
37
37
 
38
- spec.add_runtime_dependency 'activeadmin', '>= 3.0', '< 5'
39
- spec.add_runtime_dependency 'ransack', '>= 1.8', '< 5'
38
+ spec.add_dependency 'activeadmin', '>= 3.0', '< 5'
39
+ spec.add_dependency 'ransack', '>= 1.8', '< 5'
40
40
 
41
41
  spec.metadata['rubygems_mfa_required'] = 'true'
42
42
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'