lato 3.11.9 → 3.11.10

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: 222f7dc438f08dabcf4d33854937700faade02f929de89cca6d1053a557214fd
4
- data.tar.gz: 041baf847c3a2e3c81836b03c65dc24a65a99ff19c212b3a6e87f578445b9468
3
+ metadata.gz: ddd7c01a9cc4fe2d157455aef4dbd490520bfc6202e3fe6b9886bb9c50424ab6
4
+ data.tar.gz: 65074da85897c91205dc2f4163d7a9f1d8f8a28625f96a6114b28dd596e04b62
5
5
  SHA512:
6
- metadata.gz: d0fbc49d3448808a0de5646d77a6b351214e5e0bee58357f03558125a52e8210082e2b99f0f7ab3988b80f0b623af5b0b0fbb9b744e90ba7da5c45c72128cc74
7
- data.tar.gz: 586f4f7b1e51c93f45e8ff805417aec787d861df059d16671363c71c2b95c9d725c1a597fd08f643203019bc99272912128ac92ef1c3cab8a8e350104bb85161
6
+ metadata.gz: 5e58f5ab69f0a9bd43ccecf90451ff7784925bf29261348a221ab6ebb0e33b06fc2887fb7799390ecad4b3b80c7e6095facd4c5b6503b7c0c1e366de7d806eb4
7
+ data.tar.gz: 3bcd8581b91971c86df3fcd7166ddef1978a899759533017ec915107ac019b79f03ee04f45d12841dabf80f4ef1864a274fd645239e2d75a845b1c2ad7c2d294
@@ -0,0 +1,25 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = [
5
+ 'emailInput',
6
+ 'validateEmailLink'
7
+ ]
8
+
9
+ connect() {
10
+ if (this.hasEmailInputTarget) this.emailInputOriginalValue = this.emailInputTarget.value
11
+ }
12
+
13
+ onEmailKeyUp(e) {
14
+ if (!this.hasEmailInputTarget || !this.hasValidateEmailLinkTarget) return
15
+
16
+ const newEmailInputValue = this.emailInputTarget.value
17
+ if (this.emailInputOriginalValue !== newEmailInputValue) {
18
+ this.validateEmailLinkTarget.classList.add('opacity-50')
19
+ this.validateEmailLinkTarget.style.pointerEvents = 'none'
20
+ } else {
21
+ this.validateEmailLinkTarget.classList.remove('opacity-50')
22
+ this.validateEmailLinkTarget.style.pointerEvents = 'auto'
23
+ }
24
+ }
25
+ }
@@ -27,6 +27,7 @@ export default class extends Controller {
27
27
  * Events
28
28
  */
29
29
 
30
+ // This event is used to remove the Bootstrap invalid class from the input when the user starts typing.
30
31
  onInputChange(e) {
31
32
  e.target.classList.remove('is-invalid')
32
33
  }
@@ -9,8 +9,12 @@ export default class extends Controller {
9
9
  connect() {
10
10
  }
11
11
 
12
+ /**
13
+ * Events
14
+ */
15
+
16
+ // This event is used to reset the pagination when the user types in the search input to start a new search.
12
17
  onSearchKeyUp(e) {
13
- // Search the input with name "page" inside this.element and force value to 1
14
18
  const pageInput = this.element.querySelector('input[name="page"]')
15
19
  if (pageInput) pageInput.value = 1
16
20
  }
@@ -5,7 +5,7 @@ user ||= Lato::User.new
5
5
  %>
6
6
 
7
7
  <%= turbo_frame_tag 'account_form-user' do %>
8
- <%= form_with model: user, url: lato.account_update_user_action_path, data: { turbo_frame: '_self', controller: 'lato-form' } do |form| %>
8
+ <%= form_with model: user, url: lato.account_update_user_action_path, data: { turbo_frame: '_self', controller: 'lato-form lato-account-form-user' } do |form| %>
9
9
  <%= lato_form_notices class: %w[mb-3] %>
10
10
  <%= lato_form_errors user, class: %w[mb-3] %>
11
11
 
@@ -23,7 +23,7 @@ user ||= Lato::User.new
23
23
  <div class="col col-12 col-lg-4 mb-3">
24
24
  <%= lato_form_item_label form, :email %>
25
25
  <div class="input-group mb-3">
26
- <%= lato_form_item_input_email form, :email, required: true %>
26
+ <%= lato_form_item_input_email form, :email, required: true, data: { lato_account_form_user_target: 'emailInput', action: 'keyup->lato-account-form-user#onEmailKeyUp' } %>
27
27
  <% if user.email_verified_at %>
28
28
  <button
29
29
  class="btn btn-outline-success"
@@ -31,7 +31,7 @@ user ||= Lato::User.new
31
31
  aria-label="<%= I18n.t('lato.email_verified') %>"
32
32
  ><%= I18n.t('lato.email_verified') %></span>
33
33
  <% else %>
34
- <%= link_to I18n.t('lato.verify_email'), account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self' }, aria: { label: I18n.t('lato.verify_email') } %>
34
+ <%= link_to I18n.t('lato.verify_email'), account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self', lato_account_form_user_target: 'validateEmailLink' }, aria: { label: I18n.t('lato.verify_email') } %>
35
35
  <% end %>
36
36
  </div>
37
37
  </div>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.11.9"
2
+ VERSION = "3.11.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.9
4
+ version: 3.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
@@ -154,6 +154,7 @@ files:
154
154
  - app/assets/javascripts/lato/application.js
155
155
  - app/assets/javascripts/lato/controllers/application.js
156
156
  - app/assets/javascripts/lato/controllers/index.js
157
+ - app/assets/javascripts/lato/controllers/lato_account_form_user_controller.js
157
158
  - app/assets/javascripts/lato/controllers/lato_action_controller.js
158
159
  - app/assets/javascripts/lato/controllers/lato_aside_opener_controller.js
159
160
  - app/assets/javascripts/lato/controllers/lato_confirm_controller.js