super 0.0.4 → 0.0.9

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 (130) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +13 -0
  3. data/CONTRIBUTING.md +56 -0
  4. data/README.md +60 -85
  5. data/STABILITY.md +50 -0
  6. data/app/assets/javascripts/super/application.js +1169 -359
  7. data/app/assets/stylesheets/super/application.css +86648 -30707
  8. data/app/controllers/super/application_controller.rb +44 -71
  9. data/app/views/layouts/super/application.html.erb +26 -6
  10. data/app/views/super/application/{_resources_header.html.erb → _collection_header.html.erb} +5 -6
  11. data/app/views/super/application/_display_rich_text.html.erb +1 -0
  12. data/app/views/super/application/_filter.html.erb +14 -0
  13. data/app/views/super/application/_filter_type_select.html.erb +31 -0
  14. data/app/views/super/application/_filter_type_text.html.erb +22 -0
  15. data/app/views/super/application/_filter_type_timestamp.html.erb +35 -0
  16. data/app/views/super/application/_flash.html.erb +13 -13
  17. data/app/views/super/application/_form_field__destroy.html.erb +6 -2
  18. data/app/views/super/application/_form_field_checkbox.html.erb +15 -0
  19. data/app/views/super/application/_form_field_generic.html.erb +19 -0
  20. data/app/views/super/application/_form_field_rich_text_area.html.erb +13 -0
  21. data/app/views/super/application/_form_field_select.html.erb +11 -5
  22. data/app/views/super/application/_form_field_text.html.erb +13 -5
  23. data/app/views/super/application/_form_has_many.html.erb +3 -3
  24. data/app/views/super/application/_form_inline_errors.html.erb +1 -1
  25. data/app/views/super/application/{_resource_header.html.erb → _member_header.html.erb} +6 -6
  26. data/app/views/super/application/_super_layout.html.erb +12 -17
  27. data/app/views/super/application/_super_pagination.html.erb +16 -0
  28. data/app/views/super/application/_super_panel.html.erb +3 -7
  29. data/app/views/super/application/_super_schema_display_actions.html.erb +5 -0
  30. data/app/views/super/application/_super_schema_display_index.html.erb +24 -0
  31. data/app/views/super/application/_super_schema_display_show.html.erb +8 -0
  32. data/app/views/super/application/{_form.html.erb → _super_schema_form.html.erb} +2 -4
  33. data/app/views/super/application/edit.html.erb +1 -1
  34. data/app/views/super/application/index.html.erb +1 -1
  35. data/app/views/super/application/new.html.erb +1 -1
  36. data/app/views/super/application/show.html.erb +1 -1
  37. data/app/views/super/feather/{_chevron_down.svg → _chevron_down.html} +0 -0
  38. data/config/locales/en.yml +5 -0
  39. data/docs/README.md +8 -0
  40. data/docs/action_text.md +48 -0
  41. data/docs/cheat.md +41 -0
  42. data/docs/faq.md +44 -0
  43. data/docs/installation.md +21 -0
  44. data/docs/quick_start.md +30 -0
  45. data/docs/webpacker.md +25 -0
  46. data/docs/yard_customizations.rb +41 -0
  47. data/frontend/super-frontend/build.js +1 -1
  48. data/frontend/super-frontend/dist/application.css +86648 -30707
  49. data/frontend/super-frontend/dist/application.js +1169 -359
  50. data/frontend/super-frontend/package.json +2 -3
  51. data/frontend/super-frontend/src/javascripts/super/{application.ts → application.js} +5 -8
  52. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.js +17 -0
  53. data/frontend/super-frontend/src/javascripts/super/{toggle_pending_destruction_controller.ts → toggle_pending_destruction_controller.js} +2 -2
  54. data/frontend/super-frontend/tailwind.config.js +7 -1
  55. data/frontend/super-frontend/yarn.lock +1368 -1391
  56. data/lib/generators/super/action_text/USAGE +23 -0
  57. data/lib/generators/super/action_text/action_text_generator.rb +30 -0
  58. data/lib/generators/super/action_text/templates/pack_super_action_text.css +23 -0
  59. data/lib/generators/super/action_text/templates/pack_super_action_text.js +4 -0
  60. data/lib/generators/super/install/install_generator.rb +16 -0
  61. data/lib/generators/super/resource/templates/resources_controller.rb.tt +1 -31
  62. data/lib/generators/super/webpacker/USAGE +5 -4
  63. data/lib/generators/super/webpacker/webpacker_generator.rb +10 -1
  64. data/lib/super.rb +22 -5
  65. data/lib/super/action_inquirer.rb +2 -2
  66. data/lib/super/assets.rb +112 -38
  67. data/lib/super/client_error.rb +43 -0
  68. data/lib/super/compatibility.rb +25 -0
  69. data/lib/super/configuration.rb +21 -69
  70. data/lib/super/controls.rb +9 -257
  71. data/lib/super/controls/optional.rb +79 -0
  72. data/lib/super/controls/required.rb +13 -0
  73. data/lib/super/controls/steps.rb +114 -0
  74. data/lib/super/display.rb +66 -3
  75. data/lib/super/display/guesser.rb +34 -0
  76. data/lib/super/display/schema_types.rb +61 -25
  77. data/lib/super/engine.rb +7 -1
  78. data/lib/super/error.rb +8 -9
  79. data/lib/super/filter.rb +12 -0
  80. data/lib/super/filter/form_object.rb +97 -0
  81. data/lib/super/filter/guesser.rb +30 -0
  82. data/lib/super/filter/operator.rb +103 -0
  83. data/lib/super/filter/plugin.rb +47 -0
  84. data/lib/super/filter/schema_types.rb +112 -0
  85. data/lib/super/form.rb +35 -0
  86. data/lib/super/form/builder.rb +48 -0
  87. data/lib/super/form/guesser.rb +27 -0
  88. data/lib/super/form/schema_types.rb +29 -22
  89. data/lib/super/form/strong_params.rb +29 -0
  90. data/lib/super/layout.rb +28 -0
  91. data/lib/super/link.rb +55 -32
  92. data/lib/super/pagination.rb +55 -0
  93. data/lib/super/panel.rb +13 -0
  94. data/lib/super/partial.rb +12 -0
  95. data/lib/super/partial/resolving.rb +24 -0
  96. data/lib/super/plugin.rb +34 -63
  97. data/lib/super/schema.rb +12 -22
  98. data/lib/super/schema/common.rb +25 -0
  99. data/lib/super/schema/guesser.rb +77 -0
  100. data/lib/super/version.rb +1 -1
  101. data/lib/super/view_helper.rb +43 -0
  102. metadata +138 -41
  103. data/app/helpers/super/application_helper.rb +0 -32
  104. data/app/views/super/application/_index.html.erb +0 -45
  105. data/app/views/super/application/_show.html.erb +0 -10
  106. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.ts +0 -21
  107. data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +0 -1
  108. data/frontend/super-frontend/tsconfig.json +0 -13
  109. data/lib/super/action.rb +0 -22
  110. data/lib/super/action/step.rb +0 -36
  111. data/lib/super/test_support/copy_app_templates/controllers/favorite_things_controller.rb +0 -50
  112. data/lib/super/test_support/copy_app_templates/controllers/members_controller.rb +0 -74
  113. data/lib/super/test_support/copy_app_templates/controllers/ships_controller.rb +0 -47
  114. data/lib/super/test_support/copy_app_templates/migrations/20190216224956_create_members.rb +0 -11
  115. data/lib/super/test_support/copy_app_templates/migrations/20190803143320_create_ships.rb +0 -11
  116. data/lib/super/test_support/copy_app_templates/migrations/20190806014121_add_ship_to_members.rb +0 -5
  117. data/lib/super/test_support/copy_app_templates/migrations/20191126050453_create_favorite_things.rb +0 -10
  118. data/lib/super/test_support/copy_app_templates/models/favorite_thing.rb +0 -7
  119. data/lib/super/test_support/copy_app_templates/models/member.rb +0 -23
  120. data/lib/super/test_support/copy_app_templates/models/ship.rb +0 -3
  121. data/lib/super/test_support/copy_app_templates/routes.rb +0 -11
  122. data/lib/super/test_support/copy_app_templates/seeds.rb +0 -2
  123. data/lib/super/test_support/copy_app_templates/views/members/_favorite_things.html.erb +0 -11
  124. data/lib/super/test_support/fixtures/favorite_things.yml +0 -9
  125. data/lib/super/test_support/fixtures/members.yml +0 -336
  126. data/lib/super/test_support/fixtures/ships.yml +0 -10
  127. data/lib/super/test_support/generate_copy_app.rb +0 -42
  128. data/lib/super/test_support/generate_dummy.rb +0 -93
  129. data/lib/super/test_support/starfleet_seeder.rb +0 -50
  130. data/lib/tasks/super_tasks.rake +0 -4
@@ -1,121 +1,94 @@
1
1
  module Super
2
2
  # Provides a default implementation for each of the resourceful actions
3
3
  class ApplicationController < ActionController::Base
4
- include Pluggable.new(:super_application_controller)
4
+ include ClientError::Handling
5
5
 
6
6
  helper_method :action_inquirer
7
7
  helper_method :controls
8
8
 
9
- rescue_from Error::ClientError do |exception|
10
- code, default_message =
11
- case exception
12
- when Error::UnprocessableEntity
13
- [422, "Unprocessable entity"]
14
- when Error::NotFound
15
- [404, "Not found"]
16
- when Error::Forbidden
17
- [403, "Forbidden"]
18
- when Error::Unauthorized
19
- [401, "Unauthorized"]
20
- when Error::BadRequest, Error::ClientError
21
- [400, "Bad request"]
22
- end
23
-
24
- flash.now.alert =
25
- if exception.message == exception.class.name.to_s
26
- default_message
27
- else
28
- exception.message
29
- end
30
-
31
- render "nothing", status: code
32
- end
33
-
9
+ # Displays a list of records to the user
34
10
  def index
35
- @super_action = controls.index
36
- @super_action.steps.each do |step|
37
- instance_exec(&step)
38
- end
11
+ @records = controls.load_records(action: action_inquirer, params: params)
12
+ @display = controls.display_schema(action: action_inquirer)
13
+ @view = controls.build_index_view
39
14
  end
40
15
 
16
+ # Displays a specific record to the user
41
17
  def show
42
- @super_action = controls.show
43
- @super_action.steps.each do |step|
44
- instance_exec(&step)
45
- end
18
+ @record = controls.load_record(action: action_inquirer, params: params)
19
+ @display = controls.display_schema(action: action_inquirer)
20
+ @view = controls.build_show_view
46
21
  end
47
22
 
23
+ # Displays a form to allow the user to create a new record
48
24
  def new
49
- @super_action = controls.new
50
- @super_action.steps.each do |step|
51
- instance_exec(&step)
52
- end
25
+ @record = controls.build_record(action: action_inquirer)
26
+ @form = controls.form_schema(action: action_inquirer)
27
+ @view = controls.build_new_view
53
28
  end
54
29
 
30
+ # Creates a record, or shows the validation errors
55
31
  def create
56
- @super_action = controls.create
57
- @super_action.steps.each do |step|
58
- instance_exec(&step)
59
- end
32
+ @record = controls.build_record_with_params(action: action_inquirer, params: params)
60
33
 
61
- if @resource.save
62
- redirect_to polymorphic_path(Super.configuration.path_parts(@resource))
34
+ if controls.save_record(action: action_inquirer, record: @record, params: params)
35
+ redirect_to polymorphic_path(Super.configuration.path_parts(@record))
63
36
  else
37
+ @form = controls.form_schema(action: action_inquirer_for("new"))
38
+ @view = controls.build_new_view
64
39
  render :new, status: :bad_request
65
40
  end
66
41
  end
67
42
 
43
+ # Displays a form to allow the user to update an existing record
68
44
  def edit
69
- @super_action = controls.edit
70
- @super_action.steps.each do |step|
71
- instance_exec(&step)
72
- end
45
+ @record = controls.load_record(action: action_inquirer, params: params)
46
+ @form = controls.form_schema(action: action_inquirer)
47
+ @view = controls.build_edit_view
73
48
  end
74
49
 
50
+ # Updates a record, or shows validation errors
75
51
  def update
76
- @super_action = controls.update
77
- @super_action.steps.each do |step|
78
- instance_exec(&step)
79
- end
52
+ @record = controls.load_record(action: action_inquirer, params: params)
80
53
 
81
- if @resource.update(update_permitted_params)
82
- redirect_to polymorphic_path(Super.configuration.path_parts(@resource))
54
+ if controls.update_record(action: action_inquirer, record: @record, params: params)
55
+ redirect_to polymorphic_path(Super.configuration.path_parts(@record))
83
56
  else
57
+ @form = controls.form_schema(action: action_inquirer_for("edit"))
58
+ @view = controls.build_edit_view
84
59
  render :edit, status: :bad_request
85
60
  end
86
61
  end
87
62
 
63
+ # Deletes a record, or shows validation errors
88
64
  def destroy
89
- @super_action = controls.destroy
90
- @super_action.steps.each do |step|
91
- instance_exec(&step)
92
- end
65
+ @record = controls.load_record(action: action_inquirer, params: params)
93
66
 
94
- if @resource.destroy
67
+ if controls.destroy_record(action: action_inquirer, record: @record, params: params)
95
68
  redirect_to polymorphic_path(Super.configuration.path_parts(controls.model))
96
69
  else
97
- redirect_to polymorphic_path(Super.configuration.path_parts(@resource))
70
+ flash.alert = "Couldn't delete record"
71
+ redirect_to polymorphic_path(Super.configuration.path_parts(@record))
98
72
  end
73
+ rescue ActiveRecord::InvalidForeignKey => e
74
+ flash.alert = "Couldn't delete record: #{e.class}"
75
+ redirect_to polymorphic_path(Super.configuration.path_parts(@record))
99
76
  end
100
77
 
101
78
  private
102
79
 
103
80
  def controls
104
- Super::Controls.new(new_controls)
81
+ @controls ||= new_controls
105
82
  end
106
83
 
107
- def create_permitted_params
108
- controls.permitted_params(params, action: action_inquirer)
109
- end
110
-
111
- def update_permitted_params
112
- controls.permitted_params(params, action: action_inquirer)
84
+ def action_inquirer
85
+ @action_inquirer ||= action_inquirer_for(params[:action])
113
86
  end
114
87
 
115
- def action_inquirer
116
- @action_inquirer ||= ActionInquirer.new(
117
- ActionInquirer.default_resources,
118
- params[:action]
88
+ def action_inquirer_for(action)
89
+ ActionInquirer.new(
90
+ ActionInquirer.default_for_resources,
91
+ action
119
92
  )
120
93
  end
121
94
  end
@@ -9,12 +9,28 @@
9
9
 
10
10
  <meta name="viewport" content="width=device-width, initial-scale=1">
11
11
 
12
- <% if Super.configuration.asset_handler.sprockets? %>
13
- <%= stylesheet_link_tag "super/application", media: "all" %>
14
- <%= javascript_include_tag "super/application" %>
15
- <% elsif Super.configuration.asset_handler.webpacker? %>
16
- <%= stylesheet_pack_tag "super/application", media: "all" %>
17
- <%= javascript_pack_tag "super/application" %>
12
+ <% Super.configuration.stylesheets.each do |stylesheet| %>
13
+ <% if stylesheet.handler.sprockets? %>
14
+ <%= stylesheet_link_tag(stylesheet.path, **stylesheet.arguments) %>
15
+ <% elsif stylesheet.handler.webpacker? %>
16
+ <% if Gem::Dependency.new("webpacker", "> 5.99", "< 7").matching_specs.any? %>
17
+ <%= stylesheet_packs_with_chunks_tag(stylesheet.path) %>
18
+ <% else %>
19
+ <%= stylesheet_pack_tag(stylesheet.path, **stylesheet.arguments) %>
20
+ <% end %>
21
+ <% end %>
22
+ <% end %>
23
+
24
+ <% Super.configuration.javascripts.each do |javascript| %>
25
+ <% if javascript.handler.sprockets? %>
26
+ <%= javascript_include_tag(javascript.path) %>
27
+ <% elsif javascript.handler.webpacker? %>
28
+ <% if Gem::Dependency.new("webpacker", "> 5.99", "< 7").matching_specs.any? %>
29
+ <%= javascript_packs_with_chunks_tag(javascript.path) %>
30
+ <% else %>
31
+ <%= javascript_pack_tag(javascript.path) %>
32
+ <% end %>
33
+ <% end %>
18
34
  <% end %>
19
35
  </head>
20
36
 
@@ -34,6 +50,10 @@
34
50
  <div class="pt-4"></div>
35
51
 
36
52
  <%= yield %>
53
+
54
+ <div class="pt-8 text-sm text-gray-800">
55
+ <%= t("super.layout.powered_by", env: Rails.env.capitalize, version: Super::VERSION) %>
56
+ </div>
37
57
  </div>
38
58
  </body>
39
59
  </html>
@@ -3,13 +3,12 @@
3
3
  <%= controls.title %>
4
4
  </h1>
5
5
  <div>
6
- <% controls.resources_actions(params: params, action: action_inquirer).each do |link| %>
7
- <%= link_to(
8
- link.text,
9
- link.href,
10
- link.options.reverse_merge(
6
+ <% controls.collection_actions(action: action_inquirer).each do |link| %>
7
+ <%= link.to_s(
8
+ default_options: {
11
9
  class: "super-button super-button--border-blue super-button-sm inline-block ml-2"
12
- )
10
+ },
11
+ params: params
13
12
  ) %>
14
13
  <% end %>
15
14
  </div>
@@ -0,0 +1,14 @@
1
+ <%= render(Super::Panel.new) do %>
2
+ <h1 class="text-xl">Filters</h1>
3
+ <%= form_for(filter, url: filter.url, method: :get, as: :q, html: { class: "mt-4" }) do |form| %>
4
+ <% filter.each_field do |filter_field| %>
5
+ <div class="mt-4">
6
+ <%= render(filter_field, form: form) %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <div>
11
+ <%= form.submit "Filter", class: "super-button super-button--border-gray mt-6" %>
12
+ </div>
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <div class="super-field-group">
2
+ <%= form.fields_for(filter_type_select.field_name, filter_type_select) do |form_field| %>
3
+ <%= form_field.label(:q, filter_type_select.humanized_field_name) %>
4
+ <div class="super-input-select inline-block">
5
+ <%= form_field.select(
6
+ :op,
7
+ filter_type_select.operators,
8
+ {},
9
+ { class: "super-input super-input-select-field" }
10
+ ) %>
11
+ <div class="super-input-select-icon text-gray-700">
12
+ <span class="h-4 w-4">
13
+ <%= render "super/feather/chevron_down" %>
14
+ </span>
15
+ </div>
16
+ </div>
17
+ <div class="super-input-select mt-3">
18
+ <%= form_field.select(
19
+ :q,
20
+ filter_type_select.field_type.collection,
21
+ { include_blank: true },
22
+ { class: "super-input super-input-select-field" }
23
+ ) %>
24
+ <div class="super-input-select-icon text-gray-700">
25
+ <span class="h-4 w-4">
26
+ <%= render "super/feather/chevron_down" %>
27
+ </span>
28
+ </div>
29
+ </div>
30
+ <% end %>
31
+ </div>
@@ -0,0 +1,22 @@
1
+ <div class="super-field-group">
2
+ <%= form.fields_for(filter_type_text.field_name, filter_type_text) do |form_field| %>
3
+ <%= form_field.label(:q, filter_type_text.humanized_field_name) %>
4
+ <div class="relative inline-block">
5
+ <%= form_field.select(
6
+ :op,
7
+ filter_type_text.operators,
8
+ {},
9
+ { class: "super-input super-input-select-field" }
10
+ ) %>
11
+ <div class="super-input-select-icon text-gray-700">
12
+ <span class="h-4 w-4">
13
+ <%= render "super/feather/chevron_down" %>
14
+ </span>
15
+ </div>
16
+ </div>
17
+ <%= form_field.text_field(
18
+ :q,
19
+ class: "super-input w-full mt-3"
20
+ ) %>
21
+ <% end %>
22
+ </div>
@@ -0,0 +1,35 @@
1
+ <div class="super-field-group">
2
+ <%= form.fields_for(filter_type_timestamp.field_name, filter_type_timestamp) do |form_field| %>
3
+ <%= form_field.label(:q0, filter_type_timestamp.humanized_field_name) %>
4
+ <div class="relative inline-block mt-2">
5
+ <%= form_field.select(
6
+ :op,
7
+ filter_type_timestamp.operators,
8
+ {},
9
+ { class: "super-input super-input-select-field" }
10
+ ) %>
11
+ <div class="super-input-select-icon text-gray-700">
12
+ <span class="h-4 w-4">
13
+ <%= render "super/feather/chevron_down" %>
14
+ </span>
15
+ </div>
16
+ </div>
17
+ <div class="flex items-center mt-3">
18
+ <div class="flex-initial">
19
+ <%= form_field.text_field(
20
+ :q0,
21
+ class: "super-input w-full"
22
+ ) %>
23
+ </div>
24
+ <div class="flex-initial px-2">
25
+ &ndash;
26
+ </div>
27
+ <div class="flex-initial">
28
+ <%= form_field.text_field(
29
+ :q1,
30
+ class: "super-input w-full"
31
+ ) %>
32
+ </div>
33
+ </div>
34
+ <% end %>
35
+ </div>
@@ -1,17 +1,17 @@
1
- <%
2
- colors = {
1
+ <% if flash.any? %>
2
+ <% colors = {
3
3
  "notice" => { bg: "bg-blue-100", fg: "text-blue-400", border: "border-blue-600" },
4
4
  "alert" => { bg: "bg-red-100", fg: "text-red-400", border: "border-red-600" },
5
- }
6
- %>
5
+ } %>
7
6
 
8
- <div data-flash="anchor">
9
- <% flash.each do |level, messages| %>
10
- <% Array(messages).each do |message| %>
11
- <% color = colors[level.to_s] || colors["notice"] %>
12
- <div class="<%= "%<bg>s %<fg>s border-l-4 %<border>s p-4 mt-2" % color %>">
13
- <%= message %>
14
- </div>
7
+ <div class="mt-8">
8
+ <% flash.each do |level, messages| %>
9
+ <% Array(messages).each do |message| %>
10
+ <% color = colors[level.to_s] || colors["notice"] %>
11
+ <div class="<%= "%<bg>s %<fg>s border-l-4 %<border>s p-4 mt-2" % color %>">
12
+ <%= message %>
13
+ </div>
14
+ <% end %>
15
15
  <% end %>
16
- <% end %>
17
- </div>
16
+ </div>
17
+ <% end %>
@@ -1,5 +1,9 @@
1
- <div class="super-field-group">
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
2
4
  <%= form.check_box(column, data: { action: "toggle-pending-destruction#call" }) %>
3
5
  <%= form.label(column) %>
4
6
  <%= render "form_inline_errors", form: form, column: column %>
5
- </div>
7
+ <% if !local_assigns[:ungrouped] %>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
4
+ <div class="<%= Super::ViewHelper.classes(["mt-1", !local_assigns[:hide_label]]) %>">
5
+ <div>
6
+ <%= form.check_box(column) %>
7
+ <% if !local_assigns[:hide_label] %>
8
+ <%= form.label(column, class: "select-none") %>
9
+ <% end %>
10
+ </div>
11
+ <%= render "form_inline_errors", form: form, column: column %>
12
+ </div>
13
+ <% if !local_assigns[:ungrouped] %>
14
+ </div>
15
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
4
+ <% if !local_assigns[:hide_label] %>
5
+ <%= form.label(column, class: "block") %>
6
+ <% end %>
7
+ <div class="<%= Super::ViewHelper.classes(["mt-1", !local_assigns[:hide_label]]) %>">
8
+ <%= form.public_send(
9
+ local_assigns.fetch(:form_builder_method),
10
+ column,
11
+ class: "super-input w-full"
12
+ ) %>
13
+ <% if !local_assigns[:hide_form_inline_errors] %>
14
+ <%= render "form_inline_errors", form: form, column: column %>
15
+ <% end %>
16
+ </div>
17
+ <% if !local_assigns[:ungrouped] %>
18
+ </div>
19
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
4
+ <% if !local_assigns[:hide_label] %>
5
+ <%= form.label(column, class: "block") %>
6
+ <% end %>
7
+ <div class="<%= Super::ViewHelper.classes(["mt-1", !local_assigns[:hide_label]]) %>">
8
+ <%= form.rich_text_area(column, class: "trix-content super-input w-full") %>
9
+ <%= render "form_inline_errors", form: form, column: column %>
10
+ </div>
11
+ <% if !local_assigns[:ungrouped] %>
12
+ </div>
13
+ <% end %>
@@ -1,6 +1,10 @@
1
- <div class="super-field-group">
2
- <%= form.label(column, class: "block") %>
3
- <div class="super-input-select mt-1">
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
4
+ <% if !local_assigns[:hide_label] %>
5
+ <%= form.label(column, class: "block") %>
6
+ <% end %>
7
+ <div class="<%= Super::ViewHelper.classes("super-input-select", ["mt-1", !local_assigns[:hide_label]]) %>">
4
8
  <%= form.select(
5
9
  column,
6
10
  form_field_select[:collection],
@@ -9,9 +13,11 @@
9
13
  ) %>
10
14
  <div class="super-input-select-icon text-gray-700">
11
15
  <span class="h-4 w-4">
12
- <%= render "super/feather/chevron_down.svg" %>
16
+ <%= render "super/feather/chevron_down" %>
13
17
  </span>
14
18
  </div>
15
19
  </div>
16
20
  <%= render "form_inline_errors", form: form, column: column %>
17
- </div>
21
+ <% if !local_assigns[:ungrouped] %>
22
+ </div>
23
+ <% end %>