# touchmedia-kiosk-keyboard

> React NPM Module sample

Latest version **1.0.7** (published 2019-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install touchmedia-kiosk-keyboard
pnpm add touchmedia-kiosk-keyboard
yarn add touchmedia-kiosk-keyboard
bun add touchmedia-kiosk-keyboard
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-07-24 |
| First published | 2019-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daryl Seguritan |
| Maintainers | code404 |
| Keywords | kiosk-keyboard, react-keyboard, keyboard |

## Links

- npm: https://www.npmjs.com/package/touchmedia-kiosk-keyboard
- npm.io page: https://npm.io/package/touchmedia-kiosk-keyboard

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^16.8.6
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.5.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.5.5
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.5.5
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.0.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.5.5

## Recent versions

- 1.0.7 (latest) — 2019-07-24
- 1.0.6 — 2019-07-24
- 1.0.5 — 2019-07-24
- 1.0.4 — 2019-07-24
- 1.0.3 — 2019-07-24
- 1.0.2 — 2019-07-24
- 1.0.1 — 2019-07-24
- 1.0.0 — 2019-07-24

## README

<div>
  <div>This modules uses <a href="https://www.npmjs.com/package/react-simple-keyboard">react-simple-keyboard</a></div>
  <h3>Sample Code</h3>
  <hr />
  <code>

    class App extends Component {
      constructor(props) {
        super(props);
        this.state = {
          keyboardText: '1234'
        }
        this.keyboardRef = false;
        this.handleKeyboardRef = this.handleKeyboardRef.bind(this);
      }
      handleKeyboardEnterKey = () => {
        alert('sdfsdfsdf')
      }
      handleKeyboardRef = () => {

      }

      handleKeyboardInputText = (keyboardText) => {
        this.setState({ keyboardText })
      }

      handleKeyboardRef = (keyboard) => {
        this.keyboardRef = keyboard;
      }
      handleInputChange = (e) => {
        const value = e.target.value
        this.setState({ keyboardText: value }, () => {
          this.keyboardRef.keyboard.setInput(value, 'kiosk')
        })
      }

      render() {
        const { keyboardText } = this.state;
        return (
          <div>
            <input type="text" name="kiosk" id="name" value={keyboardText} onChange={this.handleInputChange} readOnly />
            <KeyBoard onSubmitKey={this.handleKeyboardEnterKey} setInputText={this.handleKeyboardInputText} setKeyboardRef={this.handleKeyboardRef} />
          </div>
        );
      }
    }

  </code>
  <hr />
  <h3>Props</h3>
  <div>
    <table>
      <tr>
        <td>Props</td><td>Default</td><td>Value</td><td>Description</td>
      </tr>
      <tr>
        <td>buttonTheme</td><td>[]</td><td>Array</td><td>Refer to: <a href="https://franciscohodge.com/projects/react-simple-keyboard/documentation/#buttonTheme">Button Theme</a> </td>
      </tr>
      <tr>
        <td>inputName</td><td>kiosk</td><td>string</td><td>name of the current input bind in keyboard</td>
      </tr>
      <tr>
        <td>buttonDisplay</td><td></td><td>object</td><td>refer to: <a href="https://franciscohodge.com/projects/react-simple-keyboard/documentation/#display">Display</a></td>
      </tr>
      <tr>
        <td>layoutName</td><td>lowercase</td><td>string</td><td>Default layouts: lowercase, uppercase, number, specialChar</td>
      </tr>
      <tr>
        <td>themeClassName</td><td>kiosk-template-keyboard</td><td>string</td><td>CSS classname</td>
      </tr>
      <tr>
        <td>layout</td>
        <td>
          <code>
            layouts: {
              lowercase: [
                "q w e r t y u i o p {bksp}",
                "a s d f g h j k l {enter}",
                "{caps} z x c v b n m _ {caps}",
                "{123abc} {space} . @"
              ],
              uppercase: [
                "Q W E R T Y U I O P {bksp}",
                "A S D F G H J K L {enter}",
                "{shift} Z X C V B N M _ {shift}",
                "{123abc} {space} . @"
              ],
              number: [
                "1 2 3",
                "4 5 6",
                "7 8 9",
                "{bksp} 0 {enter}",
              ],
              specialChar: [
                "1 2 3 4 5 6 7 8 9 0 {bksp}",
                "_ / : ; ( ) $ & \\ {enter}",
                "- < > ? ! ' \" + # * ,",
                "{abc} {space} . @"
              ]
            }
          </code>
        </td><td>object</td>
        <td>
          Refer to: <a href="https://franciscohodge.com/projects/react-simple-keyboard/documentation/#layout">layout</a>
        </td>
      </tr>
      <tr>
        <td>onSubmitKey</td><td></td><td>function</td><td>Action to call when touch the enter key</td>
      </tr>
      <tr>
        <td>setInputText</td><td></td><td>function</td><td>params: activeInputText </td>
      </tr>
      <tr>
        <td>setKeyboardRef</td><td></td><td>function</td><td>keyboard reference</td>
      </tr>
    </table>
  </div>
</div>

---
_Source: https://npm.io/package/touchmedia-kiosk-keyboard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
