active_element 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -0
- data/.strong_versions.yml +2 -0
- data/Gemfile +11 -2
- data/Gemfile.lock +230 -3
- data/Rakefile +1 -0
- data/active_element.gemspec +7 -0
- data/app/assets/config/active_element/manifest.js +2 -0
- data/app/assets/javascripts/active_element/application.js +10 -0
- data/app/assets/javascripts/active_element/confirm.js +67 -0
- data/app/assets/javascripts/active_element/form.js +61 -0
- data/app/assets/javascripts/active_element/json_field.js +316 -0
- data/app/assets/javascripts/active_element/pagination.js +18 -0
- data/app/assets/javascripts/active_element/search_field.js +127 -0
- data/app/assets/javascripts/active_element/secret.js +40 -0
- data/app/assets/javascripts/active_element/setup.js +36 -0
- data/app/assets/javascripts/active_element/theme.js +42 -0
- data/app/assets/stylesheets/active_element/_variables.scss +142 -0
- data/app/assets/stylesheets/active_element/application.scss +77 -0
- data/app/controllers/active_element/application_controller.rb +41 -0
- data/app/controllers/active_element/text_searches_controller.rb +189 -0
- data/app/views/active_element/components/_horizontal_tabs.html.erb +32 -0
- data/app/views/active_element/components/_vertical_tabs.html.erb +38 -0
- data/app/views/active_element/components/button.html.erb +27 -0
- data/app/views/active_element/components/fields/_boolean.html.erb +11 -0
- data/app/views/active_element/components/form/_check_box.html.erb +3 -0
- data/app/views/active_element/components/form/_check_boxes.html.erb +33 -0
- data/app/views/active_element/components/form/_field.html.erb +28 -0
- data/app/views/active_element/components/form/_generic_field.html.erb +3 -0
- data/app/views/active_element/components/form/_json.html.erb +12 -0
- data/app/views/active_element/components/form/_label.html.erb +17 -0
- data/app/views/active_element/components/form/_option_groups_summary.html.erb +17 -0
- data/app/views/active_element/components/form/_select.html.erb +4 -0
- data/app/views/active_element/components/form/_summary.html.erb +40 -0
- data/app/views/active_element/components/form/_templates.html.erb +85 -0
- data/app/views/active_element/components/form/_text_area.html.erb +4 -0
- data/app/views/active_element/components/form/_text_search.html.erb +16 -0
- data/app/views/active_element/components/form.html.erb +78 -0
- data/app/views/active_element/components/json.html.erb +8 -0
- data/app/views/active_element/components/page_description.html.erb +3 -0
- data/app/views/active_element/components/secret/_field.html.erb +1 -0
- data/app/views/active_element/components/secret/_templates.html.erb +11 -0
- data/app/views/active_element/components/table/_collection_row.html.erb +30 -0
- data/app/views/active_element/components/table/_grouped_collection.html.erb +88 -0
- data/app/views/active_element/components/table/_pagination.html.erb +17 -0
- data/app/views/active_element/components/table/_ungrouped_collection.html.erb +49 -0
- data/app/views/active_element/components/table/collection.html.erb +39 -0
- data/app/views/active_element/components/table/item.html.erb +39 -0
- data/app/views/active_element/components/tabs.html.erb +7 -0
- data/app/views/active_element/decorators/_boolean.html.erb +5 -0
- data/app/views/active_element/decorators/_date.html.erb +3 -0
- data/app/views/active_element/decorators/_datetime.html.erb +3 -0
- data/app/views/active_element/decorators/_time.html.erb +3 -0
- data/app/views/active_element/forbidden.html.erb +33 -0
- data/app/views/active_element/main_menu/_item.html.erb +9 -0
- data/app/views/active_element/navbar/_menu.html.erb +30 -0
- data/app/views/active_element/theme/_select.html.erb +1 -0
- data/app/views/active_element/theme/_templates.html.erb +6 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_gap.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +3 -0
- data/app/views/kaminari/_page.html.erb +9 -0
- data/app/views/kaminari/_paginator.html.erb +17 -0
- data/app/views/kaminari/_prev_page.html.erb +3 -0
- data/app/views/layouts/active_element.html.erb +65 -0
- data/app/views/layouts/active_element_error.html.erb +40 -0
- data/config/routes.rb +5 -0
- data/lib/active_element/active_menu_link.rb +80 -0
- data/lib/active_element/active_record_text_search_authorization.rb +12 -0
- data/lib/active_element/colorized_string.rb +33 -0
- data/lib/active_element/component.rb +122 -0
- data/lib/active_element/components/button.rb +156 -0
- data/lib/active_element/components/collection_table.rb +118 -0
- data/lib/active_element/components/form.rb +210 -0
- data/lib/active_element/components/item_table.rb +57 -0
- data/lib/active_element/components/json.rb +31 -0
- data/lib/active_element/components/link_helpers.rb +9 -0
- data/lib/active_element/components/page_description.rb +28 -0
- data/lib/active_element/components/secret_fields.rb +15 -0
- data/lib/active_element/components/tab.rb +37 -0
- data/lib/active_element/components/tabs.rb +35 -0
- data/lib/active_element/components/translations.rb +18 -0
- data/lib/active_element/components/util/association_mapping.rb +80 -0
- data/lib/active_element/components/util/decorator.rb +107 -0
- data/lib/active_element/components/util/display_value_mapping.rb +48 -0
- data/lib/active_element/components/util/field_mapping.rb +144 -0
- data/lib/active_element/components/util/form_field_mapping.rb +104 -0
- data/lib/active_element/components/util/form_value_mapping.rb +49 -0
- data/lib/active_element/components/util/i18n.rb +66 -0
- data/lib/active_element/components/util/record_mapping.rb +111 -0
- data/lib/active_element/components/util.rb +43 -0
- data/lib/active_element/components.rb +20 -0
- data/lib/active_element/controller_action.rb +91 -0
- data/lib/active_element/engine.rb +26 -0
- data/lib/active_element/permissions_check.rb +101 -0
- data/lib/active_element/rails_component.rb +40 -0
- data/lib/active_element/route.rb +112 -0
- data/lib/active_element/routes.rb +62 -0
- data/lib/active_element/version.rb +1 -1
- data/lib/active_element.rb +91 -1
- data/lib/tasks/active_element.rake +23 -0
- data/rspec-documentation/dummy +1 -0
- data/rspec-documentation/pages/Components/Forms.md +1 -0
- data/rspec-documentation/pages/Components/Tables.md +47 -0
- data/rspec-documentation/pages/Components/Tabs.md +1 -0
- data/rspec-documentation/pages/Components.md +1 -0
- data/rspec-documentation/pages/Decorators/Inline Decorators.md +1 -0
- data/rspec-documentation/pages/Decorators/View Decorators.md +1 -0
- data/rspec-documentation/pages/Index.md +3 -0
- data/rspec-documentation/pages/Util/I18n.md +1 -0
- data/rspec-documentation/spec_helper.rb +35 -0
- metadata +191 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26b1ee53510a64cb3215d2fc26b93bea88eb02e6dc9da9ceed48c64af7bdd4eb
|
4
|
+
data.tar.gz: e942cc5ce6c22b456c40aa999304681970bb760a437bafd9a7f65a6365f8a487
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3d5d2b2882d1e3ddcbe4c3d3c3aadd39bac2762148812d463d6e6df81972f54108f3ac43b195525550ea8cf6e19b30cb8e59431033b161b771e2a863f5269f9
|
7
|
+
data.tar.gz: d6d4a623ff93445d973ab43ac94c74eb617f6ab73f3ab49bffee3f9a018bda34acc2e9a020c38f537ca8e49c5d3bb4386ef62102cf7b2e4ce2ba0bb1220cc7b6
|
data/.rubocop.yml
CHANGED
@@ -5,3 +5,15 @@ require:
|
|
5
5
|
|
6
6
|
AllCops:
|
7
7
|
NewCops: enable
|
8
|
+
Exclude:
|
9
|
+
- 'bin/**/*'
|
10
|
+
- 'spec/dummy/bin/**/*'
|
11
|
+
- 'rspec-documentation/**/*'
|
12
|
+
|
13
|
+
RSpec/MultipleMemoizedHelpers:
|
14
|
+
Max: 8
|
15
|
+
|
16
|
+
Metrics/ParameterLists:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/active_element/components/**/*.rb'
|
19
|
+
- 'lib/active_element/active_element_component.rb'
|
data/Gemfile
CHANGED
@@ -5,11 +5,20 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in active_element.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
+
gem 'devise', '~> 4.9'
|
9
|
+
gem 'devpack', '~> 0.4.1'
|
10
|
+
gem 'factory_bot_rails', '~> 5.2'
|
8
11
|
gem 'rake', '~> 13.0'
|
9
|
-
|
10
|
-
gem 'rspec'
|
12
|
+
gem 'rspec', '~> 3.12'
|
13
|
+
gem 'rspec-documentation'
|
14
|
+
gem 'rspec-file_fixtures', '~> 0.1.6'
|
15
|
+
gem 'rspec-html', '~> 0.3.2'
|
16
|
+
gem 'rspec-its', '~> 1.3'
|
17
|
+
gem 'rspec-rails', '~> 6.0'
|
11
18
|
gem 'rubocop', '~> 1.51'
|
12
19
|
gem 'rubocop-rails', '~> 2.19'
|
13
20
|
gem 'rubocop-rake', '~> 0.6.0'
|
14
21
|
gem 'rubocop-rspec', '~> 2.22'
|
22
|
+
gem 'sqlite3', '~> 1.6'
|
15
23
|
gem 'strong_versions', '~> 0.4.5'
|
24
|
+
gem 'webmock', '~> 3.18'
|
data/Gemfile.lock
CHANGED
@@ -2,43 +2,229 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
active_element (0.0.1)
|
5
|
+
bootstrap (~> 5.3.0alpha3)
|
6
|
+
faraday (~> 2.7)
|
7
|
+
kaminari (~> 1.2)
|
8
|
+
rails (~> 6.1)
|
9
|
+
rouge (~> 4.1)
|
10
|
+
sassc (~> 2.4)
|
5
11
|
|
6
12
|
GEM
|
7
13
|
remote: https://rubygems.org/
|
8
14
|
specs:
|
9
|
-
|
15
|
+
actioncable (6.1.7.3)
|
16
|
+
actionpack (= 6.1.7.3)
|
17
|
+
activesupport (= 6.1.7.3)
|
18
|
+
nio4r (~> 2.0)
|
19
|
+
websocket-driver (>= 0.6.1)
|
20
|
+
actionmailbox (6.1.7.3)
|
21
|
+
actionpack (= 6.1.7.3)
|
22
|
+
activejob (= 6.1.7.3)
|
23
|
+
activerecord (= 6.1.7.3)
|
24
|
+
activestorage (= 6.1.7.3)
|
25
|
+
activesupport (= 6.1.7.3)
|
26
|
+
mail (>= 2.7.1)
|
27
|
+
actionmailer (6.1.7.3)
|
28
|
+
actionpack (= 6.1.7.3)
|
29
|
+
actionview (= 6.1.7.3)
|
30
|
+
activejob (= 6.1.7.3)
|
31
|
+
activesupport (= 6.1.7.3)
|
32
|
+
mail (~> 2.5, >= 2.5.4)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
actionpack (6.1.7.3)
|
35
|
+
actionview (= 6.1.7.3)
|
36
|
+
activesupport (= 6.1.7.3)
|
37
|
+
rack (~> 2.0, >= 2.0.9)
|
38
|
+
rack-test (>= 0.6.3)
|
39
|
+
rails-dom-testing (~> 2.0)
|
40
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
41
|
+
actiontext (6.1.7.3)
|
42
|
+
actionpack (= 6.1.7.3)
|
43
|
+
activerecord (= 6.1.7.3)
|
44
|
+
activestorage (= 6.1.7.3)
|
45
|
+
activesupport (= 6.1.7.3)
|
46
|
+
nokogiri (>= 1.8.5)
|
47
|
+
actionview (6.1.7.3)
|
48
|
+
activesupport (= 6.1.7.3)
|
49
|
+
builder (~> 3.1)
|
50
|
+
erubi (~> 1.4)
|
51
|
+
rails-dom-testing (~> 2.0)
|
52
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
53
|
+
activejob (6.1.7.3)
|
54
|
+
activesupport (= 6.1.7.3)
|
55
|
+
globalid (>= 0.3.6)
|
56
|
+
activemodel (6.1.7.3)
|
57
|
+
activesupport (= 6.1.7.3)
|
58
|
+
activerecord (6.1.7.3)
|
59
|
+
activemodel (= 6.1.7.3)
|
60
|
+
activesupport (= 6.1.7.3)
|
61
|
+
activestorage (6.1.7.3)
|
62
|
+
actionpack (= 6.1.7.3)
|
63
|
+
activejob (= 6.1.7.3)
|
64
|
+
activerecord (= 6.1.7.3)
|
65
|
+
activesupport (= 6.1.7.3)
|
66
|
+
marcel (~> 1.0)
|
67
|
+
mini_mime (>= 1.1.0)
|
68
|
+
activesupport (6.1.7.3)
|
10
69
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
11
70
|
i18n (>= 1.6, < 2)
|
12
71
|
minitest (>= 5.1)
|
13
72
|
tzinfo (~> 2.0)
|
73
|
+
zeitwerk (~> 2.3)
|
74
|
+
addressable (2.8.4)
|
75
|
+
public_suffix (>= 2.0.2, < 6.0)
|
14
76
|
ast (2.4.2)
|
77
|
+
autoprefixer-rails (10.4.13.0)
|
78
|
+
execjs (~> 2)
|
79
|
+
bcrypt (3.1.18)
|
80
|
+
bootstrap (5.3.0.alpha3)
|
81
|
+
autoprefixer-rails (>= 9.1.0)
|
82
|
+
popper_js (>= 2.11.7, < 3)
|
83
|
+
sassc-rails (>= 2.0.0)
|
84
|
+
builder (3.2.4)
|
15
85
|
concurrent-ruby (1.2.2)
|
86
|
+
crack (0.4.5)
|
87
|
+
rexml
|
88
|
+
crass (1.0.6)
|
89
|
+
date (3.3.3)
|
90
|
+
devise (4.9.2)
|
91
|
+
bcrypt (~> 3.0)
|
92
|
+
orm_adapter (~> 0.1)
|
93
|
+
railties (>= 4.1.0)
|
94
|
+
responders
|
95
|
+
warden (~> 1.2.3)
|
96
|
+
devpack (0.4.1)
|
16
97
|
diff-lcs (1.5.0)
|
98
|
+
erubi (1.12.0)
|
99
|
+
execjs (2.8.1)
|
100
|
+
factory_bot (5.2.0)
|
101
|
+
activesupport (>= 4.2.0)
|
102
|
+
factory_bot_rails (5.2.0)
|
103
|
+
factory_bot (~> 5.2.0)
|
104
|
+
railties (>= 4.2.0)
|
105
|
+
faraday (2.7.4)
|
106
|
+
faraday-net_http (>= 2.0, < 3.1)
|
107
|
+
ruby2_keywords (>= 0.0.4)
|
108
|
+
faraday-net_http (3.0.2)
|
109
|
+
ffi (1.15.5)
|
110
|
+
globalid (1.1.0)
|
111
|
+
activesupport (>= 5.0)
|
112
|
+
hashdiff (1.0.1)
|
17
113
|
i18n (1.13.0)
|
18
114
|
concurrent-ruby (~> 1.0)
|
19
115
|
json (2.6.3)
|
116
|
+
kaminari (1.2.2)
|
117
|
+
activesupport (>= 4.1.0)
|
118
|
+
kaminari-actionview (= 1.2.2)
|
119
|
+
kaminari-activerecord (= 1.2.2)
|
120
|
+
kaminari-core (= 1.2.2)
|
121
|
+
kaminari-actionview (1.2.2)
|
122
|
+
actionview
|
123
|
+
kaminari-core (= 1.2.2)
|
124
|
+
kaminari-activerecord (1.2.2)
|
125
|
+
activerecord
|
126
|
+
kaminari-core (= 1.2.2)
|
127
|
+
kaminari-core (1.2.2)
|
128
|
+
loofah (2.21.3)
|
129
|
+
crass (~> 1.0.2)
|
130
|
+
nokogiri (>= 1.12.0)
|
131
|
+
mail (2.8.1)
|
132
|
+
mini_mime (>= 0.1.1)
|
133
|
+
net-imap
|
134
|
+
net-pop
|
135
|
+
net-smtp
|
136
|
+
marcel (1.0.2)
|
137
|
+
method_source (1.0.0)
|
138
|
+
mini_mime (1.1.2)
|
139
|
+
mini_portile2 (2.8.2)
|
20
140
|
minitest (5.18.0)
|
141
|
+
net-imap (0.3.4)
|
142
|
+
date
|
143
|
+
net-protocol
|
144
|
+
net-pop (0.1.2)
|
145
|
+
net-protocol
|
146
|
+
net-protocol (0.2.1)
|
147
|
+
timeout
|
148
|
+
net-smtp (0.3.3)
|
149
|
+
net-protocol
|
150
|
+
nio4r (2.5.9)
|
151
|
+
nokogiri (1.15.1)
|
152
|
+
mini_portile2 (~> 2.8.2)
|
153
|
+
racc (~> 1.4)
|
154
|
+
orm_adapter (0.5.0)
|
21
155
|
paint (2.3.0)
|
22
156
|
parallel (1.23.0)
|
23
157
|
parser (3.2.2.1)
|
24
158
|
ast (~> 2.4.1)
|
25
|
-
|
159
|
+
popper_js (2.11.7)
|
160
|
+
public_suffix (5.0.1)
|
161
|
+
racc (1.6.2)
|
162
|
+
rack (2.2.7)
|
163
|
+
rack-test (2.1.0)
|
164
|
+
rack (>= 1.3)
|
165
|
+
rails (6.1.7.3)
|
166
|
+
actioncable (= 6.1.7.3)
|
167
|
+
actionmailbox (= 6.1.7.3)
|
168
|
+
actionmailer (= 6.1.7.3)
|
169
|
+
actionpack (= 6.1.7.3)
|
170
|
+
actiontext (= 6.1.7.3)
|
171
|
+
actionview (= 6.1.7.3)
|
172
|
+
activejob (= 6.1.7.3)
|
173
|
+
activemodel (= 6.1.7.3)
|
174
|
+
activerecord (= 6.1.7.3)
|
175
|
+
activestorage (= 6.1.7.3)
|
176
|
+
activesupport (= 6.1.7.3)
|
177
|
+
bundler (>= 1.15.0)
|
178
|
+
railties (= 6.1.7.3)
|
179
|
+
sprockets-rails (>= 2.0.0)
|
180
|
+
rails-dom-testing (2.0.3)
|
181
|
+
activesupport (>= 4.2.0)
|
182
|
+
nokogiri (>= 1.6)
|
183
|
+
rails-html-sanitizer (1.5.0)
|
184
|
+
loofah (~> 2.19, >= 2.19.1)
|
185
|
+
railties (6.1.7.3)
|
186
|
+
actionpack (= 6.1.7.3)
|
187
|
+
activesupport (= 6.1.7.3)
|
188
|
+
method_source
|
189
|
+
rake (>= 12.2)
|
190
|
+
thor (~> 1.0)
|
26
191
|
rainbow (3.1.1)
|
27
192
|
rake (13.0.6)
|
28
193
|
regexp_parser (2.8.0)
|
194
|
+
responders (3.1.0)
|
195
|
+
actionpack (>= 5.2)
|
196
|
+
railties (>= 5.2)
|
29
197
|
rexml (3.2.5)
|
198
|
+
rouge (4.1.1)
|
30
199
|
rspec (3.12.0)
|
31
200
|
rspec-core (~> 3.12.0)
|
32
201
|
rspec-expectations (~> 3.12.0)
|
33
202
|
rspec-mocks (~> 3.12.0)
|
34
203
|
rspec-core (3.12.2)
|
35
204
|
rspec-support (~> 3.12.0)
|
205
|
+
rspec-documentation (0.0.1)
|
36
206
|
rspec-expectations (3.12.3)
|
37
207
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
208
|
rspec-support (~> 3.12.0)
|
209
|
+
rspec-file_fixtures (0.1.6)
|
210
|
+
rspec (~> 3.0)
|
211
|
+
rspec-html (0.3.2)
|
212
|
+
nokogiri (~> 1.10)
|
213
|
+
rspec (~> 3.0)
|
214
|
+
rspec-its (1.3.0)
|
215
|
+
rspec-core (>= 3.0.0)
|
216
|
+
rspec-expectations (>= 3.0.0)
|
39
217
|
rspec-mocks (3.12.5)
|
40
218
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
219
|
rspec-support (~> 3.12.0)
|
220
|
+
rspec-rails (6.0.2)
|
221
|
+
actionpack (>= 6.1)
|
222
|
+
activesupport (>= 6.1)
|
223
|
+
railties (>= 6.1)
|
224
|
+
rspec-core (~> 3.12)
|
225
|
+
rspec-expectations (~> 3.12)
|
226
|
+
rspec-mocks (~> 3.12)
|
227
|
+
rspec-support (~> 3.12)
|
42
228
|
rspec-support (3.12.0)
|
43
229
|
rubocop (1.51.0)
|
44
230
|
json (~> 2.3)
|
@@ -67,25 +253,66 @@ GEM
|
|
67
253
|
rubocop-capybara (~> 2.17)
|
68
254
|
rubocop-factory_bot (~> 2.22)
|
69
255
|
ruby-progressbar (1.13.0)
|
256
|
+
ruby2_keywords (0.0.5)
|
257
|
+
sassc (2.4.0)
|
258
|
+
ffi (~> 1.9)
|
259
|
+
sassc-rails (2.1.2)
|
260
|
+
railties (>= 4.0.0)
|
261
|
+
sassc (>= 2.0)
|
262
|
+
sprockets (> 3.0)
|
263
|
+
sprockets-rails
|
264
|
+
tilt
|
265
|
+
sprockets (4.2.0)
|
266
|
+
concurrent-ruby (~> 1.0)
|
267
|
+
rack (>= 2.2.4, < 4)
|
268
|
+
sprockets-rails (3.4.2)
|
269
|
+
actionpack (>= 5.2)
|
270
|
+
activesupport (>= 5.2)
|
271
|
+
sprockets (>= 3.0.0)
|
272
|
+
sqlite3 (1.6.3)
|
273
|
+
mini_portile2 (~> 2.8.0)
|
70
274
|
strong_versions (0.4.5)
|
71
275
|
i18n (>= 0.5)
|
72
276
|
paint (~> 2.0)
|
277
|
+
thor (1.2.2)
|
278
|
+
tilt (2.1.0)
|
279
|
+
timeout (0.3.2)
|
73
280
|
tzinfo (2.0.6)
|
74
281
|
concurrent-ruby (~> 1.0)
|
75
282
|
unicode-display_width (2.4.2)
|
283
|
+
warden (1.2.9)
|
284
|
+
rack (>= 2.0.9)
|
285
|
+
webmock (3.18.1)
|
286
|
+
addressable (>= 2.8.0)
|
287
|
+
crack (>= 0.3.2)
|
288
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
289
|
+
websocket-driver (0.7.5)
|
290
|
+
websocket-extensions (>= 0.1.0)
|
291
|
+
websocket-extensions (0.1.5)
|
292
|
+
zeitwerk (2.6.8)
|
76
293
|
|
77
294
|
PLATFORMS
|
78
295
|
ruby
|
79
296
|
|
80
297
|
DEPENDENCIES
|
81
298
|
active_element!
|
299
|
+
devise (~> 4.9)
|
300
|
+
devpack (~> 0.4.1)
|
301
|
+
factory_bot_rails (~> 5.2)
|
82
302
|
rake (~> 13.0)
|
83
|
-
rspec (~> 3.
|
303
|
+
rspec (~> 3.12)
|
304
|
+
rspec-documentation
|
305
|
+
rspec-file_fixtures (~> 0.1.6)
|
306
|
+
rspec-html (~> 0.3.2)
|
307
|
+
rspec-its (~> 1.3)
|
308
|
+
rspec-rails (~> 6.0)
|
84
309
|
rubocop (~> 1.51)
|
85
310
|
rubocop-rails (~> 2.19)
|
86
311
|
rubocop-rake (~> 0.6.0)
|
87
312
|
rubocop-rspec (~> 2.22)
|
313
|
+
sqlite3 (~> 1.6)
|
88
314
|
strong_versions (~> 0.4.5)
|
315
|
+
webmock (~> 3.18)
|
89
316
|
|
90
317
|
BUNDLED WITH
|
91
318
|
2.1.4
|
data/Rakefile
CHANGED
data/active_element.gemspec
CHANGED
@@ -29,4 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
32
|
+
|
33
|
+
spec.add_runtime_dependency 'bootstrap', '~> 5.3.0alpha3'
|
34
|
+
spec.add_runtime_dependency 'faraday', '~> 2.7'
|
35
|
+
spec.add_runtime_dependency 'kaminari', '~> 1.2'
|
36
|
+
spec.add_runtime_dependency 'rails', '~> 6.1'
|
37
|
+
spec.add_runtime_dependency 'rouge', '~> 4.1'
|
38
|
+
spec.add_runtime_dependency 'sassc', '~> 2.4'
|
32
39
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
//= require rails-ujs
|
2
|
+
//= require bootstrap
|
3
|
+
//= require active_element/setup
|
4
|
+
//= require active_element/theme
|
5
|
+
//= require active_element/secret
|
6
|
+
//= require active_element/json_field
|
7
|
+
//= require active_element/search_field
|
8
|
+
//= require active_element/form
|
9
|
+
//= require active_element/confirm
|
10
|
+
//= require active_element/pagination
|
@@ -0,0 +1,67 @@
|
|
1
|
+
(() => {
|
2
|
+
const cloneElement = (id) => ActiveElement.cloneElement('form', id);
|
3
|
+
|
4
|
+
window.addEventListener('DOMContentLoaded', () => {
|
5
|
+
const confirmLinks = document.querySelectorAll('[data-confirm-action="true"]');
|
6
|
+
|
7
|
+
confirmLinks.forEach((element) => {
|
8
|
+
const modal = cloneElement('modal');
|
9
|
+
const modalDialog = modal.querySelector('.modal-dialog');
|
10
|
+
const modalBody = modal.querySelector('[data-field-type="modal-body"]');
|
11
|
+
const modalFooter = modal.querySelector('[data-field-type="modal-footer"]');
|
12
|
+
const bootstrapModal = new bootstrap.Modal(modal);
|
13
|
+
const title = 'Confirm';
|
14
|
+
const titleElement = modal.querySelector('[data-field-type="modal-title"]');
|
15
|
+
const confirmButton = cloneElement('confirm-button');
|
16
|
+
const confirmButtonLink = confirmButton.querySelector('a');
|
17
|
+
const cancelButton = cloneElement('cancel-button');
|
18
|
+
const cancelButtonLink = confirmButton.querySelector('a');
|
19
|
+
|
20
|
+
element.dataset.actionConfirmed = 'false';
|
21
|
+
titleElement.append(title);
|
22
|
+
modalDialog.classList.remove('modal-xl');
|
23
|
+
modalBody.append('Are you sure you want to perform this action?');
|
24
|
+
modalFooter.append(cancelButton);
|
25
|
+
modalFooter.append(confirmButton);
|
26
|
+
|
27
|
+
|
28
|
+
if (element.dataset.method === 'delete') {
|
29
|
+
confirmButtonLink.classList.remove('btn-primary');
|
30
|
+
confirmButtonLink.classList.add('btn-danger');
|
31
|
+
}
|
32
|
+
|
33
|
+
cancelButton.addEventListener('click', (ev) => {
|
34
|
+
ev.stopPropagation();
|
35
|
+
ev.preventDefault();
|
36
|
+
|
37
|
+
bootstrapModal.hide();
|
38
|
+
|
39
|
+
return false;
|
40
|
+
});
|
41
|
+
|
42
|
+
confirmButtonLink.addEventListener('click', (ev) => {
|
43
|
+
ev.stopPropagation();
|
44
|
+
ev.preventDefault();
|
45
|
+
|
46
|
+
element.dataset.actionConfirmed = 'true';
|
47
|
+
element.click();
|
48
|
+
|
49
|
+
return false;
|
50
|
+
});
|
51
|
+
|
52
|
+
element.addEventListener('click', (ev) => {
|
53
|
+
if (element.dataset.actionConfirmed === 'true') {
|
54
|
+
element.dataset.actionConfirmed = 'false';
|
55
|
+
|
56
|
+
return true;
|
57
|
+
}
|
58
|
+
|
59
|
+
ev.stopPropagation();
|
60
|
+
ev.preventDefault();
|
61
|
+
bootstrapModal.show();
|
62
|
+
|
63
|
+
return false;
|
64
|
+
});
|
65
|
+
});
|
66
|
+
});
|
67
|
+
})();
|
@@ -0,0 +1,61 @@
|
|
1
|
+
(() => {
|
2
|
+
const cloneElement = (id) => ActiveElement.cloneElement('form', id);
|
3
|
+
|
4
|
+
const initExpandButtons = () => {
|
5
|
+
document.querySelectorAll('[data-field-type="form-expand"]').forEach((element) => {
|
6
|
+
const formId = element.dataset.formId;
|
7
|
+
const form = document.querySelector(`#${formId}`);
|
8
|
+
const wrapper = document.querySelector(`#form-wrapper-${formId}`);
|
9
|
+
const expandButton = cloneElement('expand-button');
|
10
|
+
const collapseButton = cloneElement('collapse-button');
|
11
|
+
|
12
|
+
collapseButton.classList.add('d-none');
|
13
|
+
wrapper.classList.add('collapsed');
|
14
|
+
|
15
|
+
const toggle = ({ show, ev }) => {
|
16
|
+
ev.stopPropagation();
|
17
|
+
form.classList.remove('d-none');
|
18
|
+
collapseButton.classList.toggle('d-none');
|
19
|
+
expandButton.classList.toggle('d-none');
|
20
|
+
wrapper.classList.toggle('collapsed');
|
21
|
+
|
22
|
+
return false;
|
23
|
+
};
|
24
|
+
|
25
|
+
expandButton.addEventListener('click', (ev) => toggle({ show: true, ev }));
|
26
|
+
collapseButton.addEventListener('click', (ev) => toggle({ show: false, ev }));
|
27
|
+
|
28
|
+
element.append(expandButton);
|
29
|
+
element.append(collapseButton);
|
30
|
+
});
|
31
|
+
};
|
32
|
+
|
33
|
+
const initPopupButtons = () => {
|
34
|
+
document.querySelectorAll('[data-field-type="form-modal"]').forEach((element) => {
|
35
|
+
const formId = element.dataset.formId;
|
36
|
+
const form = document.querySelector(`#${formId}`);
|
37
|
+
const wrapper = document.querySelector(`#form-wrapper-${formId}`);
|
38
|
+
const modal = cloneElement('modal');
|
39
|
+
const modalBody = modal.querySelector('[data-field-type="modal-body"]');
|
40
|
+
const bootstrapModal = new bootstrap.Modal(modal);
|
41
|
+
const title = element.dataset.formTitle;
|
42
|
+
const titleElement = modal.querySelector('[data-field-type="modal-title"]');
|
43
|
+
titleElement.append(title);
|
44
|
+
|
45
|
+
modalBody.append(form);
|
46
|
+
|
47
|
+
document.body.append(modal);
|
48
|
+
|
49
|
+
element.addEventListener('click', () => {
|
50
|
+
wrapper.classList.remove('d-none');
|
51
|
+
bootstrapModal.toggle();
|
52
|
+
return false;
|
53
|
+
});
|
54
|
+
});
|
55
|
+
};
|
56
|
+
|
57
|
+
window.addEventListener('DOMContentLoaded', () => {
|
58
|
+
initExpandButtons();
|
59
|
+
initPopupButtons();
|
60
|
+
});
|
61
|
+
})();
|