pxs-forms 0.1.4.6 → 0.1.4.8

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: 05eaa7e84b007826b2bdbf1515f85c09d53070d4dbebda132d09763587898678
4
- data.tar.gz: b66d19184d9700a3cbba2a409a3ab89e8c7887873d160328d16b2f41ba212cc8
3
+ metadata.gz: 5945f2e5aedbdf454e7dbd4e5e2abaa293f83274215180164e02e92503cbbf93
4
+ data.tar.gz: 24cea079a00f0e9d8be354b42f3b16025c21e8c98611ff0b3fa9d8f0c35814ab
5
5
  SHA512:
6
- metadata.gz: 6a2316e33ee6747df85654ffe40a469fd51d4f547833e247482bb3e4854d35a9bb54c1f7fb39686b47b8aa126137f5eb6dfa8ad4506b9f03d9248d66be5daaf2
7
- data.tar.gz: 24cb58961e069d8039fa5f33e2ff75a72875d878029fd5a726e376a543ac7ae1a182fa822284b3a2c02094259b4fca4c9a454fa9829f3110db5b1001d9a1e577
6
+ metadata.gz: afe63a23ba05d23cfa0e44517ff22a745532bce1457d624029092050f87612e598f443b1ee1feae129e39702b057a43633802abeffa52cbd17b59d1920dc714d
7
+ data.tar.gz: '0917a72c41b915f82cf8853a3b98bbb4f37ae1034ea5b28565ef4ede3e3dce6880eeecfdd34bdecad0ea6b2b88eaf0043c678c0680f7ca53e55fa314b8ffed93'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Unofficial Release
4
4
 
5
+ ## [0.1.4.8] - 2025-04-22
6
+
7
+ - Fix `data` attribute not being passed along to `turbo_link_to`, `link_button_to`
8
+
9
+ ## [0.1.4.7] - 2025-04-08
10
+
11
+ - Fix string input not properly invoking string field
12
+ - Fix date field showing a rendundant date select
13
+
5
14
  ## [0.1.4.3-6] - 2025-04-03
6
15
 
7
16
  - Fix I18n missing from a I18n.t function call
@@ -4,6 +4,9 @@ module Pxs
4
4
 
5
5
  def initialize
6
6
  end
7
+
8
+ #todo configuration ideas:
9
+ # use models_helper buttons?
7
10
  end
8
11
  end
9
12
  end
@@ -5,7 +5,7 @@ module Pxs
5
5
 
6
6
  # a link that triggers a turbo request
7
7
  def turbo_link_to(text, target, options = {})
8
- link_to text, target, class: options[:class] || nil, data: { turbo_stream: true, turbo_method: options[:method] || :get, turbo_confirm: options[:confirm] }, id: options[:id], title: options[:title]
8
+ link_to text, target, class: options[:class] || nil, data: { turbo_stream: true, turbo_method: options[:method] || :get, turbo_confirm: options[:confirm] }.merge(options[:data] || {}), id: options[:id], title: options[:title]
9
9
  end
10
10
 
11
11
  # a button that triggers a turbo request
@@ -16,7 +16,7 @@ module Pxs
16
16
 
17
17
  # a button that makes an HTML request
18
18
  def link_button_to(text, target, options = {})
19
- link_to text, target, class: merge_option(:class, "button", options)[:class], method: options[:method] || :get, id: options[:id], title: options[:title]
19
+ link_to text, target, class: merge_option(:class, "button", options)[:class], method: options[:method] || :get, id: options[:id], title: options[:title], data: options[:data]
20
20
  end
21
21
 
22
22
  private
@@ -188,7 +188,7 @@ class ModelFormBuilder < ActionView::Helpers::FormBuilder
188
188
 
189
189
  safe_join [
190
190
  (field_label(attribute, options[:label]) unless options[:label] == false),
191
- @template.text_field(base_input_name, attribute, merge_input_options({class: has_error?(attribute) ? "is-invalid" : nil}, objectify_options(options[:input_html] || {}))),
191
+ string_field(attribute, merge_input_options({class: has_error?(attribute) ? "is-invalid" : nil}, objectify_options(options[:input_html] || {}))),
192
192
  ]
193
193
  end
194
194
  end
@@ -296,16 +296,7 @@ class ModelFormBuilder < ActionView::Helpers::FormBuilder
296
296
  options = { value: object[attribute] }.merge(options)
297
297
  case object_type_for_attribute(attribute)
298
298
  when :date then
299
- safe_join [
300
- @template.date_field(base_input_name, attribute, merge_input_options(options, {data: {datepicker: true}})),
301
- tag.div {
302
- date_select(attribute, {
303
- order: [:year, :month, :day],
304
- start_year: Date.today.year,
305
- end_year: Date.today.year,
306
- }, {data: {date_select: true}})
307
- },
308
- ]
299
+ @template.date_field(base_input_name, attribute, merge_input_options(options, {data: {datepicker: true}}))
309
300
  when :integer then @template.number_field(base_input_name, attribute, options)
310
301
  when :decimal then @template.number_field(base_input_name, attribute, {step: 0.1}.merge(options))
311
302
  when :string
@@ -86,7 +86,7 @@ module Pxs
86
86
  end
87
87
 
88
88
  # separate HTML options due to form_for parameter strucutre
89
- options[:html] = { class: options[:class] }
89
+ options[:html] = options[:html].merge{ class: options[:class] }
90
90
 
91
91
  args << options
92
92
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pxs
4
4
  module Forms
5
- VERSION = "0.1.4.6"
5
+ VERSION = "0.1.4.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxs-forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.6
4
+ version: 0.1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poubelle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-04 00:00:00.000000000 Z
11
+ date: 2025-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: