phlexi-form 0.5.6 → 0.5.8

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: 769c19201c23a4bd65f03d8c370ee7ce975bb5b30560028bda580d2f206131d4
4
+ data.tar.gz: aafd7a064c210f62363acccc9bb58bff7e5fc5f0657cc70c241f508928094e4b
5
5
  SHA512:
6
- metadata.gz: 249664388de34b3295df4a9889088c1faa0ac5ba6a6405561798c40a1473f74e3c73fc61d5db4854d6acb49948064d214fd7a722f8d3d7af2253cf83f98c9717
7
- data.tar.gz: 84956947661e1b7f8f69134bd08302a74f7af64544aed0c1d2bee95ddde8ff788015c5e1cb3496acae1c6bc841f273afef2b936de6e1bbb3ccc58dd189c08583
6
+ metadata.gz: 322ee42a68da4600bc714095c5b7403bcab299b0a38dd5539d2897032ec92c0a3155ab3c16c1e100712e6270c8e00e574be347e9a10f4d84dbf68815f052513f
7
+ data.tar.gz: 672d008fbe9abe7c76315dc520634d002bd8323a1328aac93a390eacf0c5e1e4bc230d731795c77714d702e8586ce4df87c5d3b48ef8ac8b94c0cf60ece5ccff
@@ -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,14 +5,17 @@ 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)
15
- inputs = params.map { |param| namespace.extract_input([param]) }
18
+ inputs = Array(params).map { |param| namespace.extract_input([param]) }
16
19
  {key => inputs}
17
20
  end
18
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Form
5
- VERSION = "0.5.6"
5
+ VERSION = "0.5.8"
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.8
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-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex