super 0.0.3 → 0.0.8

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +11 -0
  3. data/CONTRIBUTING.md +56 -0
  4. data/README.md +65 -76
  5. data/STABILITY.md +50 -0
  6. data/app/assets/javascripts/super/application.js +1186 -11151
  7. data/app/assets/stylesheets/super/application.css +93514 -27381
  8. data/app/controllers/super/application_controller.rb +49 -72
  9. data/app/views/layouts/super/application.html.erb +24 -14
  10. data/app/views/super/application/_collection_header.html.erb +15 -0
  11. data/app/views/super/application/_filter.html.erb +14 -0
  12. data/app/views/super/application/_filter_type_select.html.erb +31 -0
  13. data/app/views/super/application/_filter_type_text.html.erb +22 -0
  14. data/app/views/super/application/_filter_type_timestamp.html.erb +35 -0
  15. data/app/views/super/application/_flash.html.erb +13 -13
  16. data/app/views/super/application/_form_field__destroy.html.erb +7 -3
  17. data/app/views/super/application/_form_field_select.html.erb +14 -8
  18. data/app/views/super/application/_form_field_text.html.erb +13 -5
  19. data/app/views/super/application/_form_fieldset.html.erb +1 -1
  20. data/app/views/super/application/_form_has_many.html.erb +5 -5
  21. data/app/views/super/application/_form_inline_errors.html.erb +1 -1
  22. data/app/views/super/application/_member_header.html.erb +16 -0
  23. data/app/views/super/application/_super_layout.html.erb +29 -0
  24. data/app/views/super/application/_super_pagination.html.erb +16 -0
  25. data/app/views/super/application/_super_panel.html.erb +7 -0
  26. data/app/views/super/application/_super_schema_display_actions.html.erb +5 -0
  27. data/app/views/super/application/_super_schema_display_index.html.erb +24 -0
  28. data/app/views/super/application/_super_schema_display_show.html.erb +8 -0
  29. data/app/views/super/application/_super_schema_form.html.erb +15 -0
  30. data/app/views/super/application/edit.html.erb +1 -6
  31. data/app/views/super/application/index.html.erb +1 -1
  32. data/app/views/super/application/new.html.erb +1 -6
  33. data/app/views/super/application/show.html.erb +1 -1
  34. data/app/views/super/feather/{_chevron_down.svg → _chevron_down.html} +0 -0
  35. data/config/locales/en.yml +5 -0
  36. data/docs/README.md +6 -0
  37. data/docs/cheat.md +41 -0
  38. data/docs/faq.md +44 -0
  39. data/docs/quick_start.md +45 -0
  40. data/docs/webpacker.md +17 -0
  41. data/docs/yard_customizations.rb +41 -0
  42. data/frontend/super-frontend/build.js +12 -12
  43. data/frontend/super-frontend/dist/application.css +93514 -27381
  44. data/frontend/super-frontend/dist/application.js +1186 -11151
  45. data/frontend/super-frontend/package.json +8 -4
  46. data/frontend/super-frontend/postcss.config.js +4 -4
  47. data/frontend/super-frontend/src/javascripts/super/application.ts +11 -9
  48. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.ts +19 -0
  49. data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +1 -1
  50. data/frontend/super-frontend/src/javascripts/super/toggle_pending_destruction_controller.ts +15 -0
  51. data/frontend/super-frontend/src/stylesheets/super/application.css +63 -0
  52. data/frontend/super-frontend/tailwind.config.js +12 -4
  53. data/frontend/super-frontend/yarn.lock +1429 -1372
  54. data/lib/generators/super/install/install_generator.rb +16 -0
  55. data/lib/generators/super/resource/templates/resources_controller.rb.tt +1 -31
  56. data/lib/generators/super/webpacker/webpacker_generator.rb +10 -1
  57. data/lib/super.rb +26 -5
  58. data/lib/super/action_inquirer.rb +2 -2
  59. data/lib/super/assets.rb +108 -38
  60. data/lib/super/client_error.rb +43 -0
  61. data/lib/super/compatibility.rb +25 -0
  62. data/lib/super/configuration.rb +21 -69
  63. data/lib/super/controls.rb +9 -37
  64. data/lib/super/controls/optional.rb +79 -0
  65. data/lib/super/controls/required.rb +13 -0
  66. data/lib/super/controls/steps.rb +114 -0
  67. data/lib/super/display.rb +66 -3
  68. data/lib/super/display/guesser.rb +34 -0
  69. data/lib/super/display/schema_types.rb +55 -25
  70. data/lib/super/engine.rb +7 -1
  71. data/lib/super/error.rb +9 -9
  72. data/lib/super/filter.rb +12 -0
  73. data/lib/super/filter/form_object.rb +97 -0
  74. data/lib/super/filter/guesser.rb +30 -0
  75. data/lib/super/filter/operator.rb +103 -0
  76. data/lib/super/filter/plugin.rb +47 -0
  77. data/lib/super/filter/schema_types.rb +112 -0
  78. data/lib/super/form.rb +35 -0
  79. data/lib/super/form/builder.rb +48 -0
  80. data/lib/super/form/guesser.rb +27 -0
  81. data/lib/super/form/schema_types.rb +20 -23
  82. data/lib/super/form/strong_params.rb +29 -0
  83. data/lib/super/layout.rb +47 -0
  84. data/lib/super/link.rb +110 -0
  85. data/lib/super/pagination.rb +74 -8
  86. data/lib/super/panel.rb +30 -0
  87. data/lib/super/partial.rb +23 -0
  88. data/lib/super/partial/resolving.rb +24 -0
  89. data/lib/super/plugin.rb +34 -63
  90. data/lib/super/schema.rb +12 -22
  91. data/lib/super/schema/common.rb +25 -0
  92. data/lib/super/schema/guesser.rb +77 -0
  93. data/lib/super/version.rb +1 -1
  94. data/lib/super/view_helper.rb +43 -0
  95. metadata +133 -33
  96. data/app/views/super/application/_form.html.erb +0 -14
  97. data/app/views/super/application/_index.html.erb +0 -60
  98. data/app/views/super/application/_show.html.erb +0 -12
  99. data/frontend/super-frontend/src/javascripts/super/nested_attributes_controller.ts +0 -33
  100. data/lib/super/inline_callback.rb +0 -82
  101. data/lib/super/test_support/copy_app_templates/controllers/favorite_things_controller.rb +0 -50
  102. data/lib/super/test_support/copy_app_templates/controllers/members_controller.rb +0 -57
  103. data/lib/super/test_support/copy_app_templates/controllers/ships_controller.rb +0 -47
  104. data/lib/super/test_support/copy_app_templates/migrations/20190216224956_create_members.rb +0 -11
  105. data/lib/super/test_support/copy_app_templates/migrations/20190803143320_create_ships.rb +0 -11
  106. data/lib/super/test_support/copy_app_templates/migrations/20190806014121_add_ship_to_members.rb +0 -5
  107. data/lib/super/test_support/copy_app_templates/migrations/20191126050453_create_favorite_things.rb +0 -10
  108. data/lib/super/test_support/copy_app_templates/models/favorite_thing.rb +0 -7
  109. data/lib/super/test_support/copy_app_templates/models/member.rb +0 -23
  110. data/lib/super/test_support/copy_app_templates/models/ship.rb +0 -3
  111. data/lib/super/test_support/copy_app_templates/routes.rb +0 -11
  112. data/lib/super/test_support/copy_app_templates/seeds.rb +0 -2
  113. data/lib/super/test_support/fixtures/favorite_things.yml +0 -9
  114. data/lib/super/test_support/fixtures/members.yml +0 -336
  115. data/lib/super/test_support/fixtures/ships.yml +0 -10
  116. data/lib/super/test_support/generate_copy_app.rb +0 -41
  117. data/lib/super/test_support/generate_dummy.rb +0 -93
  118. data/lib/super/test_support/starfleet_seeder.rb +0 -50
  119. data/lib/super/view.rb +0 -25
  120. data/lib/tasks/super_tasks.rake +0 -4
@@ -1,117 +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 Super::InlineCallback
5
- include Pluggable.new(:super_application_controller)
6
-
7
- register_inline_callback(:index_paginate, on: :index, after: :yield)
4
+ include ClientError::Handling
8
5
 
9
6
  helper_method :action_inquirer
10
7
  helper_method :controls
11
8
 
12
- rescue_from Error::ClientError do |exception|
13
- code, default_message =
14
- case exception
15
- when Error::UnprocessableEntity
16
- [422, "Unprocessable entity"]
17
- when Error::NotFound
18
- [404, "Not found"]
19
- when Error::Forbidden
20
- [403, "Forbidden"]
21
- when Error::Unauthorized
22
- [401, "Unauthorized"]
23
- when Error::BadRequest, Error::ClientError
24
- [400, "Bad request"]
25
- end
26
-
27
- flash.now.alert =
28
- if exception.message == exception.class.name.to_s
29
- default_message
30
- else
31
- exception.message
32
- end
9
+ # Displays a list of records to the user
10
+ def index
11
+ @records = controls.load_records(action: action_inquirer, params: params)
12
+ @display = controls.display_schema(action: action_inquirer)
13
+ @view = controls.build_index_view
14
+ end
33
15
 
34
- render "nothing", status: code
16
+ # Displays a specific record to the user
17
+ def show
18
+ @record = controls.load_record(action: action_inquirer, params: params)
19
+ @display = controls.display_schema(action: action_inquirer)
20
+ @view = controls.build_show_view
35
21
  end
36
22
 
37
- def index
38
- with_inline_callbacks do
39
- @resources = controls.scope(action: action_inquirer)
40
- end
23
+ # Displays a form to allow the user to create a new record
24
+ def new
25
+ @record = controls.build_record(action: action_inquirer)
26
+ @form = controls.form_schema(action: action_inquirer)
27
+ @view = controls.build_new_view
41
28
  end
42
29
 
30
+ # Creates a record, or shows the validation errors
43
31
  def create
44
- @resource = controls.scope(action: action_inquirer).build(create_permitted_params)
32
+ @record = controls.build_record_with_params(action: action_inquirer, params: params)
45
33
 
46
- if @resource.save
47
- 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))
48
36
  else
37
+ @form = controls.form_schema(action: action_inquirer_for("new"))
38
+ @view = controls.build_new_view
49
39
  render :new, status: :bad_request
50
40
  end
51
41
  end
52
42
 
53
- def new
54
- @resource = controls.scope(action: action_inquirer).build
55
- end
56
-
43
+ # Displays a form to allow the user to update an existing record
57
44
  def edit
58
- @resource = controls.scope(action: action_inquirer).find(params[:id])
59
- end
60
-
61
- def show
62
- @resource = controls.scope(action: action_inquirer).find(params[:id])
45
+ @record = controls.load_record(action: action_inquirer, params: params)
46
+ @form = controls.form_schema(action: action_inquirer)
47
+ @view = controls.build_edit_view
63
48
  end
64
49
 
50
+ # Updates a record, or shows validation errors
65
51
  def update
66
- @resource = controls.scope(action: action_inquirer).find(params[:id])
52
+ @record = controls.load_record(action: action_inquirer, params: params)
67
53
 
68
- if @resource.update(update_permitted_params)
69
- 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))
70
56
  else
57
+ @form = controls.form_schema(action: action_inquirer_for("edit"))
58
+ @view = controls.build_edit_view
71
59
  render :edit, status: :bad_request
72
60
  end
73
61
  end
74
62
 
63
+ # Deletes a record, or shows validation errors
75
64
  def destroy
76
- @resource = controls.scope(action: action_inquirer).find(params[:id])
77
- if @resource.destroy
65
+ @record = controls.load_record(action: action_inquirer, params: params)
66
+
67
+ if controls.destroy_record(action: action_inquirer, record: @record, params: params)
78
68
  redirect_to polymorphic_path(Super.configuration.path_parts(controls.model))
79
69
  else
80
- 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))
81
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))
82
76
  end
83
77
 
84
78
  private
85
79
 
86
- def index_paginate
87
- @pagination = Pagination.new(
88
- total_count: @resources.size,
89
- limit: Super.configuration.index_resources_per_page,
90
- query_params: request.GET,
91
- page_query_param: :page
92
- )
93
-
94
- @resources = @resources
95
- .limit(@pagination.limit)
96
- .offset(@pagination.offset)
97
- end
98
-
99
80
  def controls
100
- Super::Controls.new(new_controls)
101
- end
102
-
103
- def create_permitted_params
104
- controls.permitted_params(params, action: action_inquirer)
81
+ @controls ||= new_controls
105
82
  end
106
83
 
107
- def update_permitted_params
108
- controls.permitted_params(params, action: action_inquirer)
84
+ def action_inquirer
85
+ @action_inquirer ||= action_inquirer_for(params[:action])
109
86
  end
110
87
 
111
- def action_inquirer
112
- @action_inquirer ||= ActionInquirer.new(
113
- ActionInquirer.default_resources,
114
- params[:action]
88
+ def action_inquirer_for(action)
89
+ ActionInquirer.new(
90
+ ActionInquirer.default_for_resources,
91
+ action
115
92
  )
116
93
  end
117
94
  end
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html class="bg-white">
2
+ <html class="bg-gray-100">
3
3
  <head>
4
4
  <title><%= Super.configuration.title %></title>
5
5
  <%= csrf_meta_tags %>
@@ -7,19 +7,29 @@
7
7
  <%= csp_meta_tag %>
8
8
  <% end -%>
9
9
 
10
- <% if Super.configuration.asset_handler.sprockets? %>
11
- <%= stylesheet_link_tag "super/application", media: "all" %>
12
- <%= javascript_include_tag "super/application" %>
13
- <% elsif Super.configuration.asset_handler.webpacker? %>
14
- <%= stylesheet_pack_tag "super/application", media: "all" %>
15
- <%= javascript_pack_tag "super/application" %>
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+
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
+ <%= stylesheet_pack_tag(stylesheet.path, **stylesheet.arguments) %>
17
+ <% end %>
18
+ <% end %>
19
+
20
+ <% Super.configuration.javascripts.each do |javascript| %>
21
+ <% if javascript.handler.sprockets? %>
22
+ <%= javascript_include_tag(javascript.path) %>
23
+ <% elsif javascript.handler.webpacker? %>
24
+ <%= javascript_pack_tag(javascript.path) %>
25
+ <% end %>
16
26
  <% end %>
17
27
  </head>
18
28
 
19
- <body class="font-sans bg-white">
29
+ <body class="font-sans pb-4">
20
30
  <div class="px-4">
21
31
  <header class="pt-4">
22
- <h1 class="text-base font-bold mr-6"><%= Super.configuration.title %></h1>
32
+ <h1 class="text-lg font-bold mr-6 mb-1"><%= Super.configuration.title %></h1>
23
33
  <%
24
34
  route_namespace = Super.configuration.route_namespace.map(&:to_s).join("/")
25
35
  Super::Navigation::Automatic.new(route_namespace: route_namespace).each do |text, href| %>
@@ -29,13 +39,13 @@
29
39
 
30
40
  <%= render "flash" %>
31
41
 
32
- <div class="pt-8"></div>
33
-
34
- <% if content_for?(:header) %>
35
- <%= yield :header %>
36
- <% end %>
42
+ <div class="pt-4"></div>
37
43
 
38
44
  <%= yield %>
45
+
46
+ <div class="pt-8 text-sm text-gray-800">
47
+ <%= t("super.layout.powered_by", env: Rails.env.capitalize, version: Super::VERSION) %>
48
+ </div>
39
49
  </div>
40
50
  </body>
41
51
  </html>
@@ -0,0 +1,15 @@
1
+ <header class="flex justify-between content-end">
2
+ <h1 class="text-xl">
3
+ <%= controls.title %>
4
+ </h1>
5
+ <div>
6
+ <% controls.collection_actions(action: action_inquirer).each do |link| %>
7
+ <%= link.to_s(
8
+ default_options: {
9
+ class: "super-button super-button--border-blue super-button-sm inline-block ml-2"
10
+ },
11
+ params: params
12
+ ) %>
13
+ <% end %>
14
+ </div>
15
+ </header>
@@ -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="lg:w-1/3">
2
- <%= form.check_box(column, data: { action: "nested-attributes#toggleDestruction" }) %>
1
+ <% if !local_assigns[:ungrouped] %>
2
+ <div class="super-field-group">
3
+ <% end %>
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 %>
@@ -1,17 +1,23 @@
1
- <div class="lg:w-1/3">
2
- <%= form.label(column) %>
3
- <div class="relative mt-2">
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],
7
11
  { include_blank: true }.merge(form_field_select[:options] || {}),
8
- { class: "appearance-none border rounded w-full py-2 px-2 text-gray-900 leading-tight border border-gray-400 focus:border-blue-400 block" }
12
+ { class: "super-input super-input-select-field" }
9
13
  ) %>
10
- <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
11
- <span class="fill-current h-4 w-4">
12
- <%= render "super/feather/chevron_down.svg" %>
14
+ <div class="super-input-select-icon text-gray-700">
15
+ <span class="h-4 w-4">
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 %>
@@ -1,5 +1,13 @@
1
- <div class="lg:w-1/3">
2
- <%= form.label(column) %>
3
- <%= form.text_field(column, class: "appearance-none border rounded w-full py-2 px-2 text-gray-900 leading-tight border border-gray-400 focus:border-blue-400 mt-2") %>
4
- <%= render "form_inline_errors", form: form, column: column %>
5
- </div>
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.text_field(column, class: "super-input w-full") %>
9
+ <%= render "form_inline_errors", form: form, column: column %>
10
+ </div>
11
+ <% if !local_assigns[:ungrouped] %>
12
+ </div>
13
+ <% end %>