-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #273 from getodk/features/value-nodes
Support for `<select>` and `<select1>` value types, partial support for `<range>`
- Loading branch information
Showing
81 changed files
with
3,913 additions
and
870 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,10 @@ | ||
--- | ||
"@getodk/common": patch | ||
"@getodk/scenario": patch | ||
"@getodk/web-forms": minor | ||
--- | ||
|
||
- Partial support for `<odk:range>` (basic horizontal and vertical sliders) | ||
- Partial support for `<select1>` bind/value types (string, int, decimal) | ||
- Partial support for `<select>` bind/value types (string, int, decimal) | ||
- **BREAKING CHANGE** (`@getodk/xforms-engine`): `SelectNode`'s write methods have been replaced with more ergonomic alternatives |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<h:html xmlns="http://www.w3.org/2002/xforms" | ||
xmlns:h="http://www.w3.org/1999/xhtml"> | ||
|
||
<h:head> | ||
<h:title>Range controls</h:title> | ||
<model> | ||
<instance> | ||
<root id="range-controls"> | ||
<range-decimal>1.0</range-decimal> | ||
<range-int>2</range-int> | ||
|
||
<vertical> | ||
<v-decimal>1.25</v-decimal> | ||
<v-int>1</v-int> | ||
</vertical> | ||
</root> | ||
</instance> | ||
<bind nodeset="/root/range-decimal" type="xsd:decimal" /> | ||
<bind nodeset="/root/range-int" type="int" /> | ||
<bind nodeset="/root/vertical/v-decimal" type="decimal" /> | ||
<bind nodeset="/root/vertical/v-int" type="xsd:int" /> | ||
</model> | ||
</h:head> | ||
|
||
<h:body> | ||
<range ref="/root/range-decimal" start="-2.0" end="2.0" step="0.5"> | ||
<label>Range control (decimal)</label> | ||
</range> | ||
<range ref="/root/range-int" start="-6" end="4" step="2"> | ||
<label>Range control (int)</label> | ||
</range> | ||
|
||
<group ref="/root/vertical"> | ||
<range ref="/root/vertical/v-decimal" start="-5.0" end="7.0" step="0.5" | ||
appearance="vertical"> | ||
<label>Range control (decimal)</label> | ||
</range> | ||
<range ref="/root/vertical/v-int" start="-3" end="4" step="3" appearance="vertical no-ticks"> | ||
<label>Range control (int)</label> | ||
</range> | ||
</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
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> |
Oops, something went wrong.