react-native-advanced-input-mask
Version:
Text input mask for React Native on iOS, Android and web. Synchronous and easy formatting without hustle
37 lines (36 loc) • 1.06 kB
JavaScript
;
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 FixedState extends _State.default {
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"} `;
};
}
var _default = exports.default = FixedState;
//# sourceMappingURL=FixedState.js.map