rails_accordion 1.0.1 → 1.0.3
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/Gemfile.lock +13 -12
- data/README.md +6 -52
- data/app/assets/config/rails_accordion_manifest.js +1 -0
- data/app/views/rails_accordion/_assets.html.erb +2 -0
- data/bin/rails +0 -1
- data/lib/rails_accordion/engine.rb +11 -0
- data/lib/rails_accordion.rb +8 -14
- data/lib/tasks/rails_accordion_tasks.rake +7 -4
- metadata +5 -5
- data/vendor/assets/javascripts/rails_accordion.js +0 -19707
- data/vendor/assets/javascripts/rails_accordion.js.map +0 -7
- data/vendor/assets/stylesheets/rails_accordion.css +0 -534
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8c3c4514120b3168aff3120e0b13292c7f2988c720106c864d019f8acb834c4
|
4
|
+
data.tar.gz: f91f2a9f0ebfc33416245309dc6c53e5b619b92cb5f792cd651fe14ecd70f674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4a7a6fc21265d50dbbb8b5bb184340648009eb43ffc50931a3833b682fbfaabd8e7d2dc1be8ac5d728074be7deeb2d993901588722542d463d7c2eb5552d947
|
7
|
+
data.tar.gz: d6a09a1bb1e78fb7c778e5905037f13030344a228ae9806a156d9ad464fc187739013aadbde4aa4db33a622a9fbf9596b786ff7a788a8336a96bc14836c9af77
|
data/Gemfile.lock
CHANGED
@@ -9,20 +9,20 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (6.1.7.
|
13
|
-
actionview (= 6.1.7.
|
14
|
-
activesupport (= 6.1.7.
|
12
|
+
actionpack (6.1.7.4)
|
13
|
+
actionview (= 6.1.7.4)
|
14
|
+
activesupport (= 6.1.7.4)
|
15
15
|
rack (~> 2.0, >= 2.0.9)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
-
actionview (6.1.7.
|
20
|
-
activesupport (= 6.1.7.
|
19
|
+
actionview (6.1.7.4)
|
20
|
+
activesupport (= 6.1.7.4)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
-
activesupport (6.1.7.
|
25
|
+
activesupport (6.1.7.4)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 1.6, < 2)
|
28
28
|
minitest (>= 5.1)
|
@@ -55,14 +55,15 @@ GEM
|
|
55
55
|
rack (2.2.7)
|
56
56
|
rack-test (2.1.0)
|
57
57
|
rack (>= 1.3)
|
58
|
-
rails-dom-testing (2.
|
59
|
-
activesupport (>=
|
58
|
+
rails-dom-testing (2.1.1)
|
59
|
+
activesupport (>= 5.0.0)
|
60
|
+
minitest
|
60
61
|
nokogiri (>= 1.6)
|
61
62
|
rails-html-sanitizer (1.5.0)
|
62
63
|
loofah (~> 2.19, >= 2.19.1)
|
63
|
-
railties (6.1.7.
|
64
|
-
actionpack (= 6.1.7.
|
65
|
-
activesupport (= 6.1.7.
|
64
|
+
railties (6.1.7.4)
|
65
|
+
actionpack (= 6.1.7.4)
|
66
|
+
activesupport (= 6.1.7.4)
|
66
67
|
method_source
|
67
68
|
rake (>= 12.2)
|
68
69
|
thor (~> 1.0)
|
@@ -123,4 +124,4 @@ DEPENDENCIES
|
|
123
124
|
zeitwerk (~> 2.6)
|
124
125
|
|
125
126
|
BUNDLED WITH
|
126
|
-
2.4.
|
127
|
+
2.4.15
|
data/README.md
CHANGED
@@ -16,64 +16,18 @@ bundle install
|
|
16
16
|
rails generate rails_accordion:install
|
17
17
|
```
|
18
18
|
|
19
|
-
|
19
|
+
In `application.html.erb`, add:
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
- [Webpacker](#webpacker) (Rails 6 default)
|
24
|
-
- [Sprockets](#sprockets)
|
25
|
-
|
26
|
-
### Importmap
|
27
|
-
|
28
|
-
In `config/importmap.rb`, add:
|
29
|
-
|
30
|
-
```ruby
|
31
|
-
pin "rails_accordion", to: "rails_accordion.js"
|
32
|
-
```
|
33
|
-
|
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
|
21
|
+
```erb
|
22
|
+
<%= rails_accordion_assets %>
|
62
23
|
```
|
63
24
|
|
64
|
-
|
25
|
+
In `application_helper.rb`, add:
|
65
26
|
|
66
|
-
```
|
67
|
-
|
27
|
+
```rb
|
28
|
+
include RailsAccordion::ApplicationHelper
|
68
29
|
```
|
69
30
|
|
70
|
-
### Sprockets
|
71
|
-
|
72
|
-
In `app/assets/javascripts/application.js`, add:
|
73
|
-
|
74
|
-
```js
|
75
|
-
//= require rails_accordion
|
76
|
-
```
|
77
31
|
|
78
32
|
## Usage
|
79
33
|
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link_tree ../builds
|
data/bin/rails
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
# installed from the root of your application.
|
4
4
|
|
5
5
|
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
-
# ENGINE_PATH = File.expand_path('../lib/rails_table/engine', __dir__)
|
7
6
|
|
8
7
|
# Set up gems listed in the Gemfile.
|
9
8
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
data/lib/rails_accordion.rb
CHANGED
@@ -7,26 +7,16 @@ loader.ignore("#{__dir__}/generators")
|
|
7
7
|
loader.setup
|
8
8
|
|
9
9
|
module RailsAccordion
|
10
|
-
|
11
|
-
class Error < StandardError; end
|
12
|
-
|
13
|
-
class Engine < ::Rails::Engine
|
14
|
-
isolate_namespace RailsAccordion
|
15
|
-
|
16
|
-
initializer "rails_accordion.importmap" do |app|
|
17
|
-
if defined?(Importmap)
|
18
|
-
app.config.assets.precompile << "rails_accordion.js"
|
19
|
-
app.config.assets.precompile << "rails_accordion.css"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
10
|
class Railtie < Rails::Railtie
|
25
11
|
ActiveSupport.on_load :action_view do
|
26
12
|
include RailsAccordion
|
27
13
|
end
|
28
14
|
end
|
29
15
|
|
16
|
+
def self.root
|
17
|
+
RailsAccordion::Engine.routes.find_script_name({})
|
18
|
+
end
|
19
|
+
|
30
20
|
def accordion(**args, &block)
|
31
21
|
render AccordionComponent.new(**args), &block
|
32
22
|
end
|
@@ -34,6 +24,10 @@ module RailsAccordion
|
|
34
24
|
def accordion_item(**args, &block)
|
35
25
|
render ItemComponent.new(**args), &block
|
36
26
|
end
|
27
|
+
|
28
|
+
def rails_accordion_assets
|
29
|
+
render "rails_accordion/assets"
|
30
|
+
end
|
37
31
|
end
|
38
32
|
|
39
33
|
loader.eager_load
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
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-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stimulus-rails
|
@@ -70,11 +70,13 @@ files:
|
|
70
70
|
- app/assets/builds/rails_accordion.css
|
71
71
|
- app/assets/builds/rails_accordion.js
|
72
72
|
- app/assets/builds/rails_accordion.js.map
|
73
|
+
- app/assets/config/rails_accordion_manifest.js
|
73
74
|
- app/assets/stylesheets/rails_accordion.css
|
74
75
|
- app/components/accordion_component.rb
|
75
76
|
- app/components/item_component.rb
|
76
77
|
- app/javascript/controllers/accordion_controller.js
|
77
78
|
- app/javascript/rails_accordion.js
|
79
|
+
- app/views/rails_accordion/_assets.html.erb
|
78
80
|
- bin/console
|
79
81
|
- bin/rails
|
80
82
|
- bin/setup
|
@@ -82,12 +84,10 @@ files:
|
|
82
84
|
- lib/generators/rails_accordion/templates/rails_accordion.tt
|
83
85
|
- lib/rails_accordion.rb
|
84
86
|
- lib/rails_accordion/configuration.rb
|
87
|
+
- lib/rails_accordion/engine.rb
|
85
88
|
- lib/rails_accordion/version.rb
|
86
89
|
- lib/tasks/rails_accordion_tasks.rake
|
87
90
|
- rails_accordion.gemspec
|
88
|
-
- vendor/assets/javascripts/rails_accordion.js
|
89
|
-
- vendor/assets/javascripts/rails_accordion.js.map
|
90
|
-
- vendor/assets/stylesheets/rails_accordion.css
|
91
91
|
homepage: https://github.com/Tajbrains/rails_accordion
|
92
92
|
licenses:
|
93
93
|
- MIT
|