-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web-forms (Vue UI): integrate value type suport for selects
Note that this doesn’t _currently_ do anything special for individual value types! I think that’s expected for the subset of value types we presently implement (which are all represented as primitive values, and all presentable in the current UI controls the same way string values have been). That will necessarily change as we add support for more complex value type representations (e.g. geo).
- Loading branch information
1 parent
0f668a4
commit 4c94f85
Showing
13 changed files
with
268 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
<?xml version="1.0"?> | ||
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" | ||
xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" | ||
xmlns:orx="http://openrosa.org/xforms"> | ||
<h:head> | ||
<h:title>Select types</h:title> | ||
<model> | ||
<instance> | ||
<root id="select-types"> | ||
<select-relevance>yes</select-relevance> | ||
|
||
<sel-1> | ||
<string-value>explicit string</string-value> | ||
<implicit-string-value>implicit string</implicit-string-value> | ||
<int-value>123</int-value> | ||
<decimal-value>45.67</decimal-value> | ||
</sel-1> | ||
|
||
<sel-n> | ||
<string-value>explicit string</string-value> | ||
<implicit-string-value>implicit string</implicit-string-value> | ||
<int-value>123</int-value> | ||
<decimal-value>45.67</decimal-value> | ||
</sel-n> | ||
</root> | ||
</instance> | ||
<instance id="strings"> | ||
<root> | ||
<!-- for select1 --> | ||
<item> | ||
<value>implicit string</value> | ||
<label>Implicit String</label> | ||
</item> | ||
<item> | ||
<value>explicit string</value> | ||
<label>Explicit String</label> | ||
</item> | ||
<item> | ||
<value>updated string</value> | ||
<label>Updated String</label> | ||
</item> | ||
|
||
<!-- for select (multiple) --> | ||
<item> | ||
<value>implicit</value> | ||
<label>Implicit</label> | ||
</item> | ||
<item> | ||
<value>explicit</value> | ||
<label>Explicit</label> | ||
</item> | ||
<item> | ||
<value>updated</value> | ||
<label>Updated</label> | ||
</item> | ||
<item> | ||
<value>string</value> | ||
<label>string</label> | ||
</item> | ||
</root> | ||
</instance> | ||
<instance id="ints"> | ||
<root> | ||
<item> | ||
<value>123</value> | ||
<label>123</label> | ||
</item> | ||
<item> | ||
<value>10</value> | ||
<label>10</label> | ||
</item> | ||
<item> | ||
<value>23</value> | ||
<label>23</label> | ||
</item> | ||
<item> | ||
<value>89</value> | ||
<label>89</label> | ||
</item> | ||
</root> | ||
</instance> | ||
<instance id="decimals"> | ||
<root> | ||
<item> | ||
<value>45.67</value> | ||
<label>45.67</label> | ||
</item> | ||
<item> | ||
<value>89</value> | ||
<label>89</label> | ||
</item> | ||
<item> | ||
<value>10</value> | ||
<label>10</label> | ||
</item> | ||
<item> | ||
<value>23.4</value> | ||
<label>23.4</label> | ||
</item> | ||
</root> | ||
</instance> | ||
<bind nodeset="/root/sel-1/string-value" type="string" | ||
relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-1/implicit-string-value" relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-1/int-value" type="int" relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-1/decimal-value" type="decimal" | ||
relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-n/string-value" type="string" | ||
relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-n/implicit-string-value" relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-n/int-value" type="int" relevant="/root/select-relevance = 'yes'" /> | ||
<bind nodeset="/root/sel-n/decimal-value" type="decimal" | ||
relevant="/root/select-relevance = 'yes'" /> | ||
</model> | ||
</h:head> | ||
<h:body> | ||
<select1 ref="/root/select-relevance"> | ||
<label>All selects relevant?</label> | ||
<item> | ||
<label>Yes</label> | ||
<value>yes</value> | ||
</item> | ||
<item> | ||
<label>No</label> | ||
<value>no</value> | ||
</item> | ||
</select1> | ||
|
||
<group ref="/root/sel-1"> | ||
<label>Select (1) with types</label> | ||
|
||
<select1 ref="/root/sel-1/string-value"> | ||
<itemset nodeset="instance('strings')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select1> | ||
<select1 ref="/root/sel-1/implicit-string-value"> | ||
<itemset nodeset="instance('strings')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select1> | ||
<select1 ref="/root/sel-1/int-value"> | ||
<itemset nodeset="instance('ints')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select1> | ||
<select1 ref="/root/sel-1/decimal-value"> | ||
<itemset nodeset="instance('decimals')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select1> | ||
</group> | ||
|
||
<group ref="/root/sel-n"> | ||
<label>Select (N) with types</label> | ||
|
||
<select ref="/root/sel-n/string-value"> | ||
<itemset nodeset="instance('strings')/root/item[not(contains(value, ' '))]"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select> | ||
<select ref="/root/sel-n/implicit-string-value"> | ||
<itemset nodeset="instance('strings')/root/item[not(contains(value, ' '))]"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select> | ||
<select ref="/root/sel-n/int-value"> | ||
<itemset nodeset="instance('ints')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select> | ||
<select ref="/root/sel-n/decimal-value"> | ||
<itemset nodeset="instance('decimals')/root/item"> | ||
<value ref="value" /> | ||
<label ref="label" /> | ||
</itemset> | ||
</select> | ||
</group> | ||
</h:body> | ||
</h:html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 11 additions & 12 deletions
23
packages/web-forms/src/components/widgets/CheckboxWidget.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
packages/web-forms/src/components/widgets/MultiselectDropdown.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.