active_element 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -2
  3. data/.strong_versions.yml +1 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +108 -75
  6. data/Makefile +10 -0
  7. data/active_element.gemspec +1 -1
  8. data/app/assets/javascripts/active_element/application.js +1 -0
  9. data/app/assets/javascripts/active_element/form.js +16 -32
  10. data/app/assets/javascripts/active_element/json_field.js +391 -135
  11. data/app/assets/javascripts/active_element/setup.js +13 -8
  12. data/app/assets/javascripts/active_element/text_search_field.js +27 -28
  13. data/app/assets/javascripts/active_element/theme.js +1 -1
  14. data/app/assets/javascripts/active_element/timezones.js +6 -0
  15. data/app/assets/stylesheets/active_element/_dark.scss +86 -0
  16. data/app/assets/stylesheets/active_element/_variables.scss +2 -1
  17. data/app/assets/stylesheets/active_element/application.scss +166 -33
  18. data/app/controllers/active_element/application_controller.rb +5 -0
  19. data/app/controllers/concerns/active_element/default_controller_actions.rb +38 -0
  20. data/app/views/active_element/_user.html.erb +20 -0
  21. data/app/views/active_element/components/fields/_json.html.erb +24 -0
  22. data/app/views/active_element/components/form/_check_box.html.erb +1 -0
  23. data/app/views/active_element/components/form/_check_boxes.html.erb +1 -1
  24. data/app/views/active_element/components/form/_datetime_range_field.html.erb +14 -0
  25. data/app/views/active_element/components/form/_field.html.erb +10 -7
  26. data/app/views/active_element/components/form/_generic_field.html.erb +1 -0
  27. data/app/views/active_element/components/form/_json.html.erb +10 -2
  28. data/app/views/active_element/components/form/_label.html.erb +12 -1
  29. data/app/views/active_element/components/form/_select.html.erb +4 -1
  30. data/app/views/active_element/components/form/_summary.html.erb +11 -1
  31. data/app/views/active_element/components/form/_templates.html.erb +37 -22
  32. data/app/views/active_element/components/form/_text_area.html.erb +2 -1
  33. data/app/views/active_element/components/form/_text_search.html.erb +7 -3
  34. data/app/views/active_element/components/form.html.erb +20 -17
  35. data/app/views/active_element/components/json.html.erb +1 -0
  36. data/app/views/active_element/components/navbar.html.erb +26 -0
  37. data/app/views/active_element/components/table/_collection_row.html.erb +2 -1
  38. data/app/views/active_element/components/table/_field.html.erb +8 -0
  39. data/app/views/active_element/components/table/collection.html.erb +1 -1
  40. data/app/views/active_element/components/table/item.html.erb +5 -4
  41. data/app/views/active_element/default_views/edit.html.erb +5 -0
  42. data/app/views/active_element/default_views/index.html.erb +15 -0
  43. data/app/views/active_element/default_views/new.html.erb +4 -0
  44. data/app/views/active_element/default_views/show.html.erb +7 -0
  45. data/app/views/active_element/navbar/_menu.html.erb +1 -30
  46. data/app/views/active_element/theme/_select.html.erb +1 -1
  47. data/app/views/layouts/active_element.html.erb +16 -1
  48. data/config/brakeman.ignore +48 -0
  49. data/example_app/.gitattributes +7 -0
  50. data/example_app/.gitignore +35 -0
  51. data/example_app/.ruby-version +1 -0
  52. data/example_app/Gemfile +34 -0
  53. data/example_app/Gemfile.lock +296 -0
  54. data/example_app/README.md +24 -0
  55. data/example_app/Rakefile +6 -0
  56. data/example_app/app/assets/config/manifest.js +4 -0
  57. data/example_app/app/assets/images/.keep +0 -0
  58. data/example_app/app/assets/stylesheets/application.css +15 -0
  59. data/example_app/app/channels/application_cable/channel.rb +4 -0
  60. data/example_app/app/channels/application_cable/connection.rb +4 -0
  61. data/example_app/app/controllers/application_controller.rb +12 -0
  62. data/example_app/app/controllers/concerns/.keep +0 -0
  63. data/example_app/app/controllers/pets_controller.rb +6 -0
  64. data/example_app/app/controllers/users_controller.rb +6 -0
  65. data/example_app/app/helpers/application_helper.rb +2 -0
  66. data/example_app/app/javascript/application.js +3 -0
  67. data/example_app/app/javascript/controllers/application.js +9 -0
  68. data/example_app/app/javascript/controllers/hello_controller.js +7 -0
  69. data/example_app/app/javascript/controllers/index.js +11 -0
  70. data/example_app/app/jobs/application_job.rb +7 -0
  71. data/example_app/app/mailers/application_mailer.rb +4 -0
  72. data/example_app/app/models/application_record.rb +3 -0
  73. data/example_app/app/models/concerns/.keep +0 -0
  74. data/example_app/app/models/pet.rb +3 -0
  75. data/example_app/app/models/user.rb +8 -0
  76. data/example_app/app/views/layouts/application.html.erb +16 -0
  77. data/example_app/app/views/layouts/mailer.html.erb +13 -0
  78. data/example_app/app/views/layouts/mailer.text.erb +1 -0
  79. data/example_app/app/views/pets/index.html.erb +3 -0
  80. data/example_app/app/views/users/show.html.erb +3 -0
  81. data/example_app/bin/bundle +109 -0
  82. data/example_app/bin/importmap +4 -0
  83. data/example_app/bin/rails +4 -0
  84. data/example_app/bin/rake +4 -0
  85. data/example_app/bin/setup +33 -0
  86. data/example_app/config/application.rb +22 -0
  87. data/example_app/config/boot.rb +4 -0
  88. data/example_app/config/cable.yml +10 -0
  89. data/example_app/config/credentials.yml.enc +1 -0
  90. data/example_app/config/database.yml +25 -0
  91. data/example_app/config/environment.rb +5 -0
  92. data/example_app/config/environments/development.rb +70 -0
  93. data/example_app/config/environments/production.rb +93 -0
  94. data/example_app/config/environments/test.rb +60 -0
  95. data/example_app/config/importmap.rb +7 -0
  96. data/example_app/config/initializers/assets.rb +12 -0
  97. data/example_app/config/initializers/content_security_policy.rb +25 -0
  98. data/example_app/config/initializers/devise.rb +16 -0
  99. data/example_app/config/initializers/filter_parameter_logging.rb +8 -0
  100. data/example_app/config/initializers/inflections.rb +16 -0
  101. data/example_app/config/initializers/permissions_policy.rb +11 -0
  102. data/example_app/config/locales/devise.en.yml +65 -0
  103. data/example_app/config/locales/en.yml +33 -0
  104. data/example_app/config/puma.rb +43 -0
  105. data/example_app/config/routes.rb +8 -0
  106. data/example_app/config/storage.yml +34 -0
  107. data/example_app/config.ru +6 -0
  108. data/example_app/db/migrate/20230616210539_create_pet.rb +12 -0
  109. data/example_app/db/migrate/20230616211328_devise_create_users.rb +46 -0
  110. data/example_app/db/schema.rb +37 -0
  111. data/example_app/db/seeds.rb +33 -0
  112. data/example_app/lib/assets/.keep +0 -0
  113. data/example_app/lib/tasks/.keep +0 -0
  114. data/example_app/log/.keep +0 -0
  115. data/example_app/public/404.html +67 -0
  116. data/example_app/public/422.html +67 -0
  117. data/example_app/public/500.html +66 -0
  118. data/example_app/public/apple-touch-icon-precomposed.png +0 -0
  119. data/example_app/public/apple-touch-icon.png +0 -0
  120. data/example_app/public/favicon.ico +0 -0
  121. data/example_app/public/robots.txt +1 -0
  122. data/example_app/storage/.keep +0 -0
  123. data/example_app/test/application_system_test_case.rb +5 -0
  124. data/example_app/test/channels/application_cable/connection_test.rb +11 -0
  125. data/example_app/test/controllers/.keep +0 -0
  126. data/example_app/test/fixtures/files/.keep +0 -0
  127. data/example_app/test/fixtures/users.yml +11 -0
  128. data/example_app/test/helpers/.keep +0 -0
  129. data/example_app/test/integration/.keep +0 -0
  130. data/example_app/test/mailers/.keep +0 -0
  131. data/example_app/test/models/.keep +0 -0
  132. data/example_app/test/models/user_test.rb +7 -0
  133. data/example_app/test/system/.keep +0 -0
  134. data/example_app/test/test_helper.rb +13 -0
  135. data/example_app/tmp/.keep +0 -0
  136. data/example_app/tmp/pids/.keep +0 -0
  137. data/example_app/tmp/storage/.keep +0 -0
  138. data/example_app/vendor/.keep +0 -0
  139. data/example_app/vendor/javascript/.keep +0 -0
  140. data/lib/active_element/component.rb +9 -2
  141. data/lib/active_element/components/collection_table.rb +9 -2
  142. data/lib/active_element/components/email_fields.rb +14 -0
  143. data/lib/active_element/components/form.rb +48 -17
  144. data/lib/active_element/components/navbar.rb +64 -0
  145. data/lib/active_element/components/phone_fields.rb +14 -0
  146. data/lib/active_element/components/text_search/authorization.rb +9 -6
  147. data/lib/active_element/components/text_search/component.rb +4 -2
  148. data/lib/active_element/components/text_search.rb +4 -0
  149. data/lib/active_element/components/util/association_mapping.rb +74 -19
  150. data/lib/active_element/components/util/display_value_mapping.rb +13 -4
  151. data/lib/active_element/components/util/form_field_mapping.rb +127 -10
  152. data/lib/active_element/components/util/form_value_mapping.rb +3 -3
  153. data/lib/active_element/components/util/i18n.rb +1 -1
  154. data/lib/active_element/components/util/record_mapping.rb +43 -11
  155. data/lib/active_element/components/util/record_path.rb +21 -4
  156. data/lib/active_element/components/util.rb +12 -5
  157. data/lib/active_element/components.rb +3 -0
  158. data/lib/active_element/controller_action.rb +8 -2
  159. data/lib/active_element/controller_interface.rb +47 -5
  160. data/lib/active_element/default_controller.rb +93 -0
  161. data/lib/active_element/default_record_params.rb +62 -0
  162. data/lib/active_element/default_text_search.rb +110 -0
  163. data/lib/active_element/json_field_schema.rb +59 -0
  164. data/lib/active_element/pre_render_processors/json.rb +98 -0
  165. data/lib/active_element/pre_render_processors.rb +11 -0
  166. data/lib/active_element/route.rb +12 -0
  167. data/lib/active_element/routes.rb +2 -1
  168. data/lib/active_element/version.rb +1 -1
  169. data/lib/active_element.rb +14 -32
  170. data/lib/tasks/active_element.rake +12 -1
  171. data/rspec-documentation/_head.html.erb +34 -0
  172. data/rspec-documentation/pages/000-Introduction.md +18 -0
  173. data/rspec-documentation/pages/005-Setup.md +75 -0
  174. data/rspec-documentation/pages/010-Components/Form Fields/Check Boxes.md +1 -0
  175. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Controller Params.md +97 -0
  176. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Schema.md +283 -0
  177. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Types.md +36 -0
  178. data/rspec-documentation/pages/010-Components/Form Fields/JSON.md +70 -0
  179. data/rspec-documentation/pages/010-Components/Form Fields/Text Search.md +133 -0
  180. data/rspec-documentation/pages/010-Components/Form Fields.md +46 -0
  181. data/rspec-documentation/pages/010-Components/Forms.md +44 -0
  182. data/rspec-documentation/pages/010-Components/JSON Data.md +23 -0
  183. data/rspec-documentation/pages/010-Components/Navbar.md +56 -0
  184. data/rspec-documentation/pages/010-Components/Page Section Title.md +13 -0
  185. data/rspec-documentation/pages/010-Components/Page Subtitle.md +11 -0
  186. data/rspec-documentation/pages/010-Components/Page Title.md +11 -0
  187. data/rspec-documentation/pages/010-Components/Tables/Collection Table.md +29 -0
  188. data/rspec-documentation/pages/010-Components/Tables/Item Table.md +18 -0
  189. data/rspec-documentation/pages/010-Components/Tables/Options.md +19 -0
  190. data/rspec-documentation/pages/010-Components/Tables.md +29 -0
  191. data/rspec-documentation/pages/010-Components.md +15 -0
  192. data/rspec-documentation/pages/020-Access Control/010-Authentication.md +20 -0
  193. data/rspec-documentation/pages/020-Access Control/020-Authorization/Environments.md +9 -0
  194. data/rspec-documentation/pages/020-Access Control/020-Authorization/Permissions/Custom Routes.md +41 -0
  195. data/rspec-documentation/pages/020-Access Control/020-Authorization/Permissions.md +58 -0
  196. data/rspec-documentation/pages/020-Access Control/020-Authorization/Setup.md +27 -0
  197. data/rspec-documentation/pages/020-Access Control/020-Authorization.md +11 -0
  198. data/rspec-documentation/pages/020-Access Control.md +31 -0
  199. data/rspec-documentation/pages/040-Decorators/Inline Decorators.md +24 -0
  200. data/rspec-documentation/pages/040-Decorators/View Decorators.md +55 -0
  201. data/rspec-documentation/pages/040-Decorators.md +12 -0
  202. data/rspec-documentation/pages/300-Alternatives.md +21 -0
  203. data/rspec-documentation/pages/900-License.md +11 -0
  204. data/rspec-documentation/spec_helper.rb +53 -16
  205. data/rspec-documentation/support.rb +84 -0
  206. metadata +155 -14
  207. data/rspec-documentation/pages/Components/Forms.md +0 -1
  208. data/rspec-documentation/pages/Components/Tables.md +0 -47
  209. data/rspec-documentation/pages/Components.md +0 -1
  210. data/rspec-documentation/pages/Decorators/Inline Decorators.md +0 -1
  211. data/rspec-documentation/pages/Decorators/View Decorators.md +0 -1
  212. data/rspec-documentation/pages/Index.md +0 -3
  213. data/rspec-documentation/pages/Util/I18n.md +0 -1
  214. /data/rspec-documentation/pages/{Components → 010-Components}/Tabs.md +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bb5a62660b8be1c2159d39aa81322af18d9f2df93306fe320853edec9e11cfe
4
- data.tar.gz: 22e6d034873936f67c4bd674865119caf232b5894864dae02a1a21ecfddd331e
3
+ metadata.gz: 59c0c229f1a2c98d33fbcb36bfac256d0c41a03ae5149f2134736830eed704f5
4
+ data.tar.gz: 25f487e038544884b13f224e7fbed2a831584b60b704900e5dae1f17082667c1
5
5
  SHA512:
6
- metadata.gz: 662fbfb4a5e57396e6577f8b7d014fc1e47d9cc40481c13b20d21679ad5f2cb44822df29e07e0bf1cb086057dfacb219070e920bb083e9a91e2a470ee4709bad
7
- data.tar.gz: dced5cd83abd57790c0908b13a175816b6a686a9ace98ff00017e4c3f7e876b88d3aeea5527d8d8753c3687a700a48e6e2c77f5db1aba84361774fae50b9a1e0
6
+ metadata.gz: ca8865cdf14f3f7aad1c7935661a31b61a8de6e97928262d6a39a468e195934958f766e87e021c110e7c23369aa15c61e304bf375fb3ed7adef89f4532d36962
7
+ data.tar.gz: aaa94959dfaddb83889c62bc5899a109394a1688428186c12550b29fc21d013852deaa37d8167165e48e831a636ed58e50a90a88f71c9e77ca04595619435910
data/.rubocop.yml CHANGED
@@ -3,13 +3,15 @@ require:
3
3
  - rubocop-rspec
4
4
  - rubocop-rails
5
5
  - rubocop-factory_bot
6
+ - rubocop-rspec-documentation
6
7
 
7
8
  AllCops:
8
9
  NewCops: enable
9
10
  Exclude:
10
11
  - 'bin/**/*'
11
- - 'spec/dummy/bin/**/*'
12
- - 'rspec-documentation/**/*'
12
+ - 'rspec-documentation/dummy/**/*'
13
+ - 'example_app/**/*'
14
+ - 'spec/dummy/**/*'
13
15
 
14
16
  RSpec/MultipleMemoizedHelpers:
15
17
  Max: 8
@@ -18,3 +20,11 @@ Metrics/ParameterLists:
18
20
  Exclude:
19
21
  - 'lib/active_element/components/**/*.rb'
20
22
  - 'lib/active_element/active_element_component.rb'
23
+
24
+ Style/SymbolArray:
25
+ Exclude:
26
+ - 'rspec-documentation/pages/**/*.md'
27
+
28
+ Style/Style/WordArray:
29
+ Exclude:
30
+ - 'rspec-documentation/pages/**/*.md'
data/.strong_versions.yml CHANGED
@@ -1,2 +1,3 @@
1
1
  ignore:
2
2
  - bootstrap
3
+ - rails
data/Gemfile CHANGED
@@ -5,11 +5,14 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in active_element.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'brakeman', '~> 5.4'
8
9
  gem 'devise', '~> 4.9'
9
10
  gem 'devpack', '~> 0.4.1'
10
11
  gem 'factory_bot_rails', '~> 5.2'
12
+ gem 'faker', '~> 2.23'
11
13
  gem 'rake', '~> 13.0'
12
14
  gem 'rspec', '~> 3.12'
15
+ gem 'rspec-documentation', '~> 0.0.9'
13
16
  gem 'rspec-file_fixtures', '~> 0.1.6'
14
17
  gem 'rspec-html', '~> 0.3.2'
15
18
  gem 'rspec-its', '~> 1.3'
@@ -18,6 +21,7 @@ gem 'rubocop', '~> 1.51'
18
21
  gem 'rubocop-rails', '~> 2.19'
19
22
  gem 'rubocop-rake', '~> 0.6.0'
20
23
  gem 'rubocop-rspec', '~> 2.22'
24
+ gem 'rubocop-rspec-documentation', '~> 0.0.2'
21
25
  gem 'sqlite3', '~> 1.6'
22
26
  gem 'strong_versions', '~> 0.4.5'
23
27
  gem 'webmock', '~> 3.18'
data/Gemfile.lock CHANGED
@@ -1,76 +1,82 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_element (0.0.10)
4
+ active_element (0.0.11)
5
5
  bootstrap (~> 5.3.0alpha3)
6
6
  kaminari (~> 1.2)
7
7
  paintbrush (~> 0.1.2)
8
- rails (~> 6.1)
8
+ rails (>= 6.0)
9
9
  rouge (~> 4.1)
10
10
  sassc (~> 2.4)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- actioncable (6.1.7.3)
16
- actionpack (= 6.1.7.3)
17
- activesupport (= 6.1.7.3)
15
+ actioncable (7.0.5)
16
+ actionpack (= 7.0.5)
17
+ activesupport (= 7.0.5)
18
18
  nio4r (~> 2.0)
19
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)
20
+ actionmailbox (7.0.5)
21
+ actionpack (= 7.0.5)
22
+ activejob (= 7.0.5)
23
+ activerecord (= 7.0.5)
24
+ activestorage (= 7.0.5)
25
+ activesupport (= 7.0.5)
26
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)
27
+ net-imap
28
+ net-pop
29
+ net-smtp
30
+ actionmailer (7.0.5)
31
+ actionpack (= 7.0.5)
32
+ actionview (= 7.0.5)
33
+ activejob (= 7.0.5)
34
+ activesupport (= 7.0.5)
32
35
  mail (~> 2.5, >= 2.5.4)
36
+ net-imap
37
+ net-pop
38
+ net-smtp
33
39
  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)
40
+ actionpack (7.0.5)
41
+ actionview (= 7.0.5)
42
+ activesupport (= 7.0.5)
43
+ rack (~> 2.0, >= 2.2.4)
38
44
  rack-test (>= 0.6.3)
39
45
  rails-dom-testing (~> 2.0)
40
46
  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)
47
+ actiontext (7.0.5)
48
+ actionpack (= 7.0.5)
49
+ activerecord (= 7.0.5)
50
+ activestorage (= 7.0.5)
51
+ activesupport (= 7.0.5)
52
+ globalid (>= 0.6.0)
46
53
  nokogiri (>= 1.8.5)
47
- actionview (6.1.7.3)
48
- activesupport (= 6.1.7.3)
54
+ actionview (7.0.5)
55
+ activesupport (= 7.0.5)
49
56
  builder (~> 3.1)
50
57
  erubi (~> 1.4)
51
58
  rails-dom-testing (~> 2.0)
52
59
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
53
- activejob (6.1.7.3)
54
- activesupport (= 6.1.7.3)
60
+ activejob (7.0.5)
61
+ activesupport (= 7.0.5)
55
62
  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)
63
+ activemodel (7.0.5)
64
+ activesupport (= 7.0.5)
65
+ activerecord (7.0.5)
66
+ activemodel (= 7.0.5)
67
+ activesupport (= 7.0.5)
68
+ activestorage (7.0.5)
69
+ actionpack (= 7.0.5)
70
+ activejob (= 7.0.5)
71
+ activerecord (= 7.0.5)
72
+ activesupport (= 7.0.5)
66
73
  marcel (~> 1.0)
67
74
  mini_mime (>= 1.1.0)
68
- activesupport (6.1.7.3)
75
+ activesupport (7.0.5)
69
76
  concurrent-ruby (~> 1.0, >= 1.0.2)
70
77
  i18n (>= 1.6, < 2)
71
78
  minitest (>= 5.1)
72
79
  tzinfo (~> 2.0)
73
- zeitwerk (~> 2.3)
74
80
  addressable (2.8.4)
75
81
  public_suffix (>= 2.0.2, < 6.0)
76
82
  ast (2.4.2)
@@ -81,6 +87,7 @@ GEM
81
87
  autoprefixer-rails (>= 9.1.0)
82
88
  popper_js (>= 2.11.7, < 3)
83
89
  sassc-rails (>= 2.0.0)
90
+ brakeman (5.4.1)
84
91
  builder (3.2.4)
85
92
  concurrent-ruby (1.2.2)
86
93
  crack (0.4.5)
@@ -102,11 +109,14 @@ GEM
102
109
  factory_bot_rails (5.2.0)
103
110
  factory_bot (~> 5.2.0)
104
111
  railties (>= 4.2.0)
112
+ faker (2.23.0)
113
+ i18n (>= 1.8.11, < 2)
105
114
  ffi (1.15.5)
106
115
  globalid (1.1.0)
107
116
  activesupport (>= 5.0)
108
117
  hashdiff (1.0.1)
109
- i18n (1.13.0)
118
+ htmlbeautifier (1.4.2)
119
+ i18n (1.14.1)
110
120
  concurrent-ruby (~> 1.0)
111
121
  json (2.6.3)
112
122
  kaminari (1.2.2)
@@ -121,6 +131,10 @@ GEM
121
131
  activerecord
122
132
  kaminari-core (= 1.2.2)
123
133
  kaminari-core (1.2.2)
134
+ kramdown (2.4.0)
135
+ rexml
136
+ kramdown-parser-gfm (1.1.0)
137
+ kramdown (~> 2.0)
124
138
  loofah (2.21.3)
125
139
  crass (~> 1.0.2)
126
140
  nokogiri (>= 1.12.0)
@@ -133,8 +147,8 @@ GEM
133
147
  method_source (1.0.0)
134
148
  mini_mime (1.1.2)
135
149
  mini_portile2 (2.8.2)
136
- minitest (5.18.0)
137
- net-imap (0.3.4)
150
+ minitest (5.18.1)
151
+ net-imap (0.3.6)
138
152
  date
139
153
  net-protocol
140
154
  net-pop (0.1.2)
@@ -144,50 +158,53 @@ GEM
144
158
  net-smtp (0.3.3)
145
159
  net-protocol
146
160
  nio4r (2.5.9)
147
- nokogiri (1.15.1)
161
+ nokogiri (1.15.2)
148
162
  mini_portile2 (~> 2.8.2)
149
163
  racc (~> 1.4)
150
164
  orm_adapter (0.5.0)
151
165
  paint (2.3.0)
152
166
  paintbrush (0.1.3)
153
167
  parallel (1.23.0)
154
- parser (3.2.2.1)
168
+ parser (3.2.2.3)
155
169
  ast (~> 2.4.1)
170
+ racc
156
171
  popper_js (2.11.7)
157
172
  public_suffix (5.0.1)
158
- racc (1.6.2)
173
+ racc (1.7.1)
159
174
  rack (2.2.7)
160
175
  rack-test (2.1.0)
161
176
  rack (>= 1.3)
162
- rails (6.1.7.3)
163
- actioncable (= 6.1.7.3)
164
- actionmailbox (= 6.1.7.3)
165
- actionmailer (= 6.1.7.3)
166
- actionpack (= 6.1.7.3)
167
- actiontext (= 6.1.7.3)
168
- actionview (= 6.1.7.3)
169
- activejob (= 6.1.7.3)
170
- activemodel (= 6.1.7.3)
171
- activerecord (= 6.1.7.3)
172
- activestorage (= 6.1.7.3)
173
- activesupport (= 6.1.7.3)
177
+ rails (7.0.5)
178
+ actioncable (= 7.0.5)
179
+ actionmailbox (= 7.0.5)
180
+ actionmailer (= 7.0.5)
181
+ actionpack (= 7.0.5)
182
+ actiontext (= 7.0.5)
183
+ actionview (= 7.0.5)
184
+ activejob (= 7.0.5)
185
+ activemodel (= 7.0.5)
186
+ activerecord (= 7.0.5)
187
+ activestorage (= 7.0.5)
188
+ activesupport (= 7.0.5)
174
189
  bundler (>= 1.15.0)
175
- railties (= 6.1.7.3)
176
- sprockets-rails (>= 2.0.0)
190
+ railties (= 7.0.5)
177
191
  rails-dom-testing (2.0.3)
178
192
  activesupport (>= 4.2.0)
179
193
  nokogiri (>= 1.6)
180
- rails-html-sanitizer (1.5.0)
181
- loofah (~> 2.19, >= 2.19.1)
182
- railties (6.1.7.3)
183
- actionpack (= 6.1.7.3)
184
- activesupport (= 6.1.7.3)
194
+ rails-html-sanitizer (1.6.0)
195
+ loofah (~> 2.21)
196
+ nokogiri (~> 1.14)
197
+ railties (7.0.5)
198
+ actionpack (= 7.0.5)
199
+ activesupport (= 7.0.5)
185
200
  method_source
186
201
  rake (>= 12.2)
187
202
  thor (~> 1.0)
203
+ zeitwerk (~> 2.5)
188
204
  rainbow (3.1.1)
189
205
  rake (13.0.6)
190
- regexp_parser (2.8.0)
206
+ redcarpet (3.6.0)
207
+ regexp_parser (2.8.1)
191
208
  responders (3.1.0)
192
209
  actionpack (>= 5.2)
193
210
  railties (>= 5.2)
@@ -199,12 +216,21 @@ GEM
199
216
  rspec-mocks (~> 3.12.0)
200
217
  rspec-core (3.12.2)
201
218
  rspec-support (~> 3.12.0)
219
+ rspec-documentation (0.0.9)
220
+ htmlbeautifier (~> 1.4)
221
+ kramdown (~> 2.4)
222
+ kramdown-parser-gfm (~> 1.1)
223
+ nokogiri (~> 1.15)
224
+ paintbrush (~> 0.1.3)
225
+ redcarpet (~> 3.6)
226
+ rouge (~> 4.1)
227
+ rspec (~> 3.12)
202
228
  rspec-expectations (3.12.3)
203
229
  diff-lcs (>= 1.2.0, < 2.0)
204
230
  rspec-support (~> 3.12.0)
205
- rspec-file_fixtures (0.1.6)
206
- rspec (~> 3.0)
207
- rspec-html (0.3.2)
231
+ rspec-file_fixtures (0.1.7)
232
+ rspec (~> 3.12)
233
+ rspec-html (0.3.4)
208
234
  nokogiri (~> 1.10)
209
235
  rspec (~> 3.0)
210
236
  rspec-its (1.3.0)
@@ -213,7 +239,7 @@ GEM
213
239
  rspec-mocks (3.12.5)
214
240
  diff-lcs (>= 1.2.0, < 2.0)
215
241
  rspec-support (~> 3.12.0)
216
- rspec-rails (6.0.2)
242
+ rspec-rails (6.0.3)
217
243
  actionpack (>= 6.1)
218
244
  activesupport (>= 6.1)
219
245
  railties (>= 6.1)
@@ -222,23 +248,23 @@ GEM
222
248
  rspec-mocks (~> 3.12)
223
249
  rspec-support (~> 3.12)
224
250
  rspec-support (3.12.0)
225
- rubocop (1.51.0)
251
+ rubocop (1.52.1)
226
252
  json (~> 2.3)
227
253
  parallel (~> 1.10)
228
- parser (>= 3.2.0.0)
254
+ parser (>= 3.2.2.3)
229
255
  rainbow (>= 2.2.2, < 4.0)
230
256
  regexp_parser (>= 1.8, < 3.0)
231
257
  rexml (>= 3.2.5, < 4.0)
232
258
  rubocop-ast (>= 1.28.0, < 2.0)
233
259
  ruby-progressbar (~> 1.7)
234
260
  unicode-display_width (>= 2.4.0, < 3.0)
235
- rubocop-ast (1.28.1)
261
+ rubocop-ast (1.29.0)
236
262
  parser (>= 3.2.1.0)
237
263
  rubocop-capybara (2.18.0)
238
264
  rubocop (~> 1.41)
239
265
  rubocop-factory_bot (2.23.1)
240
266
  rubocop (~> 1.33)
241
- rubocop-rails (2.19.1)
267
+ rubocop-rails (2.20.0)
242
268
  activesupport (>= 4.2.0)
243
269
  rack (>= 1.1)
244
270
  rubocop (>= 1.33.0, < 2.0)
@@ -248,6 +274,9 @@ GEM
248
274
  rubocop (~> 1.33)
249
275
  rubocop-capybara (~> 2.17)
250
276
  rubocop-factory_bot (~> 2.22)
277
+ rubocop-rspec-documentation (0.0.2)
278
+ rspec-documentation (~> 0.0.7)
279
+ rubocop (~> 1.52)
251
280
  ruby-progressbar (1.13.0)
252
281
  sassc (2.4.0)
253
282
  ffi (~> 1.9)
@@ -291,11 +320,14 @@ PLATFORMS
291
320
 
292
321
  DEPENDENCIES
293
322
  active_element!
323
+ brakeman (~> 5.4)
294
324
  devise (~> 4.9)
295
325
  devpack (~> 0.4.1)
296
326
  factory_bot_rails (~> 5.2)
327
+ faker (~> 2.23)
297
328
  rake (~> 13.0)
298
329
  rspec (~> 3.12)
330
+ rspec-documentation (~> 0.0.9)
299
331
  rspec-file_fixtures (~> 0.1.6)
300
332
  rspec-html (~> 0.3.2)
301
333
  rspec-its (~> 1.3)
@@ -304,6 +336,7 @@ DEPENDENCIES
304
336
  rubocop-rails (~> 2.19)
305
337
  rubocop-rake (~> 0.6.0)
306
338
  rubocop-rspec (~> 2.22)
339
+ rubocop-rspec-documentation (~> 0.0.2)
307
340
  sqlite3 (~> 1.6)
308
341
  strong_versions (~> 0.4.5)
309
342
  webmock (~> 3.18)
data/Makefile CHANGED
@@ -1,5 +1,15 @@
1
+ project=active_element
2
+
1
3
  .PHONY: test
2
4
  test:
3
5
  bundle exec rspec
4
6
  bundle exec rubocop
5
7
  bundle exec strong_versions
8
+ bundle exec brakeman
9
+ bundle exec rspec-documentation
10
+
11
+ .PHONY: publish
12
+ publish:
13
+ @RSPEC_DOCUMENTATION_URL_ROOT='/$(project)' bundle exec rspec-documentation
14
+ @rsync --delete -r rspec-documentation/bundle/ docs01.bob.frl:/mnt/docs/$(project)/
15
+ @echo 'Published.'
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency 'bootstrap', '~> 5.3.0alpha3'
34
34
  spec.add_runtime_dependency 'kaminari', '~> 1.2'
35
35
  spec.add_runtime_dependency 'paintbrush', '~> 0.1.2'
36
- spec.add_runtime_dependency 'rails', '~> 6.1'
36
+ spec.add_runtime_dependency 'rails', '>= 6.0'
37
37
  spec.add_runtime_dependency 'rouge', '~> 4.1'
38
38
  spec.add_runtime_dependency 'sassc', '~> 2.4'
39
39
  end
@@ -10,3 +10,4 @@
10
10
  //= require active_element/pagination
11
11
  //= require active_element/toast
12
12
  //= require active_element/popover
13
+ //= require active_element/timezones
@@ -1,36 +1,7 @@
1
1
  (() => {
2
2
  const cloneElement = (id) => ActiveElement.cloneElement('form', id);
3
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 = () => {
4
+ const initModalButtons = () => {
34
5
  document.querySelectorAll('[data-field-type="form-modal"]').forEach((element) => {
35
6
  const formId = element.dataset.formId;
36
7
  const form = document.querySelector(`#${formId}`);
@@ -54,8 +25,21 @@
54
25
  });
55
26
  };
56
27
 
28
+ const initClearFormButtons = () => {
29
+ document.querySelectorAll('form').forEach((form) => {
30
+ form.querySelectorAll('[data-form-input-type="clear"]').forEach((clearFormButton) => {
31
+ clearFormButton.addEventListener('click', (ev) => {
32
+ ev.preventDefault();
33
+
34
+ form.querySelectorAll('.form-fields input, .form-fields select, .form-fields textarea')
35
+ .forEach((formInput) => formInput.value = '');
36
+ });
37
+ });
38
+ });
39
+ };
40
+
57
41
  window.addEventListener('DOMContentLoaded', () => {
58
- initExpandButtons();
59
- initPopupButtons();
42
+ initModalButtons();
43
+ initClearFormButtons();
60
44
  });
61
45
  })();