ProMotion-XLForm 0.0.3 → 0.0.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16f266fe44d16f2b3dbba9d3a854e57b61096782
|
4
|
+
data.tar.gz: b392bad7840ec083954aeb5938c7f508cd7a3252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e2cec121337790d06be52097d7cc6df47b6a9c5afdbb204d559d17b38a6a0d0cfc52ff9d751e88c5ac7d80ce5330cee3aaab0c7f8c37ca37f69c4a3a3c5b588
|
7
|
+
data.tar.gz: 7c7135483141be1e1f1285568c0095301b7208e0fa7c15d8b607836f1f79a29b8972b59693d1505b8a417abbe6d5464fe3cfa298d115b78a28f2386df9a3775a
|
@@ -112,12 +112,11 @@ module ProMotion
|
|
112
112
|
add_proc cell, :on_remove, cell_data[:on_remove] if cell_data[:on_remove]
|
113
113
|
|
114
114
|
cell.selectorTitle = cell_data[:selector_title] if cell_data[:selector_title]
|
115
|
-
options
|
116
|
-
cell.selectorOptions = options
|
115
|
+
cell.options = cell_data[:options]
|
117
116
|
|
118
117
|
value = cell_data[:value]
|
119
|
-
if value and
|
120
|
-
|
118
|
+
if value and cell.selectorOptions
|
119
|
+
cell.selectorOptions.each do |opt|
|
121
120
|
if opt.formValue == value
|
122
121
|
value = opt
|
123
122
|
break
|
@@ -190,18 +189,6 @@ module ProMotion
|
|
190
189
|
@blocks[tag][event] = block.respond_to?('weak!') ? block.weak! : block
|
191
190
|
end
|
192
191
|
|
193
|
-
def parse_options(options)
|
194
|
-
return nil if options.nil? or options.empty?
|
195
|
-
|
196
|
-
options.map do |key, text|
|
197
|
-
val = key
|
198
|
-
if val.is_a? Symbol
|
199
|
-
val = val.to_s
|
200
|
-
end
|
201
|
-
XLFormOptionsObject.formOptionsObjectWithValue(val, displayText: text)
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
192
|
def parse_section_options(options)
|
206
193
|
return section_options(:none) if options.nil?
|
207
194
|
|
@@ -26,4 +26,20 @@ class XLFormRowDescriptor
|
|
26
26
|
row_descriptor_copy
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
def options=(options)
|
30
|
+
self.selectorOptions = parse_options(options)
|
31
|
+
end
|
32
|
+
|
33
|
+
def parse_options(options)
|
34
|
+
return nil if options.nil? or options.empty?
|
35
|
+
|
36
|
+
options.map do |key, text|
|
37
|
+
val = key
|
38
|
+
if val.is_a? Symbol
|
39
|
+
val = val.to_s
|
40
|
+
end
|
41
|
+
XLFormOptionsObject.formOptionsObjectWithValue(val, displayText: text)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -225,8 +225,17 @@ module ProMotion
|
|
225
225
|
|
226
226
|
def formRowDescriptorValueHasChanged(row, oldValue: old_value, newValue: new_value)
|
227
227
|
super
|
228
|
+
|
228
229
|
callback = @form_builder.get_callback(row, :on_change)
|
229
|
-
|
230
|
+
if callback
|
231
|
+
if old_value.is_a? XLFormOptionsObject
|
232
|
+
old_value = old_value.formValue
|
233
|
+
end
|
234
|
+
if new_value.is_a? XLFormOptionsObject
|
235
|
+
new_value = new_value.formValue
|
236
|
+
end
|
237
|
+
callback.call(old_value, new_value)
|
238
|
+
end
|
230
239
|
end
|
231
240
|
|
232
241
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion-XLForm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Michotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ProMotion
|