phlexi-form 0.5.5 → 0.5.7
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 +4 -4
- data/lib/phlexi/form/base.rb +2 -2
- data/lib/phlexi/form/builder.rb +1 -1
- data/lib/phlexi/form/components/form_errors.rb +1 -1
- data/lib/phlexi/form/options/inferred_types.rb +1 -1
- data/lib/phlexi/form/structure/manages_fields.rb +2 -2
- data/lib/phlexi/form/structure/namespace.rb +1 -1
- data/lib/phlexi/form/structure/namespace_collection.rb +9 -4
- data/lib/phlexi/form/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: caffd32f45047afeefc49aa53617c040aa58bcc2feb2c08ccf557343e23e2cd2
|
|
4
|
+
data.tar.gz: 30322935ea64a0c9d101713fbf0eeee5b58df1c23bf5df5fac8410fc8e4fffd6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3944387335922b711ad776f331db795c99cf6dc166d32e90ec8199c5d56212581c58f4fca31dff9d6693b2df0debbed62cc53348f0c9305dc6fd463fea35c44d
|
|
7
|
+
data.tar.gz: c4b1e473bd8b3477d000aab90179df679f182dd557d81f7ff2c2613f8ad34ce1efd994365751741ab8f7f91e0a5c6c424afb025c07c2d1085b8f5fc24a3dc94c
|
data/lib/phlexi/form/base.rb
CHANGED
|
@@ -105,11 +105,11 @@ module Phlexi
|
|
|
105
105
|
yield if block_given?
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
def extract_input(params)
|
|
108
|
+
def extract_input(params, view_context: nil)
|
|
109
109
|
params = params.to_unsafe_h if params.respond_to?(:to_unsafe_h)
|
|
110
110
|
params = {} unless params.is_a?(Hash)
|
|
111
111
|
|
|
112
|
-
call unless @_rendered
|
|
112
|
+
call(view_context: view_context) unless @_rendered
|
|
113
113
|
@namespace.extract_input(params)
|
|
114
114
|
end
|
|
115
115
|
|
data/lib/phlexi/form/builder.rb
CHANGED
|
@@ -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
|
|
@@ -6,7 +6,7 @@ module Phlexi
|
|
|
6
6
|
module ManagesFields
|
|
7
7
|
def has_file_input!
|
|
8
8
|
if parent
|
|
9
|
-
|
|
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
|
-
|
|
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,12 +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 =
|
|
11
|
-
|
|
10
|
+
namespace = namespaces[0]
|
|
11
|
+
unless namespace
|
|
12
|
+
build_namespace(0)
|
|
13
|
+
@block.call(namespace)
|
|
14
|
+
end
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
params = params[key]
|
|
17
|
+
params = params.values if params.is_a?(Hash)
|
|
18
|
+
inputs = params.map { |param| namespace.extract_input([param]) }
|
|
14
19
|
{key => inputs}
|
|
15
20
|
end
|
|
16
21
|
end
|
data/lib/phlexi/form/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: phlex
|