phlexi-form 0.5.3 → 0.5.4
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 -8
- data/lib/phlexi/form/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c0832db88c6c818befeb3eb29ab0c27cfd6283c6bb76356fe100d7b90cc4471
|
4
|
+
data.tar.gz: 1567a41dbfb954ab71c4f47625955d95253c0af56340fa250a6e82fb651f26ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32645119292a9042dba8e9f8593377d8f75e58f02d423c47188331d43d695a6f950060aab0ed9b458bd6638c8b9d72b215e83d9ffc657ddbadb2f78d61bc8e71
|
7
|
+
data.tar.gz: 8dc3b74c1d8c856c7b06599bb82e0d15a1649aec515ec855533073e3c86ea8ace4c177220b35f0be1d60c558a400c403d8bbddcb6debde7c5f01d4966ad18774
|
data/lib/phlexi/form/builder.rb
CHANGED
@@ -256,16 +256,13 @@ module Phlexi
|
|
256
256
|
protected
|
257
257
|
|
258
258
|
def create_component(component_class, theme_key, **attributes, &)
|
259
|
-
|
259
|
+
attributes = apply_component_theme(attributes, theme_key)
|
260
260
|
# TODO: refactor all this type checking code such that, the concerns will perform these actions.
|
261
261
|
# Basically, invert control so that the component asks for the extra attributes
|
262
262
|
# or calls #has_file_input!
|
263
|
-
|
264
|
-
input_attributes
|
265
|
-
else
|
266
|
-
{}
|
263
|
+
if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
|
264
|
+
attributes = mix(input_attributes, attributes)
|
267
265
|
end
|
268
|
-
attributes = mix(theme_attributes, extra_attributes, attributes)
|
269
266
|
component = component_class.new(self, **attributes, &)
|
270
267
|
if component_class.include?(Components::Concerns::ExtractsInput)
|
271
268
|
raise "input component already defined: #{@field_input_extractor.inspect}" if @field_input_extractor
|
@@ -278,10 +275,10 @@ module Phlexi
|
|
278
275
|
end
|
279
276
|
|
280
277
|
def apply_component_theme(attributes, theme_key)
|
281
|
-
return
|
278
|
+
return attributes if attributes.key?(:class!)
|
282
279
|
|
283
280
|
theme_key = attributes.delete(:theme) || theme_key
|
284
|
-
{class: themed(theme_key, self)}
|
281
|
+
mix({class: themed(theme_key, self)}, attributes)
|
285
282
|
end
|
286
283
|
|
287
284
|
def determine_initial_value(value)
|
data/lib/phlexi/form/version.rb
CHANGED