lato 3.14.8 → 3.14.9
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f424fc472d1089710195d8c872e462f4418c010fb452725d7f566ea7bd8b475
|
|
4
|
+
data.tar.gz: 5610d6b09ba78c999ea26e0acddf49855e836fca77c5ffc00438064f43cf4b91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df88eb580c7e43b08baec394249349e540dbc7ffdd1b0ef170db037ede14368a8d3f876e1a4333f41a6b61f7ee8e746290ece67b335d2f5844be80f2b6637b93
|
|
7
|
+
data.tar.gz: b3c24f61a461e6fc47eb8a2d6605eb42c73d3fb9be81946d31d5257404140874aacde6360ea0de1066ce69f6c60a843239cfed23a77792c7641ed17547da8427
|
|
@@ -66,18 +66,45 @@ export default class extends Controller {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
triggerTargetConnected(element) {
|
|
69
|
-
element.addEventListener('click', (e) =>
|
|
69
|
+
element.addEventListener('click', (e) => {
|
|
70
|
+
this.openAction(this.loadOptionsFromTriggerElement(element), e, this._loadConfirmMessage(element))
|
|
71
|
+
})
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
triggerSubmitTargetConnected(element) {
|
|
73
|
-
element.addEventListener('submit', (e) =>
|
|
75
|
+
element.addEventListener('submit', (e) => {
|
|
76
|
+
this.openAction(this.loadOptionsFromTriggerElement(element), e, this._loadConfirmMessage(element))
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// NOTE: Dato che turbo-confirm non riesce a co-esistere con lato_action_controller,
|
|
81
|
+
// rimuoviamo l'attributo data-turbo-confirm dall'elemento e lo gestiamo
|
|
82
|
+
// manualmente all'interno di openAction.
|
|
83
|
+
_loadConfirmMessage(element) {
|
|
84
|
+
let confirmData = null
|
|
85
|
+
if (element && element.hasAttribute('data-turbo-confirm')) {
|
|
86
|
+
confirmData = element.getAttribute('data-turbo-confirm')
|
|
87
|
+
element.removeAttribute('data-turbo-confirm')
|
|
88
|
+
}
|
|
89
|
+
return confirmData
|
|
74
90
|
}
|
|
75
91
|
|
|
76
92
|
/**
|
|
77
93
|
* Functions
|
|
78
94
|
*/
|
|
79
95
|
|
|
80
|
-
openAction(options) {
|
|
96
|
+
openAction(options, event, confirmMessage = null) {
|
|
97
|
+
// NOTE: Al momento non riusciamo a utilizzare lato_confirm_controller per gestire le conferme
|
|
98
|
+
// in quanto è asincrono e richiede di annullare l'evento in modo sincrono.
|
|
99
|
+
// Per questo motivo, per ora, gestiamo le conferme con il classico window.confirm.
|
|
100
|
+
if (confirmMessage) {
|
|
101
|
+
const result = window.confirm(confirmMessage)
|
|
102
|
+
if (!result) {
|
|
103
|
+
event.preventDefault()
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
81
108
|
const index = this.getFreeModalIndex()
|
|
82
109
|
|
|
83
110
|
if (options.turboFrame && options.turboFrame != '_top') {
|
|
@@ -128,6 +155,6 @@ export default class extends Controller {
|
|
|
128
155
|
*/
|
|
129
156
|
|
|
130
157
|
onTriggerRun(e) {
|
|
131
|
-
this.openAction(this.loadOptionsFromTriggerElement(e.currentTarget))
|
|
158
|
+
this.openAction(this.loadOptionsFromTriggerElement(e.currentTarget), e)
|
|
132
159
|
}
|
|
133
160
|
}
|
|
@@ -167,7 +167,7 @@ total_pages = collection.empty? ? params["#{key}_page"]&.to_i : 999_999_999 if s
|
|
|
167
167
|
<% if pagination_options %>
|
|
168
168
|
<select name="<%= "#{key}_per_page" %>" class="ms-3 form-select form-select-sm w-auto" data-action="change->lato-form#submit" aria-label="<%= I18n.t('lato.per_page_description') %>">
|
|
169
169
|
<% pagination_options.each do |option| %>
|
|
170
|
-
<option value="<%= option %>" <%= option == params["#{key}_per_page"].to_i ? 'selected' : '' %>>
|
|
170
|
+
<option value="<%= option %>" <%= option == params["#{key}_per_page"].to_i || (collection.respond_to?(:limit_value) && option == collection.limit_value) ? 'selected' : '' %>>
|
|
171
171
|
<%= option %> <%= I18n.t('lato.per_page').downcase %>
|
|
172
172
|
</option>
|
|
173
173
|
<% end %>
|
data/lib/lato/version.rb
CHANGED
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.14.
|
|
4
|
+
version: 3.14.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gregorio Galante
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|