NOTICE: Pre-alpha. This gem in is in progress of being migrated out of a separate repo and needs work before it can be included in other projects.
To make rendering the combobox pattern with a dynamic listbox easy to access and extend.
TODO
-
Figure out where dependencies live (how does gemspec x Gemfile work?)
-
Reduce dependencies on other gems
- View component -> other lib to generate HTML (view component is heavy)
- turbo-rails (can we just use turbo?)
- stimulus-rails (same here?)
- sprockets -> propshaft (lighter weight lib)
- heroicon -> static svgs? options to replace?
-
Clean up the API
- Ideally this looks a lot like a rails form field, roughly:
<%= f.combobox :task_id, collection: collection %> <%= f.combobox :task_id, refresh_url: url, ...options do |combobox| %> <%= combobox.with_listbox do |listbox| %> <% @tasks.each do |task| %> <%= listbox.with_option(id: task.id) do |option| %> ... # rendering option, option to specify how to render selected variant <% end %> <% end %> <% end %> <% end %>
-
Migrate tests
-
CI after testing is setup
-
Dependency on specific translations
How to use my plugin.
Add this line to your application's Gemfile:
gem "combobox_rails"
And then execute:
$ bundle
Or install it yourself as:
$ gem install combobox_rails
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.