nativescript-numeric-keyboard
Version:
Handy and elegant numeric keyboard for iOS NativeScript apps. On Android we fall back to the regular numeric keyboard.
57 lines • 1.77 kB
JavaScript
import { TextField, Property, Color, booleanConverter } from "@nativescript/core";
export class NumericKeyboardViewBase extends TextField {
constructor() {
super(...arguments);
this._decimalSep = "unset";
}
get ios() {
return this.nativeView;
}
set ios(value) {
this.nativeView = value;
}
getDecimalSeparator() {
return this._decimalSep;
}
getText() {
return this.text;
}
getMaxLength() {
return this.maxLength;
}
getNativeTextField() {
return this.nativeView;
}
}
export const returnKeyTitleProperty = new Property({
name: "returnKeyTitle",
defaultValue: "Done"
});
returnKeyTitleProperty.register(NumericKeyboardViewBase);
export const localeProperty = new Property({ name: "locale" });
localeProperty.register(NumericKeyboardViewBase);
export const noDecimalsProperty = new Property({
name: "noDecimals",
defaultValue: false,
valueConverter: booleanConverter
});
noDecimalsProperty.register(NumericKeyboardViewBase);
export const noReturnKeyProperty = new Property({
name: "noReturnKey",
defaultValue: false,
valueConverter: booleanConverter
});
noReturnKeyProperty.register(NumericKeyboardViewBase);
export const returnKeyButtonBackgroundColorProperty = new Property({
name: "returnKeyButtonBackgroundColor",
defaultValue: null,
valueConverter: (c) => new Color(c)
});
returnKeyButtonBackgroundColorProperty.register(NumericKeyboardViewBase);
export const noIpadInputBarProperty = new Property({
name: "noIpadInputBar",
defaultValue: false,
valueConverter: booleanConverter
});
noIpadInputBarProperty.register(NumericKeyboardViewBase);
//# sourceMappingURL=numeric-keyboard.common.js.map