Skip to content

Commit

Permalink
Merge pull request #18 from electrode-io/feat-nav-events
Browse files Browse the repository at this point in the history
feat: handle new navigation events
  • Loading branch information
asharpbflat authored Feb 5, 2020
2 parents 4cb96ec + 7706b3c commit fdb6b5c
Show file tree
Hide file tree
Showing 15 changed files with 1,025 additions and 498 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Check out our [Electode Native Navigation Blog Post](https://medium.com/walmartl
<dd></dd>
<dt><a href="#LeftButton">LeftButton</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="#NavigationEvent">NavigationEvent</a> : <code>Object</code></dt>
<dd></dd>
</dl>

<a name="AppNavigator"></a>
Expand Down Expand Up @@ -161,6 +163,8 @@ Register all screens.
* [.getAppNavigator()](#Component.getAppNavigator)[<code>AppNavigator</code>](#AppNavigator)
* *[.getDynamicTitle(jsonPayload)](#Component.getDynamicTitle)*
* *[.onNavButtonPress(buttonId)](#Component.onNavButtonPress)*
* *[.onFocus()](#Component.onFocus)*
* *[.onBlur()](#Component.onBlur)*

<a name="new_Component_new"></a>

Expand Down Expand Up @@ -341,6 +345,18 @@ Must be overriden in subclasses.
| --- | --- | --- |
| buttonId | <code>string</code> | The ID of the button which was pressed. |

<a name="Component.onFocus"></a>

### *Component.onFocus()*
Handle focus events.

**Kind**: static abstract method of [<code>Component</code>](#Component)
<a name="Component.onBlur"></a>

### *Component.onBlur()*
Handle blur events.

**Kind**: static abstract method of [<code>Component</code>](#Component)
<a name="AppNavigatorOptions"></a>

## AppNavigatorOptions : <code>Object</code>
Expand Down Expand Up @@ -390,6 +406,18 @@ Must be overriden in subclasses.
| id | <code>string</code> | The ID of the button; will be used in header button events. If set, the press event must be handled on the Javascript side, as native will no longer handle the back press. Cannot contain '.'. |
| accessibilityLabel | <code>string</code> | The text to read out with screen-reader technology. |

<a name="NavigationEvent"></a>

## NavigationEvent : <code>Object</code>
**Kind**: global typedef
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| eventType | <code>&#x27;BUTTON\_CLICK&#x27;</code> \| <code>&#x27;DID\_FOCUS&#x27;</code> \| <code>&#x27;DID\_BLUR&#x27;</code> | The type of the event. |
| viewId | <code>string</code> | The UUID for the view on which the event was fired. |
| jsonPayload | <code>string</code> | The payload for the event as stringified JSON. |


* * *

Expand Down
2 changes: 1 addition & 1 deletion docs/AppNavigator.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AppNaviga
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Dec 11 2019 18:38:20 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Fri Jan 31 2020 17:10:25 GMT-0800 (PST)
</footer>

<script> prettyPrint(); </script>
Expand Down
204 changes: 190 additions & 14 deletions docs/Component.html
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ <h4 class="name" id=".getAppNavigator"><span class="type-signature">(static) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line164">line 164</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line170">line 170</a>
</li></ul></dd>


Expand Down Expand Up @@ -492,7 +492,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line289">line 289</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line274">line 274</a>
</li></ul></dd>


Expand Down Expand Up @@ -580,7 +580,7 @@ <h4 class="name" id=".getRegisteredRoute"><span class="type-signature">(static)

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line146">line 146</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line152">line 152</a>
</li></ul></dd>


Expand Down Expand Up @@ -632,6 +632,182 @@ <h5>Returns:</h5>









<h4 class="name" id=".onBlur"><span class="type-signature">(abstract, static) </span>onBlur<span class="signature">()</span><span class="type-signature"></span></h4>






<div class="description">
Handle blur events.
</div>













<dl class="details">


























<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line307">line 307</a>
</li></ul></dd>







</dl>


























<h4 class="name" id=".onFocus"><span class="type-signature">(abstract, static) </span>onFocus<span class="signature">()</span><span class="type-signature"></span></h4>






<div class="description">
Handle focus events.
</div>













<dl class="details">


























<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line299">line 299</a>
</li></ul></dd>







</dl>























Expand Down Expand Up @@ -740,7 +916,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line299">line 299</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line284">line 284</a>
</li></ul></dd>


Expand Down Expand Up @@ -877,7 +1053,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line155">line 155</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line161">line 161</a>
</li></ul></dd>


Expand Down Expand Up @@ -1014,7 +1190,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line128">line 128</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line134">line 134</a>
</li></ul></dd>


Expand Down Expand Up @@ -1102,7 +1278,7 @@ <h4 class="name" id="back"><span class="type-signature">(async) </span>back<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line459">line 459</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line447">line 447</a>
</li></ul></dd>


Expand Down Expand Up @@ -1263,7 +1439,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line420">line 420</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line408">line 408</a>
</li></ul></dd>


Expand Down Expand Up @@ -1436,7 +1612,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line473">line 473</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line461">line 461</a>
</li></ul></dd>


Expand Down Expand Up @@ -1596,7 +1772,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line357">line 357</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line347">line 347</a>
</li></ul></dd>


Expand Down Expand Up @@ -1801,7 +1977,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line373">line 373</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line363">line 363</a>
</li></ul></dd>


Expand Down Expand Up @@ -1912,7 +2088,7 @@ <h4 class="name" id="resetNavigationBar"><span class="type-signature">(async) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line316">line 316</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line317">line 317</a>
</li></ul></dd>


Expand Down Expand Up @@ -2072,7 +2248,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line333">line 333</a>
<a href="navigation-component.js.html">navigation-component.js</a>, <a href="navigation-component.js.html#line330">line 330</a>
</li></ul></dd>


Expand Down Expand Up @@ -2147,7 +2323,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AppNaviga
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Dec 11 2019 18:38:20 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Fri Jan 31 2020 17:10:25 GMT-0800 (PST)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/app-navigator.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AppNaviga
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Dec 11 2019 18:38:20 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Fri Jan 31 2020 17:10:25 GMT-0800 (PST)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit fdb6b5c

Please sign in to comment.