tramway 1.1.1.2 → 1.1.2.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: ff6be5af7046f8107ab09309cec19ae847918386ada74006339c0130d1c2cdcc
4
- data.tar.gz: a22ac41c8bf93f817b8766f26c5f056d1fd98973d22f3eee0c7d88d2553564b3
3
+ metadata.gz: 54b7825cee0825f4606d32284f8da613c86b75137c0ecf6ef1a44639e146695e
4
+ data.tar.gz: 4ee9fb80702ecd50fa9f286b17df6133ccc01cd1f3cb659dea4290836e2dd867
5
5
  SHA512:
6
- metadata.gz: 4a315c6ad6d2af7210e6595030abf43ee149fc1f1308b193b51be7058267d262c5d74e9921cc64ba6f587e5c03c5fb627b05fbf1c5767477ea01abbab3988cb0
7
- data.tar.gz: 40703b4481eabdd0311c09dda42f430f19de1e0e7a57347b698c5e990eeddebcc1d9d582b473ac2088b4f02bc160ebe55ae4f5a53fe64ea4bdeea6fcb40493f0
6
+ metadata.gz: 01e8ec294dd08401272a7ab946384ae14e4f504aff01a41d7ea3b27d9c1ac399c0de607051e420f528d1c0739cda65bd4e798debf1b2d254c24405c798bbcd7e
7
+ data.tar.gz: cd57654aa23eb7c7551d4b4cce625fc4d9739f4d54526e51b527030129c4e7d5f4547d60026f4259ceb469c9213afb394e98d6ab40ff4bdc8a848c4dd0451286
data/README.md CHANGED
@@ -857,6 +857,7 @@ Tramway provides `tramway_form_for` helper that renders Tailwind-styled forms by
857
857
  <%= f.email_field :email %>
858
858
  <%= f.password_field :password %>
859
859
  <%= f.select :role, [:admin, :user] %>
860
+ <%= f.date_field :birth_date %>
860
861
  <%= f.multiselect :permissions, [['Create User', 'create_user'], ['Update user', 'update_user']] %>
861
862
  <%= f.file_field :file %>
862
863
  <%= f.submit 'Create User' %>
@@ -871,6 +872,7 @@ Available form helpers:
871
872
  * password_field
872
873
  * file_field
873
874
  * select
875
+ * date_field
874
876
  * multiselect ([Stimulus-based](https://github.com/Purple-Magic/tramway#stimulus-based-inputs))
875
877
  * submit
876
878
 
@@ -49,6 +49,10 @@ module Tailwinds
49
49
  ), &)
50
50
  end
51
51
 
52
+ def date_field(attribute, **, &)
53
+ common_field(:date_field, :date_field, attribute, **, &)
54
+ end
55
+
52
56
  def file_field(attribute, **options, &)
53
57
  sanitized_options = sanitize_options(options)
54
58
  input = super(attribute, **sanitized_options.merge(class: :hidden))
@@ -0,0 +1,8 @@
1
+ .mb-4
2
+ - if @label
3
+ = component('tailwinds/form/label', for: @for) do
4
+ = @label
5
+ - base_classes = 'w-full bg-white border border-gray-300 rounded focus:outline-none focus:border-red-500 '
6
+ - base_classes += 'dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:border-red-400 dark:placeholder-white'
7
+ - classes = "#{size_class(:text_input)} #{base_classes}"
8
+ = @input.call @attribute, **@options.merge(class: classes), value: @value
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tailwinds
4
+ module Form
5
+ # Tailwind-styled date field
6
+ class DateFieldComponent < TailwindComponent
7
+ end
8
+ end
9
+ end
@@ -4,6 +4,8 @@ module Tramway
4
4
  module Helpers
5
5
  # Provides view-oriented helpers for ActionView
6
6
  module ViewsHelper
7
+ include Tramway::Helpers::ComponentHelper
8
+
7
9
  def tramway_form_for(object, *, size: :middle, **options, &)
8
10
  form_for(
9
11
  object,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '1.1.1.2'
4
+ VERSION = '1.1.2.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: 1.1.1.2
4
+ version: 1.1.2.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-11-29 00:00:00.000000000 Z
12
+ date: 2025-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config
@@ -153,6 +153,8 @@ files:
153
153
  - app/components/tailwinds/containers/narrow_component.html.haml
154
154
  - app/components/tailwinds/containers/narrow_component.rb
155
155
  - app/components/tailwinds/form/builder.rb
156
+ - app/components/tailwinds/form/date_field_component.html.haml
157
+ - app/components/tailwinds/form/date_field_component.rb
156
158
  - app/components/tailwinds/form/file_field_component.html.haml
157
159
  - app/components/tailwinds/form/file_field_component.rb
158
160
  - app/components/tailwinds/form/label_component.html.haml