active_element 0.0.10 → 0.0.12

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.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -2
  3. data/.strong_versions.yml +1 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +115 -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 +38 -27
  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 +42 -24
  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 +8 -4
  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/_ungrouped_collection.html.erb +1 -0
  40. data/app/views/active_element/components/table/collection.html.erb +1 -1
  41. data/app/views/active_element/components/table/item.html.erb +6 -4
  42. data/app/views/active_element/default_views/edit.html.erb +5 -0
  43. data/app/views/active_element/default_views/forbidden.html.erb +7 -0
  44. data/app/views/active_element/default_views/index.html.erb +15 -0
  45. data/app/views/active_element/default_views/new.html.erb +4 -0
  46. data/app/views/active_element/default_views/show.html.erb +7 -0
  47. data/app/views/active_element/navbar/_menu.html.erb +1 -30
  48. data/app/views/active_element/theme/_select.html.erb +1 -1
  49. data/app/views/layouts/active_element.html.erb +16 -1
  50. data/config/brakeman.ignore +48 -0
  51. data/config/locales/en.yml +3 -0
  52. data/example_app/.gitattributes +7 -0
  53. data/example_app/.gitignore +35 -0
  54. data/example_app/.ruby-version +1 -0
  55. data/example_app/Gemfile +34 -0
  56. data/example_app/Gemfile.lock +296 -0
  57. data/example_app/README.md +24 -0
  58. data/example_app/Rakefile +6 -0
  59. data/example_app/app/assets/config/manifest.js +4 -0
  60. data/example_app/app/assets/images/.keep +0 -0
  61. data/example_app/app/assets/stylesheets/application.css +15 -0
  62. data/example_app/app/channels/application_cable/channel.rb +4 -0
  63. data/example_app/app/channels/application_cable/connection.rb +4 -0
  64. data/example_app/app/controllers/application_controller.rb +12 -0
  65. data/example_app/app/controllers/concerns/.keep +0 -0
  66. data/example_app/app/controllers/pets_controller.rb +7 -0
  67. data/example_app/app/controllers/users_controller.rb +7 -0
  68. data/example_app/app/helpers/application_helper.rb +2 -0
  69. data/example_app/app/javascript/application.js +3 -0
  70. data/example_app/app/javascript/controllers/application.js +9 -0
  71. data/example_app/app/javascript/controllers/hello_controller.js +7 -0
  72. data/example_app/app/javascript/controllers/index.js +11 -0
  73. data/example_app/app/jobs/application_job.rb +7 -0
  74. data/example_app/app/mailers/application_mailer.rb +4 -0
  75. data/example_app/app/models/application_record.rb +3 -0
  76. data/example_app/app/models/concerns/.keep +0 -0
  77. data/example_app/app/models/pet.rb +3 -0
  78. data/example_app/app/models/user.rb +8 -0
  79. data/example_app/app/views/layouts/application.html.erb +16 -0
  80. data/example_app/app/views/layouts/mailer.html.erb +13 -0
  81. data/example_app/app/views/layouts/mailer.text.erb +1 -0
  82. data/example_app/app/views/pets/index.html.erb +3 -0
  83. data/example_app/app/views/users/show.html.erb +3 -0
  84. data/example_app/bin/bundle +109 -0
  85. data/example_app/bin/importmap +4 -0
  86. data/example_app/bin/rails +4 -0
  87. data/example_app/bin/rake +4 -0
  88. data/example_app/bin/setup +33 -0
  89. data/example_app/config/application.rb +22 -0
  90. data/example_app/config/boot.rb +4 -0
  91. data/example_app/config/cable.yml +10 -0
  92. data/example_app/config/credentials.yml.enc +1 -0
  93. data/example_app/config/database.yml +25 -0
  94. data/example_app/config/environment.rb +5 -0
  95. data/example_app/config/environments/development.rb +70 -0
  96. data/example_app/config/environments/production.rb +93 -0
  97. data/example_app/config/environments/test.rb +60 -0
  98. data/example_app/config/importmap.rb +7 -0
  99. data/example_app/config/initializers/assets.rb +12 -0
  100. data/example_app/config/initializers/content_security_policy.rb +25 -0
  101. data/example_app/config/initializers/devise.rb +16 -0
  102. data/example_app/config/initializers/filter_parameter_logging.rb +8 -0
  103. data/example_app/config/initializers/inflections.rb +16 -0
  104. data/example_app/config/initializers/permissions_policy.rb +11 -0
  105. data/example_app/config/locales/devise.en.yml +65 -0
  106. data/example_app/config/locales/en.yml +33 -0
  107. data/example_app/config/puma.rb +43 -0
  108. data/example_app/config/routes.rb +8 -0
  109. data/example_app/config/storage.yml +34 -0
  110. data/example_app/config.ru +6 -0
  111. data/example_app/db/migrate/20230616210539_create_pet.rb +12 -0
  112. data/example_app/db/migrate/20230616211328_devise_create_users.rb +46 -0
  113. data/example_app/db/schema.rb +37 -0
  114. data/example_app/db/seeds.rb +33 -0
  115. data/example_app/lib/assets/.keep +0 -0
  116. data/example_app/lib/tasks/.keep +0 -0
  117. data/example_app/log/.keep +0 -0
  118. data/example_app/public/404.html +67 -0
  119. data/example_app/public/422.html +67 -0
  120. data/example_app/public/500.html +66 -0
  121. data/example_app/public/apple-touch-icon-precomposed.png +0 -0
  122. data/example_app/public/apple-touch-icon.png +0 -0
  123. data/example_app/public/favicon.ico +0 -0
  124. data/example_app/public/robots.txt +1 -0
  125. data/example_app/storage/.keep +0 -0
  126. data/example_app/test/application_system_test_case.rb +5 -0
  127. data/example_app/test/channels/application_cable/connection_test.rb +11 -0
  128. data/example_app/test/controllers/.keep +0 -0
  129. data/example_app/test/fixtures/files/.keep +0 -0
  130. data/example_app/test/fixtures/users.yml +11 -0
  131. data/example_app/test/helpers/.keep +0 -0
  132. data/example_app/test/integration/.keep +0 -0
  133. data/example_app/test/mailers/.keep +0 -0
  134. data/example_app/test/models/.keep +0 -0
  135. data/example_app/test/models/user_test.rb +7 -0
  136. data/example_app/test/system/.keep +0 -0
  137. data/example_app/test/test_helper.rb +13 -0
  138. data/example_app/tmp/.keep +0 -0
  139. data/example_app/tmp/pids/.keep +0 -0
  140. data/example_app/tmp/storage/.keep +0 -0
  141. data/example_app/vendor/.keep +0 -0
  142. data/example_app/vendor/javascript/.keep +0 -0
  143. data/lib/active_element/component.rb +9 -2
  144. data/lib/active_element/components/collection_table.rb +9 -2
  145. data/lib/active_element/components/email_fields.rb +14 -0
  146. data/lib/active_element/components/form.rb +48 -17
  147. data/lib/active_element/components/navbar.rb +64 -0
  148. data/lib/active_element/components/phone_fields.rb +14 -0
  149. data/lib/active_element/components/text_search/authorization.rb +9 -6
  150. data/lib/active_element/components/text_search/component.rb +4 -2
  151. data/lib/active_element/components/text_search.rb +13 -0
  152. data/lib/active_element/components/util/association_mapping.rb +74 -19
  153. data/lib/active_element/components/util/display_value_mapping.rb +13 -4
  154. data/lib/active_element/components/util/form_field_mapping.rb +139 -10
  155. data/lib/active_element/components/util/form_value_mapping.rb +3 -3
  156. data/lib/active_element/components/util/i18n.rb +1 -1
  157. data/lib/active_element/components/util/numeric_field.rb +73 -0
  158. data/lib/active_element/components/util/record_mapping.rb +43 -11
  159. data/lib/active_element/components/util/record_path.rb +21 -4
  160. data/lib/active_element/components/util.rb +13 -5
  161. data/lib/active_element/components.rb +3 -0
  162. data/lib/active_element/controller_action.rb +8 -2
  163. data/lib/active_element/controller_interface.rb +56 -18
  164. data/lib/active_element/controller_state.rb +44 -0
  165. data/lib/active_element/default_controller.rb +137 -0
  166. data/lib/active_element/default_record_params.rb +62 -0
  167. data/lib/active_element/default_search.rb +110 -0
  168. data/lib/active_element/json_field_schema.rb +59 -0
  169. data/lib/active_element/pre_render_processors/json.rb +98 -0
  170. data/lib/active_element/pre_render_processors.rb +11 -0
  171. data/lib/active_element/route.rb +12 -0
  172. data/lib/active_element/routes.rb +2 -1
  173. data/lib/active_element/version.rb +1 -1
  174. data/lib/active_element.rb +15 -32
  175. data/lib/tasks/active_element.rake +12 -1
  176. data/rspec-documentation/_head.html.erb +34 -0
  177. data/rspec-documentation/pages/000-Introduction.md +18 -0
  178. data/rspec-documentation/pages/005-Setup.md +75 -0
  179. data/rspec-documentation/pages/010-Components/Form Fields/Check Boxes.md +1 -0
  180. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Controller Params.md +97 -0
  181. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Schema.md +283 -0
  182. data/rspec-documentation/pages/010-Components/Form Fields/JSON/Types.md +36 -0
  183. data/rspec-documentation/pages/010-Components/Form Fields/JSON.md +70 -0
  184. data/rspec-documentation/pages/010-Components/Form Fields/Text Search.md +133 -0
  185. data/rspec-documentation/pages/010-Components/Form Fields.md +46 -0
  186. data/rspec-documentation/pages/010-Components/Forms.md +44 -0
  187. data/rspec-documentation/pages/010-Components/JSON Data.md +23 -0
  188. data/rspec-documentation/pages/010-Components/Navbar.md +56 -0
  189. data/rspec-documentation/pages/010-Components/Page Section Title.md +13 -0
  190. data/rspec-documentation/pages/010-Components/Page Subtitle.md +11 -0
  191. data/rspec-documentation/pages/010-Components/Page Title.md +11 -0
  192. data/rspec-documentation/pages/010-Components/Tables/Collection Table.md +29 -0
  193. data/rspec-documentation/pages/010-Components/Tables/Item Table.md +18 -0
  194. data/rspec-documentation/pages/010-Components/Tables/Options.md +19 -0
  195. data/rspec-documentation/pages/010-Components/Tables.md +29 -0
  196. data/rspec-documentation/pages/010-Components.md +15 -0
  197. data/rspec-documentation/pages/020-Access Control/010-Authentication.md +20 -0
  198. data/rspec-documentation/pages/020-Access Control/020-Authorization/Environments.md +9 -0
  199. data/rspec-documentation/pages/020-Access Control/020-Authorization/Permissions/Custom Routes.md +41 -0
  200. data/rspec-documentation/pages/020-Access Control/020-Authorization/Permissions.md +58 -0
  201. data/rspec-documentation/pages/020-Access Control/020-Authorization/Setup.md +27 -0
  202. data/rspec-documentation/pages/020-Access Control/020-Authorization.md +11 -0
  203. data/rspec-documentation/pages/020-Access Control.md +31 -0
  204. data/rspec-documentation/pages/040-Decorators/Inline Decorators.md +24 -0
  205. data/rspec-documentation/pages/040-Decorators/View Decorators.md +55 -0
  206. data/rspec-documentation/pages/040-Decorators.md +12 -0
  207. data/rspec-documentation/pages/300-Alternatives.md +21 -0
  208. data/rspec-documentation/pages/900-License.md +11 -0
  209. data/rspec-documentation/spec_helper.rb +53 -16
  210. data/rspec-documentation/support.rb +84 -0
  211. metadata +159 -14
  212. data/rspec-documentation/pages/Components/Forms.md +0 -1
  213. data/rspec-documentation/pages/Components/Tables.md +0 -47
  214. data/rspec-documentation/pages/Components.md +0 -1
  215. data/rspec-documentation/pages/Decorators/Inline Decorators.md +0 -1
  216. data/rspec-documentation/pages/Decorators/View Decorators.md +0 -1
  217. data/rspec-documentation/pages/Index.md +0 -3
  218. data/rspec-documentation/pages/Util/I18n.md +0 -1
  219. /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: b461a50c1dc5d99ecb2a98633424871c2ea25c99817cb0f269b0e55da9521732
4
+ data.tar.gz: 2d27482a5ffb5ea966c3f15dfa0e412ddb61b04cb63dbd628d272e95072d89c4
5
5
  SHA512:
6
- metadata.gz: 662fbfb4a5e57396e6577f8b7d014fc1e47d9cc40481c13b20d21679ad5f2cb44822df29e07e0bf1cb086057dfacb219070e920bb083e9a91e2a470ee4709bad
7
- data.tar.gz: dced5cd83abd57790c0908b13a175816b6a686a9ace98ff00017e4c3f7e876b88d3aeea5527d8d8753c3687a700a48e6e2c77f5db1aba84361774fae50b9a1e0
6
+ metadata.gz: d671afa4e3c6cea6eba9d3882bfbc3c21e2df90237d1afcd7c5c303fee433e8ce0a2a813402eeb79431ca2a33fcb737ed0879a0f3349b25ccba0b1b0763ec55b
7
+ data.tar.gz: 8e40f9498e58fd5430fa56290a5034c960dc5be81aa8b8e9e88fb790c138c7039a522e909a126bb6769d7cf680ce8937dfefa0e3c5942e5b1d541ac5b718d6ad
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/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,15 @@ 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'
13
+ gem 'listen', '~> 3.8'
11
14
  gem 'rake', '~> 13.0'
12
15
  gem 'rspec', '~> 3.12'
16
+ gem 'rspec-documentation', '~> 0.0.9'
13
17
  gem 'rspec-file_fixtures', '~> 0.1.6'
14
18
  gem 'rspec-html', '~> 0.3.2'
15
19
  gem 'rspec-its', '~> 1.3'
@@ -18,6 +22,7 @@ gem 'rubocop', '~> 1.51'
18
22
  gem 'rubocop-rails', '~> 2.19'
19
23
  gem 'rubocop-rake', '~> 0.6.0'
20
24
  gem 'rubocop-rspec', '~> 2.22'
25
+ gem 'rubocop-rspec-documentation', '~> 0.0.2'
21
26
  gem 'sqlite3', '~> 1.6'
22
27
  gem 'strong_versions', '~> 0.4.5'
23
28
  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.12)
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,13 @@ 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)
138
+ listen (3.8.0)
139
+ rb-fsevent (~> 0.10, >= 0.10.3)
140
+ rb-inotify (~> 0.9, >= 0.9.10)
124
141
  loofah (2.21.3)
125
142
  crass (~> 1.0.2)
126
143
  nokogiri (>= 1.12.0)
@@ -133,8 +150,8 @@ GEM
133
150
  method_source (1.0.0)
134
151
  mini_mime (1.1.2)
135
152
  mini_portile2 (2.8.2)
136
- minitest (5.18.0)
137
- net-imap (0.3.4)
153
+ minitest (5.18.1)
154
+ net-imap (0.3.6)
138
155
  date
139
156
  net-protocol
140
157
  net-pop (0.1.2)
@@ -144,50 +161,56 @@ GEM
144
161
  net-smtp (0.3.3)
145
162
  net-protocol
146
163
  nio4r (2.5.9)
147
- nokogiri (1.15.1)
164
+ nokogiri (1.15.2)
148
165
  mini_portile2 (~> 2.8.2)
149
166
  racc (~> 1.4)
150
167
  orm_adapter (0.5.0)
151
168
  paint (2.3.0)
152
169
  paintbrush (0.1.3)
153
170
  parallel (1.23.0)
154
- parser (3.2.2.1)
171
+ parser (3.2.2.3)
155
172
  ast (~> 2.4.1)
173
+ racc
156
174
  popper_js (2.11.7)
157
175
  public_suffix (5.0.1)
158
- racc (1.6.2)
176
+ racc (1.7.1)
159
177
  rack (2.2.7)
160
178
  rack-test (2.1.0)
161
179
  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)
180
+ rails (7.0.5)
181
+ actioncable (= 7.0.5)
182
+ actionmailbox (= 7.0.5)
183
+ actionmailer (= 7.0.5)
184
+ actionpack (= 7.0.5)
185
+ actiontext (= 7.0.5)
186
+ actionview (= 7.0.5)
187
+ activejob (= 7.0.5)
188
+ activemodel (= 7.0.5)
189
+ activerecord (= 7.0.5)
190
+ activestorage (= 7.0.5)
191
+ activesupport (= 7.0.5)
174
192
  bundler (>= 1.15.0)
175
- railties (= 6.1.7.3)
176
- sprockets-rails (>= 2.0.0)
193
+ railties (= 7.0.5)
177
194
  rails-dom-testing (2.0.3)
178
195
  activesupport (>= 4.2.0)
179
196
  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)
197
+ rails-html-sanitizer (1.6.0)
198
+ loofah (~> 2.21)
199
+ nokogiri (~> 1.14)
200
+ railties (7.0.5)
201
+ actionpack (= 7.0.5)
202
+ activesupport (= 7.0.5)
185
203
  method_source
186
204
  rake (>= 12.2)
187
205
  thor (~> 1.0)
206
+ zeitwerk (~> 2.5)
188
207
  rainbow (3.1.1)
189
208
  rake (13.0.6)
190
- regexp_parser (2.8.0)
209
+ rb-fsevent (0.11.2)
210
+ rb-inotify (0.10.1)
211
+ ffi (~> 1.0)
212
+ redcarpet (3.6.0)
213
+ regexp_parser (2.8.1)
191
214
  responders (3.1.0)
192
215
  actionpack (>= 5.2)
193
216
  railties (>= 5.2)
@@ -199,12 +222,21 @@ GEM
199
222
  rspec-mocks (~> 3.12.0)
200
223
  rspec-core (3.12.2)
201
224
  rspec-support (~> 3.12.0)
225
+ rspec-documentation (0.0.9)
226
+ htmlbeautifier (~> 1.4)
227
+ kramdown (~> 2.4)
228
+ kramdown-parser-gfm (~> 1.1)
229
+ nokogiri (~> 1.15)
230
+ paintbrush (~> 0.1.3)
231
+ redcarpet (~> 3.6)
232
+ rouge (~> 4.1)
233
+ rspec (~> 3.12)
202
234
  rspec-expectations (3.12.3)
203
235
  diff-lcs (>= 1.2.0, < 2.0)
204
236
  rspec-support (~> 3.12.0)
205
- rspec-file_fixtures (0.1.6)
206
- rspec (~> 3.0)
207
- rspec-html (0.3.2)
237
+ rspec-file_fixtures (0.1.7)
238
+ rspec (~> 3.12)
239
+ rspec-html (0.3.4)
208
240
  nokogiri (~> 1.10)
209
241
  rspec (~> 3.0)
210
242
  rspec-its (1.3.0)
@@ -213,7 +245,7 @@ GEM
213
245
  rspec-mocks (3.12.5)
214
246
  diff-lcs (>= 1.2.0, < 2.0)
215
247
  rspec-support (~> 3.12.0)
216
- rspec-rails (6.0.2)
248
+ rspec-rails (6.0.3)
217
249
  actionpack (>= 6.1)
218
250
  activesupport (>= 6.1)
219
251
  railties (>= 6.1)
@@ -222,23 +254,23 @@ GEM
222
254
  rspec-mocks (~> 3.12)
223
255
  rspec-support (~> 3.12)
224
256
  rspec-support (3.12.0)
225
- rubocop (1.51.0)
257
+ rubocop (1.52.1)
226
258
  json (~> 2.3)
227
259
  parallel (~> 1.10)
228
- parser (>= 3.2.0.0)
260
+ parser (>= 3.2.2.3)
229
261
  rainbow (>= 2.2.2, < 4.0)
230
262
  regexp_parser (>= 1.8, < 3.0)
231
263
  rexml (>= 3.2.5, < 4.0)
232
264
  rubocop-ast (>= 1.28.0, < 2.0)
233
265
  ruby-progressbar (~> 1.7)
234
266
  unicode-display_width (>= 2.4.0, < 3.0)
235
- rubocop-ast (1.28.1)
267
+ rubocop-ast (1.29.0)
236
268
  parser (>= 3.2.1.0)
237
269
  rubocop-capybara (2.18.0)
238
270
  rubocop (~> 1.41)
239
271
  rubocop-factory_bot (2.23.1)
240
272
  rubocop (~> 1.33)
241
- rubocop-rails (2.19.1)
273
+ rubocop-rails (2.20.0)
242
274
  activesupport (>= 4.2.0)
243
275
  rack (>= 1.1)
244
276
  rubocop (>= 1.33.0, < 2.0)
@@ -248,6 +280,9 @@ GEM
248
280
  rubocop (~> 1.33)
249
281
  rubocop-capybara (~> 2.17)
250
282
  rubocop-factory_bot (~> 2.22)
283
+ rubocop-rspec-documentation (0.0.2)
284
+ rspec-documentation (~> 0.0.7)
285
+ rubocop (~> 1.52)
251
286
  ruby-progressbar (1.13.0)
252
287
  sassc (2.4.0)
253
288
  ffi (~> 1.9)
@@ -291,11 +326,15 @@ PLATFORMS
291
326
 
292
327
  DEPENDENCIES
293
328
  active_element!
329
+ brakeman (~> 5.4)
294
330
  devise (~> 4.9)
295
331
  devpack (~> 0.4.1)
296
332
  factory_bot_rails (~> 5.2)
333
+ faker (~> 2.23)
334
+ listen (~> 3.8)
297
335
  rake (~> 13.0)
298
336
  rspec (~> 3.12)
337
+ rspec-documentation (~> 0.0.9)
299
338
  rspec-file_fixtures (~> 0.1.6)
300
339
  rspec-html (~> 0.3.2)
301
340
  rspec-its (~> 1.3)
@@ -304,6 +343,7 @@ DEPENDENCIES
304
343
  rubocop-rails (~> 2.19)
305
344
  rubocop-rake (~> 0.6.0)
306
345
  rubocop-rspec (~> 2.22)
346
+ rubocop-rspec-documentation (~> 0.0.2)
307
347
  sqlite3 (~> 1.6)
308
348
  strong_versions (~> 0.4.5)
309
349
  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
  })();