@magmalabs/spreadsheet
v1.0.0-alpha
Published
A spreadsheet view_component for your Rails app
Downloads
44
Readme
Spreadsheet
A spreadsheet view_component for your Rails app
Installation
Add this line to your application's Gemfile:
gem 'spreadsheet', github: 'magma-labs/spreadsheet'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spreadsheet
Then run the installation task
$ rake spreadsheet:install
NOTE: Spreadsheet's ViewComponents use shoelace and tailwind in templates, but for now these packages aren't included with the installation task so you will need to install manually
Usage
After install you can use Spreadsheet's ViewComponents in your templates
= render Spreadsheet::Cell.new(id: 'cell-id', value: 'A Spreadsheet Cell')
Most components accept the following options:
classnames
: For agregate css classes to use with your componentcolspan
: For define colspan to be applied in a componentcomponent_controller
: For use a custom stimulus controller with a componentextra_data
: For extend default dataset added in the component template
Development
Setup project locally
In development, when editing js files you will need to link your local repository
and run webpack-dev-server script from webpacker
in your rails application
In brief, the process is 2 steps:
- Run
yarn link
in this directory. - Run
yarn link "spreadsheet"
in the project that has the dependency.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/magma-labs/spreadsheet.
License
The gem is available as open source under the terms of the MIT License.