Skip to content

Commit

Permalink
Feature #141: Appearances for select node types
Browse files Browse the repository at this point in the history
* Implemented minimal, autocomplete, no-buttons, likert, list, list-nolabel, label, columns, column-pack, column-n for Select1
* Implemented minimal, autocomplete, no-buttons, list, list-nolabel, label, columns, column-pack, column-n for SelectN
* Implementation of map and image-map appearances will be handled separately
* Dynamic width of select options is achieved using javascript, we need to find a way to do it using css if possible
* Original SelectControl.vue has been decomposed into Select1Control and SelectNControl.
* Widgets directory contains low level components, mostly combination of a label and a primevue component
* Appearance directory contains wrapper components to acheive desire UI layout
  • Loading branch information
sadiqkhoja committed Jun 26, 2024
1 parent 2bf64ff commit be1d6b2
Show file tree
Hide file tree
Showing 32 changed files with 1,340 additions and 175 deletions.
1 change: 1 addition & 0 deletions packages/ui-solid/e2e/appearances.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0"?><h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" xmlns:odk="http://www.opendatakit.org/xforms"><h:head><h:title>Appearances</h:title><model odk:xforms-version="1.0.0"><instance><data id="appearances" version="20240611122951"><minimal/><search/><quick/><columns-pack/><columns/><columns-n/><no-buttons/><image-map/><likert/><map/><label/><list-nolabel/><list/><minimal_search/><meta><instanceID/></meta></data></instance><instance id="cities"><root><item><name>karachi</name><label>Karachi</label></item><item><name>toronto</name><label>toronto</label></item><item><name>lahore</name><label>lahore</label></item><item><name>islamabad</name><label>islamabad</label></item><item><name>vancourver</name><label>vancourver</label></item></root></instance><bind nodeset="/data/minimal" type="string"/><bind nodeset="/data/search" type="string"/><bind nodeset="/data/quick" type="string"/><bind nodeset="/data/columns-pack" type="string"/><bind nodeset="/data/columns" type="string"/><bind nodeset="/data/columns-n" type="string"/><bind nodeset="/data/no-buttons" type="string"/><bind nodeset="/data/image-map" type="string"/><bind nodeset="/data/likert" type="string"/><bind nodeset="/data/map" type="string"/><bind nodeset="/data/label" type="string"/><bind nodeset="/data/list-nolabel" type="string"/><bind nodeset="/data/list" type="string"/><bind nodeset="/data/minimal_search" type="string"/><bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/></model></h:head><h:body><select1 appearance="minimal" ref="/data/minimal"><label>minimal</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="search" ref="/data/search"><label>search</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="quick" ref="/data/quick"><label>quick</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="columns-pack" ref="/data/columns-pack"><label>columns-pack</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="columns" ref="/data/columns"><label>columns</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="columns-5" ref="/data/columns-n"><label>columns-n</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="no-buttons" ref="/data/no-buttons"><label>no-buttons</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="image-map" ref="/data/image-map"><label>image-map</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="likert" ref="/data/likert"><label>likert</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="map" ref="/data/map"><label>map</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="label" ref="/data/label"><label>label</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="list-nolabel" ref="/data/list-nolabel"><label>list-nolabel</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="list" ref="/data/list"><label>list</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1><select1 appearance="minimal search" ref="/data/minimal_search"><label>minimal plus search</label><itemset nodeset="instance('cities')/root/item"><value ref="name"/><label ref="label"/></itemset></select1></h:body></h:html>
10 changes: 5 additions & 5 deletions packages/ui-solid/fixtures/xforms/select/1-static-selects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@
<instance>
<data id="static-selects">
<fruit>cherry</fruit>
<fruits>blackberry peach</fruits>
<fruits>blackberry peach</fruits>
<meta>
<instanceID/>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/fruit" type="string"/>
<bind nodeset="/data/fruits" type="string"/>
<bind nodeset="/data/fruit" type="string" />
<bind nodeset="/data/fruits" type="string" />
</model>
</h:head>
<h:body>
Expand Down Expand Up @@ -267,4 +267,4 @@
</item>
</select>
</h:body>
</h:html>
</h:html>
57 changes: 57 additions & 0 deletions packages/ui-solid/fixtures/xforms/select/3-images-choice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa"
xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>images-choice</h:title>
<model odk:xforms-version="1.0.0">
<itext>
<translation lang="default" default="true()">
<text id="animals-0">
<value>tiger</value>
<value form="image">jr://images/tiger.jpg</value>
</text>
<text id="animals-1">
<value>camel</value>
<value form="image">jr://images/camel.jpg</value>
</text>
</translation>
</itext>
<instance>
<data id="images-choice" version="20240611120218">
<animal/>
<meta>
<instanceID/>
</meta>
</data>
</instance>
<instance id="animals">
<root>
<item>
<itextId>animals-0</itextId>
<name>tiger</name>
</item>
<item>
<itextId>animals-1</itextId>
<name>camel</name>
</item>
</root>
</instance>
<bind nodeset="/data/animal" type="string"/>
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/>
</model>
</h:head>
<h:body>
<select1 ref="/data/animal">
<label>Animal</label>
<itemset nodeset="instance('animals')/root/item">
<value ref="name"/>
<label ref="jr:itext(itextId)"/>
</itemset>
</select1>
</h:body>
</h:html>
Loading

0 comments on commit be1d6b2

Please sign in to comment.