phlexi-form 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9671f4f7fcb1593070bf2544eb6245cdcdf7fda5565a4596a0dd6a6849bc1e7
4
- data.tar.gz: 541f135bab202a68032c4c77200fc8a9089db71fef4cab768b172f35bfd440e4
3
+ metadata.gz: caffd32f45047afeefc49aa53617c040aa58bcc2feb2c08ccf557343e23e2cd2
4
+ data.tar.gz: 30322935ea64a0c9d101713fbf0eeee5b58df1c23bf5df5fac8410fc8e4fffd6
5
5
  SHA512:
6
- metadata.gz: 249664388de34b3295df4a9889088c1faa0ac5ba6a6405561798c40a1473f74e3c73fc61d5db4854d6acb49948064d214fd7a722f8d3d7af2253cf83f98c9717
7
- data.tar.gz: 84956947661e1b7f8f69134bd08302a74f7af64544aed0c1d2bee95ddde8ff788015c5e1cb3496acae1c6bc841f273afef2b936de6e1bbb3ccc58dd189c08583
6
+ metadata.gz: 3944387335922b711ad776f331db795c99cf6dc166d32e90ec8199c5d56212581c58f4fca31dff9d6693b2df0debbed62cc53348f0c9305dc6fd463fea35c44d
7
+ data.tar.gz: c4b1e473bd8b3477d000aab90179df679f182dd557d81f7ff2c2613f8ad34ce1efd994365751741ab8f7f91e0a5c6c424afb025c07c2d1085b8f5fc24a3dc94c
@@ -268,7 +268,7 @@ module Phlexi
268
268
  attributes = mix(input_attributes, attributes)
269
269
  end
270
270
  component = component_class.new(self, **attributes, &)
271
- if component_class.include?(Components::Concerns::ExtractsInput)
271
+ if component_class.include?(Components::Concerns::ExtractsInput)
272
272
  raise "input component already defined: #{@field_input_extractor.inspect}" if @field_input_extractor
273
273
 
274
274
  @field_input_extractor = component
@@ -15,7 +15,7 @@ module Phlexi
15
15
  p(class: themed(:form_errors_message, nil)) { @message }
16
16
  ul(class: themed(:form_errors_list, nil)) do
17
17
  @errors.each do |error|
18
- li(class: themed(:form_errors_list_item, nil)) {
18
+ li(class: themed(:form_errors_list_item, nil)) {
19
19
  error.to_s
20
20
  }
21
21
  end
@@ -8,7 +8,7 @@ module Phlexi
8
8
 
9
9
  def infer_field_component
10
10
  return :select if inferred_field_type != :association && choices
11
-
11
+
12
12
  case inferred_field_type
13
13
  when :string, :text
14
14
  infer_string_field_type || inferred_field_type
@@ -6,7 +6,7 @@ module Phlexi
6
6
  module ManagesFields
7
7
  def has_file_input!
8
8
  if parent
9
- parent.has_file_input!
9
+ parent.has_file_input!
10
10
  else
11
11
  @has_file_input = true
12
12
  end
@@ -14,7 +14,7 @@ module Phlexi
14
14
 
15
15
  def has_file_input?
16
16
  if parent
17
- parent.has_file_input?
17
+ parent.has_file_input?
18
18
  else
19
19
  @has_file_input || false
20
20
  end
@@ -5,7 +5,7 @@ module Phlexi
5
5
  module Structure
6
6
  class Namespace < Phlexi::Field::Structure::Namespace
7
7
  include Phlexi::Form::Structure::ManagesFields
8
-
8
+
9
9
  class NamespaceCollection < Phlexi::Form::Structure::NamespaceCollection; end
10
10
 
11
11
  def submit_button(key = :submit_button, **, &)
@@ -5,10 +5,13 @@ module Phlexi
5
5
  module Structure
6
6
  class NamespaceCollection < Phlexi::Field::Structure::NamespaceCollection
7
7
  include Phlexi::Form::Structure::ManagesFields
8
-
8
+
9
9
  def extract_input(params)
10
- namespace = build_namespace(0)
11
- @block.call(namespace)
10
+ namespace = namespaces[0]
11
+ unless namespace
12
+ build_namespace(0)
13
+ @block.call(namespace)
14
+ end
12
15
 
13
16
  params = params[key]
14
17
  params = params.values if params.is_a?(Hash)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Form
5
- VERSION = "0.5.6"
5
+ VERSION = "0.5.7"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-05 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex