npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

softmotions-fm7-keypad

v1.0.9

Published

Keypad plugin extends Framework7 with additional custom keyboards

Downloads

79

Readme

devDependency Status [Flattr this git repo](https://flattr.com/submit/auto?user_id=nolimits4web&url=https://github.com/nolimits4web/framework7-keypad/&title=Framework7 Keypad&language=JavaScript&tags=github&category=software)

Framework7 Keypad

Keypad plugin extends Framework7 with additional custom keyboards. By default it comes with predefined Numpad and Calculator keyboards, but it also can be used to create custom keyboards with custom buttons.

Keypad Instance

Keypad can be created and initialized only using JavaScript. We need to use related App's method:

myApp.keypad(parameters)

Where parameters - object - object with Keypad parameters. Required This method returns initialized Keypad instance

For example

var myKeypad = myApp.keypad({
    input: '#demo-numpad-limited',
    valueMaxLength: 2,
    dotButton: false
});

Keypad Parameters

Let's look on list of all available parameters:

    </code></pre>
  </td>
</tr>
<tr>
  <th colspan="4">Specific Picker Parameters</th>
</tr>
<tr>
  <td>value</td>
  <td>string</td>
  <td></td>
  <td>Initial Keypad value</td>
</tr>
<tr>
  <td>formatValue</td>
  <td>function (p, value)</td>
  <td></td>
  <td>
    Function to format input value, should return new/formatted string value. <b>value</b>
    is the current keypad value
  </td>
</tr>
<tr>
  <td>type</td>
  <td>string</td>
  <td>'numbad'</td>
  <td>Keypad type, could be 'numpad', 'calculator' or 'custom'</td>
</tr>
<tr>
  <td>valueMaxLength</td>
  <td>number</td>
  <td>null</td>
  <td>Limit value by selected number of characters</td>
</tr>
<tr>
  <td>dotButton</td>
  <td>boolean</td>
  <td>true</td>
  <td>Only for 'numpad' type. Show or hide "dot" button</td>
</tr>
<tr>
  <td>dotCharacter</td>
  <td>string</td>
  <td>'.'</td>
  <td>Dot character symbol. Only for 'numpad' and 'calculator' types</td>
</tr>
<tr>
  <td>buttons</td>
  <td>array</td>
  <td></td>
  <td>
    <p>Array with keypad buttons, by default it is predefined for numpad and calculator, but can be used for custom keypad.</p>
    <p>Each button should be presented as object with the following properties:</p>
    <ul>
        <li><i>html</i> - <b>string</b> - button inner HTML</li>
        <li><i>value</i> - <b>string/number</b> - button value</li>
        <li><i>cssClass</i> - <b>string</b> - additional CSS class on button</li>
        <li><i>dark</i> - <b>boolean</b> - defines "dark" color button</li>
        <li><i>onClick</i> - <b>function (p, button)</b> - callback function that will be executed when you click on button</li>
    </ul>
    <p>As a reference look at source code to see how buttons defined for Numpad and Calculator</p>
    <p>For example:</p>
    <pre><code>

... buttons: [ { html:'1', value: 1, onClick: function () { console.log('Button 1 clicked') } }, { html:'A', value: 'a', }, ... ]

    </code></pre>
  </td>
</tr>


<tr>
  <th colspan="4">Callbacks</th>
</tr>
<tr>
  <td>onChange</td>
  <td>function (p, value)</td>
  <td></td>
  <td>
    Callback function that will be executed when keypad value changed.
  </td>
</tr>
<tr>
  <td>onOpen</td>
  <td>function (p)</td>
  <td></td>
  <td>
    Callback function that will be executed when picker is opened
  </td>
</tr>
<tr>
  <td>onClose</td>
  <td>function (p)</td>
  <td></td>
  <td>
    Callback function that will be executed when picker is closed
  </td>
</tr>

Keypad Methods & Properties

After we initialize Keypad we have its initialized instance in variable (like myKeypad variable in example above) with helpful methods and properties:

Automatic initialization

Such predefined Numpad and Calculator keypads could be initialized automatically. Just use usual inputs but with special type attribute:

<input type="numpad">
<input type="calculator">

Access to Keypad's Instance

If you initialize Keypad as inline Keypad or using automatic initialization, it is still possible to access to Keypad's instance from its HTML container:

var myKeypad = $$('.keypad-inline')[0].f7Keypad;