rails_accordion 1.0.1 → 1.0.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.
- 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/helpers/rails_accordion/application_helper.rb +15 -0
- data/app/views/rails_accordion/_assets.html.erb +2 -0
- data/bin/rails +0 -1
- data/lib/rails_accordion/engine.rb +17 -0
- data/lib/rails_accordion.rb +2 -26
- data/lib/tasks/rails_accordion_tasks.rake +7 -4
- metadata +6 -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: a4bfa0f128b5f7a07becf2938b2e6ab2ab30be152eecd15967b0a09ff08f2ed3
|
4
|
+
data.tar.gz: c905d38999ab2d5e7ece8a82a319af597f116c241deb6ce1bc0d529c0c6757f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51b624b4cbc11f354cda95330fb4f80d519d9db7fc00a455560919e92b9cdefd934889f57e03397d7dca9202f91cfc24413df1513f7fe790c06e08f9920f9171
|
7
|
+
data.tar.gz: 244ee69d1dc5965145ce1961def630fc1b374a6b4bfbadcd1681f28bde92082e7ab1c49494e7fb3c515c111a65ae2e79a9884d30b3e9c3eca5634618aabdb1f5
|
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
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module RailsAccordion
|
2
|
+
module ApplicationHelper
|
3
|
+
def accordion(**args, &block)
|
4
|
+
render AccordionComponent.new(**args), &block
|
5
|
+
end
|
6
|
+
|
7
|
+
def accordion_item(**args, &block)
|
8
|
+
render ItemComponent.new(**args), &block
|
9
|
+
end
|
10
|
+
|
11
|
+
def rails_accordion_assets
|
12
|
+
render "rails_accordion/assets"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
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__)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module RailsAccordion
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace RailsAccordion
|
4
|
+
|
5
|
+
initializer "rails_accordion.helpers" do
|
6
|
+
ActiveSupport.on_load :action_controller do
|
7
|
+
helper RailsAccordion::ApplicationHelper
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
config.app_middleware.use(
|
12
|
+
Rack::Static,
|
13
|
+
urls: ["/rails_accordion_assets"],
|
14
|
+
root: RailsAccordion::Engine.root.join("public")
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
data/lib/rails_accordion.rb
CHANGED
@@ -7,32 +7,8 @@ loader.ignore("#{__dir__}/generators")
|
|
7
7
|
loader.setup
|
8
8
|
|
9
9
|
module RailsAccordion
|
10
|
-
|
11
|
-
|
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
|
-
class Railtie < Rails::Railtie
|
25
|
-
ActiveSupport.on_load :action_view do
|
26
|
-
include RailsAccordion
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def accordion(**args, &block)
|
31
|
-
render AccordionComponent.new(**args), &block
|
32
|
-
end
|
33
|
-
|
34
|
-
def accordion_item(**args, &block)
|
35
|
-
render ItemComponent.new(**args), &block
|
10
|
+
def self.root
|
11
|
+
RailsAccordion::Engine.routes.find_script_name({})
|
36
12
|
end
|
37
13
|
end
|
38
14
|
|
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.2
|
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,14 @@ 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
|
77
|
+
- app/helpers/rails_accordion/application_helper.rb
|
76
78
|
- app/javascript/controllers/accordion_controller.js
|
77
79
|
- app/javascript/rails_accordion.js
|
80
|
+
- app/views/rails_accordion/_assets.html.erb
|
78
81
|
- bin/console
|
79
82
|
- bin/rails
|
80
83
|
- bin/setup
|
@@ -82,12 +85,10 @@ files:
|
|
82
85
|
- lib/generators/rails_accordion/templates/rails_accordion.tt
|
83
86
|
- lib/rails_accordion.rb
|
84
87
|
- lib/rails_accordion/configuration.rb
|
88
|
+
- lib/rails_accordion/engine.rb
|
85
89
|
- lib/rails_accordion/version.rb
|
86
90
|
- lib/tasks/rails_accordion_tasks.rake
|
87
91
|
- 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
92
|
homepage: https://github.com/Tajbrains/rails_accordion
|
92
93
|
licenses:
|
93
94
|
- MIT
|