rails_accordion 0.2.0.pre.beta → 0.2.2.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -10
- data/lib/rails_accordion/configuration.rb +1 -1
- data/rails_accordion.gemspec +3 -3
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3f97b048a95a190cabdb3132a8d1dff2fefd0816c677c4201fe5f8b6b776bf
|
4
|
+
data.tar.gz: df20bf60d4c6ec24c3b7cab4d76ff4c6bd0596d14974060d97636996b8b8bdc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d8736179dd89ff72eb84f244475d7f73fe39388ad9fd9680c10ec1444b7295c91c3fd37aeccfdb0cbeaf662ad76d46f31dd8b6027aa8d93f04cbed28ef6cf8
|
7
|
+
data.tar.gz: 7278d6e7e8b925b7f1b999b235219296405276793ea0555b9d1f6143ecce82497ac741840fc8c57b9a11558d1a981fe18f4897e55f24049bdaa8bede82bef3d9
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ rails_accordion is a Ruby gem that provides an easy-to-use accordion component f
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
```rb
|
8
|
-
gem 'rails_accordion', '~> 0.
|
8
|
+
gem 'rails_accordion', '~> 0.2.0.pre.beta'
|
9
9
|
```
|
10
10
|
|
11
11
|
```shell
|
@@ -16,26 +16,69 @@ bundle install
|
|
16
16
|
rails generate rails_accordion:install
|
17
17
|
```
|
18
18
|
|
19
|
-
|
19
|
+
Then follow the instructions for your JavaScript setup:
|
20
20
|
|
21
|
-
|
21
|
+
- [Importmap](#importmap) (Rails 7 default)
|
22
|
+
- [esbuild, rollup.js, or Webpack](#esbuild-rollupjs-or-webpack)
|
23
|
+
- [Webpacker](#webpacker) (Rails 6 default)
|
24
|
+
- [Sprockets](#sprockets)
|
25
|
+
|
26
|
+
### Importmap
|
27
|
+
|
28
|
+
In `config/importmap.rb`, add:
|
29
|
+
|
30
|
+
```ruby
|
22
31
|
pin "rails_accordion", to: "rails_accordion.js"
|
23
32
|
```
|
24
33
|
|
25
|
-
And in app/javascript/application.js
|
34
|
+
And in `app/javascript/application.js`, add:
|
35
|
+
|
36
|
+
```js
|
37
|
+
import "rails_accordion"
|
38
|
+
```
|
39
|
+
|
40
|
+
### esbuild, rollup.js, or Webpack
|
41
|
+
|
42
|
+
Run:
|
43
|
+
|
44
|
+
```sh
|
45
|
+
yarn add rails_accordion rails_accordion.js
|
46
|
+
```
|
47
|
+
|
48
|
+
And in `app/javascript/application.js`, add:
|
49
|
+
|
50
|
+
```js
|
51
|
+
import "rails_accordion/rails_accordion.js"
|
52
|
+
```
|
53
|
+
|
54
|
+
Note: For rollup.js, this requires `format: "iife"` in `rollup.config.js`.
|
55
|
+
|
56
|
+
### Webpacker
|
57
|
+
|
58
|
+
Run:
|
59
|
+
|
60
|
+
```sh
|
61
|
+
yarn add rails_accordion rails_accordion.js
|
62
|
+
```
|
63
|
+
|
64
|
+
And in `app/javascript/packs/application.js`, add:
|
65
|
+
|
26
66
|
```js
|
27
|
-
import
|
67
|
+
import "rails_accordion/rails_accordion.js"
|
28
68
|
```
|
29
69
|
|
30
|
-
|
31
|
-
|
32
|
-
|
70
|
+
### Sprockets
|
71
|
+
|
72
|
+
In `app/assets/javascripts/application.js`, add:
|
73
|
+
|
74
|
+
```js
|
75
|
+
//= require rails_accordion
|
33
76
|
```
|
34
77
|
|
35
78
|
## Usage
|
36
79
|
|
37
80
|
```erb
|
38
|
-
<%= accordion class: "bg-white rounded-xl overflow-auto"
|
81
|
+
<%= accordion class: "bg-white rounded-xl overflow-auto" do %>
|
39
82
|
<%= accordion_item do |item| %>
|
40
83
|
<% item.header do %>
|
41
84
|
Hello world
|
@@ -47,6 +90,13 @@ in application.scss, add:
|
|
47
90
|
<% end %>
|
48
91
|
```
|
49
92
|
|
93
|
+
### Options
|
94
|
+
|
95
|
+
multiple_open: [true, false]
|
96
|
+
default_state: 1. all_closed: All items are closed on page load. 2. all_opened: All items are opened. 3. first_opened: First item is opened by default
|
97
|
+
|
98
|
+
<%= accordion class: "bg-white rounded-xl overflow-auto", default_state: :all_opened do %>
|
99
|
+
|
50
100
|
## Development
|
51
101
|
|
52
102
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -55,7 +105,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
55
105
|
|
56
106
|
## Contributing
|
57
107
|
|
58
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails_accordion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/
|
108
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails_accordion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Tajbrains/rails_accordion/blob/master/CODE_OF_CONDUCT.md).
|
59
109
|
|
60
110
|
## License
|
61
111
|
|
data/rails_accordion.gemspec
CHANGED
@@ -4,12 +4,12 @@ require_relative "lib/rails_accordion/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "rails_accordion"
|
7
|
-
spec.version = RailsAccordion::VERSION
|
7
|
+
spec.version = ENV['GEM_VERSION'] || RailsAccordion::VERSION
|
8
8
|
spec.authors = ["Ahmadshoh Nasrullozoda"]
|
9
9
|
spec.email = ["tajbrains@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = "rails_accordion is in
|
12
|
-
spec.description = "rails_accordion is in
|
11
|
+
spec.summary = "rails_accordion is a Ruby gem that provides an easy-to-use accordion component for use in Rails web applications."
|
12
|
+
spec.description = "rails_accordion is a Ruby gem that provides an easy-to-use accordion component for use in Rails web applications. With this gem, developers can create collapsible sections of content that can be expanded or collapsed with a single click. The accordion is a great way to improve the user experience of your web application, by providing a clean and intuitive way to display complex information."
|
13
13
|
spec.homepage = "https://tajbrains.com"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.6.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_accordion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmadshoh Nasrullozoda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stimulus-rails
|
@@ -52,7 +52,11 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.6'
|
55
|
-
description: rails_accordion is
|
55
|
+
description: rails_accordion is a Ruby gem that provides an easy-to-use accordion
|
56
|
+
component for use in Rails web applications. With this gem, developers can create
|
57
|
+
collapsible sections of content that can be expanded or collapsed with a single
|
58
|
+
click. The accordion is a great way to improve the user experience of your web application,
|
59
|
+
by providing a clean and intuitive way to display complex information.
|
56
60
|
email:
|
57
61
|
- tajbrains@gmail.com
|
58
62
|
executables: []
|
@@ -109,5 +113,6 @@ requirements: []
|
|
109
113
|
rubygems_version: 3.0.1
|
110
114
|
signing_key:
|
111
115
|
specification_version: 4
|
112
|
-
summary: rails_accordion is
|
116
|
+
summary: rails_accordion is a Ruby gem that provides an easy-to-use accordion component
|
117
|
+
for use in Rails web applications.
|
113
118
|
test_files: []
|