lato 3.10.1 → 3.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0d4c7d4ab422e292060358f4e8f0ccc9cac66fc7b95dc6012ae3fb7b026949f
4
- data.tar.gz: 686ab4c432fb60b96b1b46a21b8fa64d022bb33d58460945494c7f7a0627b007
3
+ metadata.gz: e00cca9110424c452feab9aea4a1f4b812f3af01b0f863aff89d6d9f2736de72
4
+ data.tar.gz: 0af37bfd2eb48b193353ec7a54f1155906efa746a9df70d4cb3b09c44598b978
5
5
  SHA512:
6
- metadata.gz: 2d682ea9c46ede69e0fb52aa9fc6f1e7f77d75fdf27b1917f584b315c322df439c3135d60ccc96b71e5c4625fc3328611da0c626737c41d4c353bd47e5a937c7
7
- data.tar.gz: 0e77a6f0c63229b0d5202015be785614804e8e12ebc8191c2ad12ab5d752dfcb75a8a67c6e182b9747af8a037208b5edced06bff2c3dbd2edc128ae7380680d9
6
+ metadata.gz: 9aa8aaee2ebc20f2340b298d39a43275bd8c96d6454fdb5b8da1622c87af18702e0afcf9ac38d26a24092b8a03834671e5de8306e93b19d5c9d6071890bba081
7
+ data.tar.gz: 29075530da5562decca1a38f13197d3f627c97f83012652661ec4841f78e4689b399b02b44717235e95cbd4f855bf8b775318ea5c8fef491e604bae7144253aa
@@ -7,6 +7,17 @@ export default class extends Controller {
7
7
 
8
8
  connect() {
9
9
  this.tooltip = new bootstrap.Tooltip(this.element)
10
+
11
+ // HACK: Force tooltip to be closed when a boostrap modal is opened/closed
12
+ const modals = document.querySelectorAll('.modal')
13
+ modals.forEach((modal) => {
14
+ modal.addEventListener('show.bs.modal', () => {
15
+ setTimeout(() => this.tooltip.hide(), 0)
16
+ })
17
+ modal.addEventListener('hide.bs.modal', () => {
18
+ setTimeout(() => this.tooltip.hide(), 0)
19
+ })
20
+ })
10
21
  }
11
22
 
12
23
  disconnect() {
@@ -64,7 +64,8 @@ module Lato
64
64
  model_name: model_name,
65
65
  model_name_underscore: model_name_underscore,
66
66
  pagination_options: pagination_options,
67
- custom_actions: options[:custom_actions] || {}
67
+ custom_actions: options[:custom_actions] || {},
68
+ dropdown_actions: options[:dropdown_actions] || nil
68
69
  )
69
70
  end
70
71
 
@@ -13,8 +13,8 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
13
13
  <%= hidden_field_tag k, v %>
14
14
  <% end %>
15
15
 
16
- <% if custom_actions.any? || searchable_columns.any? %>
17
- <div class="d-flex justify-content-between mb-3">
16
+ <% if custom_actions.any? || searchable_columns.any? || dropdown_actions %>
17
+ <div class="d-flex mb-3">
18
18
  <% if searchable_columns.any? %>
19
19
  <div class="input-group">
20
20
  <input type="text" name="search" class="form-control" placeholder="<%= I18n.t('lato.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>">
@@ -23,16 +23,36 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
23
23
  <% else %>
24
24
  <div></div>
25
25
  <% end %>
26
-
27
- <div class="btn-group ms-2">
28
- <% if custom_actions.any? %>
26
+
27
+ <% if custom_actions.any? %>
28
+ <div class="btn-group ms-2">
29
29
  <% custom_actions.each do |action_key, action_params| %>
30
30
  <%= link_to action_params[:path], { class: 'btn btn-primary' }.merge(action_params) do %>
31
31
  <i class="<%= action_params[:icon] %>"></i>
32
32
  <% end %>
33
33
  <% end %>
34
- <% end %>
35
- </div>
34
+ </div>
35
+ <% end %>
36
+
37
+ <% if dropdown_actions %>
38
+ <div class="dropdown ms-2">
39
+ <%= content_tag :button, { class: 'btn btn-primary dropdown-toggle', 'data-bs-toggle': 'dropdown' }.merge(dropdown_actions) do %>
40
+ <i class="<%= dropdown_actions[:icon] %>"></i>
41
+ <% end %>
42
+ <ul class="dropdown-menu">
43
+ <% dropdown_actions[:actions].each do |action| %>
44
+ <li>
45
+ <%= link_to action[:path], { class: 'dropdown-item' }.merge(action) do %>
46
+ <% if action[:icon] %>
47
+ <i class="<%= action[:icon] %> me-1"></i>
48
+ <% end %>
49
+ <%= action[:title] %>
50
+ <% end %>
51
+ </li>
52
+ <% end %>
53
+ </ul>
54
+ </div>
55
+ <% end %>
36
56
  </div>
37
57
  <% end %>
38
58
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.10.1"
2
+ VERSION = "3.10.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.1
4
+ version: 3.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails