phlexi-form 0.5.3 → 0.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c96e6448f0af93d2a4f61de357fc79b9d267bdb1e81ff59b0dc8052a9414981
4
- data.tar.gz: 7b75993729cc685d579f2189fbcc21f14a65a4bc79fff7c7f51899a08ad0cfb2
3
+ metadata.gz: 8583b90522a61700dac8266304e8777df43ea499e53cd449acd70fd68c32d55a
4
+ data.tar.gz: 5e9304c0e8be9e7770ddba399e63fb260c5038f0f7bda28fbd6a32b226e0ce12
5
5
  SHA512:
6
- metadata.gz: cfd18aa32ccdb4bf16b1be93a86f3dc8efbe70387da74d4243a8365c9789fdb5d228e6ab0dd09e20f6b21d8be1dd722075fcbf7e4503d1a3988452dbf4c79cf0
7
- data.tar.gz: fe4d87917d30269e9c34cbd9b650098923ee6299e45b67a4af70a0a90a2797aebb4abe1fd0c367f1e5bbc3c5366b5419b48d857bb7c1f12df5019b4da1f9d142
6
+ metadata.gz: fcf54a8f4b08e5bbed3973aaebcc2c95cb0d976a0946daf10e7d3ddd4eb338274ea3b6200e6548be68df597fe647fdc2e344f80a663b2e6246c3ff4c64eec03e
7
+ data.tar.gz: 6741eeefed087421ee96c7b962606a8331800c2649c4447d62cb2bf1f39de28a9194aace3022a31ee661292f482b81075909ed96f29ced1422bb45a03ad9a4d8
@@ -92,6 +92,10 @@ module Phlexi
92
92
  input_tag(type: :search, theme: :search, **, &)
93
93
  end
94
94
 
95
+ def hidden_input_tag(**, &)
96
+ input_tag(type: :hidden, theme: nil, **, &)
97
+ end
98
+ alias_method :hidden_tag, :hidden_input_tag
95
99
  # Creates a checkbox tag for the field.
96
100
  #
97
101
  # @param attributes [Hash] Additional attributes for the checkbox.
@@ -256,16 +260,13 @@ module Phlexi
256
260
  protected
257
261
 
258
262
  def create_component(component_class, theme_key, **attributes, &)
259
- theme_attributes = apply_component_theme(attributes, theme_key)
263
+ attributes = apply_component_theme(attributes, theme_key)
260
264
  # TODO: refactor all this type checking code such that, the concerns will perform these actions.
261
265
  # Basically, invert control so that the component asks for the extra attributes
262
266
  # or calls #has_file_input!
263
- extra_attributes = if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
264
- input_attributes
265
- else
266
- {}
267
+ if component_class.include?(Phlexi::Form::Components::Concerns::HandlesInput)
268
+ attributes = mix(input_attributes, attributes)
267
269
  end
268
- attributes = mix(theme_attributes, extra_attributes, attributes)
269
270
  component = component_class.new(self, **attributes, &)
270
271
  if component_class.include?(Components::Concerns::ExtractsInput)
271
272
  raise "input component already defined: #{@field_input_extractor.inspect}" if @field_input_extractor
@@ -278,10 +279,10 @@ module Phlexi
278
279
  end
279
280
 
280
281
  def apply_component_theme(attributes, theme_key)
281
- return {} if attributes.key?(:class!)
282
+ return attributes if attributes.key?(:class!)
282
283
 
283
284
  theme_key = attributes.delete(:theme) || theme_key
284
- {class: themed(theme_key, self)}
285
+ mix({class: themed(theme_key, self)}, attributes)
285
286
  end
286
287
 
287
288
  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.5"
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.3
4
+ version: 0.5.5
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-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex