tramway 2.0.4 → 2.0.4.1

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: 6ff06a67cd963b32a286efe781e1bafe4a724ac7aec363d532a977f25f4f1120
4
- data.tar.gz: a7747754a0166d497f42c414bf5d5b44e422de164fc0f0951d74928bfbdea636
3
+ metadata.gz: 3804eec9b0082cb874e06824d35b7c649aae6ec8389e7713df6fe9137f006370
4
+ data.tar.gz: 998791faeeb3a3bf0c7b50eb3d971c6ebd47571b4ad06989e3edfc3a8941b139
5
5
  SHA512:
6
- metadata.gz: 85151bcb6a37f71972d5fc6494d36e026e2796e92b4988063e9cacd9d369415847a1aa20ca9cf86ec592c0851da4701c79063f96db1ffec4ed3db68b241b824d
7
- data.tar.gz: 54bce62f0896125d142ad323914c7d7385f4e35469fac027fbfcec81dee4cf7c13afb641e5b0b20c5118acf2cd3298e733fa5e772515b71b750c7c59b4b097c5
6
+ metadata.gz: 722661f6f48ec385c0661d6d7ec1abe6be3ebeb6caafc2126753fc9ed02bd31fc4ed767b5490b4c1b31c5fd3256c0ead680236ac2870ccbf83164165f465b333
7
+ data.tar.gz: fed120c6dfc5fcad5010d14777b16632c175a84a903ed1aa346c60053e63eb2e21fb317fb3ed5b7b714bdb06d142ae24c6b95913411f9dbc77b31b1033b02a1f
@@ -1,5 +1,5 @@
1
1
  - if text.present?
2
- - if link
2
+ - if render_a_tag?
3
3
  = link_to text, path, class: classes, **options.except(:class)
4
4
  - else
5
5
  - if type&.to_sym == :submit
@@ -8,7 +8,7 @@
8
8
  - else
9
9
  = button_to text, path, method:, form: form_options, class: classes, **options.except(:class)
10
10
  - else
11
- - if link
11
+ - if render_a_tag?
12
12
  = link_to path, class: classes, **options.except(:class) do
13
13
  = content
14
14
  - else
@@ -25,7 +25,7 @@ module Tailwinds
25
25
  def classes
26
26
  (default_classes +
27
27
  color_classes +
28
- (link ? %w[px-1 h-fit] : [cursor_class])).compact.join(' ')
28
+ (render_a_tag? ? %w[px-1 h-fit] : [cursor_class])).compact.join(' ')
29
29
  end
30
30
 
31
31
  def default_classes
@@ -51,10 +51,20 @@ module Tailwinds
51
51
  options[:disabled] || false
52
52
  end
53
53
 
54
+ def render_a_tag?
55
+ return true if link
56
+
57
+ uri = URI.parse(path)
58
+
59
+ return true if method.to_s.downcase == 'get' && uri.query && !uri.query.empty?
60
+
61
+ false
62
+ end
63
+
54
64
  private
55
65
 
56
66
  def cursor_class
57
- if !link && !disabled?
67
+ if !render_a_tag? && !disabled?
58
68
  'cursor-pointer'
59
69
  else
60
70
  'cursor-not-allowed'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '2.0.4'
4
+ VERSION = '2.0.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-12-29 00:00:00.000000000 Z
12
+ date: 2026-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config