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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3804eec9b0082cb874e06824d35b7c649aae6ec8389e7713df6fe9137f006370
|
|
4
|
+
data.tar.gz: 998791faeeb3a3bf0c7b50eb3d971c6ebd47571b4ad06989e3edfc3a8941b139
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 722661f6f48ec385c0661d6d7ec1abe6be3ebeb6caafc2126753fc9ed02bd31fc4ed767b5490b4c1b31c5fd3256c0ead680236ac2870ccbf83164165f465b333
|
|
7
|
+
data.tar.gz: fed120c6dfc5fcad5010d14777b16632c175a84a903ed1aa346c60053e63eb2e21fb317fb3ed5b7b714bdb06d142ae24c6b95913411f9dbc77b31b1033b02a1f
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
- if text.present?
|
|
2
|
-
- if
|
|
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
|
|
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
|
-
(
|
|
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 !
|
|
67
|
+
if !render_a_tag? && !disabled?
|
|
58
68
|
'cursor-pointer'
|
|
59
69
|
else
|
|
60
70
|
'cursor-not-allowed'
|
data/lib/tramway/version.rb
CHANGED
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:
|
|
12
|
+
date: 2026-01-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: anyway_config
|