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 +4 -4
- data/lib/phlexi/form/builder.rb +9 -8
- 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: 8583b90522a61700dac8266304e8777df43ea499e53cd449acd70fd68c32d55a
|
4
|
+
data.tar.gz: 5e9304c0e8be9e7770ddba399e63fb260c5038f0f7bda28fbd6a32b226e0ce12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcf54a8f4b08e5bbed3973aaebcc2c95cb0d976a0946daf10e7d3ddd4eb338274ea3b6200e6548be68df597fe647fdc2e344f80a663b2e6246c3ff4c64eec03e
|
7
|
+
data.tar.gz: 6741eeefed087421ee96c7b962606a8331800c2649c4447d62cb2bf1f39de28a9194aace3022a31ee661292f482b81075909ed96f29ced1422bb45a03ad9a4d8
|
data/lib/phlexi/form/builder.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
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)
|
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.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-
|
11
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|