mensa 0.6.3 → 0.6.4

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: b6c3d12b5f69c5a0893eae56ffda155d75a658dc46620aa18cbd379d0773e16e
4
- data.tar.gz: 9e26900083f2aba091e70e5cbcc695f575432c0705b2cc6cda56df78b2d97ed3
3
+ metadata.gz: 43d7fc2be92ed19588de7ea2ea168ae560e8ac5c5b09fd5e13600a561ad8dc0a
4
+ data.tar.gz: bb86cb4e8403f99dfbd9aa1ea2acfe596c2764430be5bc64a0951795c14a7059
5
5
  SHA512:
6
- metadata.gz: c5edc68c51ba784fb05689a538fdeec88dccfaeadee54df43a10af537700b442eb16344848a60fa7b8da20ed4c4dde8754e3c2a9bad3848ba71ed255e2598f07
7
- data.tar.gz: 327b344e58309db72a11b1d90c8d8eae950b92571434144c3f237e6aa4161ac5eb9221bb3d33609f883e1a38bd6a6c4f0eb5a11a564adf79890fe9f69083ae25
6
+ metadata.gz: 6c6abafca7fd4e75772c146277e1623ad2acc4947914d6cf7158232500dc6f07480e2a8b725ac1e041b896ebfbd60fde468392b6ebfa7892eb74a593b1af2d57
7
+ data.tar.gz: ad3b6c8c7d2e9844e51959f7bc2365094d17a07cdf996945fc002569a134f64382c5cd136cea1306d61f3b9697fb9fa4377a763367935f62a69e1b8a7afbe8a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mensa (0.6.2)
4
+ mensa (0.6.3)
5
5
  csv
6
6
  importmap-rails
7
7
  pagy (>= 43)
@@ -1,48 +1,51 @@
1
- <div class="overflow-y-auto relative"
2
- data-mensa-table-target="view"
3
- data-controller="mensa-selection"
4
- data-mensa-selection-batch-url-value="<%= table.batch_actions? ? helpers.mensa.table_batch_actions_path(table.name) : "" %>">
5
- <% if table.batch_actions? %>
6
- <div class="mensa-batch-bar hidden" data-mensa-selection-target="batchBar">
7
- <div class="mensa-batch-bar__content">
8
- <input class="mensa-table__select-all" type="checkbox" data-action="click->mensa-selection#deselectAll" data-mensa-selection-target="batchAllCheckbox">
9
- <span class="mensa-batch-bar__count" data-mensa-selection-target="selectedCount"></span>
10
- <% table.batch_actions.each do |batch_action| %>
11
- <button class="mensa-batch-bar__button" type="button" data-action="click->mensa-selection#executeBatch" data-mensa-selection-batch-action-param="<%= batch_action.name %>">
12
- <%= batch_action.title %>
13
- </button>
14
- <% end %>
15
- </div>
16
- </div>
17
- <% end %>
18
- <table class="w-full">
19
- <% if table.show_header? %>
20
- <thead>
21
- <tr>
22
- <% if table.batch_actions? %>
23
- <th class="mensa-table__checkbox-col">
24
- <div class="container">
25
- <input class="mensa-table__select-all" type="checkbox" data-action="change->mensa-selection#toggleAll" data-mensa-selection-target="headerCheckbox">
26
- </div>
27
- </th>
28
- <% end %>
29
- <% if table.actions? && Mensa.config.row_actions_position == :front %>
30
- <th class="actions" aria-label="Actions"><i class="<%= Mensa.config.icons[:action_column_header] %>" aria-hidden="true"></i></th>
1
+ <div data-mensa-table-target="view">
2
+ <div class="overflow-y-auto relative"
3
+ data-controller="mensa-selection"
4
+ data-mensa-selection-batch-url-value="<%= table.batch_actions? ? helpers.mensa.table_batch_actions_path(table.name) : "" %>">
5
+ <% if table.batch_actions? %>
6
+ <div class="mensa-batch-bar hidden" data-mensa-selection-target="batchBar">
7
+ <div class="mensa-batch-bar__content">
8
+ <input class="mensa-table__select-all" type="checkbox" data-action="click->mensa-selection#deselectAll" data-mensa-selection-target="batchAllCheckbox">
9
+ <span class="mensa-batch-bar__count" data-mensa-selection-target="selectedCount"></span>
10
+ <% table.batch_actions.each do |batch_action| %>
11
+ <button class="mensa-batch-bar__button" type="button" data-action="click->mensa-selection#executeBatch" data-mensa-selection-batch-action-param="<%= batch_action.name %>">
12
+ <%= batch_action.title %>
13
+ </button>
31
14
  <% end %>
32
- <%= render(Mensa::Header::Component.with_collection(table.display_columns, table: table)) %>
33
- <% if table.actions? && Mensa.config.row_actions_position == :back %>
34
- <th class="actions" aria-label="Actions"><i class="<%= Mensa.config.icons[:action_column_header] %>" aria-hidden="true"></i></th>
35
- <% end %>
36
- </tr>
37
- </thead>
15
+ </div>
16
+ </div>
17
+ <% end %>
18
+ <table class="w-full">
19
+ <% if table.show_header? %>
20
+ <thead>
21
+ <tr>
22
+ <% if table.batch_actions? %>
23
+ <th class="mensa-table__checkbox-col">
24
+ <div class="container">
25
+ <input class="mensa-table__select-all" type="checkbox" data-action="change->mensa-selection#toggleAll" data-mensa-selection-target="headerCheckbox">
26
+ </div>
27
+ </th>
28
+ <% end %>
29
+ <% if table.actions? && Mensa.config.row_actions_position == :front %>
30
+ <th class="actions" aria-label="Actions"><i class="<%= Mensa.config.icons[:action_column_header] %>" aria-hidden="true"></i></th>
31
+ <% end %>
32
+ <%= render(Mensa::Header::Component.with_collection(table.display_columns, table: table)) %>
33
+ <% if table.actions? && Mensa.config.row_actions_position == :back %>
34
+ <th class="actions" aria-label="Actions"><i class="<%= Mensa.config.icons[:action_column_header] %>" aria-hidden="true"></i></th>
35
+ <% end %>
36
+ </tr>
37
+ </thead>
38
+ <% end %>
39
+ <tbody>
40
+ <%= render(Mensa::TableRow::Component.with_collection(table.rows, table: table)) %>
41
+ </tbody>
42
+ </table>
43
+ <% if table.pagy_details&.count == 0 %>
44
+ <%= render Mensa::EmptyState::Component.new(table: table) %>
38
45
  <% end %>
39
- <tbody>
40
- <%= render(Mensa::TableRow::Component.with_collection(table.rows, table: table)) %>
41
- </tbody>
42
- </table>
43
- <% if table.pagy_details&.count == 0 %>
44
- <%= render Mensa::EmptyState::Component.new(table: table) %>
45
- <% elsif table.pagy_details&.last > 1 %>
46
+ </div>
47
+
48
+ <% if table.pagy_details&.count != 0 && table.pagy_details&.last > 1 %>
46
49
  <div class="paging">
47
50
  <span><%= t("mensa.paging.info", model: model_name_plural, from: table.pagy_details.from, to: table.pagy_details.to, count: table.pagy_details.count) %></span>
48
51
  <%== table.pagy_details.series_nav(anchor_string: 'data-turbo-frame="_self"') %>
@@ -74,7 +74,7 @@ module Mensa
74
74
  @attribute_for_condition = if config[:attribute].present?
75
75
  raw_attribute
76
76
  elsif table.model.column_names.include? name.to_s
77
- "#{table.model.table_name}.#{name}"
77
+ Arel.sql("\"#{table.model.table_name}\".\"#{name}\"")
78
78
  end
79
79
  end
80
80
 
@@ -105,13 +105,13 @@ module Mensa
105
105
  val = value.is_a?(Array) ? value : normalize(value)
106
106
  record_scope.where.not(column.attribute_for_condition => val)
107
107
  when :gt
108
- record_scope.where(column.table.model.arel_table[column.attribute_for_condition].gt(normalize(value)))
108
+ record_scope.where(":column > :value", column: column.attribute_for_condition, value: normalize(value))
109
109
  when :lt
110
- record_scope.where(column.table.model.arel_table[column.attribute_for_condition].lt(normalize(value)))
110
+ record_scope.where(":column < :value", column: column.attribute_for_condition, value: normalize(value))
111
111
  when :gteq
112
- record_scope.where(column.table.model.arel_table[column.attribute_for_condition].gteq(normalize(value)))
112
+ record_scope.where(":column >= :value", column: column.attribute_for_condition, value: normalize(value))
113
113
  when :lteq
114
- record_scope.where(column.table.model.arel_table[column.attribute_for_condition].lteq(normalize(value)))
114
+ record_scope.where(":column <= :value", column: column.attribute_for_condition, value: normalize(value))
115
115
  else
116
116
  # Ignore unknown operators
117
117
  record_scope
data/lib/mensa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mensa
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mensa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-16 00:00:00.000000000 Z
11
+ date: 2026-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails