phlexi-display 0.0.4 → 0.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f519ac0a922ec274d4a45f66208e470d807f7d2fc34f9154ca6758c0de77b8c
|
4
|
+
data.tar.gz: d0a493ad4678d4d41ae0b0e06cdd53b510d72208e45c0fe59d1c351c5392dd62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1ac7dfb74665e852aa8e39f14b2dc85583ba8201da09cb22f6821147e7538b9503035285c285ad7dd530ade7b0e5ab9df6f02c4f0b7d5ef3594295235592b5e
|
7
|
+
data.tar.gz: e4a83a95a323eecbdfca20af2601b9291311b9292eae6de6888b3279ba52889bdf0d09b8988d0972377660215a8a10fad5d6eeda4daa0dbbbdbc630dc385a803
|
@@ -8,7 +8,30 @@ module Phlexi
|
|
8
8
|
def view_template
|
9
9
|
return render(field.placeholder_tag(**@placeholder_attributes)) unless field.has_value?
|
10
10
|
|
11
|
-
|
11
|
+
if field.multiple? && field.value.respond_to?(:each)
|
12
|
+
wrapped {
|
13
|
+
field.value.each { |value|
|
14
|
+
value = normalize_value(value)
|
15
|
+
render_value(value)
|
16
|
+
}
|
17
|
+
}
|
18
|
+
else
|
19
|
+
wrapped {
|
20
|
+
value = normalize_value(field.value)
|
21
|
+
render_value(value)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def wrapped(&)
|
27
|
+
div(
|
28
|
+
id: attributes.delete(:id),
|
29
|
+
class: tokens(component_name, "value_wrapper", themed(:value_wrapper), themed(:"#{component_name}_value_wrapper")),
|
30
|
+
&
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
def render_values(values)
|
12
35
|
values.each do |value|
|
13
36
|
render_value(normalize_value(value))
|
14
37
|
end
|
@@ -30,6 +53,13 @@ module Phlexi
|
|
30
53
|
attributes[:id] = field.dom.id if attributes[:id] == "#{field.dom.id}_#{component_name}"
|
31
54
|
end
|
32
55
|
|
56
|
+
def build_component_class
|
57
|
+
return if attributes[:class] == false
|
58
|
+
|
59
|
+
super
|
60
|
+
attributes[:class] = tokens(component_name, "value", attributes[:class].sub(component_name, ""))
|
61
|
+
end
|
62
|
+
|
33
63
|
def normalize_value(value)
|
34
64
|
value.to_s
|
35
65
|
end
|
data/lib/phlexi/display/theme.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlexi-display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.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-09-
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|