phlexi-form 0.5.8 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phlexi/form/builder.rb +5 -2
- data/lib/phlexi/form/components/input.rb +3 -2
- 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: 85ded0c728aafa222d32ba3cf6002fae6d078208f132b90f880c11ddc1e92821
|
4
|
+
data.tar.gz: bdab2b38de0a2081d10973c773acded70451abeaa03e6a16087c960afe67d45d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c48a34c2da5205abc312a2f0d51782de3b7fbaf6903a43fa746774c85cdca8ead40fa8957df5e997bd7c6422908cd676c46e0abcc4e353a97c0be1e2eb31d2a
|
7
|
+
data.tar.gz: 67dac3769567c4e3052e4e65c85078631fd8e2133da1b39d7572ce2c6d7364d659f50db6f0f86d69cc7af4a127c8a9a64bb5fb8d02f25d1d8668b5ff7bc32b3a
|
data/lib/phlexi/form/builder.rb
CHANGED
@@ -264,8 +264,11 @@ module Phlexi
|
|
264
264
|
# TODO: refactor all this type checking code such that, the concerns will perform these actions.
|
265
265
|
# Basically, invert control so that the component asks for the extra attributes
|
266
266
|
# or calls #has_file_input!
|
267
|
-
if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
|
268
|
-
|
267
|
+
attributes = if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
|
268
|
+
mix(input_attributes, attributes)
|
269
|
+
else
|
270
|
+
# we want to mix to ensure that any overrides are properly applied
|
271
|
+
mix(attributes)
|
269
272
|
end
|
270
273
|
component = component_class.new(self, **attributes, &)
|
271
274
|
if component_class.include?(Components::Concerns::ExtractsInput)
|
@@ -23,7 +23,7 @@ module Phlexi
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def build_input_attributes
|
26
|
-
attributes.fetch(:type) { attributes[:type] = field.inferred_string_field_type }
|
26
|
+
attributes.fetch(:type) { attributes[:type] = field.inferred_string_field_type || field.inferred_field_type }
|
27
27
|
attributes.fetch(:disabled) { attributes[:disabled] = field.disabled? }
|
28
28
|
|
29
29
|
case attributes[:type]
|
@@ -81,7 +81,8 @@ module Phlexi
|
|
81
81
|
attributes[:autocomplete] = "off"
|
82
82
|
else
|
83
83
|
# Handle any unrecognized input types
|
84
|
-
|
84
|
+
Rails.logger.warn("Unhandled input type: #{attributes[:type].inspect}")
|
85
|
+
attributes[:type] = :text
|
85
86
|
end
|
86
87
|
|
87
88
|
if (attributes[:type] == :file) ? attributes[:multiple] : attributes.delete(:multiple)
|
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.10
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|