elaine_crud 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b047d248b9f239b4d39561e232c3540f8da4a4fa94f09ef9a6354b6c8feab0b6
4
- data.tar.gz: 9fd66a40fd55e0fd3728e74066f2fbf8587f9cb6b988654c89b7e401ab517a52
3
+ metadata.gz: b331198ebb4dcf4ce1e5d3718d65fb36e2fac98ef24c219f46206fc9cb450309
4
+ data.tar.gz: 690b1dd2f306cf3a6156dd35095471c283dd9674fe35f3895effec18d48cc047
5
5
  SHA512:
6
- metadata.gz: 47fc98e1ea24bb5823989afe05992e45425fb389c1b95ae9ea641b7cc6c929b5e8c183e1192be6156d61255293a9f38bc6e561e28bb00626ffc7a61a6e46ec4e
7
- data.tar.gz: ed9867a8cfccba6a7bfc7e060216c5e7f985d845d5de63b8efb4a0bebd2f57d8ec38a2519d5a89ab3c36428bf9ea94c61fbe1f74f76860d5b114dcc25f20f369
6
+ metadata.gz: 40b0b2d357e3bd0b87360fe7f0ea59613fb7dab409534b7843181caa15e726681ff2d1fd0d42161765be50b79bb8ac1ba7aeab03d19eaf89288e858865abacdf
7
+ data.tar.gz: dbd100c7c1dcea367e12522c14fabb94f68b6ca7a19c6f42945da72752f475c0e2e6a8684611c33253ad1edcbb31d8e20bf31ff233b3cc912c1105bf08df3fc1
@@ -4,3 +4,12 @@
4
4
  */
5
5
  @import "tailwindcss";
6
6
  @config "../../../tailwind.config.js";
7
+
8
+ @theme {
9
+ --animate-highlight-fade: highlight-fade 2s ease-out;
10
+
11
+ @keyframes highlight-fade {
12
+ 0% { background-color: var(--color-yellow-200); }
13
+ 100% { background-color: transparent; }
14
+ }
15
+ }
@@ -164,7 +164,8 @@ module ElaineCrud
164
164
  # For Turbo Frame requests, return the view row partial
165
165
  if turbo_frame_request?
166
166
  # Use bg-white for consistency when returning from edit (alternating colors handled by full page refresh)
167
- render partial: 'elaine_crud/base/view_row', locals: { record: @record, columns: @columns, row_bg_class: 'bg-white', is_last_record: false }
167
+ # Pass just_saved: true to trigger highlight animation
168
+ render partial: 'elaine_crud/base/view_row', locals: { record: @record, columns: @columns, row_bg_class: 'bg-white', is_last_record: false, just_saved: true }
168
169
  else
169
170
  redirect_to polymorphic_path(@record), notice: "#{crud_model.name} was successfully updated.", status: :see_other
170
171
  end
@@ -4,6 +4,8 @@
4
4
  <% has_multiple_rows = record_layout.length > 1 %>
5
5
  <% is_last_record = defined?(is_last_record) ? is_last_record : false %>
6
6
  <% show_actions = local_assigns.fetch(:show_actions, true) %>
7
+ <% just_saved = local_assigns.fetch(:just_saved, false) %>
8
+ <% highlight_class = just_saved ? 'animate-highlight-fade' : '' %>
7
9
 
8
10
  <%# Wrap entire row in turbo-frame for row-level inline editing %>
9
11
  <% if controller.respond_to?(:turbo_disabled?) && controller.turbo_disabled? %>
@@ -16,7 +18,7 @@
16
18
  <% rowspan = column_config[:rowspan] || 1 %>
17
19
  <% cell_border_bottom = (has_multiple_rows && !is_last_row) || !is_last_record ? 'border-b' : '' %>
18
20
 
19
- <div class="px-3 py-3 text-sm text-gray-900 border-r border-gray-200 <%= cell_border_bottom %> break-words <%= row_bg_class %> hover:bg-blue-50 <%= 'col-span-' + colspan.to_s if colspan > 1 %> <%= 'row-span-' + rowspan.to_s if rowspan > 1 %>">
21
+ <div class="px-3 py-3 text-sm text-gray-900 border-r border-gray-200 <%= cell_border_bottom %> break-words <%= row_bg_class %> hover:bg-blue-50 <%= highlight_class %> <%= 'col-span-' + colspan.to_s if colspan > 1 %> <%= 'row-span-' + rowspan.to_s if rowspan > 1 %>">
20
22
  <%= display_field_value(record, field_name) %>
21
23
  </div>
22
24
  <% end %>
@@ -24,7 +26,7 @@
24
26
  <%# Actions column (only on first row) %>
25
27
  <% if show_actions && row_index == 0 %>
26
28
  <% actions_border_bottom = has_multiple_rows ? '' : (is_last_record ? '' : 'border-b') %>
27
- <div class="px-3 py-3 text-sm text-gray-500 border-gray-200 <%= row_bg_class %> hover:bg-blue-50 <%= actions_border_bottom %> <%= 'row-span-' + record_layout.length.to_s if record_layout.length > 1 %>">
29
+ <div class="px-3 py-3 text-sm text-gray-500 border-gray-200 <%= row_bg_class %> hover:bg-blue-50 <%= highlight_class %> <%= actions_border_bottom %> <%= 'row-span-' + record_layout.length.to_s if record_layout.length > 1 %>">
28
30
  <div class="flex space-x-2">
29
31
  <% if controller.class.show_view_action_button %>
30
32
  <%= link_to "View",
@@ -60,7 +62,7 @@
60
62
  <% rowspan = column_config[:rowspan] || 1 %>
61
63
  <% cell_border_bottom = (has_multiple_rows && !is_last_row) || !is_last_record ? 'border-b' : '' %>
62
64
 
63
- <div class="px-3 py-3 text-sm text-gray-900 border-r border-gray-200 <%= cell_border_bottom %> break-words <%= row_bg_class %> hover:bg-blue-50 <%= 'col-span-' + colspan.to_s if colspan > 1 %> <%= 'row-span-' + rowspan.to_s if rowspan > 1 %>">
65
+ <div class="px-3 py-3 text-sm text-gray-900 border-r border-gray-200 <%= cell_border_bottom %> break-words <%= row_bg_class %> hover:bg-blue-50 <%= highlight_class %> <%= 'col-span-' + colspan.to_s if colspan > 1 %> <%= 'row-span-' + rowspan.to_s if rowspan > 1 %>">
64
66
  <%= display_field_value(record, field_name) %>
65
67
  </div>
66
68
  <% end %>
@@ -68,7 +70,7 @@
68
70
  <%# Actions column (only on first row) %>
69
71
  <% if show_actions && row_index == 0 %>
70
72
  <% actions_border_bottom = has_multiple_rows ? '' : (is_last_record ? '' : 'border-b') %>
71
- <div class="px-3 py-3 text-sm text-gray-500 border-gray-200 <%= row_bg_class %> hover:bg-blue-50 <%= actions_border_bottom %> <%= 'row-span-' + record_layout.length.to_s if record_layout.length > 1 %>">
73
+ <div class="px-3 py-3 text-sm text-gray-500 border-gray-200 <%= row_bg_class %> hover:bg-blue-50 <%= highlight_class %> <%= actions_border_bottom %> <%= 'row-span-' + record_layout.length.to_s if record_layout.length > 1 %>">
72
74
  <div class="flex space-x-2">
73
75
  <% if controller.class.show_view_action_button %>
74
76
  <%= link_to "View",
@@ -12,6 +12,11 @@ module ElaineCrud
12
12
  config.autoload_paths << File.expand_path('../../app/helpers', __dir__)
13
13
  config.autoload_paths << File.expand_path('..', __dir__)
14
14
 
15
+ # Register XLSX MIME type for Excel exports
16
+ initializer 'elaine_crud.mime_types', before: :load_config_initializers do
17
+ Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx
18
+ end
19
+
15
20
  # Add vendor/assets to asset paths for precompiled CSS
16
21
  initializer 'elaine_crud.assets' do |app|
17
22
  app.config.assets.paths << File.expand_path('../../vendor/assets/stylesheets', __dir__) if app.config.respond_to?(:assets)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElaineCrud
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end