UNPKG

react-native-advanced-input-mask

Version:

Text input mask for React Native on iOS, Android and web. Synchronous and easy formatting without hustle

36 lines (35 loc) 961 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _State = _interopRequireDefault(require("./State")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } class FreeState extends _State.default { constructor(child, ownCharacter) { super(child); this.ownCharacter = ownCharacter; } accept = char => { return this.ownCharacter === char ? { state: this.nextState(), insert: char, pass: true, value: null } : { state: this.nextState(), insert: this.ownCharacter, pass: false, value: null }; }; autocomplete = () => ({ state: this.nextState(), insert: this.ownCharacter, pass: false, value: null }); toString = () => `${this.ownCharacter} -> ${this.child ? this.child.toString() : "null"}`; } var _default = exports.default = FreeState; //# sourceMappingURL=FreeState.js.map