react-native-advanced-input-mask
Version:
Text input mask for React Native on iOS, Android and web. Synchronous and easy formatting without hustle
30 lines • 811 B
JavaScript
import State from "./State";
class FixedState extends State {
constructor(child, ownCharacter) {
super(child);
this.ownCharacter = ownCharacter;
}
accept = char => char === this.ownCharacter ? {
state: this.nextState(),
pass: true,
insert: char,
value: char
} : {
state: this.nextState(),
insert: this.ownCharacter,
value: this.ownCharacter,
pass: false
};
autocomplete = () => ({
state: this.nextState(),
insert: this.ownCharacter,
value: this.ownCharacter,
pass: false
});
toString = () => {
var _this$child;
return `{${this.ownCharacter}} -> ${((_this$child = this.child) === null || _this$child === void 0 ? void 0 : _this$child.toString()) ?? "null"} `;
};
}
export default FixedState;
//# sourceMappingURL=FixedState.js.map