super 0.0.9 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +0 -9
  3. data/README.md +40 -52
  4. data/app/assets/javascripts/super/application.js +5671 -3669
  5. data/app/assets/stylesheets/super/application.css +114693 -71486
  6. data/app/controllers/super/application_controller.rb +24 -13
  7. data/app/helpers/super/form_builder_helper.rb +25 -0
  8. data/app/views/layouts/super/application.html.erb +15 -14
  9. data/app/views/super/application/{_super_schema_display_actions.html.erb → _display_actions.html.erb} +0 -0
  10. data/app/views/super/application/{_super_schema_display_index.html.erb → _display_index.html.erb} +5 -5
  11. data/app/views/super/application/_display_show.html.erb +8 -0
  12. data/app/views/super/application/_filter.html.erb +5 -13
  13. data/app/views/super/application/_filter_type_select.html.erb +9 -19
  14. data/app/views/super/application/_filter_type_text.html.erb +7 -11
  15. data/app/views/super/application/_filter_type_timestamp.html.erb +6 -17
  16. data/app/views/super/application/_form.html.erb +15 -0
  17. data/app/views/super/application/_form_field__destroy.html.erb +1 -9
  18. data/app/views/super/application/_form_field_checkbox.html.erb +1 -15
  19. data/app/views/super/application/_form_field_flatpickr_date.html.erb +8 -0
  20. data/app/views/super/application/_form_field_flatpickr_datetime.html.erb +8 -0
  21. data/app/views/super/application/_form_field_flatpickr_time.html.erb +8 -0
  22. data/app/views/super/application/_form_field_rich_text_area.html.erb +1 -13
  23. data/app/views/super/application/_form_field_select.html.erb +1 -23
  24. data/app/views/super/application/_form_field_text.html.erb +1 -13
  25. data/app/views/super/application/{_super_layout.html.erb → _layout.html.erb} +8 -8
  26. data/app/views/super/application/{_super_pagination.html.erb → _pagination.html.erb} +1 -1
  27. data/app/views/super/application/{_super_panel.html.erb → _panel.html.erb} +2 -2
  28. data/app/views/super/application/_query.html.erb +18 -0
  29. data/app/views/super/application/_sort.html.erb +18 -0
  30. data/app/views/super/application/_sort_expression.html.erb +25 -0
  31. data/app/views/super/application/edit.html.erb +1 -0
  32. data/app/views/super/application/index.html.erb +1 -0
  33. data/app/views/super/application/new.html.erb +1 -0
  34. data/app/views/super/application/show.html.erb +1 -0
  35. data/app/views/super/feather/README.md +1 -0
  36. data/app/views/super/feather/_x.html +15 -0
  37. data/config/routes.rb +2 -0
  38. data/frontend/super-frontend/dist/application.css +114693 -71486
  39. data/frontend/super-frontend/dist/application.js +5671 -3669
  40. data/lib/generators/super/action_text/action_text_generator.rb +2 -0
  41. data/lib/generators/super/install/install_generator.rb +18 -7
  42. data/lib/generators/super/install/templates/base_controller.rb.tt +9 -1
  43. data/lib/generators/super/install/templates/initializer.rb.tt +9 -2
  44. data/lib/generators/super/resource/resource_generator.rb +107 -30
  45. data/lib/generators/super/resource/templates/resources_controller.rb.tt +3 -9
  46. data/lib/generators/super/webpacker/webpacker_generator.rb +11 -5
  47. data/lib/super.rb +9 -2
  48. data/lib/super/action_inquirer.rb +2 -0
  49. data/lib/super/assets.rb +46 -23
  50. data/lib/super/cheat.rb +17 -0
  51. data/lib/super/client_error.rb +2 -0
  52. data/lib/super/compatibility.rb +21 -0
  53. data/lib/super/configuration.rb +16 -24
  54. data/lib/super/controls.rb +11 -2
  55. data/lib/super/controls/optional.rb +35 -1
  56. data/lib/super/controls/steps.rb +27 -35
  57. data/lib/super/controls/view.rb +55 -0
  58. data/lib/super/display.rb +29 -13
  59. data/lib/super/display/guesser.rb +4 -0
  60. data/lib/super/display/schema_types.rb +73 -33
  61. data/lib/super/engine.rb +4 -0
  62. data/lib/super/error.rb +21 -0
  63. data/lib/super/filter.rb +2 -0
  64. data/lib/super/filter/form_object.rb +5 -8
  65. data/lib/super/filter/guesser.rb +2 -0
  66. data/lib/super/filter/operator.rb +2 -0
  67. data/lib/super/filter/schema_types.rb +2 -0
  68. data/lib/super/form.rb +3 -1
  69. data/lib/super/form/builder.rb +289 -39
  70. data/lib/super/form/guesser.rb +12 -1
  71. data/lib/super/form/inline_errors.rb +28 -0
  72. data/lib/super/form/schema_types.rb +15 -0
  73. data/lib/super/form/strong_params.rb +2 -0
  74. data/lib/super/layout.rb +3 -1
  75. data/lib/super/link.rb +44 -31
  76. data/lib/super/link_builder.rb +58 -0
  77. data/lib/super/navigation.rb +164 -0
  78. data/lib/super/pagination.rb +3 -1
  79. data/lib/super/panel.rb +3 -1
  80. data/lib/super/partial.rb +2 -0
  81. data/lib/super/partial/resolving.rb +2 -0
  82. data/lib/super/plugin.rb +2 -0
  83. data/lib/super/query/form_object.rb +48 -0
  84. data/lib/super/schema.rb +2 -0
  85. data/lib/super/schema/common.rb +2 -0
  86. data/lib/super/schema/guesser.rb +2 -0
  87. data/lib/super/sort.rb +110 -0
  88. data/lib/super/useful/builder.rb +25 -0
  89. data/lib/super/useful/enum.rb +63 -0
  90. data/lib/super/version.rb +3 -1
  91. data/lib/super/view_helper.rb +2 -19
  92. data/lib/tasks/super/cheat.rake +9 -0
  93. metadata +53 -40
  94. data/CONTRIBUTING.md +0 -56
  95. data/Rakefile +0 -34
  96. data/STABILITY.md +0 -50
  97. data/app/views/super/application/_form_field_generic.html.erb +0 -19
  98. data/app/views/super/application/_form_inline_errors.html.erb +0 -10
  99. data/app/views/super/application/_super_schema_display_show.html.erb +0 -8
  100. data/app/views/super/application/_super_schema_form.html.erb +0 -15
  101. data/docs/README.md +0 -8
  102. data/docs/action_text.md +0 -48
  103. data/docs/faq.md +0 -44
  104. data/docs/installation.md +0 -21
  105. data/docs/quick_start.md +0 -30
  106. data/docs/webpacker.md +0 -25
  107. data/docs/yard_customizations.rb +0 -41
  108. data/frontend/super-frontend/build.js +0 -36
  109. data/frontend/super-frontend/package.json +0 -20
  110. data/frontend/super-frontend/postcss.config.js +0 -6
  111. data/frontend/super-frontend/src/javascripts/super/application.js +0 -15
  112. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.js +0 -17
  113. data/frontend/super-frontend/src/javascripts/super/toggle_pending_destruction_controller.js +0 -15
  114. data/frontend/super-frontend/src/stylesheets/super/application.css +0 -77
  115. data/frontend/super-frontend/tailwind.config.js +0 -15
  116. data/frontend/super-frontend/yarn.lock +0 -5443
  117. data/lib/super/controls/required.rb +0 -13
  118. data/lib/super/filter/plugin.rb +0 -47
  119. data/lib/super/navigation/automatic.rb +0 -71
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Super
2
4
  # Provides a default implementation for each of the resourceful actions
3
5
  class ApplicationController < ActionController::Base
@@ -5,26 +7,31 @@ module Super
5
7
 
6
8
  helper_method :action_inquirer
7
9
  helper_method :controls
10
+ helper_method :navigation
8
11
 
9
12
  # Displays a list of records to the user
10
13
  def index
11
14
  @records = controls.load_records(action: action_inquirer, params: params)
12
- @display = controls.display_schema(action: action_inquirer)
13
- @view = controls.build_index_view
15
+ @display = controls.display_schema(action: action_inquirer).apply(action: action_inquirer)
16
+ @view = controls.index_view
17
+ @query_form = controls.initialize_query_form(params: params, current_path: request.path)
18
+ controls.initialize_filter_form(query_form: @query_form)
19
+ controls.initialize_sort_form(query_form: @query_form)
20
+ @records = controls.apply_queries(query_form: @query_form, records: @records)
14
21
  end
15
22
 
16
23
  # Displays a specific record to the user
17
24
  def show
18
25
  @record = controls.load_record(action: action_inquirer, params: params)
19
- @display = controls.display_schema(action: action_inquirer)
20
- @view = controls.build_show_view
26
+ @display = controls.display_schema(action: action_inquirer).apply(action: action_inquirer)
27
+ @view = controls.show_view
21
28
  end
22
29
 
23
30
  # Displays a form to allow the user to create a new record
24
31
  def new
25
32
  @record = controls.build_record(action: action_inquirer)
26
33
  @form = controls.form_schema(action: action_inquirer)
27
- @view = controls.build_new_view
34
+ @view = controls.new_view
28
35
  end
29
36
 
30
37
  # Creates a record, or shows the validation errors
@@ -32,10 +39,10 @@ module Super
32
39
  @record = controls.build_record_with_params(action: action_inquirer, params: params)
33
40
 
34
41
  if controls.save_record(action: action_inquirer, record: @record, params: params)
35
- redirect_to polymorphic_path(Super.configuration.path_parts(@record))
42
+ redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
36
43
  else
37
44
  @form = controls.form_schema(action: action_inquirer_for("new"))
38
- @view = controls.build_new_view
45
+ @view = controls.new_view
39
46
  render :new, status: :bad_request
40
47
  end
41
48
  end
@@ -44,7 +51,7 @@ module Super
44
51
  def edit
45
52
  @record = controls.load_record(action: action_inquirer, params: params)
46
53
  @form = controls.form_schema(action: action_inquirer)
47
- @view = controls.build_edit_view
54
+ @view = controls.edit_view
48
55
  end
49
56
 
50
57
  # Updates a record, or shows validation errors
@@ -52,10 +59,10 @@ module Super
52
59
  @record = controls.load_record(action: action_inquirer, params: params)
53
60
 
54
61
  if controls.update_record(action: action_inquirer, record: @record, params: params)
55
- redirect_to polymorphic_path(Super.configuration.path_parts(@record))
62
+ redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
56
63
  else
57
64
  @form = controls.form_schema(action: action_inquirer_for("edit"))
58
- @view = controls.build_edit_view
65
+ @view = controls.edit_view
59
66
  render :edit, status: :bad_request
60
67
  end
61
68
  end
@@ -65,14 +72,14 @@ module Super
65
72
  @record = controls.load_record(action: action_inquirer, params: params)
66
73
 
67
74
  if controls.destroy_record(action: action_inquirer, record: @record, params: params)
68
- redirect_to polymorphic_path(Super.configuration.path_parts(controls.model))
75
+ redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
69
76
  else
70
77
  flash.alert = "Couldn't delete record"
71
- redirect_to polymorphic_path(Super.configuration.path_parts(@record))
78
+ redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
72
79
  end
73
80
  rescue ActiveRecord::InvalidForeignKey => e
74
81
  flash.alert = "Couldn't delete record: #{e.class}"
75
- redirect_to polymorphic_path(Super.configuration.path_parts(@record))
82
+ redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
76
83
  end
77
84
 
78
85
  private
@@ -91,5 +98,9 @@ module Super
91
98
  action
92
99
  )
93
100
  end
101
+
102
+ def navigation
103
+ Navigation.new(&:all)
104
+ end
94
105
  end
95
106
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Super
4
+ module FormBuilderHelper
5
+ def super_form_for(record, options = {}, &block)
6
+ original = ActionView::Base.field_error_proc
7
+ ActionView::Base.field_error_proc = Form::Builder::FIELD_ERROR_PROC
8
+
9
+ options[:builder] ||= Form::Builder
10
+ return form_for(record, options, &block)
11
+ ensure
12
+ ActionView::Base.field_error_proc = original
13
+ end
14
+
15
+ def super_form_with(**options, &block)
16
+ original = ActionView::Base.field_error_proc
17
+ ActionView::Base.field_error_proc = Form::Builder::FIELD_ERROR_PROC
18
+
19
+ options[:builder] ||= Form::Builder
20
+ return form_with(**options, &block)
21
+ ensure
22
+ ActionView::Base.field_error_proc = original
23
+ end
24
+ end
25
+ end
@@ -13,11 +13,7 @@
13
13
  <% if stylesheet.handler.sprockets? %>
14
14
  <%= stylesheet_link_tag(stylesheet.path, **stylesheet.arguments) %>
15
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 %>
16
+ <%= stylesheet_pack_tag(stylesheet.path, **stylesheet.arguments) %>
21
17
  <% end %>
22
18
  <% end %>
23
19
 
@@ -25,11 +21,7 @@
25
21
  <% if javascript.handler.sprockets? %>
26
22
  <%= javascript_include_tag(javascript.path) %>
27
23
  <% 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 %>
24
+ <%= javascript_pack_tag(javascript.path) %>
33
25
  <% end %>
34
26
  <% end %>
35
27
  </head>
@@ -38,10 +30,19 @@
38
30
  <div class="px-4">
39
31
  <header class="pt-4">
40
32
  <h1 class="text-lg font-bold mr-6 mb-1"><%= Super.configuration.title %></h1>
41
- <%
42
- route_namespace = Super.configuration.route_namespace.map(&:to_s).join("/")
43
- Super::Navigation::Automatic.new(route_namespace: route_namespace).each do |text, href| %>
44
- <%= link_to(text, href, class: "inline-block mr-6") %>
33
+ <% navigation.definition.each do |link_or_menu| %>
34
+ <% if link_or_menu.is_a?(Super::Link) %>
35
+ <%= link_or_menu.to_s(default_options: { class: "inline-block mr-6" }) %>
36
+ <% else %>
37
+ <details class="details-reset select-none inline-block mr-6" data-controller="click-outside-to-close" data-action="click@window->click-outside-to-close#close">
38
+ <summary class="text-blue-700"><%= link_or_menu.title %></summary>
39
+ <ul class="absolute bg-white shadow-md px-4 py-3">
40
+ <% link_or_menu.links.each do |link| %>
41
+ <li><%= link.to_s(default_options: { class: "" }) %></li>
42
+ <% end %>
43
+ </ul>
44
+ </details>
45
+ <% end %>
45
46
  <% end %>
46
47
  </header>
47
48
 
@@ -1,9 +1,9 @@
1
- <div class="mt-4 overflow-x-auto lg:overflow-x-visible">
1
+ <div class="mt-4 overflow-x-auto">
2
2
  <table class="w-full border-separate relative" cellspacing="0" cellpadding="0">
3
3
  <thead class="">
4
4
  <tr class="">
5
- <% super_schema_display_index.each_attribute_name do |attribute_name| %>
6
- <th class="p-2 first:pl-6 border-b border-b-2 border-gray-400 text-gray-600 text-left text-sm font-normal bg-white sticky top-0 z-10">
5
+ <% display_index.each_attribute_name do |attribute_name| %>
6
+ <th class="p-2 first:pl-6 border-b border-b-2 border-gray-400 text-gray-600 text-left text-sm font-normal bg-white top-0 z-10">
7
7
  <%= controls.model.human_attribute_name(attribute_name) %>
8
8
  </th>
9
9
  <% end %>
@@ -12,9 +12,9 @@
12
12
  <tbody class="">
13
13
  <% @records.each.with_index do |record, row_index| %>
14
14
  <tr id="record-pk-<%= record.id %>" class="group">
15
- <% super_schema_display_index.each_attribute_name do |attribute_name| %>
15
+ <% display_index.each_attribute_name do |attribute_name| %>
16
16
  <td class="py-1 px-2 first:pl-5 border-transparent border-t border-b group-hover:bg-blue-200 first:border-l first:rounded-l-lg last:border-r last:rounded-r-lg bg-white <%= Super::ViewHelper.classes(["bg-gray-100", row_index.odd?]) %>">
17
- <%= super_schema_display_index.render_field(template: self, record: record, column: attribute_name) %>
17
+ <%= display_index.render_attribute(template: self, record: record, column: attribute_name) %>
18
18
  </td>
19
19
  <% end %>
20
20
  </tr>
@@ -0,0 +1,8 @@
1
+ <table class="max-w-full mt-4">
2
+ <% display_show.each_attribute_name do |attribute_name| %>
3
+ <tr>
4
+ <th class="py-1 align-baseline text-right px-4"><%= controls.model.human_attribute_name(attribute_name) %></th>
5
+ <td class="py-1 align-baseline"><%= display_show.render_attribute(template: self, record: @record, column: attribute_name) %></td>
6
+ </tr>
7
+ <% end %>
8
+ </table>
@@ -1,14 +1,6 @@
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 %>
1
+ <h1 class="text-lg">Filter</h1>
2
+ <% filter.each_field do |filter_field| %>
3
+ <div class="mt-4">
4
+ <%= render(filter_field, form: form) %>
5
+ </div>
14
6
  <% end %>
@@ -1,31 +1,21 @@
1
- <div class="super-field-group">
1
+ <div class="super-field-group" data-controller="clean-filter-param">
2
2
  <%= form.fields_for(filter_type_select.field_name, filter_type_select) do |form_field| %>
3
3
  <%= form_field.label(:q, filter_type_select.humanized_field_name) %>
4
- <div class="super-input-select inline-block">
5
- <%= form_field.select(
4
+ <div class="relative inline-block">
5
+ <%= form_field.super.select(
6
6
  :op,
7
7
  filter_type_select.operators,
8
- {},
9
- { class: "super-input super-input-select-field" }
8
+ { include_blank: false },
9
+ data: { clean_filter_param_target: "candidate" }
10
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
11
  </div>
17
- <div class="super-input-select mt-3">
18
- <%= form_field.select(
12
+ <div class="mt-3">
13
+ <%= form_field.super.select(
19
14
  :q,
20
15
  filter_type_select.field_type.collection,
21
- { include_blank: true },
22
- { class: "super-input super-input-select-field" }
16
+ {},
17
+ data: { clean_filter_param_target: "control candidate" }
23
18
  ) %>
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
19
  </div>
30
20
  <% end %>
31
21
  </div>
@@ -1,22 +1,18 @@
1
- <div class="super-field-group">
1
+ <div class="super-field-group" data-controller="clean-filter-param">
2
2
  <%= form.fields_for(filter_type_text.field_name, filter_type_text) do |form_field| %>
3
3
  <%= form_field.label(:q, filter_type_text.humanized_field_name) %>
4
4
  <div class="relative inline-block">
5
- <%= form_field.select(
5
+ <%= form_field.super.select(
6
6
  :op,
7
7
  filter_type_text.operators,
8
- {},
9
- { class: "super-input super-input-select-field" }
8
+ { include_blank: false },
9
+ data: { clean_filter_param_target: "candidate" }
10
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
11
  </div>
17
- <%= form_field.text_field(
12
+ <%= form_field.super.text_field(
18
13
  :q,
19
- class: "super-input w-full mt-3"
14
+ class: "mt-3",
15
+ data: { clean_filter_param_target: "control candidate" }
20
16
  ) %>
21
17
  <% end %>
22
18
  </div>
@@ -1,34 +1,23 @@
1
- <div class="super-field-group">
1
+ <div class="super-field-group" data-controller="clean-filter-param">
2
2
  <%= form.fields_for(filter_type_timestamp.field_name, filter_type_timestamp) do |form_field| %>
3
3
  <%= form_field.label(:q0, filter_type_timestamp.humanized_field_name) %>
4
4
  <div class="relative inline-block mt-2">
5
- <%= form_field.select(
5
+ <%= form_field.super.select(
6
6
  :op,
7
7
  filter_type_timestamp.operators,
8
- {},
9
- { class: "super-input super-input-select-field" }
8
+ { include_blank: false },
9
+ data: { clean_filter_param_target: "candidate" }
10
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
11
  </div>
17
12
  <div class="flex items-center mt-3">
18
13
  <div class="flex-initial">
19
- <%= form_field.text_field(
20
- :q0,
21
- class: "super-input w-full"
22
- ) %>
14
+ <%= form_field.super.flatpickr_datetime(:q0, data: { clean_filter_param_target: "control candidate" }) %>
23
15
  </div>
24
16
  <div class="flex-initial px-2">
25
17
  &ndash;
26
18
  </div>
27
19
  <div class="flex-initial">
28
- <%= form_field.text_field(
29
- :q1,
30
- class: "super-input w-full"
31
- ) %>
20
+ <%= form_field.super.flatpickr_datetime(:q1, data: { clean_filter_param_target: "control candidate" }) %>
32
21
  </div>
33
22
  </div>
34
23
  <% end %>
@@ -0,0 +1,15 @@
1
+ <%= super_form_for(Super::Link.polymorphic_parts(@record), builder: Super::Form::Builder) do |f| %>
2
+ <div class="max-w-3xl">
3
+ <% form.each_attribute do |field, type| %>
4
+ <%= render(
5
+ type,
6
+ form: f,
7
+ column: field
8
+ ) %>
9
+ <% end %>
10
+
11
+ <div>
12
+ <%= f.super.submit class: "super-button--fill-blue mt-2" %>
13
+ </div>
14
+ </div>
15
+ <% end %>
@@ -1,9 +1 @@
1
- <% if !local_assigns[:ungrouped] %>
2
- <div class="super-field-group">
3
- <% end %>
4
- <%= form.check_box(column, data: { action: "toggle-pending-destruction#call" }) %>
5
- <%= form.label(column) %>
6
- <%= render "form_inline_errors", form: form, column: column %>
7
- <% if !local_assigns[:ungrouped] %>
8
- </div>
9
- <% end %>
1
+ <%= form.super.check_box!(column, field: { data: { action: "toggle-pending-destruction#call" } }) %>
@@ -1,15 +1 @@
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 %>
1
+ <%= form.super.check_box!(column) %>
@@ -0,0 +1,8 @@
1
+ <%= form.super.flatpickr_date!(
2
+ column,
3
+ **form_field_flatpickr_date.extras.deep_merge(
4
+ field: {
5
+ value: form.object.public_send(column)&.iso8601,
6
+ }
7
+ )
8
+ ) %>
@@ -0,0 +1,8 @@
1
+ <%= form.super.flatpickr_datetime!(
2
+ column,
3
+ **form_field_flatpickr_datetime.extras.deep_merge(
4
+ field: {
5
+ value: form.object.public_send(column)&.iso8601,
6
+ }
7
+ )
8
+ ) %>
@@ -0,0 +1,8 @@
1
+ <%= form.super.flatpickr_time!(
2
+ column,
3
+ **form_field_flatpickr_time.extras.deep_merge(
4
+ field: {
5
+ value: form.object.public_send(column)&.strftime("%H:%M:%S"),
6
+ }
7
+ )
8
+ ) %>
@@ -1,13 +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(["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
+ <%= form.super.rich_text_area!(column) %>