Docs update

This commit is contained in:
Francisco Hodge 2018-11-05 17:31:11 -05:00
parent 221c41933b
commit 4e5d36173d
11 changed files with 58441 additions and 50031 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -336,7 +336,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber54">source</a></span></span>
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber58">source</a></span></span>
</span>
</h3>
@ -424,7 +424,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber66">source</a></span></span>
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber70">source</a></span></span>
</span>
</h3>
@ -512,7 +512,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber73">source</a></span></span>
<span data-ice="source"><span><a href="file/src/demo/App.js.html#lineNumber77">source</a></span></span>
</span>
</h3>

View File

@ -1388,7 +1388,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber519">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber531">source</a></span></span>
</span>
</h3>
@ -1433,7 +1433,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber597">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber609">source</a></span></span>
</span>
</h3>
@ -1477,7 +1477,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber607">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber619">source</a></span></span>
</span>
</h3>
@ -1521,7 +1521,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber265">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber272">source</a></span></span>
</span>
</h3>
@ -1564,7 +1564,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber229">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber233">source</a></span></span>
</span>
</h3>
@ -1607,7 +1607,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber744">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber764">source</a></span></span>
</span>
</h3>
@ -1731,7 +1731,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber218">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber222">source</a></span></span>
</span>
</h3>
@ -2192,7 +2192,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber563">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber575">source</a></span></span>
</span>
</h3>
@ -2236,7 +2236,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber339">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber350">source</a></span></span>
</span>
</h3>
@ -2327,7 +2327,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber375">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber386">source</a></span></span>
</span>
</h3>
@ -2407,7 +2407,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber508">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber519">source</a></span></span>
</span>
</h3>
@ -2467,7 +2467,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber349">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber360">source</a></span></span>
</span>
</h3>
@ -2512,7 +2512,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber284">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber295">source</a></span></span>
</span>
</h3>
@ -2573,7 +2573,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber359">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber370">source</a></span></span>
</span>
</h3>
@ -2646,7 +2646,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber477">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber488">source</a></span></span>
</span>
</h3>
@ -2719,7 +2719,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber299">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber310">source</a></span></span>
</span>
</h3>
@ -2865,7 +2865,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber261">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber265">source</a></span></span>
</span>
</h3>
@ -2925,7 +2925,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber214">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber218">source</a></span></span>
</span>
</h3>
@ -2991,7 +2991,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber251">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber255">source</a></span></span>
</span>
</h3>
@ -3035,7 +3035,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber495">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber506">source</a></span></span>
</span>
</h3>
@ -3079,7 +3079,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber573">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber585">source</a></span></span>
</span>
</h3>
@ -3123,7 +3123,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber530">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber542">source</a></span></span>
</span>
</h3>
@ -3167,7 +3167,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber555">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber567">source</a></span></span>
</span>
</h3>
@ -3211,7 +3211,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber547">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber559">source</a></span></span>
</span>
</h3>
@ -3255,7 +3255,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber425">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber436">source</a></span></span>
</span>
</h3>
@ -3335,7 +3335,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber614">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber626">source</a></span></span>
</span>
</h3>
@ -3379,7 +3379,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber331">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber342">source</a></span></span>
</span>
</h3>
@ -3440,7 +3440,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber316">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber327">source</a></span></span>
</span>
</h3>
@ -3508,7 +3508,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber274">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber285">source</a></span></span>
</span>
</h3>

View File

@ -198,7 +198,7 @@
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-addStringAt">addStringAt</a></span></span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, string: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-addStringAt">addStringAt</a></span></span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, string: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
</p>
</div>
<div>
@ -372,7 +372,7 @@
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-getUpdatedInput">getUpdatedInput</a></span></span><span class="code" data-ice="signature">(button: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, input: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>, caretPos: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-getUpdatedInput">getUpdatedInput</a></span></span><span class="code" data-ice="signature">(button: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, input: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>, caretPos: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
</p>
</div>
<div>
@ -459,7 +459,7 @@
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-removeAt">removeAt</a></span></span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name"><span><a href="class/src/lib/services/Utilities.js~Utilities.html#instance-method-removeAt">removeAt</a></span></span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
</p>
</div>
<div>
@ -572,7 +572,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber300">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber308">source</a></span></span>
</span>
</h3>
@ -657,11 +657,11 @@
<span class="code" data-ice="name">addStringAt</span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, string: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name">addStringAt</span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, string: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber198">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber202">source</a></span></span>
</span>
</h3>
@ -702,6 +702,13 @@
<td data-ice="description"><p>The (cursor) position where the string should be added</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">moveCaret</td>
<td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>Whether to update simple-keyboard&apos;s cursor</p>
</td>
</tr>
</tbody>
</table>
</div>
@ -748,7 +755,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber337">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber345">source</a></span></span>
</span>
</h3>
@ -821,7 +828,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber347">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber355">source</a></span></span>
</span>
</h3>
@ -1114,11 +1121,11 @@
<span class="code" data-ice="name">getUpdatedInput</span><span class="code" data-ice="signature">(button: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, input: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>, caretPos: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name">getUpdatedInput</span><span class="code" data-ice="signature">(button: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, input: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></span>, caretPos: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber135">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber136">source</a></span></span>
</span>
</h3>
@ -1166,6 +1173,13 @@
<td data-ice="description"><p>The cursor&apos;s current position</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">moveCaret</td>
<td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>Whether to update simple-keyboard&apos;s cursor</p>
</td>
</tr>
</tbody>
</table>
</div>
@ -1212,7 +1226,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber275">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber284">source</a></span></span>
</span>
</h3>
@ -1296,7 +1310,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber328">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber336">source</a></span></span>
</span>
</h3>
@ -1348,11 +1362,11 @@
<span class="code" data-ice="name">removeAt</span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>): <span>*</span></span>
<span class="code" data-ice="name">removeAt</span><span class="code" data-ice="signature">(source: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, position: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, moveCaret: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber228">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber233">source</a></span></span>
</span>
</h3>
@ -1386,6 +1400,13 @@
<td data-ice="description"><p>The (cursor) position from where the characters should be removed</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">moveCaret</td>
<td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>Whether to update simple-keyboard&apos;s cursor</p>
</td>
</tr>
</tbody>
</table>
</div>
@ -1432,7 +1453,7 @@
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber182">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/services/Utilities.js.html#lineNumber185">source</a></span></span>
</span>
</h3>

View File

@ -68,12 +68,16 @@ class App {
* Creates a new simple-keyboard instance
*/
this.keyboard = new Keyboard({
//debug: true,
debug: true,
layoutName: this.layoutName,
onChange: input =&gt; this.onChange(input),
onKeyPress: button =&gt; this.onKeyPress(button),
newLineOnEnter: true,
physicalKeyboardHighlight: true,
inputName: &quot;inputPhone&quot;,
maxLength: {
inputPhone: 11
}
});
/**
@ -81,7 +85,7 @@ class App {
*/
document.querySelector(&apos;.simple-keyboard&apos;).insertAdjacentHTML(&apos;beforebegin&apos;, `
&lt;div class=&quot;simple-keyboard-preview&quot;&gt;
&lt;textarea class=&quot;input&quot;&gt;&lt;/textarea&gt;
&lt;textarea class=&quot;input&quot; maxlength=&quot;11&quot;&gt;&lt;/textarea&gt;
&lt;/div&gt;
`);

View File

@ -215,7 +215,9 @@ class SimpleKeyboard {
if(!this.input[this.options.inputName])
this.input[this.options.inputName] = &apos;&apos;;
let updatedInput = this.utilities.getUpdatedInput(button, this.input[this.options.inputName], this.options, this.caretPosition);
let updatedInput = this.utilities.getUpdatedInput(
button, this.input[this.options.inputName], this.options, this.caretPosition
);
if(this.input[this.options.inputName] !== updatedInput){
@ -226,7 +228,9 @@ class SimpleKeyboard {
return false;
}
this.input[this.options.inputName] = updatedInput;
this.input[this.options.inputName] = this.utilities.getUpdatedInput(
button, this.input[this.options.inputName], this.options, this.caretPosition, true
);
if(debug)
console.log(&apos;Input changed:&apos;, this.input);
@ -301,12 +305,19 @@ class SimpleKeyboard {
*/
/* istanbul ignore next */
handleButtonHold(button){
if(this.holdInteractionTimeout)
clearTimeout(this.holdInteractionTimeout);
/**
* @type {object} Timeout dictating the speed of key hold iterations
*/
this.holdInteractionTimeout = setTimeout(() =&gt; {
this.handleButtonClicked(button);
this.handleButtonHold(button);
if(this.isMouseHold){
this.handleButtonClicked(button);
this.handleButtonHold(button);
} else {
clearTimeout(this.holdInteractionTimeout);
}
}, 100);
}
@ -551,8 +562,9 @@ class SimpleKeyboard {
let targetTagName = event.target.tagName.toLowerCase();
if(
targetTagName === &quot;textarea&quot; ||
targetTagName === &quot;input&quot;
(targetTagName === &quot;textarea&quot; ||
targetTagName === &quot;input&quot;) &amp;&amp;
!this.options.disableCaretPositioning
){
/**
* Tracks current cursor position
@ -726,7 +738,10 @@ class SimpleKeyboard {
*/
var buttonDOM = document.createElement(&apos;div&apos;);
buttonDOM.className += `hg-button ${fctBtnClass}${buttonThemeClass ? &quot; &quot;+buttonThemeClass : &quot;&quot;}`;
buttonDOM.onclick = () =&gt; this.handleButtonClicked(button);
buttonDOM.onclick = () =&gt; {
this.isMouseHold = false;
this.handleButtonClicked(button);
}
buttonDOM.onmousedown = (e) =&gt; this.handleButtonMouseDown(button, e);
/**
@ -779,17 +794,17 @@ class SimpleKeyboard {
*/
this.onRender();
/**
* Handling mouseup
*/
document.onmouseup = () =&gt; this.handleButtonMouseUp();
if(!this.initialized){
/**
* Ensures that onInit is only called once per instantiation
*/
this.initialized = true;
/**
* Handling mouseup
*/
document.onmouseup = () =&gt; this.handleButtonMouseUp();
/**
* Calling onInit
*/

View File

@ -173,48 +173,51 @@ class Utilities {
* @param {string} input The input string
* @param {object} options The simple-keyboard options object
* @param {number} caretPos The cursor&apos;s current position
* @param {boolean} moveCaret Whether to update simple-keyboard&apos;s cursor
*/
getUpdatedInput(button, input, options, caretPos){
getUpdatedInput(button, input, options, caretPos, moveCaret){
let output = input;
if((button === &quot;{bksp}&quot; || button === &quot;{backspace}&quot;) &amp;&amp; output.length &gt; 0){
output = this.removeAt(output, caretPos);
output = this.removeAt(output, caretPos, moveCaret);
} else if(button === &quot;{space}&quot;)
output = this.addStringAt(output, &quot; &quot;, caretPos);
output = this.addStringAt(output, &quot; &quot;, caretPos, moveCaret);
else if(button === &quot;{tab}&quot; &amp;&amp; !(typeof options.tabCharOnTab === &quot;boolean&quot; &amp;&amp; options.tabCharOnTab === false)){
output = this.addStringAt(output, &quot;\t&quot;, caretPos);
output = this.addStringAt(output, &quot;\t&quot;, caretPos, moveCaret);
} else if((button === &quot;{enter}&quot; || button === &quot;{numpadenter}&quot;) &amp;&amp; options.newLineOnEnter)
output = this.addStringAt(output, &quot;\n&quot;, caretPos);
output = this.addStringAt(output, &quot;\n&quot;, caretPos, moveCaret);
else if(button.includes(&quot;numpad&quot;) &amp;&amp; Number.isInteger(Number(button[button.length - 2]))){
output = this.addStringAt(output, button[button.length - 2], caretPos);
}
else if(button === &quot;{numpaddivide}&quot;)
output = this.addStringAt(output, &apos;/&apos;, caretPos);
output = this.addStringAt(output, &apos;/&apos;, caretPos, moveCaret);
else if(button === &quot;{numpadmultiply}&quot;)
output = this.addStringAt(output, &apos;*&apos;, caretPos);
output = this.addStringAt(output, &apos;*&apos;, caretPos, moveCaret);
else if(button === &quot;{numpadsubtract}&quot;)
output = this.addStringAt(output, &apos;-&apos;, caretPos);
output = this.addStringAt(output, &apos;-&apos;, caretPos, moveCaret);
else if(button === &quot;{numpadadd}&quot;)
output = this.addStringAt(output, &apos;+&apos;, caretPos);
output = this.addStringAt(output, &apos;+&apos;, caretPos, moveCaret);
else if(button === &quot;{numpaddecimal}&quot;)
output = this.addStringAt(output, &apos;.&apos;, caretPos);
output = this.addStringAt(output, &apos;.&apos;, caretPos, moveCaret);
else if(button === &quot;{&quot; || button === &quot;}&quot;)
output = this.addStringAt(output, button, caretPos);
output = this.addStringAt(output, button, caretPos, moveCaret);
else if(!button.includes(&quot;{&quot;) &amp;&amp; !button.includes(&quot;}&quot;))
output = this.addStringAt(output, button, caretPos);
output = this.addStringAt(output, button, caretPos, moveCaret);
return output;
}
/**
* Moves the cursor position by a given amount
*
@ -224,7 +227,7 @@ class Utilities {
updateCaretPos(length, minus){
if(minus){
if(this.simpleKeyboardInstance.caretPosition &gt; 0)
this.simpleKeyboardInstance.caretPosition = this.simpleKeyboardInstance.caretPosition - length
this.simpleKeyboardInstance.caretPosition = this.simpleKeyboardInstance.caretPosition - length;
} else {
this.simpleKeyboardInstance.caretPosition = this.simpleKeyboardInstance.caretPosition + length;
}
@ -236,14 +239,11 @@ class Utilities {
* @param {string} source The source input
* @param {string} string The string to add
* @param {number} position The (cursor) position where the string should be added
* @param {boolean} moveCaret Whether to update simple-keyboard&apos;s cursor
*/
addStringAt(source, string, position){
addStringAt(source, string, position, moveCaret){
let output;
if(this.simpleKeyboardInstance.options.debug){
console.log(&quot;Caret at:&quot;, position);
}
if(!position &amp;&amp; position !== 0){
output = source + string;
} else {
@ -253,11 +253,15 @@ class Utilities {
* Avoid caret position change when maxLength is set
*/
if(!this.isMaxLengthReached()){
this.updateCaretPos(string.length);
if(moveCaret) this.updateCaretPos(string.length);
}
}
if(this.simpleKeyboardInstance.options.debug &amp;&amp; moveCaret){
console.log(&quot;Caret at:&quot;, position);
}
return output;
}
@ -266,8 +270,9 @@ class Utilities {
*
* @param {string} source The source input
* @param {number} position The (cursor) position from where the characters should be removed
* @param {boolean} moveCaret Whether to update simple-keyboard&apos;s cursor
*/
removeAt(source, position){
removeAt(source, position, moveCaret){
if(this.simpleKeyboardInstance.caretPosition === 0){
return source;
}
@ -287,10 +292,10 @@ class Utilities {
if(emojiMatched){
output = source.substr(0, (position - 2)) + source.substr(position);
this.updateCaretPos(2, true);
if(moveCaret) this.updateCaretPos(2, true);
} else {
output = source.substr(0, (position - 1)) + source.substr(position);
this.updateCaretPos(1, true);
if(moveCaret) this.updateCaretPos(1, true);
}
} else {
prevTwoChars = source.slice(-2);
@ -298,13 +303,17 @@ class Utilities {
if(emojiMatched){
output = source.slice(0, -2);
this.updateCaretPos(2, true);
if(moveCaret) this.updateCaretPos(2, true);
} else {
output = source.slice(0, -1);
this.updateCaretPos(1, true);
if(moveCaret) this.updateCaretPos(1, true);
}
}
if(this.simpleKeyboardInstance.options.debug &amp;&amp; moveCaret){
console.log(&quot;Caret at:&quot;, this.simpleKeyboardInstance.caretPosition);
}
return output;
}
/**
@ -319,7 +328,6 @@ class Utilities {
let currentInput = inputObj[options.inputName];
let condition = currentInput.length === maxLength;
if(
/**
* If pressing this button won&apos;t add more characters

File diff suppressed because one or more lines are too long

View File

@ -58,9 +58,9 @@
<td data-ice="filePath"><span><a href="file/src/demo/App.js.html">src/demo/App.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="class/src/demo/App.js~App.html">App</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">8/8</span></td>
<td style="display: none;" data-ice="size">1921 byte</td>
<td style="display: none;" data-ice="lines">84</td>
<td style="display: none;" data-ice="updated">2018-11-05 16:32:42 (UTC)</td>
<td style="display: none;" data-ice="size">2019 byte</td>
<td style="display: none;" data-ice="lines">88</td>
<td style="display: none;" data-ice="updated">2018-11-02 19:39:25 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/demo/index.js.html">src/demo/index.js</a></span></td>
@ -74,9 +74,9 @@
<td data-ice="filePath"><span><a href="file/src/lib/components/Keyboard.js.html">src/lib/components/Keyboard.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="class/src/lib/components/Keyboard.js~SimpleKeyboard.html">SimpleKeyboard</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">41/41</span></td>
<td style="display: none;" data-ice="size">24443 byte</td>
<td style="display: none;" data-ice="lines">759</td>
<td style="display: none;" data-ice="updated">2018-11-05 16:42:42 (UTC)</td>
<td style="display: none;" data-ice="size">24880 byte</td>
<td style="display: none;" data-ice="lines">774</td>
<td style="display: none;" data-ice="updated">2018-11-02 21:51:35 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/index.js.html">src/lib/index.js</a></span></td>
@ -106,9 +106,9 @@
<td data-ice="filePath"><span><a href="file/src/lib/services/Utilities.js.html">src/lib/services/Utilities.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="class/src/lib/services/Utilities.js~Utilities.html">Utilities</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">15/15</span></td>
<td style="display: none;" data-ice="size">10567 byte</td>
<td style="display: none;" data-ice="lines">352</td>
<td style="display: none;" data-ice="updated">2018-10-03 17:11:36 (UTC)</td>
<td style="display: none;" data-ice="size">11188 byte</td>
<td style="display: none;" data-ice="lines">360</td>
<td style="display: none;" data-ice="updated">2018-11-02 22:28:58 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/tests/TestUtility.js.html">src/lib/tests/TestUtility.js</a></span></td>