tramway 1.1.2.2 → 1.1.3
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: 6dc301f6bca8cfbc81e6c68d976cfe3dfe23cce47fcbfe000731d531f09bb742
|
|
4
|
+
data.tar.gz: 2bb6aded7c7ffaa0dfcd2c6903db30af490cd57795675f1af6d96afe9613a3a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b984b2ef4232e4b138ec76309d750e4cb570a95aebaaf0f0c21ff8f97c019ae0c8b5a53cc9184ba831ba41b3d466861d4a94db8a5a161b3205d89c5b67a376f1
|
|
7
|
+
data.tar.gz: d7b086421ecf3b0ccb511542f916d4fd713c66652b5bc71b2be0c3ef264a503fdaaa7f6819f4ffc25f40ebb8863a5d66896f8ae7eb06b12763e5cc18b5022b7d
|
data/README.md
CHANGED
|
@@ -786,6 +786,15 @@ Tramway ships with helpers for common UI patterns built on top of Tailwind compo
|
|
|
786
786
|
|
|
787
787
|
All additional keyword arguments are forwarded to the underlying component as HTML attributes.
|
|
788
788
|
|
|
789
|
+
You can also pass HTML attributes for the generated `<form>` separately via `form_options:` while keeping button-specific
|
|
790
|
+
attributes in `options:`:
|
|
791
|
+
|
|
792
|
+
```erb
|
|
793
|
+
<%= tramway_button path: user_path(user), text: 'Create',
|
|
794
|
+
form_options: { data: { turbo: false } },
|
|
795
|
+
options: { data: { controller: 'submit-once' } } %>
|
|
796
|
+
```
|
|
797
|
+
|
|
789
798
|
The `type` option maps semantic intent to Tailwind color families. The full set of supported values is:
|
|
790
799
|
|
|
791
800
|
| Type | Color |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
%button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
|
|
7
7
|
= text
|
|
8
8
|
- else
|
|
9
|
-
= button_to text, path, method:, class: classes, **options.except(:class)
|
|
9
|
+
= button_to text, path, method:, form: form_options, class: classes, **options.except(:class)
|
|
10
10
|
- else
|
|
11
11
|
- if link
|
|
12
12
|
= link_to path, class: classes, **options.except(:class) do
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
%button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
|
|
17
17
|
= content
|
|
18
18
|
- else
|
|
19
|
-
= button_to path, method:, class: classes, **options.except(:class) do
|
|
19
|
+
= button_to path, method:, class: classes, form: form_options, **options.except(:class) do
|
|
20
20
|
= content
|
|
@@ -12,6 +12,7 @@ module Tailwinds
|
|
|
12
12
|
option :method, optional: true, default: -> { :get }
|
|
13
13
|
option :link, optional: true, default: -> { false }
|
|
14
14
|
option :options, optional: true, default: -> { {} }
|
|
15
|
+
option :form_options, optional: true, default: -> { {} }
|
|
15
16
|
|
|
16
17
|
def size_classes
|
|
17
18
|
{
|
|
@@ -38,18 +38,12 @@ module Tramway
|
|
|
38
38
|
component 'tailwinds/table/cell', &
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
method:,
|
|
46
|
-
link:,
|
|
47
|
-
color: options.delete(:color),
|
|
48
|
-
type: options.delete(:type),
|
|
49
|
-
size: options.delete(:size),
|
|
50
|
-
options:,
|
|
51
|
-
&
|
|
41
|
+
# rubocop:disable Metrics/ParameterLists
|
|
42
|
+
def tramway_button(path: nil, text: nil, method: :get, link: false, form_options: {}, **options, &)
|
|
43
|
+
component 'tailwinds/button', text:, path:, method:, link:, form_options:, color: options.delete(:color),
|
|
44
|
+
type: options.delete(:type), size: options.delete(:size), options:, &
|
|
52
45
|
end
|
|
46
|
+
# rubocop:enable Metrics/ParameterLists
|
|
53
47
|
|
|
54
48
|
def tramway_back_button
|
|
55
49
|
component 'tailwinds/back_button'
|
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: 1.1.
|
|
4
|
+
version: 1.1.3
|
|
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-
|
|
12
|
+
date: 2025-12-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: anyway_config
|