| 1 |
import Masked from './base.js'; |
| 2 |
import IMask from '../core/holder.js'; |
| 3 |
import '../core/change-details.js'; |
| 4 |
import '../core/continuous-tail-details.js'; |
| 5 |
import '../core/utils.js'; |
| 6 |
|
| 7 |
/** Masking by RegExp */ |
| 8 |
class MaskedRegExp extends Masked { |
| 9 |
/** */ |
| 10 |
|
| 11 |
/** Enable characters overwriting */ |
| 12 |
|
| 13 |
/** */ |
| 14 |
|
| 15 |
/** */ |
| 16 |
|
| 17 |
/** */ |
| 18 |
|
| 19 |
updateOptions(opts) { |
| 20 |
super.updateOptions(opts); |
| 21 |
} |
| 22 |
_update(opts) { |
| 23 |
const mask = opts.mask; |
| 24 |
if (mask) opts.validate = value => value.search(mask) >= 0; |
| 25 |
super._update(opts); |
| 26 |
} |
| 27 |
} |
| 28 |
IMask.MaskedRegExp = MaskedRegExp; |
| 29 |
|
| 30 |
export { MaskedRegExp as default }; |
| 31 |
|