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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c96e6448f0af93d2a4f61de357fc79b9d267bdb1e81ff59b0dc8052a9414981
4
- data.tar.gz: 7b75993729cc685d579f2189fbcc21f14a65a4bc79fff7c7f51899a08ad0cfb2
3
+ metadata.gz: 6c0832db88c6c818befeb3eb29ab0c27cfd6283c6bb76356fe100d7b90cc4471
4
+ data.tar.gz: 1567a41dbfb954ab71c4f47625955d95253c0af56340fa250a6e82fb651f26ef
5
5
  SHA512:
6
- metadata.gz: cfd18aa32ccdb4bf16b1be93a86f3dc8efbe70387da74d4243a8365c9789fdb5d228e6ab0dd09e20f6b21d8be1dd722075fcbf7e4503d1a3988452dbf4c79cf0
7
- data.tar.gz: fe4d87917d30269e9c34cbd9b650098923ee6299e45b67a4af70a0a90a2797aebb4abe1fd0c367f1e5bbc3c5366b5419b48d857bb7c1f12df5019b4da1f9d142
6
+ metadata.gz: 32645119292a9042dba8e9f8593377d8f75e58f02d423c47188331d43d695a6f950060aab0ed9b458bd6638c8b9d72b215e83d9ffc657ddbadb2f78d61bc8e71
7
+ data.tar.gz: 8dc3b74c1d8c856c7b06599bb82e0d15a1649aec515ec855533073e3c86ea8ace4c177220b35f0be1d60c558a400c403d8bbddcb6debde7c5f01d4966ad18774
@@ -256,16 +256,13 @@ module Phlexi
256
256
  protected
257
257
 
258
258
  def create_component(component_class, theme_key, **attributes, &)
259
- theme_attributes = apply_component_theme(attributes, theme_key)
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
- extra_attributes = if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
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 {} if attributes.key?(:class!)
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Form
5
- VERSION = "0.5.3"
5
+ VERSION = "0.5.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich