1.0.3 • Published 1 year ago

@xmagic/ng-numeric-keyboard v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This project was forked in numeric-keyboard

Demo

Online Demo

Alt Text

Usage

1. Install

npm install @xmagic/ng-numeric-keyboard --save

import NgNumericKeyboardModule

import { NgNumericKeyboardModule } from '@xmagic/ng-numeric-keyboard';

@NgModule({
  imports: [ BrowserModule, NgNumericKeyboardModule ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule { }

2. Template

<ng-numeric-input layout="number"
                  entertext="Next"
                  placeholder="This is placeholder"
                  [disabled]="false"
                  [(ngModel)]="data"
                  (enterpress)="onEnter()"
                  (ngModelChange)="onChange()"
                  (focus)="onInputFocus()"
                  (blur)="onInputBlur()">
</ng-numeric-input>

API

Frequently used API is below. See the link for more information

Inputs

NameTypeDefaultDescription
layoutstringnumberkeyboard layout. Possible layouts are number, tel and phone
entertextstringEnterthe label of keyboard enter key
placeholderstringthe input component's placeholder
disabledbooleanfalsedisable the input component

Outputs

NameTypeDescription
ngModelChange()numberEmits when the enter key of keyboard is pressed
enterpress()voidEmits when the input's value changes
focus()voidEmits when called on focusing
blur()voidEmits when the input loses the focus

Layouts

There are three built-in layouts called number, tel and phone which can be used as a replacement of system keyboard.

number layout

number layout

tel layout

tel layout

phone layout

phone layout

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)