Angular and Ionic Numpad
Numpad for Angular and Ionic 2/3/4
Numpad for Angular and Ionic 2/3/4
Numpad for Angular and Ionic 2/3/4
Learn moreNumpad - Decimal
import { Component } from '@angular/core';
import { MbscNumpadDecimalOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadDecimalOptions = {
theme: '',
themeVariant: '',
lang: '',
min: 1,
scale: 2
};
}
<input [(ngModel)]="numpad" mbsc-numpad-decimal [mbsc-options]="numpadSettings" placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Currency
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
theme: '',
themeVariant: '',
lang: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
price = 20;
numpadSettings: MbscNumpadOptions = {
preset: 'decimal',
min: 5,
max: 500,
prefix: '$'
};
}
<mbsc-form [options]="formSettings" class="md-stepper-np">
<div class="mbsc-padding md-demo">
<h4 class="md-title">Automatically top up account</h4>
<div class="mbsc-desc ">Top up from credit card if account falls bellow $10</div>
<mbsc-form-group inset>
<div>
<input type="number" data-role="stepper" [(ngModel)]="price" min="10" max="120" step="10" (click)="mbscNumpad.instance.show()" readonly />
</div>
</mbsc-form-group>
<div class="md-numpad" mbsc-numpad [mbsc-options]="numpadSettings" [(ngModel)]="price" #mbscNumpad="mobiscroll"></div>
<div class="mbsc-btn-group-block">
<mbsc-button>Save Settings</mbsc-button>
</div>
</div>
</mbsc-form>
.md-stepper-np .md-demo {
text-align: center;
}
.md-stepper-np .md-demo .mbsc-desc {
font-size: 16px;
padding-bottom: 16px;
}
.md-stepper-np .md-demo .mbsc-btn {
margin-top: 36px;
}
.md-stepper-np .md-title {
margin-top: 40px;
}
.md-stepper-np {
display: inline-block;
width: 100%;
height: 100%;
}
.md-stepper-np .mbsc-segmented {
left: 50%;
margin-left: -122px;
}
.md-stepper-np .mbsc-stepper .mbsc-segmented-item {
width: 4.375em;
}
.md-stepper-np .mbsc-stepper .mbsc-segmented-item:nth-child(3) {
width: 6.25em;
}
.md-stepper-np .mbsc-stepper input {
left: 5em;
width: 7.1428em;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Integer
import { Component } from '@angular/core';
import { MbscNumpadDecimalOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadDecimalOptions = {
theme: '',
themeVariant: '',
lang: '',
scale: 0,
max: 9999,
min: -9999,
defaultValue: 0
};
}
<input [(ngModel)]="numpad" mbsc-numpad-decimal [mbsc-options]="numpadSettings"placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Timespan
import { Component } from '@angular/core';
import { MbscNumpadTimespanOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadTimespanOptions = {
theme: '',
themeVariant: '',
lang: ''
};
}
<input [(ngModel)]="numpad" mbsc-numpad-timespan [mbsc-options]="numpadSettings"placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - RTL Support
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions, MbscFormOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
theme: '',
themeVariant: '',
lang: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
arabic: Date;
hebrew: Date;
farsi: Date;
rtl: Date;
arabicSettings: MbscNumpadOptions = {
lang: 'ar'
};
hebrewSettings: MbscNumpadOptions = {
lang: 'he'
};
farsiSettings: MbscNumpadOptions = {
lang: 'fa'
};
rtlSettings: MbscNumpadOptions = {
rtl: true
};
formSettings: MbscFormOptions = {
rtl: true
}
}
<mbsc-form [options]="formSettings">
<mbsc-form-group>
<mbsc-form-group-title>RTL enabled by default</mbsc-form-group-title>
<mbsc-input mbsc-numpad [(ngModel)]="arabic" [mbsc-options]="arabicSettings" placeholder="Please Select...">Arabic</mbsc-input>
<mbsc-input mbsc-numpad [(ngModel)]="hebrew" [mbsc-options]="hebrewSettings" placeholder="Please Select...">Hebrew</mbsc-input>
<mbsc-input mbsc-numpad [(ngModel)]="farsi" [mbsc-options]="farsiSettings" placeholder="Please Select...">Farsi</mbsc-input>
</mbsc-form-group>
<mbsc-form-group>
<mbsc-form-group-title>Manually set RTL</mbsc-form-group-title>
<mbsc-input mbsc-numpad [(ngModel)]="rtl" [mbsc-options]="rtlSettings" placeholder="Please Select...">RTL</mbsc-input>
</mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Time
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadTimeOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
theme: '',
themeVariant: '',
lang: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
time24h: Date;
time12h: Date;
time24hSettings: MbscNumpadTimeOptions = {
timeFormat: 'HH:ii'
};
time12hSettings: MbscNumpadTimeOptions = {
timeFormat: 'HH:ii A'
};
}
<mbsc-form [options]="formSettings">
<mbsc-form-group>
<mbsc-form-group-title>Time formats</mbsc-form-group-title>
<mbsc-input mbsc-numpad-time [(ngModel)]="time24h" [mbsc-options]="time24hSettings" placeholder="Please Select...">24h format</mbsc-input>
<mbsc-input mbsc-numpad-time [(ngModel)]="time12h" [mbsc-options]="time12hSettings" placeholder="Please Select...">12h format</mbsc-input>
</mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Date
import { Component } from '@angular/core';
import { MbscNumpadDateOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: Date;
numpadSettings: MbscNumpadDateOptions = {
theme: '',
themeVariant: '',
lang: '',
headerText: 'Next Schedule (mm/dd/yyyy)'
};
}
<input [(ngModel)]="numpad" mbsc-numpad-date [mbsc-options]="numpadSettings" placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Masked Entry - PIN
import { Component } from '@angular/core';
import { MbscNumpadOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadOptions = {
theme: '',
themeVariant: '',
lang: '',
template: 'dddd',
allowLeadingZero: true,
placeholder: '-',
mask: '*',
validate: (event) => {
return {
disabled: [],
invalid: event.values.length !== 4
};
}
};
}
<input [(ngModel)]="numpad" mbsc-numpad [mbsc-options]="numpadSettings"placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Phone number entry
Use the numpad for phone number entry. With built-in validation your users cannot go wrong.
Use the validate
function to check for the appropriate length, format and only enable the set
button if everything looks good.
With the help of the template
setting, the formatValue
and parseValue
functions you can ensure the phone number is shown in the correct format, with all the dashes and spaces that make sense.
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
dus: number;
ius: number;
de: number;
dusSettings: MbscNumpadOptions = {
fill: 'ltr',
template: '(ddd) ddd-dddd',
allowLeadingZero: true,
validate: (event, inst) => {
if (inst.isVisible()) {
// Display the formatted value
inst._markup[0].querySelector('.mbsc-np-dsp').innerHTML = inst.settings.formatValue(event.values, event.variables, inst) || ' ';
}
return {
// Set the set button invalid until 10 chars filled
invalid: event.values.length != 10
};
},
formatValue: (numbers, variables, inst) => {
// specify how the value will be formatted
return (numbers.length > 2 ? '(' : '') + numbers.slice(0, 3).join('') + (numbers.length > 2 ? ') ' : '') + numbers.slice(3, 6).join('') + (numbers.length > 5 ? '-' : '') + numbers.slice(6, 10).join('');
},
parseValue: (v, i) => {
if (v) {
return v.replace('(', '').replace(') ', '').replace('-', '');
}
}
};
iusSettings: MbscNumpadOptions = {
fill: 'ltr',
template: '+1-ddd-ddd-dddd',
allowLeadingZero: true,
validate: (event, inst) => {
if (inst.isVisible()) {
inst._markup[0].querySelector('.mbsc-np-dsp').innerHTML = inst.settings.formatValue(event.values, event.variables, inst) || ' ';
}
return {
invalid: event.values.length != 10
};
},
formatValue: (numbers, variables, inst) => {
return '+1-' + numbers.slice(0, 3).join('') + (numbers.length > 2 ? '-' : '') + numbers.slice(3, 6).join('') + (numbers.length > 5 ? '-' : '') + numbers.slice(6, 10).join('');
},
parseValue: (v, i) => {
if (v) {
return v.replace('+1', '').replace(/-/gm, '');;
}
}
};
deSettings: MbscNumpadOptions = {
fill: 'ltr',
template: '+49-dd-ddd-ddddd',
allowLeadingZero: true,
validate: (event, inst) => {
if (inst.isVisible()) {
inst._markup[0].querySelector('.mbsc-np-dsp').innerHTML = inst.settings.formatValue(event.values, event.variables, inst) || ' ';
}
return {
invalid: event.values.length != 10
};
},
formatValue: (numbers, variables, inst) => {
return '+49-' + numbers.slice(0, 2).join('') + (numbers.length > 1 ? '-' : '') + numbers.slice(2, 5).join('') + (numbers.length > 4 ? '-' : '') + numbers.slice(5, 10).join('');
},
parseValue: (v, i) => {
if (v) {
return v.replace('+49', '').replace(/-/gm, '');
}
}
};
}
<mbsc-form>
<mbsc-input mbsc-numpad [(ngModel)]="dus" [mbsc-options]="dusSettings" input-style="box" label-style="stacked" placeholder="Enter phone number...">Domestic US</mbsc-input>
<mbsc-input mbsc-numpad [(ngModel)]="ius" [mbsc-options]="iusSettings" input-style="box" label-style="stacked" placeholder="Enter phone number...">International US</mbsc-input>
<mbsc-input mbsc-numpad [(ngModel)]="de" [mbsc-options]="deSettings" input-style="box" label-style="stacked" placeholder="Enter phone number...">International German</mbsc-input>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Variable Fraction
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
decimal = '.';
thousands = ',';
numpadSettings: MbscNumpadOptions = {
theme: '',
themeVariant: '',
lang: '',
template: 'ddddddddd',
allowLeadingZero: true,
parseValue: (value) => {
if (value) {
return value.toString().replace(this.thousands, '').split('');
}
return [];
},
formatValue: (numbers) => {
let ret: Array < string > ;
let l = numbers.length;
// Add leading zeroes if necessary
if (numbers[0] === '.') {
numbers.unshift(0);
l++;
}
ret = numbers.join('').split(this.decimal);
ret[0] = ret[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousands);
return ret.join(this.decimal);
},
leftKey: {
text: '.',
value: '.'
},
validate: (event, inst) => {
const s = inst.settings;
const values = event.values;
const disabledButtons = [];
const maxLength = 9;
const maxScale = 9;
let invalid = false;
if (values.length >= maxLength || values.indexOf(this.decimal) !== -1) {
disabledButtons.push(this.decimal);
}
if (values.length === 1 && values[0] === 0) {
for (let i = 1; i <= 9; i++) {
disabledButtons.push(i);
}
}
if (!values.length || values[values.length - 1] === this.decimal) {
invalid = true;
}
// Only allow max maxScale decimal values
if (values.length > (maxScale + 1) && values[values.length - maxScale - 1] === this.decimal) {
for (let i = 0; i <= 9; i++) {
disabledButtons.push(i);
}
}
// Display the formatted value
if (inst.isVisible()) {
inst._markup[0].querySelector('.mbsc-np-dsp').innerHTML = inst.settings.formatValue(values) || ' ';
}
return {
invalid: invalid,
disabled: disabledButtons
};
}
};
}
<input [(ngModel)]="numpad" mbsc-numpad [mbsc-options]="numpadSettings"placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Donation
import { Component } from '@angular/core';
import { MbscNumpadDecimalOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadDecimalOptions = {
theme: '',
themeVariant: '',
lang: '',
min: 1,
max: 10000,
scale: 2
};
}
<div class="md-donation-cont">
<div class="md-donation">
<div class="md-header">Giving feels good</div>
<img src="https://img.mobiscroll.com/demos/heart.png" class="md-heart" />
<div class="md-donate-padding">
<div class="md-btn-cont">
<button class="md-btn mbsc-btn">$500</button>
<button class="md-btn mbsc-btn">$250</button>
<button class="md-btn mbsc-btn">$100</button>
</div>
<label class="md-input-cont">
<input class="md-donation-input" [(ngModel)]="numpad" mbsc-numpad-decimal [mbsc-options]="numpadSettings" placeholder="Other amount..." />
</label>
</div>
<button class="md-donation-btn mbsc-btn">Donate now</button>
</div>
</div>
.md-donation-cont {
height: 100%;
}
.md-donation {
background: #fff;
min-height: 100%;
position: relative;
}
.md-donation .md-header {
color: #fb354c;
font-size: 35px;
text-align: center;
padding: 60px 0 20px 0;
}
.md-donation .md-heart {
width: 100%;
padding-bottom: 50px;
}
.md-donation .md-donate-padding {
padding: 2em 2em 6.5em 2em;
}
/* button */
.md-donation .md-btn-cont {
overflow: hidden;
}
.md-donation-cont .md-donation .md-donate-padding .md-btn {
float: left;
width: 31%;
text-decoration: none;
padding: 0.8em 2em;
margin: 0;
outline: 0;
border: 0;
overflow: visible;
cursor: pointer;
color: #fff;
background: #fb354c;
border-radius: 4px;
font-size: 16px;
}
.md-donation-cont .md-donation .md-donate-padding .md-btn:nth-child(2) {
margin: 0 3.3%;
}
.md-donation-cont .md-donation .md-donation-btn {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 68px;
margin: 0;
background: #fb354c;
color: #fff;
font-size: 20px;
text-transform: capitalize;
border-radius: 0;
box-shadow: none;
}
.md-donation-cont .md-donation .md-donate-padding .md-btn:focus,
.md-donation-cont .md-donation .md-donation-btn:active {
opacity: .6;
}
.md-donation-cont .md-donation .md-donate-padding .md-btn:hover {
background: #B50F06;
}
/* input */
.md-donation-input {
margin: 0;
}
.md-donation .md-donate-padding .md-input-cont {
position: relative;
display: block;
border: 1px solid #fb354c;
border-radius: 4px;
margin: 15px 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-weight: 100;
line-height: 1;
}
.md-donation .md-donate-padding .md-input-cont:before {
content: '$';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 35px;
background: #fb354c;
color: #fff;
font-size: 16px;
text-align: center;
line-height: 39px;
}
.md-donation .md-donate-padding input {
outline: 0;
background: #fff;
height: 100%;
width: 99%;
border: 0;
padding: 10px 10px 10px 45px;
font-size: 16px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 20px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Event handlers
EVENTS FIRED:
import { Component } from '@angular/core';
import { MbscNumpadOptions } from '@mobiscroll/angular';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadSettings: MbscNumpadOptions = {
theme: '',
themeVariant: '',
lang: '',
onInit: (event, inst) => {
// Your custom event handler goes here
},
onMarkupReady: (event, inst) => {
// Your custom event handler goes here
},
onBeforeShow: (event, inst) => {
// Your custom event handler goes here
},
onPosition: (event, inst) => {
// Your custom event handler goes here
},
onShow: (event, inst) => {
// Your custom event handler goes here
},
onSet: (event, inst) => {
// Your custom event handler goes here
},
onDestroy: (event, inst) => {
// Your custom event handler goes here
},
onClose: (event, inst) => {
// Your custom event handler goes here
},
onCancel: (event, inst) => {
// Your custom event handler goes here
},
onBeforeClose: (event, inst) => {
// Your custom event handler goes here
},
onClear: (event, inst) => {
// Your custom event handler goes here
},
validate: (data, inst) => {
// Your custom event handler goes here
}
};
}
<input [(ngModel)]="numpad" mbsc-numpad [mbsc-options]="numpadSettings"placeholder="Please select..." />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Display modes
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
numpad: number;
numpadTop: number;
numpadCenter: number;
numpadBubble: number;
numpadInline: number;
numpadSettings: MbscNumpadOptions = {
display: 'bottom'
};
numpadTopSettings: MbscNumpadOptions = {
display: 'top'
};
numpadCenterSettings: MbscNumpadOptions = {
display: 'center'
};
numpadBubbleSettings: MbscNumpadOptions = {
display: 'bubble'
};
numpadInlineSettings: MbscNumpadOptions = {
display: 'inline'
};
}
<mbsc-form>
<mbsc-form-group>
<mbsc-form-group-title>Try different display modes</mbsc-form-group-title>
<mbsc-input [(ngModel)]="numpad" mbsc-numpad [mbsc-options]="numpadSettings" placeholder="Please select...">Bottom</mbsc-input>
<mbsc-input [(ngModel)]="numpadTop" mbsc-numpad [mbsc-options]="numpadTopSettings" placeholder="Please select...">Top</mbsc-input>
<mbsc-input [(ngModel)]="numpadCenter" mbsc-numpad [mbsc-options]="numpadCenterSettings" placeholder="Please select...">Center</mbsc-input>
<mbsc-input [(ngModel)]="numpadBubble" mbsc-numpad [mbsc-options]="numpadBubbleSettings" placeholder="Please select...">Bubble</mbsc-input>
</mbsc-form-group>
<mbsc-form-group class="mbsc-padding">
<p class="mbsc-thin">With inline display you can embed the Numpad component in almost any markup or form.</p>
</mbsc-form-group>
<mbsc-form-group>
<mbsc-form-group-title>Embedded numpad scroller</mbsc-form-group-title>
<mbsc-input [(ngModel)]="numpadInline" mbsc-numpad [mbsc-options]="numpadInlineSettings" type="hidden"></mbsc-input>
</mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Numpad - Theming capabilities
The look and feel of the numpad can be deeply customized. There are four levels of customization:
- Base themes: Choose between
Mobiscroll
,iOS
,Android Material
andWindows
. - Light or dark: Every theme has a
light
anddark
variant. Setting thethemeVariant
to'auto'
will switch based on system settings. - Custom themes: Use the theme builder to customize the colors and make it match your brand.
- Custom CSS: If you need further customization, the sky is the limit with CSS overrides.
You can also see how every example looks by changing the theme in the floating action bar on the right side.
import { Component } from '@angular/core';
import { mobiscroll, MbscNumpadOptions } from '@mobiscroll/angular';
mobiscroll.settings = {
lang: '',
theme: '',
themeVariant: ''
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
iosDemo: number;
iosDarkDemo: number;
iosCustomDemo: number;
materialDemo: number;
materialDarkDemo: number;
materialCustomDemo: number;
windowsDemo: number;
windowsDarkDemo: number;
windowsCustomDemo: number;
mobiscrollDemo: number;
mobiscrollDarkDemo: number;
mobiscrollCustomDemo: number;
iosSettings: MbscNumpadOptions = {
theme: 'ios',
themeVariant: 'light',
display: 'bubble',
touchUi: false
};
iosDarkSettings: MbscNumpadOptions = {
theme: 'ios-dark',
display: 'bubble',
touchUi: false
};
iosCustomSettings: MbscNumpadOptions = {
theme: 'ios-gray',
display: 'bubble',
touchUi: false
};
materialSettings: MbscNumpadOptions = {
theme: 'material',
themeVariant: 'light',
display: 'bubble',
touchUi: false
};
materialDarkSettings: MbscNumpadOptions = {
theme: 'material-dark',
display: 'bubble',
touchUi: false
};
materialCustomSettings: MbscNumpadOptions = {
theme: 'material-indigo',
display: 'bubble',
touchUi: false
};
windowsSettings: MbscNumpadOptions = {
theme: 'windows',
themeVariant: 'light',
display: 'bubble',
touchUi: false
};
windowsDarkSettings: MbscNumpadOptions = {
theme: 'windows-dark',
display: 'bubble',
touchUi: false
};
windowsCustomSettings: MbscNumpadOptions = {
theme: 'windows-yellow',
display: 'bubble',
touchUi: false
};
mobiscrollSettings: MbscNumpadOptions = {
theme: 'mobiscroll',
themeVariant: 'light',
display: 'bubble',
touchUi: false
};
mobiscrollDarkSettings: MbscNumpadOptions = {
theme: 'mobiscroll-dark',
display: 'bubble',
touchUi: false
};
mobiscrollCustomSettings: MbscNumpadOptions = {
theme: 'mobiscroll-lime',
display: 'bubble',
touchUi: false
};
}
<mbsc-form>
<div class="mbsc-grid mbsc-grid-fixed">
<div class="mbsc-row">
<div class="mbsc-col-sm-12 mbsc-col-md-6">
<mbsc-form-group inset>
<mbsc-form-group-title>iOS Theme</mbsc-form-group-title>
<mbsc-input [(ngModel)]="iosDemo" mbsc-numpad [mbsc-options]="iosSettings" placeholder="Please Select...">Light</mbsc-input>
<mbsc-input [(ngModel)]="iosDarkDemo" mbsc-numpad [mbsc-options]="iosDarkSettings" placeholder="Please Select...">Dark</mbsc-input>
<mbsc-input [(ngModel)]="iosCustomDemo" mbsc-numpad [mbsc-options]="iosCustomSettings" placeholder="Please Select...">Custom</mbsc-input>
</mbsc-form-group>
</div>
<div class="mbsc-col-sm-12 mbsc-col-md-6">
<mbsc-form-group inset>
<mbsc-form-group-title>Material Theme</mbsc-form-group-title>
<mbsc-input [(ngModel)]="materialDemo" mbsc-numpad [mbsc-options]="materialSettings" placeholder="Please Select...">Light</mbsc-input>
<mbsc-input [(ngModel)]="materialDarkDemo" mbsc-numpad [mbsc-options]="materialDarkSettings" placeholder="Please Select...">Dark</mbsc-input>
<mbsc-input [(ngModel)]="materialCustomDemo" mbsc-numpad [mbsc-options]="materialCustomSettings" placeholder="Please Select...">Custom</mbsc-input>
</mbsc-form-group>
</div>
</div>
<div class="mbsc-row">
<div class="mbsc-col-sm-12 mbsc-col-md-6">
<mbsc-form-group inset>
<mbsc-form-group-title>Windows Theme</mbsc-form-group-title>
<mbsc-input [(ngModel)]="windowsDemo" mbsc-numpad [mbsc-options]="windowsSettings" placeholder="Please Select...">Light</mbsc-input>
<mbsc-input [(ngModel)]="windowsDarkDemo" mbsc-numpad [mbsc-options]="windowsDarkSettings" placeholder="Please Select...">Dark</mbsc-input>
<mbsc-input [(ngModel)]="windowsCustomDemo" mbsc-numpad [mbsc-options]="windowsCustomSettings" placeholder="Please Select...">Custom</mbsc-input>
</mbsc-form-group>
</div>
<div class="mbsc-col-sm-12 mbsc-col-md-6">
<mbsc-form-group inset>
<mbsc-form-group-title>Mobiscroll Theme</mbsc-form-group-title>
<mbsc-input [(ngModel)]="mobiscrollDemo" mbsc-numpad [mbsc-options]="mobiscrollSettings" placeholder="Please Select...">Light</mbsc-input>
<mbsc-input [(ngModel)]="mobiscrollDarkDemo" mbsc-numpad [mbsc-options]="mobiscrollDarkSettings" placeholder="Please Select...">Dark</mbsc-input>
<mbsc-input [(ngModel)]="mobiscrollCustomDemo" mbsc-numpad [mbsc-options]="mobiscrollCustomSettings" placeholder="Please Select...">Custom</mbsc-input>
</mbsc-form-group>
</div>
</div>
</div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MbscModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.
Component license
Purchase component licenses if you are looking for specific funcionality.
All
Framework license
Get all 36 components, including
Framework license
Get all 36 components, including
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Framework license
Select the development framework you are using. Get all 36 components with the license.
- Use it when building with plain and simple JS
- Compatible with vanilla JS app or frameworks like Vue
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with jQuery and jQuery Mobile
- Enjoy the familiar API if you already use jQuery
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular JS and Ionic 1
- For web and mobile apps based on Angular 1.x
- Royalty-free commercial usage
- Technical support is included with the license
- Use it with Angular and Ionic 2/3/4
- Visual Studio and VS Code integration
- Royalty-free commercial usage
- Technical support is included with the license
- Use it when building with React JS
- Collection of UI components for web and mobile
- Royalty-free commercial usage
- Technical support is included with the license
Select the framework you are interested in
Use Javascript when building with plain and simple JS.
Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.
Use AngularJS when building with Angular 1.x or Ionic 1.
Use Angular when building with Angular 2/4/5/6/7/8 or Ionic 2/3/4.
Use it when you are building your app or website with React.
Do you need additional support seats?
The license comes with one support seat. ( +$100/seat )
Add the source code?
What framework are you using?
We have to set you up with a trial for this to run 👍
Step 1.Install the Mobiscroll CLI from npm
$ npm install -g @mobiscroll/cli
The CLI makes configuring your apps super simple 👍
Step 2.Run the following command in the root folder of your Ionic project
$ mobiscroll config ionic
$ mobiscroll config ionic --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Create an Ionic 3 & Mobiscroll starter with the CLI:
Run this command for Ionic 4 & Mobiscroll starter:
Step 3.Copy the code into your app.
Step 4.Run ionic serve in the root folder of your app 🎉
$ ionic serve
And voilà, everything should be running smoothly.
Step 1.Install the Mobiscroll CLI from npm
$ npm install -g @mobiscroll/cli
The CLI makes configuring your apps super simple 👍
Step 2.Run the following command in the root folder of your Angular project
$ mobiscroll config angular
$ mobiscroll config angular --lite
You will be prompted to log in with your mobiscroll account. Set your password here
Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.
Step 4.Run ng serve in the root folder of your app 🎉
$ ng serve
And voilà, everything should be running smoothly.
Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.
$ npm install
$ ionic serve
Let us know if we can help and enjoy!
Your password has been changed!
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
Extract the zip file and open the demo in your favorite browser.
To install Mobiscroll in your project
follow instructions from this page.
Let us know if we can help and enjoy! 👍
Please extract the zip file and run the project like any Angular CLI app.
Make sure to have the Angular CLI installed.
For installation and usage, extract the zip file and open a terminal window and follow these steps.
$ npm install
$ ng serve --open
Let us know if we can help and enjoy! 👍
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
The easiest way to get started is to follow the installation steps and by
grabbing the code directly from the demo page. Let us know if we can help and enjoy!
You'll find a fully functional Kitchen-sink Ionic app in the zip file.
Everything is set up so that you can dig in right away and start exploring.
We have set up a trial so that you can try the demos locally.
The demos are using Babel's in-browser ES6 and JSX transformer.
Extract the zip file and open the demo in your browser. To install Mobiscroll in your project
follow instructions from this page.
Let us know if we can help and enjoy! 👍